Packagemx.messaging.messages
Classpublic class CommandMessage
InheritanceCommandMessage Inheritance AsyncMessage Inheritance AbstractMessage Inheritance Object

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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.



Public Properties
 PropertyDefined By
 Inheritedbody : Object
The body of a message contains the specific data that needs to be delivered to the remote destination.
AbstractMessage
 InheritedclientId : String
The clientId indicates which MessageAgent sent the message.
AbstractMessage
 InheritedcorrelationId : String
Provides access to the correlation id of the message.
AsyncMessage
 Inheriteddestination : String
The message destination.
AbstractMessage
 Inheritedheaders : Object
The headers of a message are an associative array where the key is the header name and the value is the header value.
AbstractMessage
 InheritedmessageId : String
The unique id for the message.
AbstractMessage
  operation : uint
Provides access to the operation/command for the CommandMessage.
CommandMessage
 Inheritedtimestamp : Number
Provides access to the time stamp for the message.
AbstractMessage
 InheritedtimeToLive : Number
The time to live value of a message indicates how long the message should be considered valid and deliverable.
AbstractMessage
Public Methods
 MethodDefined By
  
Constructs an instance of a CommandMessage with an empty body and header and a default operation of UNKNOWN_OPERATION.
CommandMessage
  
getOperationAsString(op:uint):String
[static] Provides a description of the operation specified.
CommandMessage
  
toString():String
[override] Returns a string representation of the message.
CommandMessage
Public Constants
 ConstantDefined By
  ADD_SUBSCRIPTIONS : String = DSAddSub
[static] Header used in a MULTI_SUBSCRIBE message to specify an Array of subtopic/selector pairs to add to the existing set of subscriptions.
CommandMessage
  AUTHENTICATION_MESSAGE_REF_TYPE : String = flex.messaging.messages.AuthenticationMessage
[static] The server message type for authentication commands.
CommandMessage
  CLIENT_PING_OPERATION : uint = 5
[static] This operation is used to test connectivity over the current channel to the remote endpoint.
CommandMessage
  CLIENT_SYNC_OPERATION : uint = 4
[static] 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.
CommandMessage
  CLUSTER_REQUEST_OPERATION : uint = 7
[static] This operation is used to request a list of failover endpoint URIs for the remote destination based on cluster membership.
CommandMessage
  CREDENTIALS_CHARSET_HEADER : String = DSCredentialsCharset
[static] Header to specify which character set encoding was used while encoding login credentials.
CommandMessage
 InheritedDESTINATION_CLIENT_ID_HEADER : String = DSDstClientId
[static] Messages pushed from the server may arrive in a batch, with messages in the batch potentially targeted to different Consumer instances.
AbstractMessage
  DISCONNECT_OPERATION : uint = 12
[static] This operation is used to indicate that a channel has disconnected.
CommandMessage
 InheritedENDPOINT_HEADER : String = DSEndpoint
[static] Messages are tagged with the endpoint id for the Channel they are sent over.
AbstractMessage
 InheritedFLEX_CLIENT_ID_HEADER : String = DSId
[static] This header is used to transport the global FlexClient Id value in outbound messages once it has been assigned by the server.
AbstractMessage
  HEARTBEAT_HEADER : String = DS<3
[static] Header that indicates the message is a heartbeat.
CommandMessage
  LOGIN_OPERATION : uint = 8
[static] This operation is used to send credentials to the endpoint so that the user can be logged in over the current channel.
CommandMessage
  LOGOUT_OPERATION : uint = 9
[static] 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.
CommandMessage
  MAX_FREQUENCY_HEADER : String = DSMaxFrequency
[static] Header to indicate the maximum number of messages a Consumer wants to receive per second.
CommandMessage
  MESSAGING_VERSION : String = DSMessagingVersion
[static] 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.
CommandMessage
  MULTI_SUBSCRIBE_OPERATION : uint = 11
[static] Used by the MultiTopicConsumer to subscribe/unsubscribe for more than one topic in the same message.
CommandMessage
  NEEDS_CONFIG_HEADER : String = DSNeedsConfig
[static] Header to indicate that the Channel needs the configuration from the server.
CommandMessage
  NO_OP_POLL_HEADER : String = DSNoOpPoll
[static] Header to suppress poll response processing.
CommandMessage
  POLL_OPERATION : uint = 2
[static] This operation is used to poll a remote destination for pending, undelivered messages.
CommandMessage
  POLL_WAIT_HEADER : String = DSPollWait
[static] Header to drive an idle wait time before the next client poll request.
CommandMessage
  PRESERVE_DURABLE_HEADER : String = DSPreserveDurable
[static] Durable JMS subscriptions are preserved when an unsubscribe message has this parameter set to true in its header.
CommandMessage
 InheritedPRIORITY_HEADER : String = DSPriority
[static] Messages sent by a MessageAgent can have a priority header with a 0-9 numerical value (0 being lowest) and the server can choose to use this numerical value to prioritize messages to clients.
AbstractMessage
 InheritedREMOTE_CREDENTIALS_CHARSET_HEADER : String = DSRemoteCredentialsCharset
[static] Messages that need to set remote credentials for a destination may also need to report the character-set encoding that was used to create the credentials String using this header.
AbstractMessage
 InheritedREMOTE_CREDENTIALS_HEADER : String = DSRemoteCredentials
[static] Messages that need to set remote credentials for a destination carry the Base64 encoded credentials in this header.
AbstractMessage
  REMOVE_SUBSCRIPTIONS : String = DSRemSub
[static] Like the above, but specifies the subtopic/selector array of to remove
CommandMessage
 InheritedREQUEST_TIMEOUT_HEADER : String = DSRequestTimeout
[static] Messages sent with a defined request timeout use this header.
AbstractMessage
  SELECTOR_HEADER : String = DSSelector
