Interface Packet
- 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 -
Method Summary
Modifier and TypeMethodDescriptionvoiddecode(ActiveMQBuffer buffer) decodes the buffer into this packetencode(CoreRemotingConnection connection) Encodes the packet and returns aActiveMQBuffercontaining the datadefault intThis will return the expected packet size for the encodinglongReturns the channel id of the channel that should handle this packet.longintReturns The size of the entire packet including headers, and extra data; i.e. the size needed to encode this packet.bytegetType()Returns the type of the packet; needed when decoding the packet.booleanReturns true if a confirmation should be sent on receipt of this packet.booleanbooleanReturns true if this packet is being sent in response to a previously received packet.booleandefault voidrelease()The packet wasn't used because the stream is closed.voidsetChannelID(long channelID) Sets the channel id that should be used once the packet has been successfully decoded it is sent to the correct channel.voidsetCorrelationID(long correlationID)
-
Field Details
-
INITIAL_PACKET_SIZE
static final int INITIAL_PACKET_SIZE- See Also:
-
-
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 aActiveMQBuffercontaining the data- Parameters:
connection- the connection- Returns:
- the buffer to encode to
-
decode
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.
-