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 Summary
Modifier and TypeMethodDescriptioncom.google.protobuf.MessagebuildOuterFromInner(com.google.protobuf.Message innerPayload) Wraps the inner payload Protobuf message into the outer step message.com.google.protobuf.MessagebuildPayload(Object... fields) Builds a Protobuf payload message from the provided fields.Object[]extractFields(com.google.protobuf.Message payload, AnB_Session session) Extracts the original fields from a received payload Protobuf message.Methods inherited from interface anbxj.Channel_ProtobufSerializer.StepDescriptor
getInnerPayloadDescriptor, parseFrom, toJavaObject, toProtobuf
-
Method Details
-
buildPayload
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
Extracts the original fields from a received payload Protobuf message.- Parameters:
payload- the received payload messagesession- 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
-