[static] Subscribe commands issued by a Consumer pass the Consumer's selector expression in this header.
CommandMessage
 InheritedSTATUS_CODE_HEADER : String = DSStatusCode
[static] A status code can provide context about the nature of a response message.
AbstractMessage
  SUBSCRIBE_OPERATION : uint = 0
[static] This operation is used to subscribe to a remote destination.
CommandMessage
  SUBSCRIPTION_INVALIDATE_OPERATION : uint = 10
[static] This operation is used to indicate that the client's subscription with a remote destination has timed out.
CommandMessage
 InheritedSUBTOPIC_HEADER : String = DSSubtopic
[static] Messages sent by a MessageAgent with a defined subtopic property indicate their target subtopic in this header.
AsyncMessage
  SUBTOPIC_SEPARATOR : String = _;_
[static] The separator string used for separating subtopic and selectors in the add and remove subscription headers.
CommandMessage
  TRIGGER_CONNECT_OPERATION : uint = 13
[static] This operation is used to trigger a ChannelSet to connect.
CommandMessage
  UNKNOWN_OPERATION : uint = 10000
[static] This is the default operation for new CommandMessage instances.
CommandMessage
  UNSUBSCRIBE_OPERATION : uint = 1
[static] This operation is used to unsubscribe from a remote destination.
CommandMessage
Property Detail
operationproperty
public var operation:uint

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

Constructor Detail
CommandMessage()Constructor
public function CommandMessage()

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

Method Detail
getOperationAsString()method
public static function getOperationAsString(op:uint):String

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

Parameters

op:uint — One of the CommandMessage operation constants.

Returns
String — Short name for the operation.

Example
         var msg:CommandMessage = CommandMessage(event.message);
         trace("Current operation -'"+
                CommandMessage.getOperationAsString(msg.operation)+ "'.");
      
toString()method 
override public function toString():String

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

Returns a string representation of the message.

Returns
String — String representation of the message.
Constant Detail
ADD_SUBSCRIPTIONSConstant
public static const ADD_SUBSCRIPTIONS:String = DSAddSub

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

AUTHENTICATION_MESSAGE_REF_TYPEConstant 
public static const AUTHENTICATION_MESSAGE_REF_TYPE:String = flex.messaging.messages.AuthenticationMessage

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

The server message type for authentication commands.

CLIENT_PING_OPERATIONConstant 
public static const CLIENT_PING_OPERATION:uint = 5

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

CLIENT_SYNC_OPERATIONConstant 
public static const CLIENT_SYNC_OPERATION:uint = 4

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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.

CLUSTER_REQUEST_OPERATIONConstant 
public static const CLUSTER_REQUEST_OPERATION:uint = 7

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

CREDENTIALS_CHARSET_HEADERConstant 
public static const CREDENTIALS_CHARSET_HEADER:String = DSCredentialsCharset

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

DISCONNECT_OPERATIONConstant 
public static const DISCONNECT_OPERATION:uint = 12

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

HEARTBEAT_HEADERConstant 
public static const HEARTBEAT_HEADER:String = DS<3

Header that indicates the message is a heartbeat.

LOGIN_OPERATIONConstant 
public static const LOGIN_OPERATION:uint = 8

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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.

LOGOUT_OPERATIONConstant 
public static const LOGOUT_OPERATION:uint = 9

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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.

MAX_FREQUENCY_HEADERConstant 
public static const MAX_FREQUENCY_HEADER:String = DSMaxFrequency

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

MESSAGING_VERSIONConstant 
public static const MESSAGING_VERSION:String = DSMessagingVersion

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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.

MULTI_SUBSCRIBE_OPERATIONConstant 
public static const MULTI_SUBSCRIBE_OPERATION:uint = 11

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

NEEDS_CONFIG_HEADERConstant 
public static const NEEDS_CONFIG_HEADER:String = DSNeedsConfig

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

NO_OP_POLL_HEADERConstant 
public static const NO_OP_POLL_HEADER:String = DSNoOpPoll

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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.

POLL_OPERATIONConstant 
public static const POLL_OPERATION:uint = 2

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

POLL_WAIT_HEADERConstant 
public static const POLL_WAIT_HEADER:String = DSPollWait

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

PRESERVE_DURABLE_HEADERConstant 
public static const PRESERVE_DURABLE_HEADER:String = DSPreserveDurable

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

REMOVE_SUBSCRIPTIONSConstant 
public static const REMOVE_SUBSCRIPTIONS:String = DSRemSub

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

SELECTOR_HEADERConstant 
public static const SELECTOR_HEADER:String = DSSelector

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

SUBSCRIBE_OPERATIONConstant 
public static const SUBSCRIBE_OPERATION:uint = 0

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

This operation is used to subscribe to a remote destination.

SUBSCRIPTION_INVALIDATE_OPERATIONConstant 
public static const SUBSCRIPTION_INVALIDATE_OPERATION:uint = 10

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

SUBTOPIC_SEPARATORConstant 
public static const SUBTOPIC_SEPARATOR:String = _;_

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

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

TRIGGER_CONNECT_OPERATIONConstant 
public static const TRIGGER_CONNECT_OPERATION:uint = 13

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

This operation is used to trigger a ChannelSet to connect.

UNKNOWN_OPERATIONConstant 
public static const UNKNOWN_OPERATION:uint = 10000

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

This is the default operation for new CommandMessage instances.

UNSUBSCRIBE_OPERATIONConstant 
public static const UNSUBSCRIBE_OPERATION:uint = 1

Language Version : ActionScript 3.0
Product Versions : BlazeDS 4, LCDS 3
Runtime Versions : Flash Player 9, AIR 1.1

This operation is used to unsubscribe from a remote destination.