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


public interface SyncBoResponse

SyncBoRepsonse represents the error/conflict response information, which corresponds to a specific quarantined SyncBo. This has the following information:
1. SyncBoResponse type i.e. Error or Conflict.
2. SyncKey.
3. Current and history log.
4. SyncBoDescriptor instance
5. SyncBoResolver used to resolve the quarantined state by either reverting to server state or keeping the client state.

The SyncBoResponses can be retrieved from the ErrorConflictInbox

Example: Resolve to server state for a given syncbo.


ErrorConflictInbox errorConflictInbox= SmartSyncRuntime.getInstance().getErrorConflictInbox();

//For the given synbo.

MeIterator it = errorConflictInbox.getAllSyncBoResponses(syncBoDescriptor);

while(it.hasNext()){

SyncBoResponse resp = (SyncBoResponse)it.next();

resp.acceptServerSyncBo();

}

Copyright: Copyright (c) 2003

Company: SAP AG

Since:
2.5
Version:
2.5
See Also:
ErrorConflictInbox, SyncBoResponseType

Method Summary
 void acceptClientSyncBo()
          The client data is kept and the server data is discarded.
 void acceptServerSyncBo()
          Reverts the client data to the server state; the client data is discarded.
 void delete()
          Delete this SyncBoResponse object from database.
 SyncBoChangeActionType getActionType()
          Returns the server action type of the response.
 SyncBoResponseLog getCurrentLog()
          Deprecated. use instead to access the same information. This method will be removed in next MI releases.
 java.lang.String getMessageClass()
          Returns the messageClass from the server.
 int getMessageNumber()
          Returns the messageNumber from the server.
 SyncBoResponseType getResponseType()
          Returns the SyncBoResponseType of this SyncBoResponse; either ERROR or CONFLICT
 SyncBo getServerSyncBo()
          Returns the contrary SyncBo with the server data.
 SyncBoDescriptor getSyncBoDescriptor()
          Returns the SyncBoDescriptor of this SyncBoResponse
 java.math.BigInteger getSyncBoKey()
          Returns the syncKey of this SyncBoResponse
 SyncBoResolver getSyncBoResolver()
          Deprecated. This method will be removed in next MI releases. Use
 SyncBoResponseState getSyncBoResponseState()
          Returns the current state of this instance.
 java.lang.String getSyncKey()
          Deprecated. use getSyncBoKey() instead. This method will be removed in next MI releases.
 java.lang.String getText()
          Returns the text message from the server.
 void merge()
          Replaces the current client SyncBo by a merged version which is a mixture of client data and server data.
 

Method Detail

getResponseType

public SyncBoResponseType getResponseType()
Returns the SyncBoResponseType of this SyncBoResponse; either ERROR or CONFLICT

Returns:
SyncBoResponseType

getSyncKey

public java.lang.String getSyncKey()
Deprecated. use getSyncBoKey() instead. This method will be removed in next MI releases.

Returns the syncKey of this SyncBoResponse

Returns:
the syncKey

getSyncBoKey

public java.math.BigInteger getSyncBoKey()
Returns the syncKey of this SyncBoResponse

Returns:
the syncKey

getCurrentLog

public SyncBoResponseLog getCurrentLog()
Deprecated. use instead to access the same information. This method will be removed in next MI releases.

Returns the current SyncBoResponseLog of this SyncBoResponse

Returns:
SyncBoResponseLog

getText

public java.lang.String getText()
Returns the text message from the server.

Returns:
the text message from the server

getMessageClass

public java.lang.String getMessageClass()
Returns the messageClass from the server.

Returns:
the messageClass from the server.

getMessageNumber

public int getMessageNumber()
Returns the messageNumber from the server.

Returns:
the messageNumber from the server.

getSyncBoDescriptor

public SyncBoDescriptor getSyncBoDescriptor()
Returns the SyncBoDescriptor of this SyncBoResponse

Returns:
SyncBoDescriptor

getSyncBoResolver

public SyncBoResolver getSyncBoResolver()
Deprecated. This method will be removed in next MI releases. Use

getServerSyncBo

public SyncBo getServerSyncBo()
                       throws SmartSyncException,
                              PersistenceException
Returns the contrary SyncBo with the server data.

Returns:
SyncBo the server version of the SyncBo. This is null if response is already resolved or if there is no contrary SyncBo on server side (response for a client add).
Throws:
SmartSyncException - thrown if this instance is either in already resolved (SyncBoResponseState.RESOLVED) or already deleted (SyncBoResponseState.DELETED).
PersistenceException - thrown for any exceptions caught in the Persistence layer

acceptServerSyncBo

public void acceptServerSyncBo()
                        throws SmartSyncException,
                               PersistenceException
Reverts the client data to the server state; the client data is discarded.

Throws:
SmartSyncException - thrown if this instance is either in already resolved (SyncBoResponseState.RESOLVED) or already deleted (SyncBoResponseState.DELETED).
PersistenceException - thrown for any exceptions caught in the Persistence layer

acceptClientSyncBo

public void acceptClientSyncBo()
                        throws SmartSyncException,
                               PersistenceException
The client data is kept and the server data is discarded. This is only possible if there is a contrary SyncBo stored and the SyncBoResponse is yet resolved.

Throws:
SmartSyncException - thrown if this instance is either in already resolved (SyncBoResponseState.RESOLVED) or already deleted (SyncBoResponseState.DELETED)
PersistenceException - thrown for any exceptions caught in the Persistence layer

getActionType

public SyncBoChangeActionType getActionType()
Returns the server action type of the response.

Returns:
SyncBoChangeActionType

merge

public void merge()
           throws SmartSyncException,
                  PersistenceException
Replaces the current client SyncBo by a merged version which is a mixture of client data and server data. This merged version is stored in SyncBoDataFacade and can be retreived as normal. The SyncBo is still locked for modification until is called. Merging is an action which can only be done before resolving the SyncBo. Not all server and client SyncBo merges are possible this means merge can sementically fail. For this use getSyncBoResponseState(). to get feedback if the merge was successfull or not.

Throws:
SmartSyncException - thrown if this instance is not in state {@link SyncBoResponseState#INITIAL).
PersistenceException - thrown if there is an error while storing the merged version.

delete

public void delete()
            throws SmartSyncException,
                   PersistenceException
Delete this SyncBoResponse object from database.

Throws:
SmartSyncException - thrown if the SyncBoResponse is not in state {@link SyncBoResponseState#RESOLVED).
PersistenceException - thrown if the delete operation fails.

getSyncBoResponseState

public SyncBoResponseState getSyncBoResponseState()
Returns the current state of this instance.

Returns:
the current state of this instance.


Copyright © 2005 SAP AG. All Rights Reserved.