synchronize (with SyncListener)

Executes all pending requests for the specified security module (device in the reader) and provides an event listener that returns status data. If no actions are pending, no security module content action results. This method supports the optional runtime parameter (LOCK) with values of true or false.

When set to true, this triggers GlobalPlatform locking at the end of synchronization. If a “synchronize” is performed with no pending actions and LOCK=true is supplied to the synchronization, this locks the security module with no other effect on the device or its lifecycle state. If no actions are pending and LOCK=false, no security module content action results.

The SyncManager.synchronize(...) method supports the ability to pass a listener to harvest specified events generated during the synchronization.

The SyncListener implementation is passed only events to which it is explicitly subscribed. Subscription to these events is carried out by passing a comma-delimited list of event IDs using the ACTION_RUNTIME_PARAM_EVENTS runtime parameter.

For more information, see the Synchronization Events section.

For Java:

Copy
boolean synchronize(String platformClass, Parameter[] accessParameters, Parameter[] runtimeParameters, SyncListener listener)
throws NoSuchSecurityModuleException, SyncCancelledException, SyncException, SessionException, LocalizedRemoteException;

For C++:

Copy
bool synchronize(TString platformClass, ParameterVector accessParameters, ParameterVector *runtimeParameters, SyncListener *listener);

Parameters:

  • platformClass—Class of the security module platform (smart card, TPM, or USB). The following supported option is:

  • PLATFORM_CLASS_SMARTCARD

  • accessParameters—Parameters required to access the security module.

For example, the reader name of the device might be an access parameter.

In the following code example, once you have assigned a value to the accessParams variable, you can pass the accessParams variable to any method to get information about the security module from the reader when issuing a device.

Copy
Parameter readerParam = new Parameter();
// Set reader Params id, value, encoding and type… Parameter[]    accessParams = new Parameter [] {readerParam};

The supported option for the PLATFORM_CLASS_SMARTCARD platform class is:

ACCESS_PARAM_SMARTCARD_READERNAME

(the name of the reader in which the security module is inserted).

  • runtimeParameters—Runtime parameters for the synchronization.

List of runtime parameters:

  • ACTION_RUNTIME_PARAM_PIN— device PIN used for ISSUANCE, PRODUCE and PINUNLOCK action type

  • ACTION_RUNTIME_PARAM_LOCK— device is locked at the end of synchronization if set to TRUE

  • ACTION_RUNTIME_ACTIONID—action identifer used only if ActivID CMS supports Multi device

  • ACTION_RUNTIME_PARAM_EVENTS—SyncListener events subscription
  • SyncListener—Event listener that receives status information from ActivID CMS during synchronization.

Returns:

A value of true if synchronization was performed, and false if nothing was found to synchronize.

Exceptions:

  • NoSuchSecurityModuleException— if the specified security module does not exist.

  • SyncCancelledException— if the synchronization is cancelled by another thread.

  • SyncException— if an internal implementation level failure.

  • SessionException— if there is no valid session (such as session not opened or timed out).

  • LocalizedRemoteException— (thrown by the Web service layer) only when the most severe, unexpected, SOAP-level failures occur.