Package anbxj

Interface Channel_ProtobufSerializer.StepPayloadDescriptor

All Superinterfaces:
Channel_ProtobufSerializer.StepDescriptor
Enclosing class:
Channel_ProtobufSerializer

public static interface Channel_ProtobufSerializer.StepPayloadDescriptor extends Channel_ProtobufSerializer.StepDescriptor
Extension of Channel_ProtobufSerializer.StepDescriptor for steps that carry a user-defined payload consisting of multiple fields.

Implementations must define how to buildPayload(Object...) from field values and how to extractFields(Message, AnB_Session) back into the original field objects. They also provide a method to wrap the inner payload into the outer step message.

  • Method Details

    • buildPayload

      com.google.protobuf.Message buildPayload(Object... fields) throws IOException
      Builds a Protobuf payload message from the provided fields.
      Parameters:
      fields - the fields to encode
      Returns:
      the built payload message
      Throws:
      IOException - if building fails
    • extractFields

      Object[] extractFields(com.google.protobuf.Message payload, AnB_Session session) throws IOException
      Extracts the original fields from a received payload Protobuf message.
      Parameters:
      payload - the received payload message
      session - the session context (may be used for crypto operations)
      Returns:
      an array of extracted field objects
      Throws:
      IOException - if extraction fails
    • buildOuterFromInner

      com.google.protobuf.Message buildOuterFromInner(com.google.protobuf.Message innerPayload) throws IOException
      Wraps the inner payload Protobuf message into the outer step message.
      Parameters:
      innerPayload - the already-built payload message (e.g., Step1_Payload)
      Returns:
      the outer Protobuf message (e.g., Step1)
      Throws:
      IOException - if wrapping fails