org.atmosphere.socketio.transport
Class WebSocketTransport.SocketIOWebSocketSessionWrapperImpl

java.lang.Object
  extended by org.atmosphere.socketio.transport.WebSocketTransport.SocketIOWebSocketSessionWrapperImpl
All Implemented Interfaces:
SocketIOOutbound, SocketIOSessionOutbound, SocketIOWebSocketSessionWrapper
Enclosing class:
WebSocketTransport

public class WebSocketTransport.SocketIOWebSocketSessionWrapperImpl
extends Object
implements SocketIOWebSocketSessionWrapper


Field Summary
 boolean initiated
           
 SocketIOSession session
           
 SocketIOWebSocketEventListener socketioEventListener
           
 org.atmosphere.websocket.WebSocket webSocket
           
 
Method Summary
 void abort()
          Cause connection and all activity to be aborted and all resources to be released.
 void close()
          force close connection
 void disconnect()
          disconnect the current connection
 SocketIOSession getSession()
           
 String getSessionId()
           
 org.atmosphere.cpr.Action handle(org.atmosphere.cpr.AtmosphereRequest request, org.atmosphere.cpr.AtmosphereResponse response, SocketIOSession session)
           
 void initiated(boolean initiated)
           
 boolean isInitiated()
           
 void onDisconnect()
           
 void onMessage(byte frame, byte[] data, int offset, int length)
           
 void onMessage(byte frame, String message)
           
 void sendMessage(List<SocketIOPacketImpl> messages)
          Send messages to the client.
 void sendMessage(SocketIOPacket packet)
          Send a message to the client formatted is SocketIO format.
 void sendMessage(String message)
          Send a message to the client.
 void setWebSocket(org.atmosphere.websocket.WebSocket websocket)
           
 org.atmosphere.websocket.WebSocket webSocket()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

public final SocketIOSession session

socketioEventListener

public final SocketIOWebSocketEventListener socketioEventListener

initiated

public boolean initiated

webSocket

public org.atmosphere.websocket.WebSocket webSocket
Method Detail

onDisconnect

public void onDisconnect()
Specified by:
onDisconnect in interface SocketIOWebSocketSessionWrapper

onMessage

public void onMessage(byte frame,
                      String message)
Specified by:
onMessage in interface SocketIOWebSocketSessionWrapper

onMessage

public void onMessage(byte frame,
                      byte[] data,
                      int offset,
                      int length)
Specified by:
onMessage in interface SocketIOWebSocketSessionWrapper

disconnect

public void disconnect()
Description copied from interface: SocketIOOutbound
disconnect the current connection

Specified by:
disconnect in interface SocketIOOutbound

close

public void close()
Description copied from interface: SocketIOOutbound
force close connection

Specified by:
close in interface SocketIOOutbound

sendMessage

public void sendMessage(SocketIOPacket packet)
                 throws SocketIOException
Description copied from interface: SocketIOOutbound
Send a message to the client formatted is SocketIO format. If the session is still active, the message will be cached if the connection is closed.

Specified by:
sendMessage in interface SocketIOOutbound
Parameters:
packet - The message to send
Throws:
SocketIOException

sendMessage

public void sendMessage(List<SocketIOPacketImpl> messages)
                 throws SocketIOException
Description copied from interface: SocketIOOutbound
Send messages to the client. If the session is still active, the messages will be cached if the connection is closed.

Specified by:
sendMessage in interface SocketIOOutbound
Throws:
SocketIOException

sendMessage

public void sendMessage(String message)
                 throws SocketIOException
Description copied from interface: SocketIOOutbound
Send a message to the client. If the session is still active, the message will be cached if the connection is closed.

Specified by:
sendMessage in interface SocketIOOutbound
Parameters:
message - The message to send
Throws:
SocketIOException

handle

public org.atmosphere.cpr.Action handle(org.atmosphere.cpr.AtmosphereRequest request,
                                        org.atmosphere.cpr.AtmosphereResponse response,
                                        SocketIOSession session)
                                 throws IOException
Specified by:
handle in interface SocketIOSessionOutbound
Returns:
Throws:
IOException

abort

public void abort()
Description copied from interface: SocketIOSessionOutbound
Cause connection and all activity to be aborted and all resources to be released. The handler is expected to call the session's onShutdown() when it is finished. The only session method that the handler can legally call after this is onShutdown();

Specified by:
abort in interface SocketIOSessionOutbound

getSession

public SocketIOSession getSession()
Specified by:
getSession in interface SocketIOWebSocketSessionWrapper
Returns:

isInitiated

public boolean isInitiated()
Specified by:
isInitiated in interface SocketIOWebSocketSessionWrapper
Returns:

webSocket

public org.atmosphere.websocket.WebSocket webSocket()
Specified by:
webSocket in interface SocketIOWebSocketSessionWrapper
Returns:

setWebSocket

public void setWebSocket(org.atmosphere.websocket.WebSocket websocket)
Specified by:
setWebSocket in interface SocketIOWebSocketSessionWrapper

initiated

public void initiated(boolean initiated)
Specified by:
initiated in interface SocketIOWebSocketSessionWrapper

getSessionId

public String getSessionId()
Specified by:
getSessionId in interface SocketIOSessionOutbound
Returns:


Copyright © 2013. All Rights Reserved.