Class ConnectionCounter
-
Field Summary
Fields inherited from class com.wowza.wms.client.ConnectionCounterBase
DATEFORMATSTR, NEVERSTR, REJECTREASON_APPLICATION, REJECTREASON_COUNT, REJECTREASON_LICENSE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
acceptConnection
(com.wowza.wms.client.ConnectionHolder connectionHolder, byte[] license) Accept a new connection.void
addConnectionListener
(IConnectionNotify connectionNotify) Add a connection listener.void
decrement
(com.wowza.wms.client.ConnectionHolder connectionHolder, boolean isValid, Date date, long stamp, byte[] license) Decrement connection counters.void
disconnect
(com.wowza.wms.client.ConnectionHolder connectionHolder, byte[] license) Disconnect connection.long
Get total number of client currently conencted to this object.long
Get time (milliseconds) of the last conenction to this object.Get time (milliseconds) of the last conenction to this object as formatted string.Get time (milliseconds) of the last accepeted conenction to this object.Get time (milliseconds) of the last accepeted conenction to this object as formatted string.long
getLastConnectRejectedByReasonStamp
(int reason) Get time (milliseconds) of the last rejected conenction by reason to this object.getLastConnectRejectedByReasonStampString
(int reason) Get time (milliseconds) of the last rejected conenction by reason to this object as formatted string.getLastConnectRejectedByReasonTime
(int reason) Get date and time of last rejected connection by reason to this object as Date object.getLastConnectRejectedByReasonTimeString
(int reason) Get date and time of last rejected connection by reason to this object as formated string.long
Get time (milliseconds) of the last rejected conenction to this object.Get time (milliseconds) of the last rejected conenction to this object as formatted string.Get date and time of last rejected connection to this object as Date object.Get date and time of last rejected connection to this object as formated string.long
Get time (milliseconds) of the last disconnected conenction to this object.Get time (milliseconds) of the last disconnected conenction to this object as formatted string.Get date and time of last disconnected connection to this object as Date object.Get date and time of last disconnected connection to this object as Date object as formatted string.long
getTotal()
Get total number of connection attempts to this object.long
Get total number of accepted connections to this object.long
Get total number of rejected connections to this object.void
incrementAccept
(com.wowza.wms.client.ConnectionHolder connectionHolder, Date date, long stamp, byte[] license) Increment accepted connections.void
incrementReject
(com.wowza.wms.client.ConnectionHolder connectionHolder, int reason, Date date, long stamp, byte[] license) Increment reject connection.void
rejectConnection
(com.wowza.wms.client.ConnectionHolder connectionHolder, int reason, byte[] license) Reject connection.void
removeConnectionListener
(IConnectionNotify connectionNotify) Remove connection listenervoid
setConnectionValidator
(com.wowza.wms.client.IConnectionValidator connectionValidator) Set the connection validator.boolean
validateNewConnection
(com.wowza.wms.client.ConnectionHolder connectionHolder, byte[] license) Validate a new connection.
-
Constructor Details
-
ConnectionCounter
public ConnectionCounter()Create empty ConnectionCounter
-
-
Method Details
-
addConnectionListener
Add a connection listener. Receives following events: onClientConnect, onClientDisconnect, onClientAccept and onClientReject.- Parameters:
connectionNotify
- connection listener
-
removeConnectionListener
Remove connection listener- Parameters:
connectionNotify
- connection listener
-
setConnectionValidator
public void setConnectionValidator(com.wowza.wms.client.IConnectionValidator connectionValidator) Set the connection validator.- Parameters:
connectionValidator
- connection validator
-
validateNewConnection
public boolean validateNewConnection(com.wowza.wms.client.ConnectionHolder connectionHolder, byte[] license) Validate a new connection.NOTE: This is a private internal call. Server will not work properly if this method is not called properly using internal security mechanism.
- Parameters:
connectionHolder
- connection holderlicense
- security data- Returns:
- true if connection is accepted
-
acceptConnection
public void acceptConnection(com.wowza.wms.client.ConnectionHolder connectionHolder, byte[] license) Accept a new connection.NOTE: This is a private internal call. Server will not work properly if this method is not called properly using internal security mechanism.
- Parameters:
connectionHolder
- connection holderlicense
- security data
-
incrementAccept
public void incrementAccept(com.wowza.wms.client.ConnectionHolder connectionHolder, Date date, long stamp, byte[] license) Increment accepted connections.NOTE: This is a private internal call. Server will not work properly if this method is not called properly using internal security mechanism.
- Parameters:
connectionHolder
- connection holderdate
- date the connection occuredstamp
- time stamp connection occured (milliseconds)license
- security data
-
rejectConnection
public void rejectConnection(com.wowza.wms.client.ConnectionHolder connectionHolder, int reason, byte[] license) Reject connection.NOTE: This is a private internal call. Server will not work properly if this method is not called properly using internal security mechanism.
- Parameters:
connectionHolder
- connection holderreason
- reason the connection was refused. See REJECTREASON_*license
- security data
-
incrementReject
public void incrementReject(com.wowza.wms.client.ConnectionHolder connectionHolder, int reason, Date date, long stamp, byte[] license) Increment reject connection.NOTE: This is a private internal call. Server will not work properly if this method is not called properly using internal security mechanism.
- Parameters:
connectionHolder
- connection holderreason
- reason the connection was refused. See REJECTREASON_*date
- date the connection occuredstamp
- time stamp connection occured (milliseconds)license
- security data
-
disconnect
public void disconnect(com.wowza.wms.client.ConnectionHolder connectionHolder, byte[] license) Disconnect connection.NOTE: This is a private internal call. Server will not work properly if this method is not called properly using internal security mechanism.
- Parameters:
connectionHolder
- connection holderlicense
- security data
-
decrement
public void decrement(com.wowza.wms.client.ConnectionHolder connectionHolder, boolean isValid, Date date, long stamp, byte[] license) Decrement connection counters.NOTE: This is a private internal call. Server will not work properly if this method is not called properly using internal security mechanism.
- Parameters:
connectionHolder
- connection holderisValid
- is a valid connectiondate
- date the connection occuredstamp
- time stamp connection occured (milliseconds)license
- security data
-
getCurrent
public long getCurrent()Get total number of client currently conencted to this object.- Returns:
- total number of client currently conencted to this object
-
getLastConnectAcceptedStamp
public long getLastConnectAcceptedStamp()Get time (milliseconds) of the last conenction to this object.- Returns:
- time (milliseconds) of the last conenction to this object
-
getLastConnectAcceptedStampString
Get time (milliseconds) of the last conenction to this object as formatted string.- Returns:
- time (milliseconds) of the last conenction to this object as formatted string
-
getLastConnectAcceptedTime
Get time (milliseconds) of the last accepeted conenction to this object.- Returns:
- time (milliseconds) of the last accepeted conenction to this object
-
getLastConnectAcceptedTimeString
Get time (milliseconds) of the last accepeted conenction to this object as formatted string.- Returns:
- time (milliseconds) of the last accepeted conenction to this object as formatted string
-
getLastConnectRejectedStamp
public long getLastConnectRejectedStamp()Get time (milliseconds) of the last rejected conenction to this object.- Returns:
- time (milliseconds) of the last rejected conenction to this object
-
getLastConnectRejectedStampString
Get time (milliseconds) of the last rejected conenction to this object as formatted string.- Returns:
- time (milliseconds) of the last rejected conenction to this object as formatted string
-
getLastConnectRejectedTime
Get date and time of last rejected connection to this object as Date object.- Returns:
- date and time of last reject connection to this object as Date object
-
getLastConnectRejectedTimeString
Get date and time of last rejected connection to this object as formated string.- Returns:
- date and time of last reject connection to this object as formated string
-
getLastConnectRejectedByReasonStampString
Get time (milliseconds) of the last rejected conenction by reason to this object as formatted string.- Parameters:
reason
- reason, see REJECTREASON_*- Returns:
- time (milliseconds) of the last rejected conenction by reason to this object as formatted string
-
getLastConnectRejectedByReasonStamp
public long getLastConnectRejectedByReasonStamp(int reason) Get time (milliseconds) of the last rejected conenction by reason to this object.- Parameters:
reason
- reason, see REJECTREASON_*- Returns:
- time (milliseconds) of the last rejected conenction by reason to this object
-
getLastConnectRejectedByReasonTime
Get date and time of last rejected connection by reason to this object as Date object.- Parameters:
reason
- reason, see REJECTREASON_*- Returns:
- date and time of last reject connection by reason to this object as Date object
-
getLastConnectRejectedByReasonTimeString
Get date and time of last rejected connection by reason to this object as formated string.- Parameters:
reason
- reason, see REJECTREASON_*- Returns:
- date and time of last rejected connection by reason to this object as formated string
-
getLastDisconnectStampString
Get time (milliseconds) of the last disconnected conenction to this object as formatted string.- Returns:
- time (milliseconds) of the last disconnected conenction to this object as formatted string
-
getLastDisconnectStamp
public long getLastDisconnectStamp()Get time (milliseconds) of the last disconnected conenction to this object.- Returns:
- time (milliseconds) of the last disconnected conenction to this object
-
getLastDisconnectTime
Get date and time of last disconnected connection to this object as Date object.- Returns:
- date and time of last disconnected connection to this object as Date object
-
getLastDisconnectTimeString
Get date and time of last disconnected connection to this object as Date object as formatted string.- Returns:
- date and time of last disconnected connection to this object as Date object as formatted string
-
getTotal
public long getTotal()Get total number of connection attempts to this object.- Returns:
- total number of connection attempts to this object
-
getTotalAccepted
public long getTotalAccepted()Get total number of accepted connections to this object.- Returns:
- total number of accepted connections to this object
-
getTotalRejected
public long getTotalRejected()Get total number of rejected connections to this object.- Returns:
- total number of rejected connections to this object
-