Class ProxyWebsocketEndpoint
java.lang.Object
io.fluxzero.proxy.ProxyWebsocketEndpoint
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final record -
Constructor Summary
ConstructorsConstructorDescriptionProxyWebsocketEndpoint(io.fluxzero.sdk.configuration.client.Client client, io.fluxzero.sdk.publishing.RequestHandler requestHandler) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected ProxyWebsocketEndpoint.SessionContextgetContext(io.fluxzero.proxy.ProxyWebsocketSession session) protected voidhandleDisconnects(List<io.fluxzero.common.api.SerializedMessage> resultMessages) protected voidhandleResultMessages(List<io.fluxzero.common.api.SerializedMessage> resultMessages) voidonBinary(io.fluxzero.proxy.ProxyWebsocketSession session, byte[] message) Forwards a binary frame as a socket message request.voidonClose(io.fluxzero.proxy.ProxyWebsocketSession session, io.fluxzero.sdk.common.websocket.WebsocketCloseReason closeReason) Removes session bookkeeping and keep-alive scheduling, sends its close notification, and waits up to the configured notification timeout.voidLogs a socket transport error, distinguishing already closing channels and idle timeouts from unexpected failures.voidonOpen(io.fluxzero.proxy.ProxyWebsocketSession session) Registers an opened socket, forwards its open notification, and schedules keep-alive checks.voidonPong(io.fluxzero.proxy.ProxyWebsocketSession session, ByteBuffer message) Consumes matching internal keep-alive pongs and forwards other pong payloads to application handlers.voidEncodes a text frame as UTF-8 and forwards it as a socket message request.protected CompletableFuture<?> sendCloseRequest(io.fluxzero.proxy.ProxyWebsocketSession session, io.fluxzero.sdk.common.websocket.WebsocketCloseReason closeReason) protected CompletableFuture<?> sendRequest(io.fluxzero.proxy.ProxyWebsocketSession session, String method, byte[] payload) voidshutDown()Shuts down the endpoint with the default close-notification timeout and the standard client and request-handler cleanup policy.
-
Constructor Details
-
ProxyWebsocketEndpoint
public ProxyWebsocketEndpoint(io.fluxzero.sdk.configuration.client.Client client, io.fluxzero.sdk.publishing.RequestHandler requestHandler)
-
-
Method Details
-
onOpen
public void onOpen(io.fluxzero.proxy.ProxyWebsocketSession session) Registers an opened socket, forwards its open notification, and schedules keep-alive checks. -
onBinary
public void onBinary(io.fluxzero.proxy.ProxyWebsocketSession session, byte[] message) Forwards a binary frame as a socket message request. -
onText
Encodes a text frame as UTF-8 and forwards it as a socket message request. -
onPong
Consumes matching internal keep-alive pongs and forwards other pong payloads to application handlers. -
onClose
public void onClose(io.fluxzero.proxy.ProxyWebsocketSession session, io.fluxzero.sdk.common.websocket.WebsocketCloseReason closeReason) Removes session bookkeeping and keep-alive scheduling, sends its close notification, and waits up to the configured notification timeout. Notification failures propagate and are recorded for close completion. -
onError
Logs a socket transport error, distinguishing already closing channels and idle timeouts from unexpected failures. -
sendRequest
protected CompletableFuture<?> sendRequest(io.fluxzero.proxy.ProxyWebsocketSession session, String method, byte[] payload) -
sendCloseRequest
protected CompletableFuture<?> sendCloseRequest(io.fluxzero.proxy.ProxyWebsocketSession session, io.fluxzero.sdk.common.websocket.WebsocketCloseReason closeReason) -
handleResultMessages
-
handleDisconnects
-
getContext
protected ProxyWebsocketEndpoint.SessionContext getContext(io.fluxzero.proxy.ProxyWebsocketSession session) -
ensureStarted
protected void ensureStarted() -
shutDown
public void shutDown()Shuts down the endpoint with the default close-notification timeout and the standard client and request-handler cleanup policy.
-