Package com.wowza.wms.websocket.model
Interface IWebSocketSession
public interface IWebSocketSession
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionvoidClose the WebSocket sessionGet context string for loggingGet the time the WebSocket session has been aliveGet the listener object that receives WebSockets eventsGet map of HTTP headers from original upgrade HTTP requestGet the HTTPProvider that is the parent of this WebSocket sessioncom.wowza.wms.http.HTTPRequestGet HTTPRequest objectintGet time in milliseconds between idle eventsGet IO performance counter that tracks incoming and outgoing TCP trafficorg.apache.mina.common.IoSessionGet the low level IOSession for this websocketgetLock()Get the internal synchronization lock for this sessionlongGet the maximum WebSocket message size for a single message (0 = no limit)intGet the number of bytes that can be pending waiting to be sent before messages are no longer send (0 turns off this feature)longNot being used currentlyGet map of HTTP parameters from original upgrade HTTP requestintGet the timeout (milliseconds) that we wait for a response (pong) to a ping messageGet user propertiesGet query string from original upgrade HTTP requestGet remote hostGet the remote Ip addressGet request URI from original upgrade HTTP requestGet request URL from original upgrade HTTP requestintGet WebSocket session IdintGet time in milliseconds between validation messages (ping from server to client).booleanisActive()True if WebSocket session is still active, false if close has been called but session is still connected (waiting to close)booleanShould outgoing messages be masked (many browsers do not support masked outgoing messages)voidping(IWebSocketPingResult pingResult) Send a ping message from server to clientvoidsendMessage(WebSocketMessage message) Send a WebSocket message from server to clientvoidsetHTTPRequest(com.wowza.wms.http.HTTPRequest httpRequest) Set HTTPRequest objectvoidsetIdleFrequency(int idleFrequency) Set time in milliseconds between idle eventsvoidsetMaskOutgoingMessages(boolean maskOutgoingMessages) Should outgoing messages be masked (many browsers do not support masked outgoing messages)voidsetMaximumMessageSize(long maxMessageSize) Set the maximum WebSocket message size for a single message (0 = no limit)voidsetMaximumPendingWriteBytes(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)voidsetPacketFragmentationSize(long packetFragmentationSize) Not being used currentlyvoidsetPingTimeout(int pingTimeout) Set the timeout (milliseconds) that we wait for a response (pong) to a ping messagevoidsetRemoteHost(String remoteHost) Set remote hostvoidsetRemoteIpAddress(String remoteIpAddress) Set remote Ip addressvoidsetValidationFrequency(int validationFrequency) Set time in milliseconds between validation messages (ping from server to client).
-
Field Details
-
SECURITY_GUID
- See Also:
-
SECURITY_DIGEST_ALGORITHM
- See Also:
-
CHARENCODING
- See Also:
-
PINGWOWZAID
static final int PINGWOWZAID- See Also:
-
CLOSETIMEOUT
static final int CLOSETIMEOUT- See Also:
-
HTTPHEADER_NAME
- See Also:
-
HTTPHEADER_SECKEY
- See Also:
-
HTTPHEADER_SECACCEPT
- See Also:
-
CLOSECODE_NORMAL
static final int CLOSECODE_NORMAL- See Also:
-
CLOSESTR_NORMAL
- See Also:
-
CLOSECODE_GOINGAWAY
static final int CLOSECODE_GOINGAWAY- See Also:
-
CLOSESTR_GOINGAWAY
- See Also:
-
CLOSECODE_PROTOCOLERROR
static final int CLOSECODE_PROTOCOLERROR- See Also:
-
CLOSESTR_PROTOCOLERROR
- See Also:
-
CLOSECODE_UNSUPPORTEDDATA
static final int CLOSECODE_UNSUPPORTEDDATA- See Also:
-
CLOSESTR_UNSUPPORTEDDATA
- See Also:
-
CLOSECODE_RESERVED
static final int CLOSECODE_RESERVED- See Also:
-
CLOSESTR_RESERVED
- See Also:
-
CLOSECODE_NOSTATUSRECEIVED
static final int CLOSECODE_NOSTATUSRECEIVED- See Also:
-
CLOSESTR_NOSTATUSRECEIVED
- See Also:
-
CLOSECODE_ABNORMAL
static final int CLOSECODE_ABNORMAL- See Also:
-
CLOSESTR_ABNORMAL
- See Also:
-
CLOSECODE_INVALIDFRAME
static final int CLOSECODE_INVALIDFRAME- See Also:
-
CLOSESTR_INVALIDFRAME
- See Also:
-
CLOSECODE_POLICYVIOLATION
static final int CLOSECODE_POLICYVIOLATION- See Also:
-
CLOSESTR_POLICYVIOLATION
- See Also:
-
CLOSECODE_MESSAGETOOBIG
static final int CLOSECODE_MESSAGETOOBIG- See Also:
-
CLOSESTR_MESSAGETOOBIG
- See Also:
-
CLOSECODE_MANDATORYEXT
static final int CLOSECODE_MANDATORYEXT- See Also:
-
CLOSESTR_MANDATORYEXT
- See Also:
-
CLOSECODE_INTERNALSERVER
static final int CLOSECODE_INTERNALSERVER- See Also:
-
CLOSESTR_INTERNALSERVER
- See Also:
-
CLOSECODE_TLSHANDSHAKE
static final int CLOSECODE_TLSHANDSHAKE- See Also:
-
CLOSESTR_TLSHANDSHAKE
- See Also:
-
-
Method Details
-
getContextStr
String getContextStr()Get context string for logging- Returns:
- context string for logging
-
close
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
Get map of HTTP headers from original upgrade HTTP request- Returns:
- HTTP headers
-
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
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
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
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
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()
-