Package com.iizix.comm.statistics
Class SessionStatistics
java.lang.Object
com.iizix.comm.statistics.SessionStatistics
Statistics of a transaction session, including all connections.
- Author:
- Christopher Mindus
- Constructor SummaryConstructorsConstructorDescriptionCreates a new instance for the Session Transaction Manager.
- Method SummaryModifier and TypeMethodDescriptionGets the current state.Gets the current connection statistics.- longGets the time when the session began to be dormant.Gets the history of connection statistics.- longGets the time of the last activity of the session, used for time-out checking.- longGets the last connection time.Gets a copy of all properties of the last or current connection.- getProperty- (String name, boolean searchPrevious) Gets a property.Clones this instance.- void- onPong- (long time) Called when a pong transaction is received.- void- onReceived- (int size) Called when a transaction is received.- void- onReceived- (ReadTransaction trans) Called when a transaction is received.- void- onSent- (int size) Called when data has been sent.- void- onSent- (SendTransaction trans) Called when a transaction is sent.- voidCalled when the connection is closed.- voidCalled when the connection is connected.- void- setHeartBeatDuration- (long duration) Sets the last web socket heart-beat duration (the PING-PONG message exchange in milliseconds).- void- setProperty- (String name, String value) Sets a property for the connection.- void- setReconnected- (SessionStatistics other) Called when the connection is re-connected.
- Constructor Details- SessionStatisticspublic SessionStatistics()Creates a new instance for the Session Transaction Manager.
 
- Method Details- setPropertySets a property for the connection.
- getPropertyGets a property.- Parameters:
- name- The property name.
- searchPrevious- Flag indicating previous connections should be included in locating the property. Searching is done backwards in history.
- Returns:
- The value, or null if not found.
 
- getPropertiesGets a copy of all properties of the last or current connection.- Returns:
- The copy of the properties, or null if none are present.
 
- getLastConnectionTimepublic long getLastConnectionTime()Gets the last connection time.- Returns:
- The time in milliseconds like System.currentTimeMillis(), or zero if not connected ever.
 
- getLastActivityTimepublic long getLastActivityTime()Gets the time of the last activity of the session, used for time-out checking.
- getDormantStartTimepublic long getDormantStartTime()Gets the time when the session began to be dormant.- Returns:
- Zero if session is not dormant.
 
- getStatisticsSnapshotClones this instance.
- onSentCalled when a transaction is sent.
- onSentpublic void onSent- (int size) Called when data has been sent.
- onReceivedCalled when a transaction is received.
- onReceivedpublic void onReceived- (int size) Called when a transaction is received.
- setConnectedpublic void setConnected()Called when the connection is connected. An error is logged if current state is not INITIALIZING.
- setClosedCalled when the connection is closed. An error is logged if current state is not INITIALIZING or CONNECTED.- Parameters:
- reason- The reason state.
 
- setReconnectedCalled when the connection is re-connected. An error is logged if current state is not PAUSED or BROKEN.
- getCurrentStateGets the current state.
- onPongpublic void onPong- (long time) Called when a pong transaction is received.
- setHeartBeatDurationpublic void setHeartBeatDuration- (long duration) Sets the last web socket heart-beat duration (the PING-PONG message exchange in milliseconds).
- getCurrentStatiticsGets the current connection statistics.
- getHistoryGets the history of connection statistics.- Returns:
- The array of statistics for the history, or null if none is available.