mx.data.messages

# UpdateCollectionMessage - AS3 ADEP Data Services

Package | mx.data.messages
Class | public class UpdateCollectionMessage
Inheritance | UpdateCollectionMessage DataMessage AsyncMessage AbstractMessage Object

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

This message is used to establish consistency between the remote sequence and the corresponding local collection. It contains all insert and delete operations that were performed on a collection. Clients send this message when a local collection is updated using the collection API (`IListView.removeItemAt()`, etc) or the Single Managed Object API (`DataService.createItem()`). The remote destination sends this message when the remote sequence is updated and items are moved or removed and inserted. This `body` property contains a list of `UpdateCollectionRange` objects that indicate just how the collection was modified. Applying the update collection ranges inorder will establish a consistent ordering of the items within the specified collection.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | body : Object The body of a message contains the specific data that needs to be delivered to the remote destination. | AbstractMessage
|  | clientId : String The clientId indicates which MessageAgent sent the message. | AbstractMessage
|  | collectionId : Object The unique identifier for the collection that was updated. | UpdateCollectionMessage
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | correlationId : String Provides access to the correlation id of the message. | AsyncMessage
|  | destination : String The message destination. | AbstractMessage
|  | headers : 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
|  | identity : Object Provides access to the identity map which defines the unique identity of the item affected by this DataMessage (relevant for create/update/delete but not fill operations). | DataMessage
|  | messageId : String The unique id for the message. | AbstractMessage
|  | operation : uint Provides access to the operation/command of this DataMessage. | DataMessage
|  | replace : Boolean Indicates if the entire collection should be replaced by the contents of this message. | UpdateCollectionMessage
|  | timestamp : Number Provides access to the time stamp for the message. | AbstractMessage
|  | timeToLive : Number The time to live value of a message indicates how long the message should be considered valid and deliverable. | AbstractMessage
|  | updateMode : int Indicates the state of this update. | UpdateCollectionMessage

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | UpdateCollectionMessage() Creates a new instance of an empty UpdateCollectionMessage. | UpdateCollectionMessage
|  | getOperationAsString(op:uint):String [static] Provides a description of the operation specified. | DataMessage
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isCreate():Boolean Returns true if this is a create operation. | DataMessage
|  | isEmptyUpdate():Boolean Returns true if this message is both an update and its list of property names has a length of zero. | DataMessage
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns a string representation of the message. | AbstractMessage
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Public Constants
Hide Inherited Public Constants
Show Inherited Public Constants

| Constant | Defined By
--- | --- | ---
|  | CLIENT_UPDATE : int = 0 [static] Indicates this update collection message was client generated. | UpdateCollectionMessage
|  | SERVER_OVERRIDE : int = 2 [static] Indicates this update collection message was client generated and the remote destination determined that it should be reverted on that client. | UpdateCollectionMessage
|  | SERVER_UPDATE : int = 1 [static] Indicates this update collection message was remotely generated and is based on the current state of the remote sequence. | UpdateCollectionMessage

Property Detail

### collectionId

property

`public var collectionId:Object`

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

The unique identifier for the collection that was updated. For a collection filled with the `DataService.fill()` method this contains and Array of the parameters specified.

### replace

property

`public var replace:Boolean`

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

Indicates if the entire collection should be replaced by the contents of this message. When the number of changes to a remote sequence have reached a tipping point a replace message is generated as an optimization. When `true` the `body` property contains an Array of item identities that should replace any existing items.

### updateMode

property

`public var updateMode:int`

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

Indicates the state of this update. The remote destination sends update collection messages to clients with one of three update modes:

- `UpdateCollectionMessage.SERVER_UPDATE` - client applies this update collection unconditionally
- `UpdateCollectionMessage.CLIENT_UPDATE` - the committing client does not need to process this update collection.
- `UpdateCollectionMessage.SERVER_OVERRIDEN` - the remote destination modified the update collection message sent by the client and the committing client must revert this update collection.

Constructor Detail

### UpdateCollectionMessage

()
Constructor

`public function UpdateCollectionMessage()`

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

Creates a new instance of an empty UpdateCollectionMessage.

Constant Detail

### CLIENT_UPDATE

Constant

`public static const CLIENT_UPDATE:int = 0`

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

Indicates this update collection message was client generated.

Related API Elements

mx.data.messages.UpdateCollectionMessage.updateMode

### SERVER_OVERRIDE

Constant

`public static const SERVER_OVERRIDE:int = 2`

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

Indicates this update collection message was client generated and the remote destination determined that it should be reverted on that client. A subsequent update collection message will follow containing the correct values to apply getting the client collection back to a consistent state with the remote one.

Related API Elements

mx.data.messages.UpdateCollectionMessage.updateMode

### SERVER_UPDATE

Constant

`public static const SERVER_UPDATE:int = 1`

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

Indicates this update collection message was remotely generated and is based on the current state of the remote sequence.

Related API Elements

mx.data.messages.UpdateCollectionMessage.updateMode

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00