Class NetStat.BusyPort
java.lang.Object
org.terracotta.utilities.test.net.NetStat.BusyPort
- Enclosing class:
- NetStat
Describes an active TCP port and associates it with the controlling process.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classstatic enumEnumerates the types of IP addresses supported.static enumTCP Connection states. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final InetSocketAddressprivate final longprivate final InetSocketAddressprivate final Stringprivate final NetStat.BusyPort.TcpState -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBusyPort(long processId, InetSocketAddress localEndpoint, InetSocketAddress remoteEndpoint, NetStat.BusyPort.TcpState state, String shortCommand, String commandLine) -
Method Summary
Modifier and TypeMethodDescriptionprivate static NetStat.BusyPort.Builderbuilder()private static NetStat.BusyPort.Builderbuilder(NetStat.BusyPort busyPort) Gets the long representation of the command.Gets the local endpoint socket address.longGets the process id associated with this connection.Gets the remote endpoint socket address.Gets the short representation of the command as provided by the TCP connection information source.state()Gets the state of this TCP connection.toString()Produces a print-suitable string of thisBusyPortinstance.
-
Field Details
-
processId
private final long processId -
localEndpoint
-
remoteEndpoint
-
state
-
shortCommand
-
commandLine
-
-
Constructor Details
-
BusyPort
private BusyPort(long processId, InetSocketAddress localEndpoint, InetSocketAddress remoteEndpoint, NetStat.BusyPort.TcpState state, String shortCommand, String commandLine)
-
-
Method Details
-
processId
public long processId()Gets the process id associated with this connection.- Returns:
- the process id
-
localEndpoint
Gets the local endpoint socket address.- Returns:
- the local endpoint socket address
-
remoteEndpoint
Gets the remote endpoint socket address. IflocalEndpoint()is a listening port, the value returned uses a socket number of zero and an IP address corresponding to awildcard address.- Returns:
- the remote endpoint socket address
-
state
Gets the state of this TCP connection.- Returns:
- the TCP connection state
-
shortCommand
Gets the short representation of the command as provided by the TCP connection information source.- Returns:
- the short command 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
-
builder
-
toString
Produces a print-suitable string of thisBusyPortinstance. This method displays only one ofshortCommandorcommandLine-- ifcommandLineis set, its value is included; otherwise, theshortCommandvalue is used.- Parameters:
fieldSeparator- the field separator to use; ifnullor empty, a single space is used- Returns:
- a print-suitable string
-
toString
-