Adobe® Flash® Platform 用 ActionScript® 3.0 リファレンスガイド
ホーム  |  パッケージおよびクラスリストの非表示 |  パッケージ  |  クラス  |  新機能  |  索引  |  付録  |  英語で表示される理由
フィルター: サーバーからデータを取得しています...
サーバーからデータを取得しています...
mx.data 

ConflictDetector  - AS3 ADEP Data Services

パッケージmx.data
クラスpublic class ConflictDetector
継承ConflictDetector Inheritance Object

言語バージョン: ActionScript 3.0
製品バージョン: Adobe Digital Enterprise Platform Data Services for Java EE 3
ランタイムバージョン: Flash Player 9, AIR 1.1

DataService インスタンスは、ConflictDetector インスタンスを使用して、リモート宛先からプッシュされた操作に関連する競合が発生したかどうかを判定します。

プッシュされた操作を処理するときに競合が発生したかどうかを判定するために使用されるメソッドには、checkCreate()checkDelete()、および checkUpdate() の 3 種類があります。各メソッドは対応する操作に関して呼び出され、ローカルとリモートの変更を 2 つのパラメーターとして使用します。

クライアントでの競合の検出方法をカスタマイズするには、このクラスを拡張し、リモートアセンブラーのロジックと一致するように必要に応じて動作を修正します。

次のコードは、これらのメソッドを使用して競合が発生したことを通知する方法の例を示しています。競合は常に remoteChange で示されます。

例を表示



パブリックプロパティ
 プロパティ定義元
 Inheritedconstructor : Object
指定されたオブジェクトインスタンスのクラスオブジェクトまたはコンストラクター関数への参照です。
Object
パブリックメソッド
 メソッド定義元
  
ConflictDetector(dataService:ConcreteDataService)
デフォルトの競合検出メカニズムのインスタンスを作成します。
ConflictDetector
  
checkCreate(remoteChange:IChangeObject, localChange:IChangeObject):void
リモート宛先から create 操作がプッシュされて処理されると、DataService によって呼び出されます。
ConflictDetector
  
checkDelete(remoteChange:IChangeObject, localChange:IChangeObject):void
リモート宛先から delete 操作がプッシュされて処理されると、DataService によって呼び出されます。
ConflictDetector
  
checkRemoveFromFill(localChange:IChangeObject, fillParameters:Object):void
リモート宛先から remove from fill 操作がプッシュされて処理されると、DataService によって呼び出されます。
ConflictDetector
  
checkUpdate(remoteChange:IChangeObject, localChange:IChangeObject):void
リモート宛先から update 操作がプッシュされて処理されると、DataService によって呼び出されます。
ConflictDetector
 Inherited
オブジェクトに指定されたプロパティが定義されているかどうかを示します。
Object
 Inherited
Object クラスのインスタンスが、パラメーターとして指定されたオブジェクトのプロトタイプチェーン内にあるかどうかを示します。
Object
 Inherited
指定されたプロパティが存在し、列挙できるかどうかを示します。
Object
 Inherited
ループ処理に対するダイナミックプロパティの可用性を設定します。
Object
 Inherited
ロケール固有の規則に従って書式設定された、このオブジェクトのストリング表現を返します。
Object
 Inherited
指定されたオブジェクトのストリング表現を返します。
Object
 Inherited
指定されたオブジェクトのプリミティブな値を返します。
Object
コンストラクターの詳細

ConflictDetector

()コンストラクター
public function ConflictDetector(dataService:ConcreteDataService)

言語バージョン: ActionScript 3.0
製品バージョン: Adobe Digital Enterprise Platform Data Services for Java EE 3
ランタイムバージョン: Flash Player 9, AIR 1.1

デフォルトの競合検出メカニズムのインスタンスを作成します。

パラメーター
dataService:ConcreteDataService — この競合検出メカニズムを使用するデータサービスへの ConcreteDataService 参照です。
メソッドの詳細

checkCreate

()メソッド
public function checkCreate(remoteChange:IChangeObject, localChange:IChangeObject):void

言語バージョン: ActionScript 3.0
製品バージョン: Adobe Digital Enterprise Platform Data Services for Java EE 3
ランタイムバージョン: Flash Player 9, AIR 1.1

リモート宛先から create 操作がプッシュされて処理されると、DataService によって呼び出されます。

パラメーター

remoteChange:IChangeObject — 現在処理されているリモート変更を表す IChangeObject です。
 
localChange:IChangeObjectremoteChange パラメーターで参照されているものと同じオブジェクトに対するローカル変更を表す IChangeObject です。remoteChange パラメーターで指定されたアイテムに対してローカルでの変更が加えられていない場合は、この値を null にできます。

checkDelete

()メソッド 
public function checkDelete(remoteChange:IChangeObject, localChange:IChangeObject):void

言語バージョン: ActionScript 3.0
製品バージョン: Adobe Digital Enterprise Platform Data Services for Java EE 3
ランタイムバージョン: Flash Player 9, AIR 1.1

リモート宛先から delete 操作がプッシュされて処理されると、DataService によって呼び出されます。

パラメーター

remoteChange:IChangeObject — 現在処理されているリモート変更を表す IChangeObject です。
 
localChange:IChangeObjectremoteChange パラメーターで参照されているものと同じオブジェクトに対するローカル変更を表す IChangeObject です。remoteChange パラメーターで指定されたアイテムに対してローカルでの変更が加えられていない場合は、この値を null にできます。

checkRemoveFromFill

()メソッド 
public function checkRemoveFromFill(localChange:IChangeObject, fillParameters:Object):void

言語バージョン: ActionScript 3.0
製品バージョン: Adobe Digital Enterprise Platform Data Services for Java EE 3
ランタイムバージョン: Flash Player 9, AIR 1.1

リモート宛先から remove from fill 操作がプッシュされて処理されると、DataService によって呼び出されます。

パラメーター

localChange:IChangeObject — 指定した fill 操作から削除するようにサーバーが示しているアイテムのローカルバージョンを表す IChangeObject です。
 
fillParameters:Object — アイテムを削除する fill 操作を示す fill パラメーターです。

checkUpdate

()メソッド 
public function checkUpdate(remoteChange:IChangeObject, localChange:IChangeObject):void

言語バージョン: ActionScript 3.0
製品バージョン: Adobe Digital Enterprise Platform Data Services for Java EE 3
ランタイムバージョン: Flash Player 9, AIR 1.1

リモート宛先から update 操作がプッシュされて処理されると、DataService によって呼び出されます。

パラメーター

remoteChange:IChangeObject — 現在処理されているリモート変更を表す IChangeObject です。
 
localChange:IChangeObjectremoteChange パラメーターで参照されているものと同じオブジェクトに対するローカル変更を表す IChangeObject です。remoteChange パラメーターで指定されたアイテムに対してローカルでの変更が加えられていない場合は、この値を null にできます。

 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 ]英語で表示される理由
ActionScript 3.0 リファレンスガイドのコンテンツが英語で表示されます。

ActionScript 3.0 リファレンスガイドのすべての部分がすべての言語に翻訳されているわけではありません。言語エレメントが翻訳されていない場合、そのエレメントは英語で表示されます。例えば、ga.controls.HelpBox クラスはどの言語にも訳されていません。このため、リファレンスガイドの日本語バージョンでは、ga.controls.HelpBox クラスは英語で表示されます。