Class AuthenticatedMessageHeader

  • All Implemented Interfaces:
    java.io.Externalizable , java.io.Serializable , java.lang.Comparable , org.apache.avro.generic.GenericContainer , org.apache.avro.generic.GenericRecord , org.apache.avro.generic.IndexedRecord , org.apache.avro.specific.SpecificRecord

    
    public class AuthenticatedMessageHeader
    extends SpecificRecordBase implements SpecificRecord
                        
    • Constructor Detail

      • AuthenticatedMessageHeader

        AuthenticatedMessageHeader()
        Default constructor.
      • AuthenticatedMessageHeader

        AuthenticatedMessageHeader(HoldingIdentity destination, HoldingIdentity source, Instant ttl, String messageId, String traceId, String subsystem, MembershipStatusFilter statusFilter)
        All-args constructor.
        Parameters:
        destination - The destination identity for this message.
        source - The source identity of this message.
        ttl - A (time-to-live) unix timestamp (in milliseconds) after which this message will be dropped from the p2p layer.
        messageId - A unique identifier for this message.
        traceId - A trace identifier.
        subsystem - This value identifies the upstream user of the p2p layer that this message is sent from and should be received by.
        statusFilter - Indicates what type of membership information should be used for P2P communication: pending, active, active or suspended.
    • Method Detail

      • setDestination

         void setDestination(HoldingIdentity value)

        Sets the value of the 'destination' field. The destination identity for this message.

        Parameters:
        value - the value to set.
      • getSource

         HoldingIdentity getSource()

        Gets the value of the 'source' field.

        Returns:

        The source identity of this message.

      • setSource

         void setSource(HoldingIdentity value)

        Sets the value of the 'source' field. The source identity of this message.

        Parameters:
        value - the value to set.
      • getTtl

         Instant getTtl()

        Gets the value of the 'ttl' field.

        Returns:

        A (time-to-live) unix timestamp (in milliseconds) after which this message will be dropped from the p2p layer. If no ttl is specified, the p2p layer will continue replaying this message infinitely until it is delivered.

      • setTtl

         void setTtl(Instant value)

        Sets the value of the 'ttl' field. A (time-to-live) unix timestamp (in milliseconds) after which this message will be dropped from the p2p layer. If no ttl is specified, the p2p layer will continue replaying this message infinitely until it is delivered.

        Parameters:
        value - the value to set.
      • getMessageId

         String getMessageId()

        Gets the value of the 'messageId' field.

        Returns:

        A unique identifier for this message. This will be used by the p2p layer to track the delivery of this specific message.

      • setMessageId

         void setMessageId(String value)

        Sets the value of the 'messageId' field. A unique identifier for this message. This will be used by the p2p layer to track the delivery of this specific message.

        Parameters:
        value - the value to set.
      • getTraceId

         String getTraceId()

        Gets the value of the 'traceId' field.

        Returns:

        A trace identifier. The semantics of this field can vary based on the use-case of the upstream user, but it can be used to trace together multiple instances of the same message (e.g. in cases where the upstream user also performs replays, it can assign the same trace ID to all the instances of the same replayed message).

      • setTraceId

         void setTraceId(String value)

        Sets the value of the 'traceId' field. A trace identifier. The semantics of this field can vary based on the use-case of the upstream user, but it can be used to trace together multiple instances of the same message (e.g. in cases where the upstream user also performs replays, it can assign the same trace ID to all the instances of the same replayed message).

        Parameters:
        value - the value to set.
      • getSubsystem

         String getSubsystem()

        Gets the value of the 'subsystem' field.

        Returns:

        This value identifies the upstream user of the p2p layer that this message is sent from and should be received by. It can be used to filter incoming messages from the p2p layer and process only the ones destined for a specific system.

      • setSubsystem

         void setSubsystem(String value)

        Sets the value of the 'subsystem' field. This value identifies the upstream user of the p2p layer that this message is sent from and should be received by. It can be used to filter incoming messages from the p2p layer and process only the ones destined for a specific system.

        Parameters:
        value - the value to set.
      • getStatusFilter

         MembershipStatusFilter getStatusFilter()

        Gets the value of the 'statusFilter' field.

        Returns:

        Indicates what type of membership information should be used for P2P communication: pending, active, active or suspended. Active value must be used by non-MGM services. Only MGM services will use other options

      • setStatusFilter

         void setStatusFilter(MembershipStatusFilter value)

        Sets the value of the 'statusFilter' field. Indicates what type of membership information should be used for P2P communication: pending, active, active or suspended. Active value must be used by non-MGM services. Only MGM services will use other options

        Parameters:
        value - the value to set.
      • getEncoder

         static BinaryMessageEncoder<AuthenticatedMessageHeader> getEncoder()

        Return the BinaryMessageEncoder instance used by this class.

        Returns:

        the message encoder used by this class

      • getDecoder

         static BinaryMessageDecoder<AuthenticatedMessageHeader> getDecoder()

        Return the BinaryMessageDecoder instance used by this class.

        Returns:

        the message decoder used by this class

      • createDecoder

         static BinaryMessageDecoder<AuthenticatedMessageHeader> createDecoder(SchemaStore resolver)

        Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore.

        Parameters:
        resolver - a SchemaStore used to find schemas by fingerprint
        Returns:

        a BinaryMessageDecoder instance for this class backed by the given SchemaStore

      • toByteBuffer

         ByteBuffer toByteBuffer()

        Serializes this AuthenticatedMessageHeader to a ByteBuffer.

        Returns:

        a buffer holding the serialized data for this instance

      • fromByteBuffer

         static AuthenticatedMessageHeader fromByteBuffer(ByteBuffer b)

        Deserializes a AuthenticatedMessageHeader from a ByteBuffer.

        Parameters:
        b - a byte buffer holding serialized data for an instance of this class
        Returns:

        a AuthenticatedMessageHeader instance decoded from the given buffer