Package com.wowza.wms.websocket.model
Interface IWebSocketSession
-
public interface IWebSocketSession
-
-
Field Summary
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close(boolean immediately, int reasonCode, String reasonStr)
Close the WebSocket sessionString
getContextStr()
Get context string for loggingElapsedTimer
getElapsedTime()
Get the time the WebSocket session has been aliveIWebSocketEventNotify
getEventListener()
Get the listener object that receives WebSockets eventsjava.util.Map<String,String>
getHeaderMap()
Get map of HTTP headers from original upgrade HTTP requestIHTTPProvider
getHTTPProvider()
Get the HTTPProvider that is the parent of this WebSocket sessioncom.wowza.wms.http.HTTPRequest
getHTTPRequest()
Get HTTPRequest objectint
getIdleFrequency()
Get time in milliseconds between idle eventsIOPerformanceCounter
getIOPerformanceCounter()
Get IO performance counter that tracks incoming and outgoing TCP trafficorg.apache.mina.common.IoSession
getIoSession()
Get the low level IOSession for this websocketObject
getLock()
Get the internal synchronization lock for this sessionlong
getMaximumMessageSize()
Get the maximum WebSocket message size for a single message (0 = no limit)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)long
getPacketFragmentationSize()
Not being used currentlyjava.util.Map<String,java.util.List<String>>
getParameterMap()
Get map of HTTP parameters from original upgrade HTTP requestint
getPingTimeout()
Get the timeout (milliseconds) that we wait for a response (pong) to a ping messageWMSProperties
getProperties()
Get user propertiesString
getQueryString()
Get query string from original upgrade HTTP requestString
getRemoteHost()
Get remote hostString
getRemoteIpAddress()
Get the remote Ip addressString
getRequestedDomainName()
String
getReqURI()
Get request URI from original upgrade HTTP requestString
getReqURL()
Get request URL from original upgrade HTTP requestint
getSessionId()
Get WebSocket session Idint
getValidationFrequency()
Get time in milliseconds between validation messages (ping from server to client).boolean
isActive()
True if WebSocket session is still active, false if close has been called but session is still connected (waiting to close)boolean
isMaskOutgoingMessages()
Should outgoing messages be masked (many browsers do not support masked outgoing messages)void
ping(IWebSocketPingResult pingResult)
Send a ping message from server to clientvoid
sendMessage(WebSocketMessage message)
Send a WebSocket message from server to clientvoid
setHTTPRequest(com.wowza.wms.http.HTTPRequest httpRequest)
Set HTTPRequest objectvoid
setIdleFrequency(int idleFrequency)
Set time in milliseconds between idle eventsvoid
setMaskOutgoingMessages(boolean maskOutgoingMessages)
Should outgoing messages be masked (many browsers do not support masked outgoing messages)void
setMaximumMessageSize(long maxMessageSize)
Set the maximum WebSocket message size for a single message (0 = no limit)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)void
setPacketFragmentationSize(long packetFragmentationSize)
Not being used currentlyvoid
setPingTimeout(int pingTimeout)
Set the timeout (milliseconds) that we wait for a response (pong) to a ping messagevoid
setRemoteHost(String remoteHost)
Set remote hostvoid
setRemoteIpAddress(String remoteIpAddress)
Set remote Ip addressvoid
setValidationFrequency(int validationFrequency)
Set time in milliseconds between validation messages (ping from server to client).
-
-
-
Field Detail
-
SECURITY_GUID
static final String SECURITY_GUID
- See Also:
- Constant Field Values
-
SECURITY_DIGEST_ALGORITHM
static final String SECURITY_DIGEST_ALGORITHM
- See Also:
- Constant Field Values
-
CHARENCODING
static final String CHARENCODING
- See Also:
- Constant Field Values
-
PINGWOWZAID
static final int PINGWOWZAID
- See Also:
- Constant Field Values
-
CLOSETIMEOUT
static final int CLOSETIMEOUT
- See Also:
- Constant Field Values
-
HTTPHEADER_NAME
static final String HTTPHEADER_NAME
- See Also:
- Constant Field Values
-
HTTPHEADER_SECKEY
static final String HTTPHEADER_SECKEY
- See Also:
- Constant Field Values
-
HTTPHEADER_SECACCEPT
static final String HTTPHEADER_SECACCEPT
- See Also:
- Constant Field Values
-
CLOSECODE_NORMAL
static final int CLOSECODE_NORMAL
- See Also:
- Constant Field Values
-
CLOSESTR_NORMAL
static final String CLOSESTR_NORMAL
- See Also:
- Constant Field Values
-
CLOSECODE_GOINGAWAY
static final int CLOSECODE_GOINGAWAY
- See Also:
- Constant Field Values
-
CLOSESTR_GOINGAWAY
static final String CLOSESTR_GOINGAWAY
- See Also:
- Constant Field Values
-
CLOSECODE_PROTOCOLERROR
static final int CLOSECODE_PROTOCOLERROR
- See Also:
- Constant Field Values
-
CLOSESTR_PROTOCOLERROR
static final String CLOSESTR_PROTOCOLERROR
- See Also:
- Constant Field Values
-
CLOSECODE_UNSUPPORTEDDATA
static final int CLOSECODE_UNSUPPORTEDDATA
- See Also:
- Constant Field Values
-
CLOSESTR_UNSUPPORTEDDATA
static final String CLOSESTR_UNSUPPORTEDDATA
- See Also:
- Constant Field Values
-
CLOSECODE_RESERVED
static final int CLOSECODE_RESERVED
- See Also:
- Constant Field Values
-
CLOSESTR_RESERVED
static final String CLOSESTR_RESERVED
- See Also:
- Constant Field Values
-
CLOSECODE_NOSTATUSRECEIVED
static final int CLOSECODE_NOSTATUSRECEIVED
- See Also:
- Constant Field Values
-
CLOSESTR_NOSTATUSRECEIVED
static final String CLOSESTR_NOSTATUSRECEIVED
- See Also:
- Constant Field Values
-
CLOSECODE_ABNORMAL
static final int CLOSECODE_ABNORMAL
- See Also:
- Constant Field Values
-
CLOSESTR_ABNORMAL
static final String CLOSESTR_ABNORMAL
- See Also:
- Constant Field Values
-
CLOSECODE_INVALIDFRAME
static final int CLOSECODE_INVALIDFRAME
- See Also:
- Constant Field Values
-
CLOSESTR_INVALIDFRAME
static final String CLOSESTR_INVALIDFRAME
- See Also:
- Constant Field Values
-
CLOSECODE_POLICYVIOLATION
static final int CLOSECODE_POLICYVIOLATION
- See Also:
- Constant Field Values
-
CLOSESTR_POLICYVIOLATION
static final String CLOSESTR_POLICYVIOLATION
- See Also:
- Constant Field Values
-
CLOSECODE_MESSAGETOOBIG
static final int CLOSECODE_MESSAGETOOBIG
- See Also:
- Constant Field Values
-
CLOSESTR_MESSAGETOOBIG
static final String CLOSESTR_MESSAGETOOBIG
- See Also:
- Constant Field Values
-
CLOSECODE_MANDATORYEXT
static final int CLOSECODE_MANDATORYEXT
- See Also:
- Constant Field Values
-
CLOSESTR_MANDATORYEXT
static final String CLOSESTR_MANDATORYEXT
- See Also:
- Constant Field Values
-
CLOSECODE_INTERNALSERVER
static final int CLOSECODE_INTERNALSERVER
- See Also:
- Constant Field Values
-
CLOSESTR_INTERNALSERVER
static final String CLOSESTR_INTERNALSERVER
- See Also:
- Constant Field Values
-
CLOSECODE_TLSHANDSHAKE
static final int CLOSECODE_TLSHANDSHAKE
- See Also:
- Constant Field Values
-
CLOSESTR_TLSHANDSHAKE
static final String CLOSESTR_TLSHANDSHAKE
- See Also:
- Constant Field Values
-
-
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 sentreasonCode
- 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()
-
-