public class CommandMessage extends AsyncMessage
CommandMessage
- The CommandMessage class provides
a mechanism for sending commands to the server infrastructure,
such as commands related to publish/subscribe messaging scenarios, ping operations,
and cluster operations.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADD_SUBSCRIPTIONS
ADD_SUBSCRIPTIONS - "DSAddSub" :
header used in a MULTI_SUBSCRIBE message to specify an Array of subtopic/selector
pairs to add to the existing set of subscriptions. |
static int |
CLIENT_PING_OPERATION
CLIENT_PING_OPERATION - 5 :
this operation is used to test connectivity over the current channel to
the remote endpoint. |
static int |
CLIENT_SYNC_OPERATION
CLIENT_SYNC_OPERATION - 4 :
this operation is used by a remote destination to sync missed or cached messages
back to a client as a result of a client issued poll command. |
static int |
CLUSTER_REQUEST_OPERATION
CLUSTER_REQUEST_OPERATION - 7 :
this operation is used to request a list of failover endpoint URIs
for the remote destination based on cluster membership. |
static java.lang.String |
CREDENTIALS_CHARSET_HEADER
CREDENTIALS_CHARSET_HEADER - "DSCredentialsCharset" :
header to specify which character set encoding was used while encoding
login credentials. |
static int |
DISCONNECT_OPERATION
DISCONNECT_OPERATION - 12 :
this operation is used to indicate that a channel has disconnected. |
static int |
LOGIN_OPERATION
LOGIN_OPERATION - 8 :
this operation is used to send credentials to the endpoint so that
the user can be logged in over the current channel. |
static int |
LOGOUT_OPERATION
LOGOUT_OPERATION - 9 :
this operation is used to log the user out of the current channel, and
will invalidate the server session if the channel is HTTP based. |
static java.lang.String |
MESSAGING_VERSION
MESSAGING_VERSION - "DSMessagingVersion" :
endpoints can imply what features they support by reporting the
latest version of messaging they are capable of during the handshake of
the initial ping CommandMessage. |
static int |
MULTI_SUBSCRIBE_OPERATION
MULTI_SUBSCRIBE_OPERATION - 11 :
this operation is used by the MultiTopicConsumer to subscribe/unsubscribe
from multiple subtopics/selectors in the same message. |
static java.lang.String |
NEEDS_CONFIG_HEADER
NEEDS_CONFIG_HEADER - "DSNeedsConfig" :
header to indicate that the Channel needs the configuration from the
server. |
static java.lang.String |
NO_OP_POLL_HEADER
NO_OP_POLL_HEADER - "DSNoOpPoll" :
header to suppress poll response processing. |
int |
operation
Provides access to the operation/command for the CommandMessage.
|
static int |
POLL_OPERATION
POLL_OPERATION - 2 :
this operation is used to poll a remote destination for pending,
undelivered messages. |
static java.lang.String |
POLL_WAIT_HEADER
POLL_WAIT_HEADER - "DSPollWait" :
header to drive an idle wait time before the next client poll request. |
static java.lang.String |
PRESERVE_DURABLE_HEADER
PRESERVE_DURABLE_HEADER - "DSPreserveDurable" :
durable JMS subscriptions are preserved when an unsubscribe message
has this parameter set to true in its header. |
static java.lang.String |
REMOVE_SUBSCRIPTIONS
REMOVE_SUBSCRIPTIONS - "DSRemSub" :
like the above, but specifies the subtopic/selector array of to remove |
static java.lang.String |
SELECTOR_HEADER
SELECTOR_HEADER - "DSSelector" :
the name for the selector header in subscribe messages. |
static int |
SUBSCRIBE_OPERATION
SUBSCRIBE_OPERATION - 0 :
This operation is used to subscribe to a remote destination. |
static int |
SUBSCRIPTION_INVALIDATE_OPERATION
SUBSCRIPTION_INVALIDATE_OPERATION - 10 :
this operation is used to indicate that the client's subscription to a
remote destination has been invalidated. |
static java.lang.String |
SUBSCRIPTION_INVALIDATED_HEADER
SUBSCRIPTION_INVALIDATED_HEADER - "DSSubscriptionInvalidated" :
the name for the header used internaly on the server to indicate that an unsubscribe
message is due to a client subscription being invalidated. |
static java.lang.String |
SUBTOPIC_SEPARATOR
SUBTOPIC_SEPARATOR - "_;_" :
the separator used in the add and remove subscription headers for
multi subscribe messages. |
static java.lang.String |
SUPPRESS_POLL_WAIT_HEADER
SUPPRESS_POLL_WAIT_HEADER - "DSSuppressPollWait" :
internal header used to tag poll messages when a poll-wait must be suppressed. |
static int |
UNKNOWN_OPERATION
UNKNOWN_OPERATION - 10000 :
this is the default operation for new CommandMessage instances. |
static int |
UNSUBSCRIBE_OPERATION
UNSUBSCRIBE_OPERATION - 1 :
this operation is used to unsubscribe from a remote destination. |
correlationId, SUBTOPIC_HEADER
body, clientId, destination, DESTINATION_CLIENT_ID_HEADER, ENDPOINT_HEADER, FLEX_CLIENT_ID_HEADER, headers, messageId, PRIORITY_HEADER, REMOTE_CREDENTIALS_CHARSET_HEADER, REMOTE_CREDENTIALS_HEADER, REQUEST_TIMEOUT_HEADER, STATUS_CODE_HEADER, timestamp, timeToLive
Constructor and Description |
---|
CommandMessage()
Constructor.
|
CommandMessage(int operation)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
readExternal(java.io.ObjectInput in) |
void |
writeExternal(java.io.ObjectOutput out) |
createUUID, readFlags
public static final int SUBSCRIBE_OPERATION
SUBSCRIBE_OPERATION
- 0 :
This operation is used to subscribe to a remote destination.public static final int UNSUBSCRIBE_OPERATION
UNSUBSCRIBE_OPERATION
- 1 :
this operation is used to unsubscribe from a remote destination.public static final int POLL_OPERATION
POLL_OPERATION
- 2 :
this operation is used to poll a remote destination for pending,
undelivered messages.public static final int CLIENT_SYNC_OPERATION
CLIENT_SYNC_OPERATION
- 4 :
this operation is used by a remote destination to sync missed or cached messages
back to a client as a result of a client issued poll command.public static final int CLIENT_PING_OPERATION
CLIENT_PING_OPERATION
- 5 :
this operation is used to test connectivity over the current channel to
the remote endpoint.public static final int CLUSTER_REQUEST_OPERATION
CLUSTER_REQUEST_OPERATION
- 7 :
this operation is used to request a list of failover endpoint URIs
for the remote destination based on cluster membership.public static final int LOGIN_OPERATION
LOGIN_OPERATION
- 8 :
this operation is used to send credentials to the endpoint so that
the user can be logged in over the current channel.
The credentials need to be Base64 encoded and stored in the body
of the message.public static final int LOGOUT_OPERATION
LOGOUT_OPERATION
- 9 :
this operation is used to log the user out of the current channel, and
will invalidate the server session if the channel is HTTP based.public static final int SUBSCRIPTION_INVALIDATE_OPERATION
SUBSCRIPTION_INVALIDATE_OPERATION
- 10 :
this operation is used to indicate that the client's subscription to a
remote destination has been invalidated.public static final int MULTI_SUBSCRIBE_OPERATION
MULTI_SUBSCRIBE_OPERATION
- 11 :
this operation is used by the MultiTopicConsumer to subscribe/unsubscribe
from multiple subtopics/selectors in the same message.public static final int DISCONNECT_OPERATION
DISCONNECT_OPERATION
- 12 :
this operation is used to indicate that a channel has disconnected.public static final int UNKNOWN_OPERATION
UNKNOWN_OPERATION
- 10000 :
this is the default operation for new CommandMessage instances.public static final java.lang.String MESSAGING_VERSION
MESSAGING_VERSION
- "DSMessagingVersion" :
endpoints can imply what features they support by reporting the
latest version of messaging they are capable of during the handshake of
the initial ping CommandMessage.public static final java.lang.String SELECTOR_HEADER
SELECTOR_HEADER
- "DSSelector" :
the name for the selector header in subscribe messages.public static final java.lang.String SUBSCRIPTION_INVALIDATED_HEADER
SUBSCRIPTION_INVALIDATED_HEADER
- "DSSubscriptionInvalidated" :
the name for the header used internaly on the server to indicate that an unsubscribe
message is due to a client subscription being invalidated.public static final java.lang.String PRESERVE_DURABLE_HEADER
PRESERVE_DURABLE_HEADER
- "DSPreserveDurable" :
durable JMS subscriptions are preserved when an unsubscribe message
has this parameter set to true in its header.public static final java.lang.String NEEDS_CONFIG_HEADER
NEEDS_CONFIG_HEADER
- "DSNeedsConfig" :
header to indicate that the Channel needs the configuration from the
server.public static final java.lang.String ADD_SUBSCRIPTIONS
ADD_SUBSCRIPTIONS
- "DSAddSub" :
header used in a MULTI_SUBSCRIBE message to specify an Array of subtopic/selector
pairs to add to the existing set of subscriptions.public static final java.lang.String REMOVE_SUBSCRIPTIONS
REMOVE_SUBSCRIPTIONS
- "DSRemSub" :
like the above, but specifies the subtopic/selector array of to removepublic static final java.lang.String SUBTOPIC_SEPARATOR
SUBTOPIC_SEPARATOR
- "_;_" :
the separator used in the add and remove subscription headers for
multi subscribe messages.public static final java.lang.String POLL_WAIT_HEADER
POLL_WAIT_HEADER
- "DSPollWait" :
header to drive an idle wait time before the next client poll request.public static final java.lang.String NO_OP_POLL_HEADER
NO_OP_POLL_HEADER
- "DSNoOpPoll" :
header to suppress poll response processing. If a client has a long-poll
parked on the server and issues another poll, the response to this subsequent poll
should be tagged with this header in which case the response is treated as a
no-op and the next poll will not be scheduled. Without this, a subsequent poll
will put the channel and endpoint into a busy polling cycle.public static final java.lang.String SUPPRESS_POLL_WAIT_HEADER
SUPPRESS_POLL_WAIT_HEADER
- "DSSuppressPollWait" :
internal header used to tag poll messages when a poll-wait must be suppressed.public static final java.lang.String CREDENTIALS_CHARSET_HEADER
CREDENTIALS_CHARSET_HEADER
- "DSCredentialsCharset" :
header to specify which character set encoding was used while encoding
login credentials.public int operation
public CommandMessage()
public CommandMessage(int operation)
operation
- one of the operation constantspublic void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class AsyncMessage
java.io.IOException
java.lang.ClassNotFoundException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class AsyncMessage
java.io.IOException