Class CloudRequest

java.lang.Object
com.ultikits.ultitools.websocket.CloudRequest

@Internal public final class CloudRequest extends Object
Immutable protocol request snapshot; internal, not for module use. Payloads are copied on construction and access because callers must not mutate another handler's request. Payload validation remains the handler's responsibility.
Since:
6.3.1
  • Field Details

    • id

      private final String id
    • type

      private final String type
    • ts

      private final long ts
    • replyTo

      private final String replyTo
    • payload

      private final com.google.gson.JsonObject payload
  • Constructor Details

    • CloudRequest

      public CloudRequest(String id, String type, long ts, String replyTo, com.google.gson.JsonObject payload)
      Copies an envelope already checked by the protocol parser.
      Parameters:
      id - the message ULID
      type - the registered message type
      ts - the sender's epoch-millisecond timestamp
      replyTo - the correlated request ULID, or null when absent
      payload - the non-null payload to copy; it may contain credentials
  • Method Details

    • id

      public String id()
      Returns:
      the message ULID, used to correlate replies
    • type

      public String type()
      Returns:
      the registered message type
    • ts

      public long ts()
      Returns:
      the sender's epoch-millisecond timestamp
    • replyTo

      public String replyTo()
      Returns:
      the correlated request ULID, or null when absent
    • payload

      public com.google.gson.JsonObject payload()
      Returns:
      a defensive deep copy of the payload; never log its contents
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      only id and type, never payload or credential data