All Known Implementing Classes:
ActiveMQExceptionMessage, ActiveMQExceptionMessage_V2, BackupRegistrationMessage, BackupReplicationStartFailedMessage, BackupRequestMessage, BackupResponseMessage, CheckFailoverMessage, CheckFailoverReplyMessage, ClusterConnectMessage, ClusterConnectReplyMessage, ClusterTopologyChangeMessage, ClusterTopologyChangeMessage_V2, ClusterTopologyChangeMessage_V3, ClusterTopologyChangeMessage_V4, CreateAddressMessage, CreateProducerMessage, CreateQueueMessage, CreateQueueMessage_V2, CreateSessionMessage, CreateSessionMessage_V2, CreateSessionResponseMessage, CreateSharedQueueMessage, CreateSharedQueueMessage_V2, DisconnectConsumerMessage, DisconnectConsumerWithKillMessage, DisconnectMessage, DisconnectMessage_V2, DisconnectMessage_V3, FederationDownstreamConnectMessage, FederationStreamConnectMessage, MessagePacket, NodeAnnounceMessage, NullResponseMessage, NullResponseMessage_V2, PacketImpl, PacketsConfirmedMessage, Ping, QueueAbstractPacket, QuorumVoteMessage, QuorumVoteReplyMessage, ReattachSessionMessage, ReattachSessionResponseMessage, RemoveProducerMessage, ReplicationAddMessage, ReplicationAddTXMessage, ReplicationCommitMessage, ReplicationDeleteMessage, ReplicationDeleteTXMessage, ReplicationLargeMessageBeginMessage, ReplicationLargeMessageEndMessage, ReplicationLargeMessageWriteMessage, ReplicationPageEventMessage, ReplicationPageWriteMessage, ReplicationPrepareMessage, ReplicationPrimaryIsStoppingMessage, ReplicationResponseMessage, ReplicationResponseMessageV2, ReplicationStartSyncMessage, ReplicationSyncFileMessage, RollbackMessage, ScaleDownAnnounceMessage, SessionAcknowledgeMessage, SessionAddMetaDataMessage, SessionAddMetaDataMessageV2, SessionBindingQueryMessage, SessionBindingQueryResponseMessage, SessionBindingQueryResponseMessage_V2, SessionBindingQueryResponseMessage_V3, SessionBindingQueryResponseMessage_V4, SessionBindingQueryResponseMessage_V5, SessionCloseMessage, SessionCommitMessage, SessionCommitMessage_V2, SessionConsumerCloseMessage, SessionConsumerFlowCreditMessage, SessionContinuationMessage, SessionCreateConsumerMessage, SessionDeleteQueueMessage, SessionExpireMessage, SessionForceConsumerDelivery, SessionIndividualAcknowledgeMessage, SessionProducerCreditsFailMessage, SessionProducerCreditsMessage, SessionQueueQueryMessage, SessionQueueQueryResponseMessage, SessionQueueQueryResponseMessage_V2, SessionQueueQueryResponseMessage_V3, SessionReceiveClientLargeMessage, SessionReceiveContinuationMessage, SessionReceiveLargeMessage, SessionReceiveMessage, SessionReceiveMessage_1X, SessionRequestProducerCreditsMessage, SessionSendContinuationMessage, SessionSendContinuationMessage_V2, SessionSendContinuationMessage_V3, SessionSendLargeMessage, SessionSendMessage, SessionSendMessage_1X, SessionSendMessage_V2, SessionSendMessage_V3, SessionUniqueAddMetaDataMessage, SessionXAAfterFailedMessage, SessionXACommitMessage, SessionXAEndMessage, SessionXAForgetMessage, SessionXAGetInDoubtXidsResponseMessage, SessionXAGetTimeoutResponseMessage, SessionXAJoinMessage, SessionXAPrepareMessage, SessionXAResponseMessage, SessionXAResponseMessage_V2, SessionXAResumeMessage, SessionXARollbackMessage, SessionXASetTimeoutMessage, SessionXASetTimeoutResponseMessage, SessionXAStartMessage, SubscribeClusterTopologyUpdatesMessage, SubscribeClusterTopologyUpdatesMessageV2

public interface Packet
A Packet represents a packet of data transmitted over a connection.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    decodes the buffer into this packet
    Encodes the packet and returns a ActiveMQBuffer containing the data
    default int
    This will return the expected packet size for the encoding
    long
    Returns the channel id of the channel that should handle this packet.
    long
     
    int
    Returns The size of the entire packet including headers, and extra data; i.e. the size needed to encode this packet.
    byte
    Returns the type of the packet; needed when decoding the packet.
    boolean
    Returns true if a confirmation should be sent on receipt of this packet.
    boolean
     
    boolean
    Returns true if this packet is being sent in response to a previously received packet.
    boolean
     
    default void
    The packet wasn't used because the stream is closed.
    void
    setChannelID(long channelID)
    Sets the channel id that should be used once the packet has been successfully decoded it is sent to the correct channel.
    void
    setCorrelationID(long correlationID)
     
  • Field Details

  • Method Details

    • setChannelID

      void setChannelID(long channelID)
      Sets the channel id that should be used once the packet has been successfully decoded it is sent to the correct channel.
      Parameters:
      channelID - the id of the channel to handle the packet
    • expectedEncodeSize

      default int expectedEncodeSize()
      This will return the expected packet size for the encoding
    • isRequiresResponse

      boolean isRequiresResponse()
    • isResponseAsync

      boolean isResponseAsync()
    • getCorrelationID

      long getCorrelationID()
    • setCorrelationID

      void setCorrelationID(long correlationID)
    • getChannelID

      long getChannelID()
      Returns the channel id of the channel that should handle this packet.
      Returns:
      the channel id of the channel that should handle this packet
    • isResponse

      boolean isResponse()
      Returns true if this packet is being sent in response to a previously received packet.
      Returns:
      true if this packet is being sent in response to a previously received packet
    • getType

      byte getType()
      Returns the type of the packet; needed when decoding the packet.
      Returns:
      the type of the packet; needed when decoding the packet
    • encode

      Encodes the packet and returns a ActiveMQBuffer containing the data
      Parameters:
      connection - the connection
      Returns:
      the buffer to encode to
    • decode

      void decode(ActiveMQBuffer buffer)
      decodes the buffer into this packet
      Parameters:
      buffer - the buffer to decode from
    • getPacketSize

      int getPacketSize()
      Returns The size of the entire packet including headers, and extra data; i.e. the size needed to encode this packet.
      Returns:
      The size of the entire packet including headers, and extra data; i.e. the size needed to encode this packet
    • isRequiresConfirmations

      boolean isRequiresConfirmations()
      Returns true if a confirmation should be sent on receipt of this packet.
      Returns:
      true if a confirmation should be sent on receipt of this packet
    • release

      default void release()
      The packet wasn't used because the stream is closed. This gives a chance to sub classes to cleanup anything that won't be used.