Interface IWebSocketSession


  • public interface IWebSocketSession
    • Method Detail

      • getContextStr

        String getContextStr()
        Get context string for logging
        Returns:
        context string for logging
      • close

        void close​(boolean immediately,
                   int reasonCode,
                   String reasonStr)
        Close the WebSocket session
        Parameters:
        immediately - if true, session will be terminated immediately by closing TCP connection, if false close command will be sent
        reasonCode - reason for close, see CLOSECODE_*
        reasonStr - reason string for close, see CLOSESTR_*
      • getHeaderMap

        java.util.Map<String,​String> getHeaderMap()
        Get map of HTTP headers from original upgrade HTTP request
        Returns:
        HTTP headers
      • getParameterMap

        java.util.Map<String,​java.util.List<String>> getParameterMap()
        Get map of HTTP parameters from original upgrade HTTP request
        Returns:
        HTTP parameters
      • getQueryString

        String getQueryString()
        Get query string from original upgrade HTTP request
        Returns:
        query string
      • getReqURI

        String getReqURI()
        Get request URI from original upgrade HTTP request
        Returns:
        request URI
      • getReqURL

        String getReqURL()
        Get request URL from original upgrade HTTP request
        Returns:
        request URL
      • getMaximumMessageSize

        long getMaximumMessageSize()
        Get the maximum WebSocket message size for a single message (0 = no limit)
        Returns:
        maximum WebSocket message size
      • setMaximumMessageSize

        void setMaximumMessageSize​(long maxMessageSize)
        Set the maximum WebSocket message size for a single message (0 = no limit)
        Parameters:
        maxMessageSize - maximum WebSocket message size
      • isMaskOutgoingMessages

        boolean isMaskOutgoingMessages()
        Should outgoing messages be masked (many browsers do not support masked outgoing messages)
        Returns:
        true, if messages are masked
      • setMaskOutgoingMessages

        void setMaskOutgoingMessages​(boolean maskOutgoingMessages)
        Should outgoing messages be masked (many browsers do not support masked outgoing messages)
        Parameters:
        maskOutgoingMessages - true, if messages are masked
      • isActive

        boolean isActive()
        True if WebSocket session is still active, false if close has been called but session is still connected (waiting to close)
        Returns:
        true if WebSocket session is still active
      • getPacketFragmentationSize

        long getPacketFragmentationSize()
        Not being used currently
        Returns:
        not being used
      • setPacketFragmentationSize

        void setPacketFragmentationSize​(long packetFragmentationSize)
        Not being used currently
        Parameters:
        packetFragmentationSize - not being used
      • getIdleFrequency

        int getIdleFrequency()
        Get time in milliseconds between idle events
        Returns:
        idle time (milliseconds)
      • setIdleFrequency

        void setIdleFrequency​(int idleFrequency)
        Set time in milliseconds between idle events
        Parameters:
        idleFrequency - idle time (milliseconds)
      • sendMessage

        void sendMessage​(WebSocketMessage message)
        Send a WebSocket message from server to client
        Parameters:
        message - WebSocket message
      • getValidationFrequency

        int getValidationFrequency()
        Get time in milliseconds between validation messages (ping from server to client). Value of zero turns off validation.
        Returns:
        validation time (milliseconds)
      • setValidationFrequency

        void setValidationFrequency​(int validationFrequency)
        Set time in milliseconds between validation messages (ping from server to client). Value of zero turns off validation.
        Parameters:
        validationFrequency - validation time (milliseconds)
      • getMaximumPendingWriteBytes

        int getMaximumPendingWriteBytes()
        Get the number of bytes that can be pending waiting to be sent before messages are no longer send (0 turns off this feature)
        Returns:
        number of bytes that can be pending waiting
      • setMaximumPendingWriteBytes

        void setMaximumPendingWriteBytes​(int maximumPendingWriteBytes)
        Set the number of bytes that can be pending waiting to be sent before messages are no longer send (0 turns off this feature)
        Parameters:
        maximumPendingWriteBytes - number of bytes that can be pending waiting
      • ping

        void ping​(IWebSocketPingResult pingResult)
        Send a ping message from server to client
        Parameters:
        pingResult - callback object when pong messages is received or ping message timesout
      • getLock

        Object getLock()
        Get the internal synchronization lock for this session
        Returns:
        internal synchronization lock
      • getEventListener

        IWebSocketEventNotify getEventListener()
        Get the listener object that receives WebSockets events
        Returns:
        listener object
      • getSessionId

        int getSessionId()
        Get WebSocket session Id
        Returns:
        WebSocket session Id
      • getHTTPProvider

        IHTTPProvider getHTTPProvider()
        Get the HTTPProvider that is the parent of this WebSocket session
        Returns:
        HTTPProvider
      • getIOPerformanceCounter

        IOPerformanceCounter getIOPerformanceCounter()
        Get IO performance counter that tracks incoming and outgoing TCP traffic
        Returns:
        IO performance counter
      • getElapsedTime

        ElapsedTimer getElapsedTime()
        Get the time the WebSocket session has been alive
        Returns:
        time the WebSocket session has been alive
      • getPingTimeout

        int getPingTimeout()
        Get the timeout (milliseconds) that we wait for a response (pong) to a ping message
        Returns:
        timeout (milliseconds)
      • setPingTimeout

        void setPingTimeout​(int pingTimeout)
        Set the timeout (milliseconds) that we wait for a response (pong) to a ping message
        Parameters:
        pingTimeout - timeout (milliseconds)
      • getProperties

        WMSProperties getProperties()
        Get user properties
        Returns:
        user properties
      • getRemoteIpAddress

        String getRemoteIpAddress()
        Get the remote Ip address
        Returns:
        remote Ip address
      • setRemoteIpAddress

        void setRemoteIpAddress​(String remoteIpAddress)
        Set remote Ip address
        Parameters:
        remoteIpAddress - remote Ip address
      • setHTTPRequest

        void setHTTPRequest​(com.wowza.wms.http.HTTPRequest httpRequest)
        Set HTTPRequest object
        Parameters:
        HTTPRequest -
      • getHTTPRequest

        com.wowza.wms.http.HTTPRequest getHTTPRequest()
        Get HTTPRequest object
        Returns:
      • getRemoteHost

        String getRemoteHost()
        Get remote host
        Returns:
        remote host
      • setRemoteHost

        void setRemoteHost​(String remoteHost)
        Set remote host
        Parameters:
        remoteHost - remote host
      • getIoSession

        org.apache.mina.common.IoSession getIoSession()
        Get the low level IOSession for this websocket
        Returns:
        low level IOSession
      • getRequestedDomainName

        String getRequestedDomainName()