public class WebSocketClient extends Object
| Constructor and Description |
|---|
WebSocketClient(WebSocketClientCallback callback) |
WebSocketClient(YamcsConnectionProperties yprops) |
WebSocketClient(YamcsConnectionProperties yprops,
WebSocketClientCallback callback) |
| Modifier and Type | Method and Description |
|---|---|
io.netty.channel.ChannelFuture |
connect() |
void |
disconnect() |
void |
enableReconnection(boolean enableReconnection)
enable or disable reconnection in case of failure to connect or if the client is disconnected.
|
void |
enableTcpKeepAlive(boolean enableTcpKeepAlive)
Enable/disable the TCP Keep-Alive on websocket sockets.
|
Web.ConnectionInfo |
getConnectionInfo() |
int |
getMaxFramePayloadLength() |
boolean |
isConnected() |
boolean |
isInsecureTls() |
boolean |
isUseProtobuf() |
CompletableFuture<Web.WebSocketServerMessage.WebSocketReplyData> |
sendRequest(WebSocketRequest request)
Performs the request in a different thread
|
void |
sendRequest(WebSocketRequest request,
WebSocketResponseHandler responseHandler) |
void |
setCaCertFile(String caCertFile)
In case of https connections, this file contains the CA certificates that are used to verify server certificate
|
void |
setConnectionProperties(YamcsConnectionProperties yprops) |
void |
setConnectionTimeoutMs(int timeoutMs) |
void |
setInsecureTls(boolean insecureTls)
if true and https connections are used, do not verify server certificate
|
void |
setMaxFramePayloadLength(int maxFramePayloadLength) |
void |
setReconnectionInterval(long reconnectionIntervalMillisec)
set the reconnection interval in milliseconds.
|
void |
setUserAgent(String userAgent) |
io.netty.util.concurrent.Future<?> |
shutdown() |
public WebSocketClient(WebSocketClientCallback callback)
public WebSocketClient(YamcsConnectionProperties yprops, WebSocketClientCallback callback)
public WebSocketClient(YamcsConnectionProperties yprops)
public int getMaxFramePayloadLength()
public void setMaxFramePayloadLength(int maxFramePayloadLength)
public void setConnectionProperties(YamcsConnectionProperties yprops)
public void setUserAgent(String userAgent)
public void setConnectionTimeoutMs(int timeoutMs)
public void enableReconnection(boolean enableReconnection)
enableReconnection - public io.netty.channel.ChannelFuture connect()
throws SSLException,
GeneralSecurityException
SSLExceptionGeneralSecurityExceptionpublic void setReconnectionInterval(long reconnectionIntervalMillisec)
enableReconnection(boolean) to enable the recconnection.reconnectionIntervalMillisec - public CompletableFuture<Web.WebSocketServerMessage.WebSocketReplyData> sendRequest(WebSocketRequest request)
request - public void sendRequest(WebSocketRequest request, WebSocketResponseHandler responseHandler)
public boolean isUseProtobuf()
public void disconnect()
public void enableTcpKeepAlive(boolean enableTcpKeepAlive)
enableTcpKeepAlive - if true the TCP SO_KEEPALIVE option is setpublic io.netty.util.concurrent.Future<?> shutdown()
public boolean isConnected()
public Web.ConnectionInfo getConnectionInfo()
public void setCaCertFile(String caCertFile) throws IOException, GeneralSecurityException
caCertFile - IOExceptionGeneralSecurityExceptionpublic boolean isInsecureTls()
public void setInsecureTls(boolean insecureTls)
insecureTls - Copyright © 2019 Space Applications Services. All rights reserved.