public abstract class AbstractJsonRpcClientWebSocket extends JsonRpcClient
| Modifier and Type | Field and Description |
|---|---|
protected static int |
maxPacketSize |
protected static long |
RECONNECT_DELAY_TIME_MILLIS |
protected URI |
uri |
closedByClient, connectionTimeout, handlerManager, heartbeating, heartbeatInterval, idleTimeout, label, registerInfo, rsHelper, session| Constructor and Description |
|---|
AbstractJsonRpcClientWebSocket(String url,
JsonRpcWSConnectionListener connectionListener) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this client.
|
protected void |
closeClient(String reason) |
protected abstract void |
closeNativeClient() |
protected void |
closeWithReconnection() |
void |
connect() |
protected void |
connectIfNecessary() |
protected abstract void |
connectNativeClient() |
void |
connectWithSession() |
protected void |
createExecServiceIfNecessary() |
protected void |
fireConnected() |
protected void |
fireConnectionFailed() |
protected void |
fireDisconnected() |
protected void |
fireReconnectedNewServer() |
protected void |
fireReconnectedSameServer() |
protected void |
fireReconnecting() |
long |
getRequestTimeout() |
protected void |
handleReconnectDisconnection(int statusCode,
String closeReason) |
protected void |
handleResponseFromServer(com.google.gson.JsonObject message) |
protected void |
internalConnectIfNecessary() |
protected <P> void |
internalSendRequestWebSocket(Request<P> request,
Class<com.google.gson.JsonElement> resultClass,
Continuation<Response<com.google.gson.JsonElement>> continuation) |
protected <P,R> Response<R> |
internalSendRequestWebSocket(Request<P> request,
Class<R> resultClass) |
boolean |
isConcurrentServerRequest() |
protected abstract boolean |
isNativeClientConnected() |
boolean |
isSendCloseMessage() |
boolean |
isTryReconnectingForever() |
void |
onConnected(Handler connectedHandler) |
void |
onConnectionFailed(Handler connectionFailedHandler) |
void |
onDisconnected(Handler disconnectedHandler) |
void |
onReconnected(ReconnectedHandler reconnectedHandler) |
void |
onReconnecting(Handler reconnectingHandler) |
protected void |
receivedTextMessage(String message) |
protected abstract void |
sendTextMessage(String jsonMessage) |
void |
setConcurrentServerRequest(boolean concurrentServerRequest)
Configures how requests from server have to be processed.
|
void |
setRequestTimeout(long timeout)
Configures the request timeout in this client.
|
void |
setSendCloseMessage(boolean sendCloseMessage)
Configures if this client should send a close message to server when close() method is invoked.
|
void |
setTryReconnectingForever(boolean tryReconnectingForever) |
void |
setTryReconnectingMaxTime(long tryReconnectingMaxTime) |
disableHeartbeat, disableHeartbeat, enableHeartbeat, enableHeartbeat, getConnectionTimeout, getHeartbeatInterval, getIdleTimeout, getSession, isClosedByUser, sendNotification, sendNotification, sendNotification, sendRequest, sendRequest, sendRequest, sendRequest, sendRequest, sendRequest, sendRequest, sendRequestHonorId, sendRequestHonorId, setConnectionTimeout, setHeartbeatInterval, setIdleTimeout, setLabel, setServerRequestHandler, setSessionIdprotected static final long RECONNECT_DELAY_TIME_MILLIS
protected static final int maxPacketSize
protected URI uri
public AbstractJsonRpcClientWebSocket(String url, JsonRpcWSConnectionListener connectionListener)
public void setRequestTimeout(long timeout)
setRequestTimeout in class JsonRpcClientpublic long getRequestTimeout()
public void setSendCloseMessage(boolean sendCloseMessage)
sendCloseMessage - public boolean isSendCloseMessage()
public void setTryReconnectingForever(boolean tryReconnectingForever)
public boolean isTryReconnectingForever()
public void setConcurrentServerRequest(boolean concurrentServerRequest)
concurrentServerRequest - public boolean isConcurrentServerRequest()
protected void fireReconnectedNewServer()
protected void fireReconnectedSameServer()
protected void fireConnectionFailed()
protected void fireConnected()
protected void fireReconnecting()
protected void fireDisconnected()
protected void createExecServiceIfNecessary()
protected <P,R> Response<R> internalSendRequestWebSocket(Request<P> request, Class<R> resultClass) throws IOException
IOExceptionprotected <P> void internalSendRequestWebSocket(Request<P> request, Class<com.google.gson.JsonElement> resultClass, Continuation<Response<com.google.gson.JsonElement>> continuation)
public void close()
throws IOException
JsonRpcClientclose in interface Closeableclose in interface AutoCloseableclose in class JsonRpcClientIOException - if an I/O error occurs when closing this client.#isClosedprotected void closeClient(String reason)
protected void handleResponseFromServer(com.google.gson.JsonObject message)
protected void receivedTextMessage(String message)
protected void handleReconnectDisconnection(int statusCode,
String closeReason)
protected void closeWithReconnection()
closeWithReconnection in class JsonRpcClientpublic void connect()
throws IOException
connect in class JsonRpcClientIOExceptionpublic void connectWithSession()
throws IOException
IOExceptionprotected void internalConnectIfNecessary()
throws IOException
IOExceptionprotected void connectIfNecessary()
throws IOException
IOExceptionpublic void onConnected(Handler connectedHandler)
public void onConnectionFailed(Handler connectionFailedHandler)
public void onDisconnected(Handler disconnectedHandler)
public void onReconnecting(Handler reconnectingHandler)
public void onReconnected(ReconnectedHandler reconnectedHandler)
public void setTryReconnectingMaxTime(long tryReconnectingMaxTime)
protected abstract void sendTextMessage(String jsonMessage) throws IOException
IOExceptionprotected abstract void closeNativeClient()
protected abstract boolean isNativeClientConnected()
protected abstract void connectNativeClient()
throws TimeoutException,
Exception
TimeoutExceptionExceptionCopyright © 2017 Kurento. All rights reserved.