com.funambol.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

Version:
$Id: SyncItem.java,v 1.3 2007-12-22 18:09:18 nichele Exp $

Field Summary
static java.lang.String PROPERTY_BINARY_CONTENT
           
static java.lang.String PROPERTY_FORMAT
           
static java.lang.String PROPERTY_TIMESTAMP
           
static java.lang.String PROPERTY_TYPE
           
 
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

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

PROPERTY_TIMESTAMP

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

PROPERTY_TYPE

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

PROPERTY_FORMAT

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

getKey

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

getState

char getState()

setState

void setState(char state)

getProperties

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

Returns:
the properties property.

setProperties

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

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

Parameters:
property - The property to set/add

getProperty

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

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

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

SyncSource getSyncSource()
Getter for property syncSource.

Returns:
Value of property syncSource.


Copyright © 2010 Funambol. All Rights Reserved.