public class WebSocketCloverTransport extends CloverTransport implements CloverNVWebSocketClientListener
DEVICE_CONNECTED, DEVICE_DISCONNECTED, DEVICE_READY
Constructor and Description |
---|
WebSocketCloverTransport(java.net.URI endpoint,
PairingDeviceConfiguration pairingConfig,
CloverDeviceConfiguration cloverDeviceConfiguration,
java.security.KeyStore trustStore,
java.lang.String posName,
java.lang.String serialNumber,
java.lang.String authToken,
long pongTimeout,
long pingFrequency,
long reconnectDelay,
long reportConnectionProblemAfter) |
Modifier and Type | Method and Description |
---|---|
void |
connectionError(CloverNVWebSocketClient ws) |
void |
dispose()
Closes the connection to the underlying transport
|
void |
initializeConnection()
Initializes the connection using the underlying transport
|
void |
onClose(CloverNVWebSocketClient ws,
int code,
java.lang.String reason,
boolean remote) |
void |
onMessage(CloverNVWebSocketClient ws,
java.lang.String message) |
void |
onNotResponding(CloverNVWebSocketClient ws) |
void |
onOpen(CloverNVWebSocketClient ws) |
void |
onPingResponding(CloverNVWebSocketClient ws) |
void |
onPong(CloverNVWebSocketClient ws) |
void |
onSendError(java.lang.String payloadText) |
int |
sendMessage(java.lang.String message)
Sends the provided encoded message.
|
addObserver, getRemoteMessageVersion, notifyDeviceConnected, notifyDeviceDisconnected, notifyDeviceReady, onMessage, removeObserver
public WebSocketCloverTransport(java.net.URI endpoint, PairingDeviceConfiguration pairingConfig, CloverDeviceConfiguration cloverDeviceConfiguration, java.security.KeyStore trustStore, java.lang.String posName, java.lang.String serialNumber, java.lang.String authToken, long pongTimeout, long pingFrequency, long reconnectDelay, long reportConnectionProblemAfter)
public int sendMessage(java.lang.String message)
sendMessage
in interface ICloverTransport
message
- encoded message to sendpublic void initializeConnection()
ICloverTransport
initializeConnection
in interface ICloverTransport
public void dispose()
ICloverTransport
dispose
in interface ICloverTransport
dispose
in class CloverTransport
public void connectionError(CloverNVWebSocketClient ws)
connectionError
in interface CloverNVWebSocketClientListener
public void onNotResponding(CloverNVWebSocketClient ws)
onNotResponding
in interface CloverNVWebSocketClientListener
public void onPingResponding(CloverNVWebSocketClient ws)
onPingResponding
in interface CloverNVWebSocketClientListener
public void onOpen(CloverNVWebSocketClient ws)
onOpen
in interface CloverNVWebSocketClientListener
public void onClose(CloverNVWebSocketClient ws, int code, java.lang.String reason, boolean remote)
onClose
in interface CloverNVWebSocketClientListener
public void onMessage(CloverNVWebSocketClient ws, java.lang.String message)
onMessage
in interface CloverNVWebSocketClientListener
public void onPong(CloverNVWebSocketClient ws)
onPong
in interface CloverNVWebSocketClientListener
public void onSendError(java.lang.String payloadText)
onSendError
in interface CloverNVWebSocketClientListener