Adobe® Flex® 4 Language Reference
Show Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
mx.data 
Conflict 
Packagemx.data
Classpublic class Conflict
InheritanceConflict Inheritance Error Inheritance Object
Implements IExternalizable

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

The Conflict class is used to represent error that has occurred due to an update operation. Conflicts are generated for many reasons. For example, another client has updated the same property of an item.

Conflicts are determined by both the remote destination and the local DataService. A conflict detected by the DataService is considered a local conflict. A conflict detected by the remote destination is a remote conflict.

Custom assemblers can generate a remote conflict for any operation when processing an update. Local conflicts are determined by the ConflictDetector object. To customize local conflict detection the ConflictDetector can be extended and assigned to the DataService.conflictDetector property.

All conflicts must be resolved before changes can be committed.



Public Properties
 PropertyDefined By
  cause : DataMessage
[read-only] The DataMessage object that caused the conflict.
Conflict
  causedByLocalCommit : Boolean
[read-only] Contains true if this conflict resulted from commiting a local change to the remote destination, and false if it resulted from a pushed change conflicting with a local change.
Conflict
  clientObject : Object
[read-only] The state of the client object (whose property was changed) at the time of the conflict.
Conflict
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  destination : String
[read-only] The destination for the data service of the item involved in this conflict.
Conflict
 InheritederrorID : int
[read-only] Contains the reference number associated with the specific error message.
Error
 Inheritedmessage : String
Contains the message associated with the Error object.
Error
 Inheritedname : String
Contains the name of the Error object.
Error
  originalObject : Object
[read-only] The state of the original client object before its properties were changed, as known at the time of the conflict.
Conflict
  propertyNames : Array
[read-only] An Array of the names of the properties that were in conflict between the client change and the remote item state.
Conflict
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  resolved : Boolean
[read-only] Indicates whether this Conflict has been resolved (acceptClient() or acceptServer() has been called).
Conflict
  serverObject : Object
[read-only] The value of the server object whose property was to be changed.
Conflict
  serverObjectDeleted : Boolean
[read-only] When the serverObject property of this class is null, this property lets you know whether the server version is null because the item was deleted on the server (true) or because the item was removed from a fill that this client is subscribed to (false).
Conflict
  serverObjectReferencedIds : Object
[read-only] If the serverObject has any properties with lazy="true", returns an Object that stores the referencedId Arrays for each lazily loaded property, using the property name as the lookup key value.
Conflict
Public Methods
 MethodDefined By
  
Requeues the current local changes and updates the property values such that a subsequent call to DataService.commit() should succeed, causing these changes to override the previous ones.
Conflict
  
Removes the conflicting local change and applies the property values found on Conflict.serverObject to the local item.
Conflict
 Inherited
Returns the call stack for an error as a string at the time of the error's construction (for the debugger version of Flash Player and the AIR Debug Launcher (ADL) only; returns null if not using the debugger version of Flash Player or the ADL.
Error
 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
  
A class implements this method to decode itself from a data stream by calling the methods of the IDataInput interface.
Conflict
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
  
Returns a String representation of this Conflict object.
Conflict
 Inherited
Returns the primitive value of the specified object.
Object
  
A class implements this method to encode itself for a data stream by calling the methods of the IDataOutput interface.
Conflict
Public Constants
 ConstantDefined By
  NONE : String = "none"
[static] Conflict mode constant representing zero conflict detection.
Conflict
  OBJECT : String = "object"
[static] Conflict mode constant representing object level conflict detection.
Conflict
  PROPERTY : String = "property"
[static] Conflict mode constant representing property level conflict detection.
Conflict
Property Detail

cause

property
cause:DataMessage  [read-only]

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

The DataMessage object that caused the conflict.



Implementation
    public function get cause():DataMessage

causedByLocalCommit

property 
causedByLocalCommit:Boolean  [read-only]

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Contains true if this conflict resulted from commiting a local change to the remote destination, and false if it resulted from a pushed change conflicting with a local change.



Implementation
    public function get causedByLocalCommit():Boolean

clientObject

property 
clientObject:Object  [read-only]

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

The state of the client object (whose property was changed) at the time of the conflict.



Implementation
    public function get clientObject():Object

destination

property 
destination:String  [read-only]

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

The destination for the data service of the item involved in this conflict.



Implementation
    public function get destination():String

originalObject

property 
originalObject:Object  [read-only]

The state of the original client object before its properties were changed, as known at the time of the conflict.



Implementation
    public function get originalObject():Object

propertyNames

property 
propertyNames:Array  [read-only]

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

An Array of the names of the properties that were in conflict between the client change and the remote item state. All property names are String values and exist in the public namespace.



Implementation
    public function get propertyNames():Array

resolved

property 
resolved:Boolean  [read-only]

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Indicates whether this Conflict has been resolved (acceptClient() or acceptServer() has been called).



Implementation
    public function get resolved():Boolean

See also

serverObject

property 
serverObject:Object  [read-only]

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

The value of the server object whose property was to be changed.



Implementation
    public function get serverObject():Object

serverObjectDeleted

property 
serverObjectDeleted:Boolean  [read-only]

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

When the serverObject property of this class is null, this property lets you know whether the server version is null because the item was deleted on the server (true) or because the item was removed from a fill that this client is subscribed to (false). This flag will return false if the serverObject property is not null.



Implementation
    public function get serverObjectDeleted():Boolean

serverObjectReferencedIds

property 
serverObjectReferencedIds:Object  [read-only]

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

If the serverObject has any properties with lazy="true", returns an Object that stores the referencedId Arrays for each lazily loaded property, using the property name as the lookup key value.



Implementation
    public function get serverObjectReferencedIds():Object
Method Detail

acceptClient

()method
public function acceptClient():void

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Requeues the current local changes and updates the property values such that a subsequent call to DataService.commit() should succeed, causing these changes to override the previous ones.


Example  ( How to use this example )
         private function conflictHandler(event:DataConflictEvent):void
         {
             if (acceptClientCheck.selected)
             {
                  event.conflict.acceptClient();
             }
             else
             {
                  event.conflict.acceptServer();
             }
         }
      

acceptServer

()method 
public function acceptServer():void

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Removes the conflicting local change and applies the property values found on Conflict.serverObject to the local item.


Example  ( How to use this example )
         private function conflictHandler(event:DataConflictEvent):void
         {
             if (acceptClientCheck.selected)
             {
                  event.conflict.acceptClient();
             }
             else
             {
                  event.conflict.acceptServer();
             }
         }
      

readExternal

()method 
public function readExternal(input:IDataInput):void

A class implements this method to decode itself from a data stream by calling the methods of the IDataInput interface. This method must read the values in the same sequence and with the same types as were written by the writeExternal() method.

Parameters

input:IDataInput — The name of the class that implements the IDataInput interface.

toString

()method 
public function toString():String

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Returns a String representation of this Conflict object.

Returns
String — A String representation of this Conflict object.

writeExternal

()method 
public function writeExternal(output:IDataOutput):void

A class implements this method to encode itself for a data stream by calling the methods of the IDataOutput interface.

Parameters

output:IDataOutput — The name of the class that implements the IDataOutput interface.

Constant Detail

NONE

Constant
public static const NONE:String = "none"

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Conflict mode constant representing zero conflict detection.

OBJECT

Constant 
public static const OBJECT:String = "object"

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Conflict mode constant representing object level conflict detection.

PROPERTY

Constant 
public static const PROPERTY:String = "property"

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Conflict mode constant representing property level conflict detection.