public class MsbClient extends Object implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static class |
MsbClient.Builder
The type Builder to build a client.
|
| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
hostnameVerification
The constant hostnameVerification.
|
| Constructor and Description |
|---|
MsbClient(String url)
Instantiates a new Client.
|
MsbClient(String url,
int eventCacheSize)
Instantiates a new Msb client.
|
MsbClient(String url,
int eventCacheSize,
int websocketTextMessageSize)
Instantiates a new Msb client.
|
MsbClient(String url,
int eventCacheSize,
int websocketTextMessageSize,
int functionCallExecutorPoolSize)
Instantiates a new Msb client.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Future<MsbClientHandler> |
connect()
Start the client, which opens and hold a connection to MSB.
|
static void |
disableHostnameVerification(boolean disable)
Disable hostname checking when establishing a secure connection,
if self-signed certificates are used or an ip is used instead of a domain name.
|
void |
disconnect()
Stop client and close connection to MSB.
|
MsbClientHandler |
getClientHandler()
Get client handler to interact with the connected MSB instance.
|
int |
getEventCacheSize()
Gets event cache size.
|
int |
getReconnectInterval()
Gets reconnect interval.
|
String |
getUrl()
Gets url.
|
int |
getWebsocketTextMessageSize()
Gets websocket text message size.
|
boolean |
isAutoReconnect()
Is auto reconnect boolean.
|
boolean |
isConnected()
Checks if is connected.
|
boolean |
isDataFormatValidation()
Is data format validation boolean.
|
boolean |
isEventCache()
Is event cache boolean.
|
boolean |
isHostnameVerificationDisabled()
Is hostname verification enabled.
|
boolean |
isInvokableFunctionCalls()
Is invokable function calls boolean.
|
boolean |
isRegistered()
Is registered boolean.
|
void |
setAutoReconnect(boolean autoReconnect)
Sets auto reconnect.
|
void |
setDataFormatValidation(boolean dataFormatValidationEnabled)
Set data format validation.
|
void |
setEventCache(boolean eventCacheEnabled)
Set event cache.
|
void |
setInvokableFunctionCalls(boolean invokable)
Sets invokable function calls.
|
void |
setReconnectInterval(int millis)
Sets reconnect interval, it must be greater than 3000 milliseconds.
|
void |
setTrustStore(String trustStorePath,
String trustStorePwd)
Sets trust store for secure connection over wss/https.
|
protected static boolean hostnameVerification
public MsbClient(String url)
url - the url of MSB websocket interfacepublic MsbClient(String url, int eventCacheSize)
url - the urleventCacheSize - the event cache sizepublic MsbClient(String url, int eventCacheSize, int websocketTextMessageSize)
url - the urleventCacheSize - the event cache sizewebsocketTextMessageSize - the websocket text message sizepublic MsbClient(String url, int eventCacheSize, int websocketTextMessageSize, int functionCallExecutorPoolSize)
url - the urleventCacheSize - the event cache sizewebsocketTextMessageSize - the websocket text message sizefunctionCallExecutorPoolSize - the function call executor pool sizepublic void setTrustStore(String trustStorePath, String trustStorePwd)
trustStorePath - the trust store pathtrustStorePwd - the trust store pwdpublic static void disableHostnameVerification(boolean disable)
disable - the disablepublic boolean isHostnameVerificationDisabled()
public String getUrl()
public int getEventCacheSize()
public int getWebsocketTextMessageSize()
public MsbClientHandler getClientHandler()
public boolean isInvokableFunctionCalls()
public void setInvokableFunctionCalls(boolean invokable)
invokable - the invokablepublic boolean isEventCache()
public void setEventCache(boolean eventCacheEnabled)
eventCacheEnabled - the event cache enabledpublic boolean isAutoReconnect()
public void setAutoReconnect(boolean autoReconnect)
autoReconnect - the auto reconnectpublic void setReconnectInterval(int millis)
millis - the millispublic int getReconnectInterval()
public boolean isDataFormatValidation()
public void setDataFormatValidation(boolean dataFormatValidationEnabled)
dataFormatValidationEnabled - the data format validation enabledpublic Future<MsbClientHandler> connect()
public boolean isConnected()
public boolean isRegistered()
public void disconnect()
public void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2019 Fraunhofer IPA. All rights reserved.