net.rim.device.api.synchronization
Interface SyncCollection

All Known Implementing Classes:
OTASyncCapableSyncItem, SyncItem

public interface SyncCollection

A collection of SyncObjects used for backup/restore and synchronization.

Each application that supports synchronization maintains a collection of synchronized objects, with each collection identified by a unique name.

See Also:
SyncObject, SyncItem, SyncManager.enableSynchronization(net.rim.device.api.synchronization.SyncCollection), StateInfoListener
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

Method Summary
Category: Signed  boolean addSyncObject(SyncObject object)
          Adds a SyncObject to this SyncCollection.
Category: Signed  void beginTransaction()
          Starts a transaction.
Category: Signed  void clearSyncObjectDirty(SyncObject object)
          Marks the specified SyncObject as not dirty.
Category: Signed  void endTransaction()
          Ends a transaction.
Category: Signed  SyncConverter getSyncConverter()
          Returns the synchronization message converter (SyncConverter) for this SyncCollection.
Category: Signed  String getSyncName()
          Returns the name of this SyncCollection.
Category: Signed  String getSyncName(Locale locale)
          Returns the translated user-friendly name of this SyncCollection.
Category: Signed  SyncObject getSyncObject(int uid)
          Return the SyncObject in this SyncCollection with the given UID.
Category: Signed  int getSyncObjectCount()
          Returns a the number of SyncObjects in this SyncCollection.
Category: Signed  SyncObject[] getSyncObjects()
          Returns an array of SyncObjects representing all SyncObjects in this SyncCollection.
Category: Signed  int getSyncVersion()
          Returns the current version number of this SyncCollection.
Category: Signed  boolean isSyncObjectDirty(SyncObject object)
          Determines whether a specified SyncObject is dirty.
Category: Signed  boolean removeAllSyncObjects()
          Called to remove all SyncObjects from the SyncCollection.
Category: Signed  boolean removeSyncObject(SyncObject object)
          Removes a SyncObject from this SyncCollection.
Category: Signed  void setSyncObjectDirty(SyncObject object)
          Marks the specified SyncObject as dirty.
Category: Signed  boolean updateSyncObject(SyncObject oldObject, SyncObject newObject)
          Updates a SyncObject in this SyncCollection.
 



Method Detail

addSyncObject

boolean addSyncObject(SyncObject object)
Adds a SyncObject to this SyncCollection.

The SyncObject's dirty bit is set to clean by default.

Parameters:
object - The SyncObject to be added to the collection.
Returns:
true if the operation was successful; false otherwise.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

updateSyncObject

boolean updateSyncObject(SyncObject oldObject,
                         SyncObject newObject)
Updates a SyncObject in this SyncCollection.

The method accepts the old object to be replaced as well as the new object that will replace it in the collection. The SyncObject should subsequently be marked clean.

Parameters:
oldObject - The object to be updated.
newobject - The object to take its place.
Returns:
true if the operation was successful; false otherwise.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

removeSyncObject

boolean removeSyncObject(SyncObject object)
Removes a SyncObject from this SyncCollection.

Parameters:
object - The object to be removed.
Returns:
true if the operation was successful; false otherwise.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

removeAllSyncObjects

boolean removeAllSyncObjects()
Called to remove all SyncObjects from the SyncCollection.

Returns:
true if the update succeeded; false otherwise.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

getSyncObjects

SyncObject[] getSyncObjects()
Returns an array of SyncObjects representing all SyncObjects in this SyncCollection.

The synchronization manager assumes that it is free to manipulate this array as it requires.

Returns:
An array of SyncObjects in this SyncCollection.
See Also:
SyncObject
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

getSyncObject

SyncObject getSyncObject(int uid)
Return the SyncObject in this SyncCollection with the given UID.

Parameters:
uid - The UID of the SyncObject to retrieve.
Returns:
The SyncObject with the given ID or null if no such SyncObject exists.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

isSyncObjectDirty

boolean isSyncObjectDirty(SyncObject object)
Determines whether a specified SyncObject is dirty.

"Dirty" refers to whether or not the object has been modified on the handheld.

Parameters:
object - The object in question.
Returns:
true if the SyncObject is dirty; false otherwise.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

setSyncObjectDirty

void setSyncObjectDirty(SyncObject object)
Marks the specified SyncObject as dirty.

"Dirty" refers to whether or not the object has been modified on the handheld.

Parameters:
object - The SyncObject in question.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

clearSyncObjectDirty

void clearSyncObjectDirty(SyncObject object)
Marks the specified SyncObject as not dirty.

"Dirty" refers to whether or not the object has been modified on the handheld.

Parameters:
object - The SyncObject in question.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

getSyncObjectCount

int getSyncObjectCount()
Returns a the number of SyncObjects in this SyncCollection.

Returns:
The number of SyncObjects in this SyncCollection.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

getSyncVersion

int getSyncVersion()
Returns the current version number of this SyncCollection.

Returns:
The current version number of this SyncCollection.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

getSyncName

String getSyncName()
Returns the name of this SyncCollection. NOTE: The name that is returned must be unique across all SyncCollections and should never be localized.

Returns:
The name of this SyncCollection.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

getSyncName

String getSyncName(Locale locale)
Returns the translated user-friendly name of this SyncCollection.

If this returns null, then the result from getSyncName() will be shown instead.

Parameters:
locale - The locale (specific region) of the associated collection.
Returns:
The name of this SyncCollection.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

getSyncConverter

SyncConverter getSyncConverter()
Returns the synchronization message converter (SyncConverter) for this SyncCollection.

A SyncConverter serializes SyncObjects and processes serialized data to create SyncObjects.

Returns:
The synchronization message converter for this SyncCollection.
See Also:
SyncConverter
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

beginTransaction

void beginTransaction()
Starts a transaction.

Transactions are required to execute synchronizations that involve a large number of data records. The beginTransaction method is invoked by the SyncManager before adding, modifying or deleting a data record serially.

See Also:
SyncCollection.endTransaction()
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

endTransaction

void endTransaction()
Ends a transaction.

Transactions are required to execute synchronizations that involve a large number of data records. The endTransaction method is invoked to signal the end of the transaction.

See Also:
SyncCollection.beginTransaction()
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.