(Adobe® Flex™ Data Services 2 only)
Packagemx.messaging.messages
Classpublic class CommandMessage
InheritanceCommandMessage Inheritance AsyncMessage Inheritance AbstractMessage Inheritance Object

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
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 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
  messageRefType : String
Targets the CommandMessage to a remote destination belonging to a specific service, based upon whether this server message type matches the message type the service handles.
CommandMessage
  operation : uint
Provides access to the operation/command for the CommandMessage.
CommandMessage
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
 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
  
[static] Provides a description of the operation specified.
CommandMessage
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
Returns a string representation of the message.
CommandMessage
 Inherited
Returns the primitive value of the specified object.
Object
Public Constants
 ConstantDefined by
  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
 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
 InheritedENDPOINT_HEADER : String = "DSEndpoint"
[static] Messages are tagged with the endpoint id for the Channel they are sent over.
AbstractMessage
  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
  POLL_OPERATION : uint = 2
[static] This operation is used to poll a remote destination for pending, undelivered messages.
CommandMessage
 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
 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
  SESSION_INVALIDATE_OPERATION : uint = 10
[static] This operation is used to indicate that the client's session with a remote destination has timed out.
CommandMessage
  SUBSCRIBE_OPERATION : uint = 0
[static] This operation is used to subscribe to a remote destination.
CommandMessage
 InheritedSUBTOPIC_HEADER : String = "DSSubtopic"
[static] Messages sent by a MessageAgent with a defined subtopic property indicate their target subtopic in this header.
AsyncMessage
  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
messageRefTypeproperty
public var messageRefType:String

Targets the CommandMessage to a remote destination belonging to a specific service, based upon whether this server message type matches the message type the service handles.

operationproperty 
public var operation:uint

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()

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

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 
public override function toString():String

Returns a string representation of the message.

Returns
String — String representation of the message.
Constant detail
AUTHENTICATION_MESSAGE_REF_TYPEconstant
public static const AUTHENTICATION_MESSAGE_REF_TYPE:String = "flex.messaging.messages.AuthenticationMessage"

The server message type for authentication commands.

CLIENT_PING_OPERATIONconstant 
public static const CLIENT_PING_OPERATION:uint = 5

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

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

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

LOGIN_OPERATIONconstant 
public static const LOGIN_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.

LOGOUT_OPERATIONconstant 
public static const LOGOUT_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.

POLL_OPERATIONconstant 
public static const POLL_OPERATION:uint = 2

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

SELECTOR_HEADERconstant 
public static const SELECTOR_HEADER:String = "DSSelector"

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

SESSION_INVALIDATE_OPERATIONconstant 
public static const SESSION_INVALIDATE_OPERATION:uint = 10

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

SUBSCRIBE_OPERATIONconstant 
public static const SUBSCRIBE_OPERATION:uint = 0

This operation is used to subscribe to a remote destination.

UNKNOWN_OPERATIONconstant 
public static const UNKNOWN_OPERATION:uint = 10000

This is the default operation for new CommandMessage instances.

UNSUBSCRIBE_OPERATIONconstant 
public static const UNSUBSCRIBE_OPERATION:uint = 1

This operation is used to unsubscribe from a remote destination.





Take a survey


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flex/201/langref/mx/messaging/messages/CommandMessage.html