Class XHRTransport.XHRSessionHelper
- java.lang.Object
-
- 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 java.lang.Object implements SocketIOSessionOutbound
-
-
Field Summary
Fields Modifier and Type Field Description protected SocketIOSessionsession
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidabort()Cause connection and all activity to be aborted and all resources to be released.voidclose()force close connectionvoidconnect(org.atmosphere.cpr.AtmosphereResourceImpl resource)protected abstract voidcustomConnect(org.atmosphere.cpr.AtmosphereRequest request, org.atmosphere.cpr.AtmosphereResponse response)voiddisconnect()disconnect the current connectionprotected abstract voidfinishSend(org.atmosphere.cpr.AtmosphereResponse response)java.lang.StringgetSessionId()org.atmosphere.cpr.Actionhandle(org.atmosphere.cpr.AtmosphereRequest request, org.atmosphere.cpr.AtmosphereResponse response, SocketIOSession session)voidsendMessage(java.lang.String message)Send a message to the client.voidsendMessage(java.util.List<SocketIOPacketImpl> messages)Send messages to the client.voidsendMessage(SocketIOPacket packet)Send a message to the client formatted is SocketIO format.protected abstract voidstartSend(org.atmosphere.cpr.AtmosphereResponse response)protected abstract voidwriteData(org.atmosphere.cpr.AtmosphereResponse response, java.lang.String data)
-
-
-
Field Detail
-
session
protected final SocketIOSession session
-
-
Method Detail
-
startSend
protected abstract void startSend(org.atmosphere.cpr.AtmosphereResponse response) throws java.io.IOException- Throws:
java.io.IOException
-
writeData
protected abstract void writeData(org.atmosphere.cpr.AtmosphereResponse response, java.lang.String data) throws java.io.IOException- Throws:
java.io.IOException
-
finishSend
protected abstract void finishSend(org.atmosphere.cpr.AtmosphereResponse response) throws java.io.IOException- Throws:
java.io.IOException
-
disconnect
public void disconnect()
Description copied from interface:SocketIOOutbounddisconnect the current connection- Specified by:
disconnectin interfaceSocketIOOutbound
-
close
public void close()
Description copied from interface:SocketIOOutboundforce close connection- Specified by:
closein interfaceSocketIOOutbound
-
sendMessage
public void sendMessage(SocketIOPacket packet) throws SocketIOException
Description copied from interface:SocketIOOutboundSend 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:
sendMessagein interfaceSocketIOOutbound- Parameters:
packet- The message to send- Throws:
SocketIOException
-
sendMessage
public void sendMessage(java.util.List<SocketIOPacketImpl> messages) throws SocketIOException
Description copied from interface:SocketIOOutboundSend messages to the client. If the session is still active, the messages will be cached if the connection is closed.- Specified by:
sendMessagein interfaceSocketIOOutbound- Throws:
SocketIOException
-
sendMessage
public void sendMessage(java.lang.String message) throws SocketIOExceptionDescription copied from interface:SocketIOOutboundSend a message to the client. If the session is still active, the message will be cached if the connection is closed.- Specified by:
sendMessagein interfaceSocketIOOutbound- 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 java.io.IOException- Specified by:
handlein interfaceSocketIOSessionOutbound- Returns:
- Throws:
java.io.IOException
-
customConnect
protected abstract void customConnect(org.atmosphere.cpr.AtmosphereRequest request, org.atmosphere.cpr.AtmosphereResponse response) throws java.io.IOException- Throws:
java.io.IOException
-
connect
public void connect(org.atmosphere.cpr.AtmosphereResourceImpl resource) throws java.io.IOException- Throws:
java.io.IOException
-
abort
public void abort()
Description copied from interface:SocketIOSessionOutboundCause 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:
abortin interfaceSocketIOSessionOutbound
-
getSessionId
public java.lang.String getSessionId()
- Specified by:
getSessionIdin interfaceSocketIOSessionOutbound- Returns:
-
-