Package org.atmosphere.socketio
Interface SocketIOSession
-
public interface SocketIOSession- Author:
- Sebastien Dionne : sebastien.dionne@gmail.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearHeartbeatTimer()voidclearTimeoutTimer()java.lang.StringgenerateRandomString(int length)Generate the session idorg.atmosphere.cpr.AtmosphereHandlergetAtmosphereHandler()org.atmosphere.cpr.AtmosphereResourceImplgetAtmosphereResourceImpl()longgetHeartbeat()longgetRequestSuspendTime()java.lang.StringgetSessionId()longgetTimeout()SocketIOSessionOutboundgetTransportHandler()voidonClose(java.lang.String data)voidonConnect(org.atmosphere.cpr.AtmosphereResourceImpl resource, SocketIOSessionOutbound handler)voidonDisconnect(DisconnectReason reason)Pass disconnect through to contained SocketIOInbound and update any internal state.voidonMessage(org.atmosphere.cpr.AtmosphereResourceImpl resource, SocketIOSessionOutbound handler, java.lang.String message)Pass message through to contained SocketIOInbound If a timeout timer is set, then it will be reset.voidonShutdown()Called by handler to report that it is done and the session can be cleaned up.voidsendHeartBeat()voidsetAtmosphereResourceImpl(org.atmosphere.cpr.AtmosphereResourceImpl resource)voidsetHeartbeat(long delay)voidsetRequestSuspendTime(long suspendTime)voidsetTimeout(long timeout)voidstartClose()Initiate close.voidstartHeartbeatTimer()voidstartTimeoutTimer()voidtimeout()
-
-
-
Method Detail
-
generateRandomString
java.lang.String generateRandomString(int length)
Generate the session id- Parameters:
length- session id length- Returns:
-
getSessionId
java.lang.String getSessionId()
- Returns:
- the session id for this session
-
getAtmosphereHandler
org.atmosphere.cpr.AtmosphereHandler getAtmosphereHandler()
- Returns:
-
getAtmosphereResourceImpl
org.atmosphere.cpr.AtmosphereResourceImpl getAtmosphereResourceImpl()
- Returns:
-
setAtmosphereResourceImpl
void setAtmosphereResourceImpl(org.atmosphere.cpr.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(java.lang.String data)
- Parameters:
data-
-
onConnect
void onConnect(org.atmosphere.cpr.AtmosphereResourceImpl resource, SocketIOSessionOutbound handler)- Parameters:
handler- The handler or null if the connection failed.
-
onMessage
void onMessage(org.atmosphere.cpr.AtmosphereResourceImpl resource, SocketIOSessionOutbound handler, java.lang.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.
-
-