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,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,ReplicationAddMessage,ReplicationAddTXMessage,ReplicationCommitMessage,ReplicationDeleteMessage,ReplicationDeleteTXMessage,ReplicationLargeMessageBeginMessage,ReplicationLargeMessageEndMessage,ReplicationLargeMessageWriteMessage,ReplicationLiveIsStoppingMessage,ReplicationPageEventMessage,ReplicationPageWriteMessage,ReplicationPrepareMessage,ReplicationResponseMessage,ReplicationResponseMessageV2,ReplicationStartSyncMessage,ReplicationSyncFileMessage,RollbackMessage,ScaleDownAnnounceMessage,SessionAcknowledgeMessage,SessionAddMetaDataMessage,SessionAddMetaDataMessageV2,SessionBindingQueryMessage,SessionBindingQueryResponseMessage,SessionBindingQueryResponseMessage_V2,SessionBindingQueryResponseMessage_V3,SessionBindingQueryResponseMessage_V4,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,SessionSendLargeMessage,SessionSendMessage,SessionSendMessage_1X,SessionSendMessage_V2,SessionUniqueAddMetaDataMessage,SessionXAAfterFailedMessage,SessionXACommitMessage,SessionXAEndMessage,SessionXAForgetMessage,SessionXAGetInDoubtXidsResponseMessage,SessionXAGetTimeoutResponseMessage,SessionXAJoinMessage,SessionXAPrepareMessage,SessionXAResponseMessage,SessionXAResponseMessage_V2,SessionXAResumeMessage,SessionXARollbackMessage,SessionXASetTimeoutMessage,SessionXASetTimeoutResponseMessage,SessionXAStartMessage,SubscribeClusterTopologyUpdatesMessage,SubscribeClusterTopologyUpdatesMessageV2
public interface PacketA Packet represents a packet of data transmitted over a connection.
-
-
Field Summary
Fields Modifier and Type Field Description static intINITIAL_PACKET_SIZE
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voiddecode(ActiveMQBuffer buffer)decodes the buffer into this packetActiveMQBufferencode(CoreRemotingConnection connection)Encodes the packet and returns aActiveMQBuffercontaining the datadefault intexpectedEncodeSize()This will return the expected packet size for the encodinglonggetChannelID()Returns the channel id of the channel that should handle this packet.longgetCorrelationID()intgetPacketSize()returns the size needed to encode this packet.bytegetType()returns the type of the packet.booleanisRequiresConfirmations()returns true if a confirmation should be sent on receipt of this packet.booleanisRequiresResponse()booleanisResponse()returns true if this packet is being sent in response to a previously received packetbooleanisResponseAsync()default voidrelease()The packe wasn't used because the stream is closed, this gives a chance to sub classes to cleanup anything that won't be used.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 Detail
-
INITIAL_PACKET_SIZE
static final int INITIAL_PACKET_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
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- Returns:
-
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 id of the channel
-
isResponse
boolean isResponse()
returns true if this packet is being sent in response to a previously received packet- Returns:
- true if a response
-
getType
byte getType()
returns the type of the packet.This is needed when decoding the packet
- Returns:
- the packet type
-
encode
ActiveMQBuffer encode(CoreRemotingConnection connection)
Encodes the packet and returns aActiveMQBuffercontaining 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 needed to encode this packet.- Returns:
- The size of the entire packet including headers, and extra data
-
isRequiresConfirmations
boolean isRequiresConfirmations()
returns true if a confirmation should be sent on receipt of this packet.- Returns:
- true if confirmation is required
-
release
default void release()
The packe wasn't used because the stream is closed, this gives a chance to sub classes to cleanup anything that won't be used.
-
-