Class ConnectionCounter

Object
com.wowza.wms.client.ConnectionCounterBase
com.wowza.wms.client.ConnectionCounter

public class ConnectionCounter extends com.wowza.wms.client.ConnectionCounterBase
  • Constructor Details

    • ConnectionCounter

      public ConnectionCounter()
      Create empty ConnectionCounter
  • Method Details

    • addConnectionListener

      public void addConnectionListener(IConnectionNotify connectionNotify)
      Add a connection listener. Receives following events: onClientConnect, onClientDisconnect, onClientAccept and onClientReject.
      Parameters:
      connectionNotify - connection listener
    • removeConnectionListener

      public void removeConnectionListener(IConnectionNotify connectionNotify)
      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 holder
      license - 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 holder
      license - 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 holder
      date - date the connection occured
      stamp - 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 holder
      reason - 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 holder
      reason - reason the connection was refused. See REJECTREASON_*
      date - date the connection occured
      stamp - 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 holder
      license - 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 holder
      isValid - is a valid connection
      date - date the connection occured
      stamp - 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

      public String 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

      public Date getLastConnectAcceptedTime()
      Get time (milliseconds) of the last accepeted conenction to this object.
      Returns:
      time (milliseconds) of the last accepeted conenction to this object
    • getLastConnectAcceptedTimeString

      public String 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

      public String 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

      public Date 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

      public String 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

      public String getLastConnectRejectedByReasonStampString(int reason)
      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

      public Date getLastConnectRejectedByReasonTime(int reason)
      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

      public String getLastConnectRejectedByReasonTimeString(int reason)
      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

      public 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

      public Date 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

      public String 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