com.glines.socketio.server
Interface SocketIOSession


public interface SocketIOSession


Nested Class Summary
static interface SocketIOSession.Factory
           
static interface SocketIOSession.SessionTask
           
static interface SocketIOSession.SessionTransportHandler
           
 
Method Summary
 void clearHeartbeatTimer()
           
 void clearTimeoutTimer()
           
 String generateRandomString(int length)
           
 ConnectionState getConnectionState()
           
 long getHeartbeat()
           
 SocketIOInbound getInbound()
           
 String getSessionId()
           
 long getTimeout()
           
 SocketIOSession.SessionTransportHandler getTransportHandler()
           
 void onClose(String data)
           
 void onConnect(SocketIOSession.SessionTransportHandler handler)
           
 void onDisconnect(DisconnectReason reason)
          Pass disconnect through to contained SocketIOInbound and update any internal state.
 void onMessage(SocketIOFrame message)
           
 void onMessage(String message)
          Pass message through to contained SocketIOInbound If a timeout timer is set, then it will be reset.
 void onPing(String data)
           
 void onPong(String data)
           
 void onShutdown()
          Called by handler to report that it is done and the session can be cleaned up.
 SocketIOSession.SessionTask scheduleTask(Runnable task, long delay)
          Schedule a task (e.g.
 void setHeartbeat(long delay)
           
 void setTimeout(long timeout)
           
 void startClose()
          Initiate close.
 void startHeartbeatTimer()
           
 void startTimeoutTimer()
           
 

Method Detail

generateRandomString

String generateRandomString(int length)

getSessionId

String getSessionId()

getConnectionState

ConnectionState getConnectionState()

getInbound

SocketIOInbound getInbound()

getTransportHandler

SocketIOSession.SessionTransportHandler getTransportHandler()

setHeartbeat

void setHeartbeat(long delay)

getHeartbeat

long getHeartbeat()

setTimeout

void setTimeout(long timeout)

getTimeout

long getTimeout()

startTimeoutTimer

void startTimeoutTimer()

clearTimeoutTimer

void clearTimeoutTimer()

startHeartbeatTimer

void startHeartbeatTimer()

clearHeartbeatTimer

void clearHeartbeatTimer()

startClose

void startClose()
Initiate close.


onMessage

void onMessage(SocketIOFrame message)

onPing

void onPing(String data)

onPong

void onPong(String data)

onClose

void onClose(String data)

scheduleTask

SocketIOSession.SessionTask scheduleTask(Runnable task,
                                         long delay)
Schedule a task (e.g. timeout timer)

Parameters:
task - The task to execute after specified delay.
delay - Delay in milliseconds.
Returns:

onConnect

void onConnect(SocketIOSession.SessionTransportHandler handler)
Parameters:
handler - The handler or null if the connection failed.

onMessage

void onMessage(String message)
Pass message through to contained SocketIOInbound If a timeout timer is set, then it will be reset.

Parameters:
message -

onDisconnect

void onDisconnect(DisconnectReason reason)
Pass disconnect through to contained SocketIOInbound and update any internal state.

Parameters:
reason -

onShutdown

void onShutdown()
Called by handler to report that it is done and the session can be cleaned up. If onDisconnect has not been called yet, then it will be called with DisconnectReason.ERROR.



Copyright © 2010-2011. All Rights Reserved.