Class ConnectionCounter


  • public class ConnectionCounter
    extends com.wowza.wms.client.ConnectionCounterBase
    • Field Summary

      • Fields inherited from class com.wowza.wms.client.ConnectionCounterBase

        DATEFORMATSTR, NEVERSTR, REJECTREASON_APPLICATION, REJECTREASON_COUNT, REJECTREASON_LICENSE
    • Constructor Summary

      Constructors 
      Constructor Description
      ConnectionCounter()
      Create empty ConnectionCounter
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void 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, java.util.Date date, long stamp, byte[] license)
      Decrement connection counters.
      void disconnect​(com.wowza.wms.client.ConnectionHolder connectionHolder, byte[] license)
      Disconnect connection.
      long getCurrent()
      Get total number of client currently conencted to this object.
      long getLastConnectAcceptedStamp()
      Get time (milliseconds) of the last conenction to this object.
      String getLastConnectAcceptedStampString()
      Get time (milliseconds) of the last conenction to this object as formatted string.
      java.util.Date getLastConnectAcceptedTime()
      Get time (milliseconds) of the last accepeted conenction to this object.
      String getLastConnectAcceptedTimeString()
      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.
      String getLastConnectRejectedByReasonStampString​(int reason)
      Get time (milliseconds) of the last rejected conenction by reason to this object as formatted string.
      java.util.Date getLastConnectRejectedByReasonTime​(int reason)
      Get date and time of last rejected connection by reason to this object as Date object.
      String getLastConnectRejectedByReasonTimeString​(int reason)
      Get date and time of last rejected connection by reason to this object as formated string.
      long getLastConnectRejectedStamp()
      Get time (milliseconds) of the last rejected conenction to this object.
      String getLastConnectRejectedStampString()
      Get time (milliseconds) of the last rejected conenction to this object as formatted string.
      java.util.Date getLastConnectRejectedTime()
      Get date and time of last rejected connection to this object as Date object.
      String getLastConnectRejectedTimeString()
      Get date and time of last rejected connection to this object as formated string.
      long getLastDisconnectStamp()
      Get time (milliseconds) of the last disconnected conenction to this object.
      String getLastDisconnectStampString()
      Get time (milliseconds) of the last disconnected conenction to this object as formatted string.
      java.util.Date getLastDisconnectTime()
      Get date and time of last disconnected connection to this object as Date object.
      String getLastDisconnectTimeString()
      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 getTotalAccepted()
      Get total number of accepted connections to this object.
      long getTotalRejected()
      Get total number of rejected connections to this object.
      void incrementAccept​(com.wowza.wms.client.ConnectionHolder connectionHolder, java.util.Date date, long stamp, byte[] license)
      Increment accepted connections.
      void incrementReject​(com.wowza.wms.client.ConnectionHolder connectionHolder, int reason, java.util.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 listener
      void 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.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConnectionCounter

        public ConnectionCounter()
        Create empty ConnectionCounter
    • Method Detail

      • 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,
                                    java.util.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,
                                    java.util.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,
                              java.util.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 java.util.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 java.util.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 java.util.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 java.util.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