|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.cpr.AsyncIOWriterAdapter
org.atmosphere.cpr.AtmosphereInterceptorWriter
org.atmosphere.websocket.WebSocket
public abstract class WebSocket
Represent a portable WebSocket implementation which can be used to write message.
| Field Summary | |
|---|---|
protected boolean |
binaryWrite
|
protected long |
lastWrite
|
protected static org.slf4j.Logger |
logger
|
static String |
WEBSOCKET_ACCEPT_DONE
|
static String |
WEBSOCKET_INITIATED
|
static String |
WEBSOCKET_RESUME
|
static String |
WEBSOCKET_SUSPEND
|
| Fields inherited from class org.atmosphere.cpr.AtmosphereInterceptorWriter |
|---|
filters |
| Constructor Summary | |
|---|---|
WebSocket(AtmosphereConfig config)
|
|
| Method Summary | |
|---|---|
abstract void |
close()
|
void |
close(AtmosphereResponse r)
No OPS |
AtmosphereConfig |
config()
|
WebSocket |
flush(AtmosphereResponse r)
No OPS |
abstract boolean |
isOpen()
Is the underlying WebSocket open. |
long |
lastWriteTimeStampInMilliseconds()
The last time, in milliseconds, a write operation occurred. |
WebSocket |
redirect(AtmosphereResponse r,
String location)
No OPS |
AtmosphereResource |
resource()
Return the an AtmosphereResource used by this WebSocket, or null if the WebSocket has been closed
before the WebSocket message has been processed. |
WebSocket |
resource(AtmosphereResource r)
Associate an AtmosphereResource to this WebSocket |
protected byte[] |
transform(byte[] b,
int offset,
int length)
|
protected WebSocketHandler |
webSocketHandler()
|
protected WebSocket |
webSocketHandler(WebSocketHandler webSocketHandler)
|
WebSocket |
write(AtmosphereResponse r,
byte[] data)
No OPS |
WebSocket |
write(AtmosphereResponse r,
byte[] b,
int offset,
int length)
No OPS |
WebSocket |
write(AtmosphereResponse r,
String data)
No OPS |
abstract WebSocket |
write(byte[] b,
int offset,
int length)
|
abstract WebSocket |
write(String s)
|
WebSocket |
writeError(AtmosphereResponse r,
int errorCode,
String message)
No OPS |
| Methods inherited from class org.atmosphere.cpr.AtmosphereInterceptorWriter |
|---|
interceptor, invokeInterceptor, writeReady |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.slf4j.Logger logger
public static final String WEBSOCKET_INITIATED
public static final String WEBSOCKET_SUSPEND
public static final String WEBSOCKET_RESUME
public static final String WEBSOCKET_ACCEPT_DONE
protected long lastWrite
protected final boolean binaryWrite
| Constructor Detail |
|---|
public WebSocket(AtmosphereConfig config)
| Method Detail |
|---|
public AtmosphereConfig config()
protected WebSocket webSocketHandler(WebSocketHandler webSocketHandler)
protected WebSocketHandler webSocketHandler()
public WebSocket resource(AtmosphereResource r)
AtmosphereResource to this WebSocket
r - an AtmosphereResource to this WebSocket
public AtmosphereResource resource()
AtmosphereResource used by this WebSocket, or null if the WebSocket has been closed
before the WebSocket message has been processed.
AtmosphereResourcepublic long lastWriteTimeStampInMilliseconds()
protected byte[] transform(byte[] b,
int offset,
int length)
throws IOException
IOException
public WebSocket write(AtmosphereResponse r,
String data)
throws IOException
write in interface AsyncIOWriterwrite in class AtmosphereInterceptorWriterdata - the WebSocket message
IOException
public WebSocket write(AtmosphereResponse r,
byte[] data)
throws IOException
write in interface AsyncIOWriterwrite in class AtmosphereInterceptorWriterdata - the WebSocket message
IOException
public WebSocket write(AtmosphereResponse r,
byte[] b,
int offset,
int length)
throws IOException
write in interface AsyncIOWriterwrite in class AtmosphereInterceptorWriterb - the WebSocket messageoffset - offset of the messagelength - length if the message
IOException
public WebSocket writeError(AtmosphereResponse r,
int errorCode,
String message)
throws IOException
writeError in interface AsyncIOWriterwriteError in class AtmosphereInterceptorWritererrorCode - the error code
IOException
public WebSocket redirect(AtmosphereResponse r,
String location)
throws IOException
redirect in interface AsyncIOWriterredirect in class AtmosphereInterceptorWriterIOException
public void close(AtmosphereResponse r)
throws IOException
close in interface AsyncIOWriterclose in class AtmosphereInterceptorWriterIOException
public WebSocket flush(AtmosphereResponse r)
throws IOException
flush in interface AsyncIOWriterflush in class AtmosphereInterceptorWriterIOExceptionpublic abstract boolean isOpen()
public abstract WebSocket write(String s)
throws IOException
IOException
public abstract WebSocket write(byte[] b,
int offset,
int length)
throws IOException
IOExceptionpublic abstract void close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||