org.atmosphere.socketio.transport
Class XHRTransport.XHRSessionHelper

java.lang.Object
  extended by org.atmosphere.socketio.transport.XHRTransport.XHRSessionHelper
All Implemented Interfaces:
SocketIOOutbound, SocketIOSessionOutbound
Direct Known Subclasses:
JSONPPollingTransport.XHRPollingSessionHelper, XHRPollingTransport.XHRPollingSessionHelper
Enclosing class:
XHRTransport

protected abstract class XHRTransport.XHRSessionHelper
extends Object
implements SocketIOSessionOutbound


Field Summary
protected  SocketIOSession session
           
 
Method Summary
 void abort()
          Cause connection and all activity to be aborted and all resources to be released.
 void close()
          force close connection
 void connect(org.atmosphere.cpr.AtmosphereResourceImpl resource)
           
protected abstract  void customConnect(org.atmosphere.cpr.AtmosphereRequest request, org.atmosphere.cpr.AtmosphereResponse response)
           
 void disconnect()
          disconnect the current connection
protected abstract  void finishSend(org.atmosphere.cpr.AtmosphereResponse response)
           
 String getSessionId()
           
 org.atmosphere.cpr.Action handle(org.atmosphere.cpr.AtmosphereRequest request, org.atmosphere.cpr.AtmosphereResponse response, SocketIOSession session)
           
 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.
protected abstract  void startSend(org.atmosphere.cpr.AtmosphereResponse response)
           
protected abstract  void writeData(org.atmosphere.cpr.AtmosphereResponse response, String data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

protected final SocketIOSession session
Method Detail

startSend

protected abstract void startSend(org.atmosphere.cpr.AtmosphereResponse response)
                           throws IOException
Throws:
IOException

writeData

protected abstract void writeData(org.atmosphere.cpr.AtmosphereResponse response,
                                  String data)
                           throws IOException
Throws:
IOException

finishSend

protected abstract void finishSend(org.atmosphere.cpr.AtmosphereResponse response)
                            throws IOException
Throws:
IOException

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

customConnect

protected abstract void customConnect(org.atmosphere.cpr.AtmosphereRequest request,
                                      org.atmosphere.cpr.AtmosphereResponse response)
                               throws IOException
Throws:
IOException

connect

public void connect(org.atmosphere.cpr.AtmosphereResourceImpl resource)
             throws IOException
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

getSessionId

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


Copyright © 2015. All Rights Reserved.