Class AbstractWebsocketClient
java.lang.Object
io.fluxcapacitor.javaclient.common.websocket.AbstractWebsocketClient
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
WebSocketEventStoreClient,WebsocketGatewayClient,WebsocketKeyValueClient,WebsocketSchedulingClient,WebSocketSearchClient,WebsocketTrackingClient
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic com.fasterxml.jackson.databind.ObjectMapperstatic javax.websocket.WebSocketContainer -
Constructor Summary
ConstructorsConstructorDescriptionAbstractWebsocketClient(URI endpointUri, WebSocketClient.ClientConfig clientConfig, boolean sendMetrics) AbstractWebsocketClient(URI endpointUri, WebSocketClient.ClientConfig clientConfig, boolean sendMetrics, int numberOfSessions) AbstractWebsocketClient(javax.websocket.WebSocketContainer container, URI endpointUri, WebSocketClient.ClientConfig clientConfig, boolean sendMetrics, Duration reconnectDelay, com.fasterxml.jackson.databind.ObjectMapper objectMapper, int numberOfSessions) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voidclose(boolean clearOutstandingRequests) protected voidhandleResult(QueryResult result, String batchId) voidonClose(javax.websocket.Session session, javax.websocket.CloseReason closeReason) voidvoidonMessage(byte[] bytes) protected voidretryOutstandingRequests(String sessionId) protected Awaitableprotected <R extends QueryResult>
CompletableFuture<R>protected AwaitablesendAndForget(JsonType object) protected <R extends QueryResult>
RsendAndWait(Request request) protected Awaitableprotected voidtryPublishMetrics(JsonType message, Metadata metadata)
-
Field Details
-
defaultWebSocketContainer
public static javax.websocket.WebSocketContainer defaultWebSocketContainer -
defaultObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper defaultObjectMapper
-
-
Constructor Details
-
AbstractWebsocketClient
public AbstractWebsocketClient(URI endpointUri, WebSocketClient.ClientConfig clientConfig, boolean sendMetrics) -
AbstractWebsocketClient
public AbstractWebsocketClient(URI endpointUri, WebSocketClient.ClientConfig clientConfig, boolean sendMetrics, int numberOfSessions) -
AbstractWebsocketClient
public AbstractWebsocketClient(javax.websocket.WebSocketContainer container, URI endpointUri, WebSocketClient.ClientConfig clientConfig, boolean sendMetrics, Duration reconnectDelay, com.fasterxml.jackson.databind.ObjectMapper objectMapper, int numberOfSessions)
-
-
Method Details
-
send
-
sendAndWait
-
sendAndForget
-
send
-
sendBatch
-
onMessage
public void onMessage(byte[] bytes) -
handleResult
-
onClose
public void onClose(javax.websocket.Session session, javax.websocket.CloseReason closeReason) -
retryOutstandingRequests
-
onError
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
close
protected void close(boolean clearOutstandingRequests) -
tryPublishMetrics
-