public class ConnectionInfo extends java.lang.Object implements java.lang.Comparable<ConnectionInfo>
Modifier and Type | Field and Description |
---|---|
private static java.util.Set<ConnectionInfo> |
allConnections
a list of all current connections to be shown in Connections_p
|
private java.lang.String |
command |
private int |
id |
private long |
initTime |
private static int |
maxcount |
private java.lang.String |
protocol |
private static java.util.Set<ConnectionInfo> |
serverConnections |
private static int |
serverMaxCount |
private static int |
staleAfterMillis |
private java.lang.String |
targetHost |
private long |
upbytes |
Constructor and Description |
---|
ConnectionInfo(java.lang.String protocol,
java.lang.String targetHost,
java.lang.String command,
int id,
long initTime,
long upbytes)
constructor setting all data
|
Modifier and Type | Method and Description |
---|---|
static void |
addConnection(ConnectionInfo conInfo)
add a connection to the list of all current connections
|
static void |
addServerConnection(ConnectionInfo conInfo)
add a Server connection to the list of all current connections
|
static void |
cleanUp()
removes stale connections
|
private static void |
cleanup(java.util.Set<ConnectionInfo> connectionSet) |
int |
compareTo(ConnectionInfo o) |
boolean |
equals(java.lang.Object obj) |
static long |
getActiveUpbytes() |
static java.util.Set<ConnectionInfo> |
getAllConnections()
gets a
Set of all collected ConnectionInfos
Important: iterations must be synchronized! |
java.lang.String |
getCommand() |
static int |
getCount()
gets the number of active client connections
|
int |
getID() |
long |
getLifetime() |
static int |
getLoadPercent()
gets the usage of the Client connection manager by active connections
|
static int |
getMaxcount()
gets the max connection count of the Client connection manager
|
java.lang.String |
getProtocol() |
static java.util.Set<ConnectionInfo> |
getServerConnections()
gets a
Set of all collected server ConnectionInfos
Important: iterations must be synchronized! |
static int |
getServerCount()
gets the number of active server connections
|
static int |
getServerMaxcount()
gets the max connection count of the Server connection manager
|
java.lang.String |
getTargetHost() |
long |
getUpbytes() |
int |
hashCode() |
static boolean |
isServerCountReached() |
protected static void |
removeConnection(ConnectionInfo conInfo)
remove a connection from the list of all current connections
|
static void |
removeConnection(int id)
connections with same id
equals() another |
static void |
removeServerConnection(ConnectionInfo conInfo)
remove a Server connection from the list of all current connections
|
static void |
removeServerConnection(int id)
connections with same id
equals() another |
static void |
setMaxcount(int max)
gets the max connection count of the Client connection manager
to be used in statistics
|
static void |
setServerMaxcount(int max)
gets the max connection count of the Sever connection manager
to be used in statistics
|
java.lang.String |
toString() |
private static final java.util.Set<ConnectionInfo> allConnections
private static final java.util.Set<ConnectionInfo> serverConnections
private static final int staleAfterMillis
private static int maxcount
private static int serverMaxCount
private final java.lang.String protocol
private final java.lang.String targetHost
private final java.lang.String command
private final int id
private final long initTime
private final long upbytes
public ConnectionInfo(java.lang.String protocol, java.lang.String targetHost, java.lang.String command, int id, long initTime, long upbytes)
protocol
- targetHost
- command
- id
- initTime
- public java.lang.String getProtocol()
public long getLifetime()
public long getUpbytes()
public java.lang.String getCommand()
public java.lang.String getTargetHost()
public int getID()
public static java.util.Set<ConnectionInfo> getAllConnections()
Set
of all collected ConnectionInfos
Important: iterations must be synchronized!public static java.util.Set<ConnectionInfo> getServerConnections()
Set
of all collected server ConnectionInfos
Important: iterations must be synchronized!public static int getCount()
public static int getServerCount()
public static int getLoadPercent()
public static boolean isServerCountReached()
public static long getActiveUpbytes()
public static int getMaxcount()
public static void setMaxcount(int max)
max
- connectionspublic static int getServerMaxcount()
public static void setServerMaxcount(int max)
max
- connectionspublic static void addConnection(ConnectionInfo conInfo)
conInfo
- public static void addServerConnection(ConnectionInfo conInfo)
conInfo
- protected static void removeConnection(ConnectionInfo conInfo)
conInfo
- public static void removeServerConnection(ConnectionInfo conInfo)
conInfo
- public static void removeConnection(int id)
equals()
anotherid
- public static void removeServerConnection(int id)
equals()
anotherid
- public static void cleanUp()
private static void cleanup(java.util.Set<ConnectionInfo> connectionSet)
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int compareTo(ConnectionInfo o)
compareTo
in interface java.lang.Comparable<ConnectionInfo>