Class NetStat.BusyPort

java.lang.Object
org.terracotta.utilities.test.net.NetStat.BusyPort
Enclosing class:
NetStat

public static class NetStat.BusyPort extends Object
Describes an active TCP port and associates it with the controlling process.
  • Field Details

  • Constructor Details

  • Method Details

    • processId

      public long processId()
      Gets the process id associated with this connection.
      Returns:
      the process id
    • localEndpoint

      public InetSocketAddress localEndpoint()
      Gets the local endpoint socket address.
      Returns:
      the local endpoint socket address
    • remoteEndpoint

      public InetSocketAddress remoteEndpoint()
      Gets the remote endpoint socket address. If localEndpoint() is a listening port, the value returned uses a socket number of zero and an IP address corresponding to a wildcard address.
      Returns:
      the remote endpoint socket address
    • state

      public NetStat.BusyPort.TcpState state()
      Gets the state of this TCP connection.
      Returns:
      the TCP connection state
    • shortCommand

      public String shortCommand()
      Gets the short representation of the command as provided by the TCP connection information source.
      Returns:
      the short command string
    • commandLine

      public String commandLine()
      Gets the long representation of the command. This value is the full command line if available.
      Returns:
      the long command string; may be null
    • builder

      private static NetStat.BusyPort.Builder builder()
    • builder

      private static NetStat.BusyPort.Builder builder(NetStat.BusyPort busyPort)
    • toString

      public String toString(String fieldSeparator)
      Produces a print-suitable string of this BusyPort instance. This method displays only one of shortCommand or commandLine -- if commandLine is set, its value is included; otherwise, the shortCommand value is used.
      Parameters:
      fieldSeparator - the field separator to use; if null or empty, a single space is used
      Returns:
      a print-suitable string
    • toString

      public String toString()
      Overrides:
      toString in class Object