sync4j.syncclient.spds.engine
Interface SyncItem

All Known Implementing Classes:
SyncItemImpl

public interface SyncItem

SyncItem is the indivisible entity that can be exchanged in a synchronization process. It is similar to a sync4j.framework.core.Item, but this one is more generic, not related to any protocol.
A SyncItem is uniquely identified by its SyncItemKey, whilst item data is stored in properties, which can be retrieved calling getProperty(), getProperties() and getPropertyValue(). Properties can be set by calling setProperties(), setProperty() and setPropertyValue().
A SyncItem is also associated with a state, which can be one of the values defined in SyncItemState.

The following properties are standard properties:

TIMSTAMP
BINARY_CONTENTA row bynary representation of the item content
The creation/modification/deletion timestamp for the item


Field Summary
static java.lang.String PROPERTY_BINARY_CONTENT
           
static java.lang.String PROPERTY_TIMESTAMP
           
 
Method Summary
 SyncItemKey getKey()
           
 java.util.Hashtable getProperties()
          Returns the properties property.
 SyncItemProperty getProperty(java.lang.String propertyName)
          Returns the property with the given name
 java.lang.Object getPropertyValue(java.lang.String propertyName)
          Returns the value of the property with the given name.
 char getState()
           
 SyncSource getSyncSource()
          Getter for property syncSource.
 void setProperties(java.util.Hashtable properties)
          Sets the properties property.
 void setProperty(SyncItemProperty property)
          Sets/adds the given property to this SyncItem
 void setPropertyValue(java.lang.String propertyName, java.lang.String propertyValue)
          Sets the value of the property with the given name.
 void setState(char state)
           
 

Field Detail

PROPERTY_BINARY_CONTENT

public static final java.lang.String PROPERTY_BINARY_CONTENT
See Also:
Constant Field Values

PROPERTY_TIMESTAMP

public static final java.lang.String PROPERTY_TIMESTAMP
See Also:
Constant Field Values
Method Detail

getKey

public SyncItemKey getKey()
Returns:
the SyncItem's uique identifier

getState

public char getState()

setState

public void setState(char state)

getProperties

public java.util.Hashtable getProperties()
Returns the properties property. A cloned copy of the internal map is returned.

Returns:
the properties property.

setProperties

public void setProperties(java.util.Hashtable properties)
Sets the properties property. All items in the given map are added to the internal map.

Parameters:
properties - the new values

setProperty

public void setProperty(SyncItemProperty property)
Sets/adds the given property to this SyncItem

Parameters:
property - The property to set/add

getProperty

public SyncItemProperty getProperty(java.lang.String propertyName)
Returns the property with the given name

Parameters:
propertyName - The property name
Returns:
the property with the given name if exists or null if not

setPropertyValue

public void setPropertyValue(java.lang.String propertyName,
                             java.lang.String propertyValue)
Sets the value of the property with the given name.

Parameters:
propertyName - The property's name
propertyValue - The new value

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String propertyName)
Returns the value of the property with the given name.

Parameters:
propertyName - The property's name
Returns:
the property value if this SyncItem has the given property or null otherwise.

getSyncSource

public SyncSource getSyncSource()
Getter for property syncSource.

Returns:
Value of property syncSource.


Copyright © 2003-2005 Sync4j.