SHOW Signed
 

net.rim.device.api.synchronization
Interface SyncCollection

All Superinterfaces:
Collection
All Known Implementing Classes:
SyncItem

public interface SyncCollection
extends Collection

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.

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:
JDE 3.6.0
See Also:
SyncObject, SyncItem, SyncManager.enableSynchronization(net.rim.device.api.synchronization.SyncCollection), StateInfoListener

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

public 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.
Since:
JDE 3.6.0
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.

beginTransaction

public 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.

Since:
JDE 3.6.0
See Also:
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.

clearSyncObjectDirty

public 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.
Since:
JDE 3.6.0
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.

endTransaction

public 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.

Since:
JDE 3.6.0
See Also:
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.

getSyncConverter

public 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.
Since:
JDE 3.6.0
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.

getSyncName

public 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.
Since:
JDE 3.6.0
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.

getSyncName

public 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.
Since:
JDE 3.6.0
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.

getSyncObject

public 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.
Since:
JDE 3.6.0
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.

getSyncObjectCount

public int getSyncObjectCount()
Returns a the number of SyncObjects in this SyncCollection.
Returns:
The number of SyncObjects in this SyncCollection.
Since:
JDE 3.6.0
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.

getSyncObjects

public 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.
Since:
JDE 3.6.0
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.

getSyncVersion

public int getSyncVersion()
Returns the current version number of this SyncCollection.
Returns:
The current version number of this SyncCollection.
Since:
JDE 3.6.0
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.

isSyncObjectDirty

public 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.
Since:
JDE 3.6.0
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.

removeAllSyncObjects

public boolean removeAllSyncObjects()
Called to remove all SyncObjects from the SyncCollection.
Returns:
true if the update succeeded; false otherwise.
Since:
JDE 3.6.0
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.

removeSyncObject

public 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.
Since:
JDE 3.6.0
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.

setSyncObjectDirty

public 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.
Since:
JDE 3.6.0
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.

updateSyncObject

public 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.
Since:
JDE 3.6.0
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.



Copyright 1999-2009 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.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.