Class SocketRequest
Each SocketRequest includes a unique requestId used to track and match responses, and a
JsonNode representation of the actual request payload.
Requests are typically created using the static valueOf(Object) method, which serialize the original request
object to JSON. The requestId can be autogenerated or provided explicitly.
Note: In most cases, SocketRequests and SocketResponses are created and handled
automatically by the SocketSession. Developers working within a Fluxzero system typically do not need
to construct them manually. However, understanding their format becomes important when integrating with non-Fluxzero
systems—such as a browser-based UI—over WebSocket. In such scenarios, this class defines the structure of a request
expected by a Fluxzero client.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AtomicLongCounter used to generate unique request IDs for new socket requests. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SocketRequestCreates a newSocketRequestwith an auto-incremented ID and the given request object.
-
Field Details
-
counter
Counter used to generate unique request IDs for new socket requests.
-
-
Constructor Details
-
SocketRequest
public SocketRequest()
-
-
Method Details
-
valueOf
Creates a newSocketRequestwith an auto-incremented ID and the given request object.- Parameters:
request- the request object to be sent over the WebSocket session- Returns:
- a new
SocketRequestinstance with a unique ID
-