flex.data
Interface ChangeObject

All Superinterfaces:
Serializable

public interface ChangeObject
extends Serializable

The ChangeObject interface is the public interface for the JavaAdapter's synchronization methods.


Method Summary
 void addChangedPropertyName(String propertyName)
          If the adapter modifies an additional property, not changed on the client, you can use this method to add that property to the list of changes so it is pushed to other clients.
 void conflict(Object serverVersion)
          Declares that a conflict occurred while processing this change.
 void conflict(Object serverVersion, boolean conflictOnProperty)
          Declares that a conflict occurred while processing this change.
 void fail()
          Declares that a failure occurred while processing this change.
 void fail(String description)
          Declares that a failure occurred while processing this change.
 String[] getChangedPropertyNames()
          Returns the list of property names which changed as part of this update.
 Map getChangedValues()
          Gets a map of property names and their current values on the item.
 flex.data.messages.DataMessage getMessage()
          Accesses the underlying Message transmitted by the client for the change.
 Object getNewVersion()
          Gets the current version known to the client, which is the proposed new version for the server.
 Object getObjectId()
          Gets the identity of the changed object instance
 Object getPreviousValue(String propertyName)
          Gets the previous value of the named property on the item.
 Object getPreviousVersion()
          Gets the previous version known to the client.
 boolean isCreate()
          Inspects what sort of change occurred on the current item.
 boolean isDelete()
          Inspect what sort of change occurred on the current item.
 boolean isUpdate()
          Inspects what sort of change occurred on the current item.
 void setNewVersion(Object o)
          Sets the current version of the item.
 

Method Detail

getObjectId

public Object getObjectId()
Gets the identity of the changed object instance


getPreviousVersion

public Object getPreviousVersion()
Gets the previous version known to the client.


getNewVersion

public Object getNewVersion()
Gets the current version known to the client, which is the proposed new version for the server.


setNewVersion

public void setNewVersion(Object o)
Sets the current version of the item.


isCreate

public boolean isCreate()
Inspects what sort of change occurred on the current item. True if the item is new


isUpdate

public boolean isUpdate()
Inspects what sort of change occurred on the current item. True if the item is updated.


isDelete

public boolean isDelete()
Inspect what sort of change occurred on the current item. True if the item is deleted.


getChangedPropertyNames

public String[] getChangedPropertyNames()
Returns the list of property names which changed as part of this update. If this method returns null, it is in indication that all properties may have changed.


addChangedPropertyName

public void addChangedPropertyName(String propertyName)
If the adapter modifies an additional property, not changed on the client, you can use this method to add that property to the list of changes so it is pushed to other clients. You might use this to implement a versionId property which changes on each update for example.


getChangedValues

public Map getChangedValues()
Gets a map of property names and their current values on the item.


getPreviousValue

public Object getPreviousValue(String propertyName)
Gets the previous value of the named property on the item.


getMessage

public flex.data.messages.DataMessage getMessage()
Accesses the underlying Message transmitted by the client for the change.


fail

public void fail()
Declares that a failure occurred while processing this change. The failure will be manifested as a fault event on the client.


fail

public void fail(String description)
Declares that a failure occurred while processing this change. The failure will be manifested as a fault event on the client, and the error description will contain the String input parameter.


conflict

public void conflict(Object serverVersion)
Declares that a conflict occurred while processing this change. The failure will be manifested as a conflict event on the client, and any values which differ between the client's previous version of the object and the server's current version will be marked as out of sync.


conflict

public void conflict(Object serverVersion,
                     boolean conflictOnProperty)
Declares that a conflict occurred while processing this change. The failure will be manifested as a conflict event on the client. If the boolean input parameter is true, then only the properties which the client attempted to modify will be examined for discrepancies between the client's previous version and the server's current version. If the boolean input parameter is false, then all of the object's properties, not just those that are changing, will be inspected for differences between client and server versions.



Copyright © 2006 Adobe Systems Inc. All Rights Reserved. (Updated August 2, 2006)

Take a survey