com.sap.ip.me.api.smartsync
Interface SyncBoInDeltaObserver


Deprecated. avoid using SyncBoInDeltaObserver because it reduces performance of inbound processing.

public interface SyncBoInDeltaObserver

This interface has to be implemented for any class observing SyncBO inbound delta. SmartSync does not provide any abstract class or concrete class for this interface. It has to specify which SyncBO inbound delta it is notified for by naming the SyncBO types it is obeserving. The observers are being notified thru the method syncBoInDeltaReceived when an inbound SyncBo delta data for any of the specified SyncBO types is received.
As opposed to SyncBoDeltaObserver, this observer's method is called before modification (posting of SyncBoInDelta into local data store) takes place. It is only used for SyncBo delta from the backend, no inbound delta that is initiated from within the client.

To activate the observer, its instance needs to be registered with InboxNotifier.

note
Transaction is not allowed to be used inside callback method syncBoInDeltaReceived(SyncBoInDelta), and therefore SmartSyncTransactionManager.beginTransaction() musn't be called inside.

Example:
To perform some post operation on success.

  Class MySynBoInDelta implements SyncBoInDeltaObserver{
     // Return the SyncBo desc which the application should monitor
     public SyncBoDescriptor[] observeSyncBoTypes(){
        SyncBoDescriptor[] syncDescs = new SyncBoDescriptor[1];
        syncDescs[0]= syncBoDesc2Observe;
     }
     //Implement the action
     public SyncBoInDelta receivedSyncBoInDelta(SyncBoInDelta syncBoInDelta){
        if(syncBoInDelta.getSyncReply().getType()==SyncReplyType.SUCCESS){
             // perform post success operation.
        }
     }
  }

  // Register the observer.
  SmartSyncRuntime.getInboxNotifier().registerSyncBoInDeltaObserver(MySynBoInDelta);
 

Version:
2.1
Author:
SAP
See Also:
InboxNotifier, SyncBoInDelta

Method Summary
 SyncBoDescriptor[] observeSyncBoTypes()
          Deprecated. Specifies SyncBo descriptors that application needs to observe.
 SyncBoInDelta receivedSyncBoInDelta(SyncBoInDelta syncBoInDelta)
          Deprecated.  Notifies the observer with the inbound data which is designated by application
 

Method Detail

observeSyncBoTypes

public SyncBoDescriptor[] observeSyncBoTypes()
Deprecated. 
Specifies SyncBo descriptors that application needs to observe.

Returns:
array of SyncBoDescriptor instance that are to be observed.

receivedSyncBoInDelta

public SyncBoInDelta receivedSyncBoInDelta(SyncBoInDelta syncBoInDelta)
Deprecated. 

Notifies the observer with the inbound data which is designated by application

Returns:
SyncBoInDelta the specified SyncBoInDelta in delta


Copyright © 2005 SAP AG. All Rights Reserved.