Class NetStat.BusyPort
- java.lang.Object
-
- org.terracotta.utilities.test.net.NetStat.BusyPort
-
- Enclosing class:
- NetStat
public static class NetStat.BusyPort extends java.lang.ObjectDescribes an active TCP port and associates it with the controlling process.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classNetStat.BusyPort.Builderstatic classNetStat.BusyPort.IPVersionEnumerates the types of IP addresses supported.static classNetStat.BusyPort.TcpStateTCP Connection states.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringcommandLineprivate java.net.InetSocketAddresslocalEndpointprivate longprocessIdprivate java.net.InetSocketAddressremoteEndpointprivate java.lang.StringshortCommandprivate NetStat.BusyPort.TcpStatestate
-
Constructor Summary
Constructors Modifier Constructor Description privateBusyPort(long processId, java.net.InetSocketAddress localEndpoint, java.net.InetSocketAddress remoteEndpoint, NetStat.BusyPort.TcpState state, java.lang.String shortCommand, java.lang.String commandLine)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static NetStat.BusyPort.Builderbuilder()private static NetStat.BusyPort.Builderbuilder(NetStat.BusyPort busyPort)java.lang.StringcommandLine()Gets the long representation of the command.java.net.InetSocketAddresslocalEndpoint()Gets the local endpoint socket address.longprocessId()Gets the process id associated with this connection.java.net.InetSocketAddressremoteEndpoint()Gets the remote endpoint socket address.java.lang.StringshortCommand()Gets the short representation of the command as provided by the TCP connection information source.NetStat.BusyPort.TcpStatestate()Gets the state of this TCP connection.java.lang.StringtoString()java.lang.StringtoString(java.lang.String fieldSeparator)Produces a print-suitable string of thisBusyPortinstance.
-
-
-
Field Detail
-
processId
private final long processId
-
localEndpoint
private final java.net.InetSocketAddress localEndpoint
-
remoteEndpoint
private final java.net.InetSocketAddress remoteEndpoint
-
state
private final NetStat.BusyPort.TcpState state
-
shortCommand
private final java.lang.String shortCommand
-
commandLine
private final java.lang.String commandLine
-
-
Constructor Detail
-
BusyPort
private BusyPort(long processId, java.net.InetSocketAddress localEndpoint, java.net.InetSocketAddress remoteEndpoint, NetStat.BusyPort.TcpState state, java.lang.String shortCommand, java.lang.String commandLine)
-
-
Method Detail
-
processId
public long processId()
Gets the process id associated with this connection.- Returns:
- the process id
-
localEndpoint
public java.net.InetSocketAddress localEndpoint()
Gets the local endpoint socket address.- Returns:
- the local endpoint socket address
-
remoteEndpoint
public java.net.InetSocketAddress 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
public NetStat.BusyPort.TcpState state()
Gets the state of this TCP connection.- Returns:
- the TCP connection state
-
shortCommand
public java.lang.String shortCommand()
Gets the short representation of the command as provided by the TCP connection information source.- Returns:
- the short command string
-
commandLine
public java.lang.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 java.lang.String toString(java.lang.String fieldSeparator)
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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-