|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.tyrus.platform.RemoteEndpointWrapper<T>
public final class RemoteEndpointWrapper<T>
Wrapps the RemoteEndpoint and represents the other side of the websocket connection.
| Method Summary | |
|---|---|
void |
close(CloseReason cr)
|
String |
getAddress()
URI to which the remote originally connected. |
static RemoteEndpointWrapper |
getRemoteWrapper(SPIRemoteEndpoint socket,
WebSocketEndpointImpl application,
boolean serverEndpoint)
Get the RemoteEndpoint wrapper. |
OutputStream |
getSendStream()
|
Writer |
getSendWriter()
|
Session |
getSession()
|
boolean |
isConnected()
The endpoint is connected. |
void |
sendBytes(byte[] data)
Send a binary message, returning when all of the message has been transmitted. |
Future<SendResult> |
sendBytes(byte[] data,
SendHandler completion)
Initiates the asynchronous transmission of a binary message. |
void |
sendObject(T o)
Sends a custom developer object, blocking until it has been transmitted. |
Future<SendResult> |
sendObject(T o,
SendHandler handler)
Initiates the transmission of a custom developer object. |
void |
sendPartialBytes(byte[] partialByte,
boolean isLast)
Send a binary message, blocking until all of the message has been transmitted. |
void |
sendPartialString(String fragment,
boolean isLast)
|
void |
sendPing(byte[] applicationData)
Send a Ping message containing the given application data to the remote endpoint. |
void |
sendPong(byte[] applicationData)
Allows the developer to send an unsolicited Pong message containing the given application data in order to serve as a unidirectional heartbeat for the session. |
void |
sendString(String data)
Send a text message, blocking until all of the message has been transmitted. |
Future<SendResult> |
sendString(String text,
SendHandler completion)
Initiates the asynchronous transmission of a text message. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static RemoteEndpointWrapper getRemoteWrapper(SPIRemoteEndpoint socket,
WebSocketEndpointImpl application,
boolean serverEndpoint)
socket - socket corresponding to the required wrapperapplication - web socket endpoint for which the wrapper represents the other side of the connectionserverEndpoint - server / client endpoint
public String getAddress()
public boolean isConnected()
true iff the endpoint is connected, false otherwise.
public void sendString(String data)
throws IOException
RemoteEndpoint
sendString in interface RemoteEndpoint<T>IOException
public void sendBytes(byte[] data)
throws IOException
RemoteEndpoint
sendBytes in interface RemoteEndpoint<T>IOException
public void sendPartialString(String fragment,
boolean isLast)
throws IOException
sendPartialString in interface RemoteEndpoint<T>IOException
public void sendPartialBytes(byte[] partialByte,
boolean isLast)
throws IOException
RemoteEndpoint
sendPartialBytes in interface RemoteEndpoint<T>IOException
public OutputStream getSendStream()
throws IOException
getSendStream in interface RemoteEndpoint<T>IOException
public Writer getSendWriter()
throws IOException
getSendWriter in interface RemoteEndpoint<T>IOException
public void sendObject(T o)
throws IOException,
EncodeException
RemoteEndpoint
sendObject in interface RemoteEndpoint<T>IOException
EncodeException
public Future<SendResult> sendString(String text,
SendHandler completion)
RemoteEndpoint
sendString in interface RemoteEndpoint<T>
public Future<SendResult> sendBytes(byte[] data,
SendHandler completion)
RemoteEndpoint
sendBytes in interface RemoteEndpoint<T>
public Future<SendResult> sendObject(T o,
SendHandler handler)
RemoteEndpoint
sendObject in interface RemoteEndpoint<T>public void sendPing(byte[] applicationData)
RemoteEndpoint
sendPing in interface RemoteEndpoint<T>public void sendPong(byte[] applicationData)
RemoteEndpoint
sendPong in interface RemoteEndpoint<T>public String toString()
toString in class Object
public void close(CloseReason cr)
throws IOException
IOExceptionpublic Session getSession()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||