Class PacketImpl
java.lang.Object
org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl
- All Implemented Interfaces:
Packet
- Direct Known Subclasses:
ActiveMQExceptionMessage,BackupRegistrationMessage,BackupReplicationStartFailedMessage,BackupRequestMessage,BackupResponseMessage,CheckFailoverMessage,CheckFailoverReplyMessage,ClusterConnectMessage,ClusterConnectReplyMessage,ClusterTopologyChangeMessage,CreateAddressMessage,CreateProducerMessage,CreateQueueMessage,CreateSessionMessage,CreateSessionResponseMessage,CreateSharedQueueMessage,DisconnectConsumerMessage,DisconnectConsumerWithKillMessage,DisconnectMessage,FederationStreamConnectMessage,MessagePacket,NodeAnnounceMessage,NullResponseMessage,PacketsConfirmedMessage,Ping,QueueAbstractPacket,QuorumVoteMessage,QuorumVoteReplyMessage,ReattachSessionMessage,ReattachSessionResponseMessage,RemoveProducerMessage,ReplicationAddMessage,ReplicationAddTXMessage,ReplicationCommitMessage,ReplicationDeleteMessage,ReplicationDeleteTXMessage,ReplicationLargeMessageBeginMessage,ReplicationLargeMessageEndMessage,ReplicationLargeMessageWriteMessage,ReplicationPageEventMessage,ReplicationPageWriteMessage,ReplicationPrepareMessage,ReplicationPrimaryIsStoppingMessage,ReplicationResponseMessage,ReplicationStartSyncMessage,ReplicationSyncFileMessage,RollbackMessage,ScaleDownAnnounceMessage,SessionAcknowledgeMessage,SessionAddMetaDataMessage,SessionAddMetaDataMessageV2,SessionBindingQueryResponseMessage,SessionCloseMessage,SessionCommitMessage,SessionConsumerCloseMessage,SessionConsumerFlowCreditMessage,SessionContinuationMessage,SessionDeleteQueueMessage,SessionExpireMessage,SessionForceConsumerDelivery,SessionIndividualAcknowledgeMessage,SessionProducerCreditsFailMessage,SessionProducerCreditsMessage,SessionQueueQueryResponseMessage,SessionReceiveLargeMessage,SessionRequestProducerCreditsMessage,SessionSendLargeMessage,SessionXAAfterFailedMessage,SessionXACommitMessage,SessionXAEndMessage,SessionXAForgetMessage,SessionXAGetInDoubtXidsResponseMessage,SessionXAGetTimeoutResponseMessage,SessionXAJoinMessage,SessionXAPrepareMessage,SessionXAResponseMessage,SessionXAResumeMessage,SessionXARollbackMessage,SessionXASetTimeoutMessage,SessionXASetTimeoutResponseMessage,SessionXAStartMessage,SubscribeClusterTopologyUpdatesMessage
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final bytestatic final bytestatic final bytestatic final byteprotected longstatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final intstatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final intstatic final bytestatic final bytestatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final intstatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final byteprotected intstatic final bytestatic final byteFields inherited from interface org.apache.activemq.artemis.core.protocol.core.Packet
INITIAL_PACKET_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertName(SimpleString name) protected static io.netty.buffer.ByteBufcopyMessageBuffer(io.netty.buffer.ByteBuf buffer, int skipBytes) protected ActiveMQBuffercreatePacket(CoreRemotingConnection connection) voiddecode(ActiveMQBuffer buffer) decodes the buffer into this packetvoiddecodeRest(ActiveMQBuffer buffer) encode(CoreRemotingConnection connection) Encodes the packet and returns aActiveMQBuffercontaining the dataprotected voidencodeHeader(ActiveMQBuffer buffer) voidencodeRest(ActiveMQBuffer buffer) voidencodeRest(ActiveMQBuffer buffer, CoreRemotingConnection coreRemotingConnection) protected voidencodeSize(ActiveMQBuffer buffer) booleanlongReturns 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.protected StringbytegetType()Returns the type of the packet; needed when decoding the packet.inthashCode()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.booleanprotected intvoidsetChannelID(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) final StringtoString()extensions of this class are supposed to use getPacketString to provide toString functionalityMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.core.protocol.core.Packet
expectedEncodeSize, release
-
Field Details
-
ADDRESSING_CHANGE_VERSION
public static final int ADDRESSING_CHANGE_VERSION- See Also:
-
ARTEMIS_2_7_0_VERSION
public static final int ARTEMIS_2_7_0_VERSION- See Also:
-
ASYNC_RESPONSE_CHANGE_VERSION
public static final int ASYNC_RESPONSE_CHANGE_VERSION- See Also:
-
CONSUMER_PRIORITY_CHANGE_VERSION
public static final int CONSUMER_PRIORITY_CHANGE_VERSION- See Also:
-
FQQN_CHANGE_VERSION
public static final int FQQN_CHANGE_VERSION- See Also:
-
ARTEMIS_2_18_0_VERSION
public static final int ARTEMIS_2_18_0_VERSION- See Also:
-
ARTEMIS_2_21_0_VERSION
public static final int ARTEMIS_2_21_0_VERSION- See Also:
-
ARTEMIS_2_24_0_VERSION
public static final int ARTEMIS_2_24_0_VERSION- See Also:
-
ARTEMIS_2_28_0_VERSION
public static final int ARTEMIS_2_28_0_VERSION- See Also:
-
ARTEMIS_2_29_0_VERSION
public static final int ARTEMIS_2_29_0_VERSION- See Also:
-
ARTEMIS_2_37_0_VERSION
public static final int ARTEMIS_2_37_0_VERSION- See Also:
-
OLD_QUEUE_PREFIX
-
OLD_TEMP_QUEUE_PREFIX
-
OLD_TOPIC_PREFIX
-
OLD_TEMP_TOPIC_PREFIX
-
PACKET_HEADERS_SIZE
public static final int PACKET_HEADERS_SIZE- See Also:
-
channelID
protected long channelID -
size
protected int size -
PING
public static final byte PING- See Also:
-
DISCONNECT
public static final byte DISCONNECT- See Also:
-
DISCONNECT_CONSUMER
public static final byte DISCONNECT_CONSUMER- See Also:
-
DISCONNECT_CONSUMER_KILL
public static final byte DISCONNECT_CONSUMER_KILL- See Also:
-
EXCEPTION
public static final byte EXCEPTION- See Also:
-
NULL_RESPONSE
public static final byte NULL_RESPONSE- See Also:
-
PACKETS_CONFIRMED
public static final byte PACKETS_CONFIRMED- See Also:
-
CREATESESSION
public static final byte CREATESESSION- See Also:
-
CREATESESSION_RESP
public static final byte CREATESESSION_RESP- See Also:
-
REATTACH_SESSION
public static final byte REATTACH_SESSION- See Also:
-
REATTACH_SESSION_RESP
public static final byte REATTACH_SESSION_RESP- See Also:
-
CREATE_QUEUE
public static final byte CREATE_QUEUE- See Also:
-
DELETE_QUEUE
public static final byte DELETE_QUEUE- See Also:
-
CREATE_SHARED_QUEUE
public static final byte CREATE_SHARED_QUEUE- See Also:
-
SESS_XA_FAILED
public static final byte SESS_XA_FAILED- See Also:
-
SESS_CREATECONSUMER
public static final byte SESS_CREATECONSUMER- See Also:
-
SESS_ACKNOWLEDGE
public static final byte SESS_ACKNOWLEDGE- See Also:
-
SESS_EXPIRED
public static final byte SESS_EXPIRED- See Also:
-
SESS_COMMIT
public static final byte SESS_COMMIT- See Also:
-
SESS_ROLLBACK
public static final byte SESS_ROLLBACK- See Also:
-
SESS_QUEUEQUERY
public static final byte SESS_QUEUEQUERY- See Also:
-
SESS_QUEUEQUERY_RESP
public static final byte SESS_QUEUEQUERY_RESP- See Also:
-
SESS_BINDINGQUERY
public static final byte SESS_BINDINGQUERY- See Also:
-
SESS_BINDINGQUERY_RESP
public static final byte SESS_BINDINGQUERY_RESP- See Also:
-
SESS_XA_START
public static final byte SESS_XA_START- See Also:
-
SESS_XA_END
public static final byte SESS_XA_END- See Also:
-
SESS_XA_COMMIT
public static final byte SESS_XA_COMMIT- See Also:
-
SESS_XA_PREPARE
public static final byte SESS_XA_PREPARE- See Also:
-
SESS_XA_RESP
public static final byte SESS_XA_RESP- See Also:
-
SESS_XA_ROLLBACK
public static final byte SESS_XA_ROLLBACK- See Also:
-
SESS_XA_JOIN
public static final byte SESS_XA_JOIN- See Also:
-
SESS_XA_SUSPEND
public static final byte SESS_XA_SUSPEND- See Also:
-
SESS_XA_RESUME
public static final byte SESS_XA_RESUME- See Also:
-
SESS_XA_FORGET
public static final byte SESS_XA_FORGET- See Also:
-
SESS_XA_INDOUBT_XIDS
public static final byte SESS_XA_INDOUBT_XIDS- See Also:
-
SESS_XA_INDOUBT_XIDS_RESP
public static final byte SESS_XA_INDOUBT_XIDS_RESP- See Also:
-
SESS_XA_SET_TIMEOUT
public static final byte SESS_XA_SET_TIMEOUT- See Also:
-
SESS_XA_SET_TIMEOUT_RESP
public static final byte SESS_XA_SET_TIMEOUT_RESP- See Also:
-
SESS_XA_GET_TIMEOUT
public static final byte SESS_XA_GET_TIMEOUT- See Also:
-
SESS_XA_GET_TIMEOUT_RESP
public static final byte SESS_XA_GET_TIMEOUT_RESP- See Also:
-
SESS_START
public static final byte SESS_START- See Also:
-
SESS_STOP
public static final byte SESS_STOP- See Also:
-
SESS_CLOSE
public static final byte SESS_CLOSE- See Also:
-
SESS_FLOWTOKEN
public static final byte SESS_FLOWTOKEN- See Also:
-
SESS_SEND
public static final byte SESS_SEND- See Also:
-
SESS_SEND_LARGE
public static final byte SESS_SEND_LARGE- See Also:
-
SESS_SEND_CONTINUATION
public static final byte SESS_SEND_CONTINUATION- See Also:
-
SESS_CONSUMER_CLOSE
public static final byte SESS_CONSUMER_CLOSE- See Also:
-
SESS_RECEIVE_MSG
public static final byte SESS_RECEIVE_MSG- See Also:
-
SESS_RECEIVE_LARGE_MSG
public static final byte SESS_RECEIVE_LARGE_MSG- See Also:
-
SESS_RECEIVE_CONTINUATION
public static final byte SESS_RECEIVE_CONTINUATION- See Also:
-
SESS_FORCE_CONSUMER_DELIVERY
public static final byte SESS_FORCE_CONSUMER_DELIVERY- See Also:
-
SESS_PRODUCER_REQUEST_CREDITS
public static final byte SESS_PRODUCER_REQUEST_CREDITS- See Also:
-
SESS_PRODUCER_CREDITS
public static final byte SESS_PRODUCER_CREDITS- See Also:
-
SESS_INDIVIDUAL_ACKNOWLEDGE
public static final byte SESS_INDIVIDUAL_ACKNOWLEDGE- See Also:
-
SESS_PRODUCER_FAIL_CREDITS
public static final byte SESS_PRODUCER_FAIL_CREDITS- See Also:
-
REPLICATION_RESPONSE
public static final byte REPLICATION_RESPONSE- See Also:
-
REPLICATION_APPEND
public static final byte REPLICATION_APPEND- See Also:
-
REPLICATION_APPEND_TX
public static final byte REPLICATION_APPEND_TX- See Also:
-
REPLICATION_DELETE
public static final byte REPLICATION_DELETE- See Also:
-
REPLICATION_DELETE_TX
public static final byte REPLICATION_DELETE_TX- See Also:
-
REPLICATION_PREPARE
public static final byte REPLICATION_PREPARE- See Also:
-
REPLICATION_COMMIT_ROLLBACK
public static final byte REPLICATION_COMMIT_ROLLBACK- See Also:
-
REPLICATION_PAGE_WRITE
public static final byte REPLICATION_PAGE_WRITE- See Also:
-
REPLICATION_PAGE_EVENT
public static final byte REPLICATION_PAGE_EVENT- See Also:
-
REPLICATION_LARGE_MESSAGE_BEGIN
public static final byte REPLICATION_LARGE_MESSAGE_BEGIN- See Also:
-
REPLICATION_LARGE_MESSAGE_END
public static final byte REPLICATION_LARGE_MESSAGE_END- See Also:
-
REPLICATION_LARGE_MESSAGE_WRITE
public static final byte REPLICATION_LARGE_MESSAGE_WRITE- See Also:
-
REPLICATION_SYNC_FILE
public static final byte REPLICATION_SYNC_FILE- See Also:
-
SESS_ADD_METADATA
public static final byte SESS_ADD_METADATA- See Also:
-
SESS_ADD_METADATA2
public static final byte SESS_ADD_METADATA2- See Also:
-
SESS_UNIQUE_ADD_METADATA
public static final byte SESS_UNIQUE_ADD_METADATA- See Also:
-
CLUSTER_TOPOLOGY
public static final byte CLUSTER_TOPOLOGY- See Also:
-
NODE_ANNOUNCE
public static final byte NODE_ANNOUNCE- See Also:
-
SUBSCRIBE_TOPOLOGY
public static final byte SUBSCRIBE_TOPOLOGY- See Also:
-
SUBSCRIBE_TOPOLOGY_V2
public static final byte SUBSCRIBE_TOPOLOGY_V2- See Also:
-
CLUSTER_TOPOLOGY_V2
public static final byte CLUSTER_TOPOLOGY_V2- See Also:
-
BACKUP_REGISTRATION
public static final byte BACKUP_REGISTRATION- See Also:
-
BACKUP_REGISTRATION_FAILED
public static final byte BACKUP_REGISTRATION_FAILED- See Also:
-
REPLICATION_START_FINISH_SYNC
public static final byte REPLICATION_START_FINISH_SYNC- See Also:
-
REPLICATION_SCHEDULED_FAILOVER
public static final byte REPLICATION_SCHEDULED_FAILOVER- See Also:
-
CLUSTER_TOPOLOGY_V3
public static final byte CLUSTER_TOPOLOGY_V3- See Also:
-
DISCONNECT_V2
public static final byte DISCONNECT_V2- See Also:
-
CLUSTER_CONNECT
public static final byte CLUSTER_CONNECT- See Also:
-
CLUSTER_CONNECT_REPLY
public static final byte CLUSTER_CONNECT_REPLY- See Also:
-
BACKUP_REQUEST
public static final byte BACKUP_REQUEST- See Also:
-
BACKUP_REQUEST_RESPONSE
public static final byte BACKUP_REQUEST_RESPONSE- See Also:
-
QUORUM_VOTE
public static final byte QUORUM_VOTE- See Also:
-
QUORUM_VOTE_REPLY
public static final byte QUORUM_VOTE_REPLY- See Also:
-
CHECK_FOR_FAILOVER
public static final byte CHECK_FOR_FAILOVER- See Also:
-
CHECK_FOR_FAILOVER_REPLY
public static final byte CHECK_FOR_FAILOVER_REPLY- See Also:
-
SCALEDOWN_ANNOUNCEMENT
public static final byte SCALEDOWN_ANNOUNCEMENT- See Also:
-
SESS_QUEUEQUERY_RESP_V2
public static final byte SESS_QUEUEQUERY_RESP_V2- See Also:
-
SESS_BINDINGQUERY_RESP_V2
public static final byte SESS_BINDINGQUERY_RESP_V2- See Also:
-
REPLICATION_RESPONSE_V2
public static final byte REPLICATION_RESPONSE_V2- See Also:
-
SESS_BINDINGQUERY_RESP_V3
public static final byte SESS_BINDINGQUERY_RESP_V3- See Also:
-
CREATE_ADDRESS
public static final byte CREATE_ADDRESS- See Also:
-
CREATE_QUEUE_V2
public static final byte CREATE_QUEUE_V2- See Also:
-
CREATE_SHARED_QUEUE_V2
public static final byte CREATE_SHARED_QUEUE_V2- See Also:
-
SESS_QUEUEQUERY_RESP_V3
public static final byte SESS_QUEUEQUERY_RESP_V3- See Also:
-
SESS_BINDINGQUERY_RESP_V4
public static final byte SESS_BINDINGQUERY_RESP_V4- See Also:
-
FEDERATION_DOWNSTREAM_CONNECT
public static final byte FEDERATION_DOWNSTREAM_CONNECT- See Also:
-
CLUSTER_TOPOLOGY_V4
public static final byte CLUSTER_TOPOLOGY_V4- See Also:
-
CREATESESSION_V2
public static final byte CREATESESSION_V2- See Also:
-
DISCONNECT_V3
public static final byte DISCONNECT_V3- See Also:
-
CREATE_PRODUCER
public static final byte CREATE_PRODUCER- See Also:
-
REMOVE_PRODUCER
public static final byte REMOVE_PRODUCER- See Also:
-
SESS_BINDINGQUERY_RESP_V5
public static final byte SESS_BINDINGQUERY_RESP_V5- See Also:
-
-
Constructor Details
-
PacketImpl
public PacketImpl(byte type)
-
-
Method Details
-
convertName
-
getType
public byte getType()Description copied from interface:PacketReturns the type of the packet; needed when decoding the packet. -
getChannelID
public long getChannelID()Description copied from interface:PacketReturns the channel id of the channel that should handle this packet.- Specified by:
getChannelIDin interfacePacket- Returns:
- the channel id of the channel that should handle this packet
-
setChannelID
public void setChannelID(long channelID) Description copied from interface:PacketSets the channel id that should be used once the packet has been successfully decoded it is sent to the correct channel.- Specified by:
setChannelIDin interfacePacket- Parameters:
channelID- the id of the channel to handle the packet
-
encode
Description copied from interface:PacketEncodes the packet and returns aActiveMQBuffercontaining the data -
encodeHeader
-
encodeSize
-
createPacket
-
decode
Description copied from interface:Packetdecodes the buffer into this packet -
copyMessageBuffer
protected static io.netty.buffer.ByteBuf copyMessageBuffer(io.netty.buffer.ByteBuf buffer, int skipBytes) -
getPacketSize
public int getPacketSize()Description copied from interface:PacketReturns The size of the entire packet including headers, and extra data; i.e. the size needed to encode this packet.- Specified by:
getPacketSizein interfacePacket- Returns:
- The size of the entire packet including headers, and extra data; i.e. the size needed to encode this packet
-
isResponse
public boolean isResponse()Description copied from interface:PacketReturns true if this packet is being sent in response to a previously received packet.- Specified by:
isResponsein interfacePacket- Returns:
- true if this packet is being sent in response to a previously received packet
-
encodeRest
-
encodeRest
-
decodeRest
-
isRequiresConfirmations
public boolean isRequiresConfirmations()Description copied from interface:PacketReturns true if a confirmation should be sent on receipt of this packet.- Specified by:
isRequiresConfirmationsin interfacePacket- Returns:
- true if a confirmation should be sent on receipt of this packet
-
toString
extensions of this class are supposed to use getPacketString to provide toString functionality -
getPacketString
-
hashCode
public int hashCode() -
equals
-
nullableStringEncodeSize
-
isRequiresResponse
public boolean isRequiresResponse()- Specified by:
isRequiresResponsein interfacePacket
-
isResponseAsync
public boolean isResponseAsync()- Specified by:
isResponseAsyncin interfacePacket
-
getCorrelationID
public long getCorrelationID()- Specified by:
getCorrelationIDin interfacePacket
-
setCorrelationID
public void setCorrelationID(long correlationID) - Specified by:
setCorrelationIDin interfacePacket
-