org.atmosphere.socketio
Interface SocketIOSession


public interface SocketIOSession

Author:
Sebastien Dionne : sebastien.dionne@gmail.com

Method Summary
 void clearHeartbeatTimer()
           
 void clearTimeoutTimer()
           
 String generateRandomString(int length)
          Generate the session id
 AtmosphereHandler getAtmosphereHandler()
           
 AtmosphereResourceImpl getAtmosphereResourceImpl()
           
 long getHeartbeat()
           
 long getRequestSuspendTime()
           
 String getSessionId()
           
 long getTimeout()
           
 SocketIOSessionOutbound getTransportHandler()
           
 void onClose(String data)
           
 void onConnect(AtmosphereResourceImpl resource, SocketIOSessionOutbound handler)
           
 void onDisconnect(DisconnectReason reason)
          Pass disconnect through to contained SocketIOInbound and update any internal state.
 void onMessage(AtmosphereResourceImpl resource, SocketIOSessionOutbound handler, String message)
          Pass message through to contained SocketIOInbound If a timeout timer is set, then it will be reset.
 void onShutdown()
          Called by handler to report that it is done and the session can be cleaned up.
 void sendHeartBeat()
           
 void setAtmosphereResourceImpl(AtmosphereResourceImpl resource)
           
 void setHeartbeat(long delay)
           
 void setRequestSuspendTime(long suspendTime)
           
 void setTimeout(long timeout)
           
 void startClose()
          Initiate close.
 void startHeartbeatTimer()
           
 void startTimeoutTimer()
           
 void timeout()
           
 

Method Detail

generateRandomString

String generateRandomString(int length)
Generate the session id

Parameters:
length - session id length
Returns:

getSessionId

String getSessionId()
Returns:
the session id for this session

getAtmosphereHandler

AtmosphereHandler getAtmosphereHandler()
Returns:

getAtmosphereResourceImpl

AtmosphereResourceImpl getAtmosphereResourceImpl()
Returns:

setAtmosphereResourceImpl

void setAtmosphereResourceImpl(AtmosphereResourceImpl resource)
Parameters:
resource -

getTransportHandler

SocketIOSessionOutbound getTransportHandler()
Returns:

setHeartbeat

void setHeartbeat(long delay)
Parameters:
delay -

getHeartbeat

long getHeartbeat()
Returns:

sendHeartBeat

void sendHeartBeat()

setTimeout

void setTimeout(long timeout)
Parameters:
timeout -

getTimeout

long getTimeout()
Returns:

timeout

void timeout()

startTimeoutTimer

void startTimeoutTimer()

clearTimeoutTimer

void clearTimeoutTimer()

startHeartbeatTimer

void startHeartbeatTimer()

clearHeartbeatTimer

void clearHeartbeatTimer()

setRequestSuspendTime

void setRequestSuspendTime(long suspendTime)
Parameters:
suspendTime -

getRequestSuspendTime

long getRequestSuspendTime()
Returns:

startClose

void startClose()
Initiate close.


onClose

void onClose(String data)
Parameters:
data -

onConnect

void onConnect(AtmosphereResourceImpl resource,
               SocketIOSessionOutbound handler)
Parameters:
handler - The handler or null if the connection failed.

onMessage

void onMessage(AtmosphereResourceImpl resource,
               SocketIOSessionOutbound handler,
               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 © 2013. All Rights Reserved.