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.

Static variables

@:value("DSAddSub")staticfinalread onlyADD_SUBSCRIPTIONS:String = "DSAddSub"

Header used in a MULTI_SUBSCRIBE message to specify an Array of subtopic/selector pairs to add to the existing set of subscriptions.

@:value("flex.messaging.messages.AuthenticationMessage")staticfinalread onlyAUTHENTICATION_MESSAGE_REF_TYPE:String = "flex.messaging.messages.AuthenticationMessage"

The server message type for authentication commands.

@:value(5)staticfinalread onlyCLIENT_PING_OPERATION:UInt = 5

This operation is used to test connectivity over the current channel to he remote endpoint.

@:value(4)staticfinalread onlyCLIENT_SYNC_OPERATION:UInt = 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.

@:value(7)staticfinalread onlyCLUSTER_REQUEST_OPERATION:UInt = 7

This operation is used to request a list of failover endpoint URIs for the remote destination based on cluster membership.

@:value("DSCredentialsCharset")staticfinalread onlyCREDENTIALS_CHARSET_HEADER:String = "DSCredentialsCharset"

Header to specify which character set encoding was used while encoding login credentials.

@:value(12)staticfinalread onlyDISCONNECT_OPERATION:UInt = 12

This operation is used to indicate that a channel has disconnected.

@:value("DS<3")staticfinalread onlyHEARTBEAT_HEADER:String = "DS<3"

Header that indicates the message is a heartbeat.

@:value(8)staticfinalread onlyLOGIN_OPERATION:UInt = 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.

@:value(9)staticfinalread onlyLOGOUT_OPERATION:UInt = 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.

@:value("DSMaxFrequency")staticfinalread onlyMAX_FREQUENCY_HEADER:String = "DSMaxFrequency"

Header to indicate the maximum number of messages a Consumer wants to receive per second.

@:value("DSMessagingVersion")staticfinalread onlyMESSAGING_VERSION:String = "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.

@:value(11)staticfinalread onlyMULTI_SUBSCRIBE_OPERATION:UInt = 11

Used by the MultiTopicConsumer to subscribe/unsubscribe for more than one topic in the same message.

@:value("DSNeedsConfig")staticfinalread onlyNEEDS_CONFIG_HEADER:String = "DSNeedsConfig"

Header to indicate that the Channel needs the configuration from the server.

@:value("DSNoOpPoll")staticfinalread onlyNO_OP_POLL_HEADER:String = "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.

@:value(2)staticfinalread onlyPOLL_OPERATION:UInt = 2

This operation is used to poll a remote destination for pending, undelivered messages.

@:value("DSPollWait")staticfinalread onlyPOLL_WAIT_HEADER:String = "DSPollWait"

Header to drive an idle wait time before the next client poll request.

@:value("DSPreserveDurable")staticfinalread onlyPRESERVE_DURABLE_HEADER:String = "DSPreserveDurable"

Durable JMS subscriptions are preserved when an unsubscribe message has this parameter set to true in its header.

@:value("DSRemSub")staticfinalread onlyREMOVE_SUBSCRIPTIONS:String = "DSRemSub"

Like the above, but specifies the subtopic/selector array of to remove

@:value("DSSelector")staticfinalread onlySELECTOR_HEADER:String = "DSSelector"

Subscribe commands issued by a Consumer pass the Consumer's selector expression in this header.

@:value(0)staticfinalread onlySUBSCRIBE_OPERATION:UInt = 0

This operation is used to subscribe to a remote destination.

@:value(10)staticfinalread onlySUBSCRIPTION_INVALIDATE_OPERATION:UInt = 10

This operation is used to indicate that the client's subscription with a remote destination has timed out.

@:value("_;_")staticfinalread onlySUBTOPIC_SEPARATOR:String = "_;_"

The separator string used for separating subtopic and selectors in the add and remove subscription headers.

@:value(13)staticfinalread onlyTRIGGER_CONNECT_OPERATION:UInt = 13

This operation is used to trigger a ChannelSet to connect.

@:value(10000)staticfinalread onlyUNKNOWN_OPERATION:UInt = 10000

This is the default operation for new CommandMessage instances.

@:value(1)staticfinalread onlyUNSUBSCRIBE_OPERATION:UInt = 1

This operation is used to unsubscribe from a remote destination.

Static methods

staticgetOperationAsString(op:UInt):String

Provides a description of the operation specified. This method is used in toString() operations on this message.

Parameters:

op

One of the CommandMessage operation constants.

Returns:

Short name for the operation.

var msg = cast(event.message, CommandMessage);
trace("Current operation -'" +
	CommandMessage.getOperationAsString(msg.operation)+ "'.");

Constructor

new()

Constructs an instance of a CommandMessage with an empty body and header and a default operation of UNKNOWN_OPERATION.

Variables

operation:UInt

Provides access to the operation/command for the CommandMessage. Operations indicate how this message should be processed by the remote destination.

Methods

toString():String

Returns a string representation of the message.

Returns:

String representation of the message.

Inherited Variables

Defined by AsyncMessage

@:flash.propertycorrelationId:String

Provides access to the correlation id of the message. Used for acknowledgement and for segmentation of messages. The correlationId contains the messageId of the previous message that this message refers to.

See also:

  • feathers.messaging.messages.AbstractMessage#messageId

Defined by AbstractMessage

@:flash.propertybody:Any

The body of a message contains the specific data that needs to be delivered to the remote destination.

@:flash.propertyclientId:String

The clientId indicates which MessageAgent sent the message.

@:flash.propertydestination:String

The message destination.

@:flash.propertyheaders:Any

The headers of a message are an associative array where the key is the header name and the value is the header value. This property provides access to the specialized meta information for the specific message instance. Core header names begin with a 'DS' prefix. Custom header names should start with a unique prefix to avoid name collisions.

@:flash.propertymessageId:String

The unique id for the message.

@:flash.propertytimeToLive:Float

The time to live value of a message indicates how long the message should be considered valid and deliverable. This value works in conjunction with the timestamp value. Time to live is the number of milliseconds that this message remains valid starting from the specified timestamp value. For example, if the timestamp value is 04/05/05 1:30:45 PST and the timeToLive value is 5000, then this message will expire at 04/05/05 1:30:50 PST. Once a message expires it will not be delivered to any other clients.

@:flash.propertytimestamp:Float

Provides access to the time stamp for the message. A time stamp is the date and time that the message was sent. The time stamp is used for tracking the message through the system, ensuring quality of service levels and providing a mechanism for message expiration.

See also:

Inherited Methods