com.ibm.mobileservices.isync
Interface ISyncProvider

All Known Implementing Classes:
MIDPISyncProvider

public interface ISyncProvider

This interface contains the factory methods for ISync.


Method Summary
 boolean acceptsURL(java.lang.String uri)
          Tests if this provider supports the specified protocol in the uri.
 com.ibm.mobileservices.isync.ISyncService createSyncService(java.lang.String uri, java.lang.Object propObj)
          Gets a synchronization service instance.
 com.ibm.mobileservices.isync.ISyncService createSyncService(java.lang.String host, java.lang.String port, java.lang.String user, java.lang.String password)
          Deprecated. See other createSyncService methods.
 java.lang.String getBuildDate()
          Gets the build date of the provider.
 int getVersion()
          Returns the version of this product in a 32-bit unsigned integer in the format of 0xMMNNRRXX, where MM, NN, and RR are hexadecimal representation of major, minor, and modification version numbers respectively, and XX is reserved.
 

Method Detail

createSyncService

public com.ibm.mobileservices.isync.ISyncService createSyncService(java.lang.String host,
                                                                   java.lang.String port,
                                                                   java.lang.String user,
                                                                   java.lang.String password)
                                                            throws ISyncException
Deprecated. See other createSyncService methods.

Gets a synchronization service instance. When the sync driver's sync method is invoked, it will establish a connection to server, on the specified port authenticating with user, and password.

Parameters:
host - server hostname or IP address
port - port number
user - user ID for DB2 Everyplace Sync Server
password - password for DB2 Everyplace Sync Server
Returns:
a new ISyncService instance for use with ISyncConfigStore
Throws:
throws - ISyncException with code:
  • EXC_ILLEGAL_ARG
  • EXC_ILLEGAL_STATE
  • EXC_UNSUPPORTED_ENCODING
ISyncException
See Also:
ISyncConfigStore

createSyncService

public com.ibm.mobileservices.isync.ISyncService createSyncService(java.lang.String uri,
                                                                   java.lang.Object propObj)
                                                            throws ISyncException
Gets a synchronization service instance. When the sync driver's sync method is invoked, it will establish a connection to uri, authenticating with user, and password obtained from the propObj parameter. For uri, the maximum length is 48 characters for the server name/IP address and 5 characters for port number. Supported properties (with their maximum length):

Parameters:
uri - [protocol]+[url] or [url]
propObj - Object which is an instance of Properties, user and password are used for the DB2 Everyplace Sync Server authentication. See specific implementations for what properties may be set. MIDP accepts a Hashtable since there are no Properties.
Returns:
a new ISyncService instance for use with ISyncConfigStore
Throws:
throws - ISyncException with code:
  • EXC_ILLEGAL_ARG
  • EXC_ILLEGAL_STATE
  • EXC_UNSUPPORTED_ENCODING

An example of how to use the propObj parameter:

Properties prop = new Properties():
prop.put("isync.user", "nurse1");
prop.put("isync.password", "nurse1");
prop.put("isync.encoding", "Cp1252");
prop.put("isync.trace", "default");
prop.put("isync.messagesize", "64000");
provider.createSyncService("http://localhost:8080", prop);
ISyncException
See Also:
ISyncConfigStore, ISync

getVersion

public int getVersion()
               throws ISyncException
Returns the version of this product in a 32-bit unsigned integer in the format of 0xMMNNRRXX, where MM, NN, and RR are hexadecimal representation of major, minor, and modification version numbers respectively, and XX is reserved.

Returns:
Version number of this ISync Java API.
Throws:
ISyncException - with code:
  • EXC_ILLEGAL_STATE

getBuildDate

public java.lang.String getBuildDate()
                              throws ISyncException
Gets the build date of the provider.

Returns:
a String specifying the build date
Throws:
ISyncException

acceptsURL

public boolean acceptsURL(java.lang.String uri)
Tests if this provider supports the specified protocol in the uri. e.g. isync:db2j:, isync:db2e:

Parameters:
uri - a String uri
Returns:
true if the provider supports the protocol; false otherwise


(c) Copyright IBM Corp. 2001, 2002, 2003. All Rights Reserved.