Referencia de ActionScript® 3.0 para la plataforma de Adobe® Flash®
Inicio  |  Ocultar lista de paquetes y clases |  Paquetes  |  Clases  |  Novedades  |  Índice  |  Apéndices  |  ¿Por qué hay texto en inglés?
Filtros: Recuperando datos del servidor...
Recuperando datos del servidor...
mx.data 

ConflictDetector  - AS3 ADEP Data Services

Paquetemx.data
Clasepublic class ConflictDetector
HerenciaConflictDetector Inheritance Object

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

A DataService instance uses a ConflictDetector instance to determine when a conflict occurs for an operation pushed from a remote destination.

It has three methods that are used to determine if a conflict exists when processing a pushed operation, checkCreate(), checkDelete(), and checkUpdate(). Each of these methods is called for the corresponding operation with two parameters, the local and the remote change.

If you want to customize how conflicts are detected on the client, you can extend this class and augment the behavior as needed to match remote assembler logic.

The following code provides examples of how these methods can be used to indicate a conflict has occurred. Conflicts are always indicated on the remoteChange.

Ver los ejemplos



Propiedades públicas
 PropiedadDefinido por
 Inheritedconstructor : Object
Una referencia a la clase de objeto o función constructora para una instancia de objeto determinada.
Object
Métodos públicos
 MétodoDefinido por
  
ConflictDetector(dataService:ConcreteDataService)
Constructs an instance of the default conflict detection mechanism.
ConflictDetector
  
checkCreate(remoteChange:IChangeObject, localChange:IChangeObject):void
Called by the DataService when a create operation is pushed/processed from the remote destination.
ConflictDetector
  
checkDelete(remoteChange:IChangeObject, localChange:IChangeObject):void
Called by the DataService when a delete operation is pushed/processed from the remote destination.
ConflictDetector
  
checkRemoveFromFill(localChange:IChangeObject, fillParameters:Object):void
Called by the DataService when a remove from fill operation is pushed/processed from the remote destination.
ConflictDetector
  
checkUpdate(remoteChange:IChangeObject, localChange:IChangeObject):void
Called by the DataService when an update operation is pushed/processed from the remote destination.
ConflictDetector
 Inherited
Indica si un objeto tiene definida una propiedad especificada.
Object
 Inherited
Indica si hay una instancia de la clase Object en la cadena de prototipo del objeto especificado como parámetro.
Object
 Inherited
Indica si existe la propiedad especificada y si es enumerable.
Object
 Inherited
Establece la disponibilidad de una propiedad dinámica para operaciones de bucle.
Object
 Inherited
Devuelve la representación de cadena de este objeto, con formato según las convenciones específicas de configuración regional.
Object
 Inherited
Devuelve la representación de cadena del objeto especificado.
Object
 Inherited
Devuelve el valor simple del objeto especificado.
Object
Información sobre constructores

ConflictDetector

()Información sobre
public function ConflictDetector(dataService:ConcreteDataService)

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Constructs an instance of the default conflict detection mechanism.

Parámetros
dataService:ConcreteDataService — ConcreteDataService reference to the data service that will use this conflict detector.
Información sobre métodos

checkCreate

()método
public function checkCreate(remoteChange:IChangeObject, localChange:IChangeObject):void

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Called by the DataService when a create operation is pushed/processed from the remote destination.

Parámetros

remoteChange:IChangeObject — IChangeObject representing the remote change being processed.
 
localChange:IChangeObject — IChangeObject representing any local changes made to the same object referenced by the remoteChange parameter. This value can be null if no local changes have been made to the item represented by the remoteChange parameter.

checkDelete

()método 
public function checkDelete(remoteChange:IChangeObject, localChange:IChangeObject):void

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Called by the DataService when a delete operation is pushed/processed from the remote destination.

Parámetros

remoteChange:IChangeObject — IChangeObject representing the remote change being processed.
 
localChange:IChangeObject — IChangeObject representing any local changes made to the same object referenced by the remoteChange parameter. This value can be null if no local changes have been made to the item represented by the remoteChange parameter.

checkRemoveFromFill

()método 
public function checkRemoveFromFill(localChange:IChangeObject, fillParameters:Object):void

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Called by the DataService when a remove from fill operation is pushed/processed from the remote destination.

Parámetros

localChange:IChangeObject — IChangeObject representing the local version of the item that the server is telling us to remove from the specified dill
 
fillParameters:Object — fill parameters identifying the fill from which the item is to be removed.

checkUpdate

()método 
public function checkUpdate(remoteChange:IChangeObject, localChange:IChangeObject):void

Versión del lenguaje: ActionScript 3.0
Versión de producto: Adobe Digital Enterprise Platform Data Services for Java EE 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Called by the DataService when an update operation is pushed/processed from the remote destination.

Parámetros

remoteChange:IChangeObject — IChangeObject representing the remote change being processed.
 
localChange:IChangeObject — IChangeObject representing any local changes made to the same object referenced by the remoteChange parameter. This value can be null if no local changes have been made to the item represented by the remoteChange parameter.

 override public function checkCreate(remoteChange:IChangeObject,
                                      localChange:IChangeObject):void
 {
     // if we have created a local item that is the same item as the remote 
     // change then we have a conflict
     if (localChange != null && 
         ObjectUtil.compare(remoteChange.identity, localChange.identity) == 0)
     {
         remoteChange.conflict("Local created item is in conflict with remotely created item",
                               localChange.changedPropertyNames);
     }
 }
 
 override public function checkDelete(remoteChange:IChangeObject,
                                      localChange:IChangeObject):void
 {
     // if we have an update locally for an item that was deleted remotely
     // that is considered a conflict.
     if (localChange != null)
     {
         if (localChange.isUpdate())
         {
             remoteChange.conflict("Local item was updated and is in conflict with pushed delete.",
                                   localChange.changedPropertyNames);
         }
     }
 }
 
 override public function checkUpdate(remoteChange:IChangeObject,
                                      localChange:IChangeObject):void
 {
     // get a list of all of the changed properties
     var changes:Array = remoteChange.changedPropertyNames;
     // get the remote state of the item's properties
     var newVersion:Object = remoteChange.newVersion;
     var prevVersion:Object = localChange.previousVersion;
     // properties will be in conflict if the old value of a property on the 
     // local item is different from the same property value of the new version
     // of the remote item.
     var conflictingProps:Array = [];
     for (var i:int=0; i<changes.length; i++)
     {
         var prop:Object = changes[i]; // could be a String or QName
         if (ObjectUtil.compare(prevVersion[prop], newVersion[prop]) != 0)
         {
             conflictingProps.push(prop);
         }
     }
 
     if (conflictingProps.length > 0)
     {
         remoteChange.conflict("Local item has changes to properties that conflict with remote change.",
                               conflictingProps);
     }
 }
 




[ X ]¿Por qué hay texto en inglés?
Cierto contenido de la Referencia de ActionScript 3.0 se muestra en inglés

No todo el contenido de la Referencia de ActionScript 3.0 se traduce a todos los idiomas. Si un elemento del lenguaje no se traduce, aparecerá en inglés. Por ejemplo, la clase ga.controls.HelpBox no está traducida en ningún idioma. Por lo tanto, en la versión en español de la referencia, la clase ga.controls.HelpBox aparecerá en inglés.