com.funambol.ws.client
Class BusinessDelegate

java.lang.Object
  extended bycom.funambol.ws.client.BusinessDelegate
All Implemented Interfaces:
java.io.Serializable

public class BusinessDelegate
extends java.lang.Object
implements java.io.Serializable

Manages the interaction with the business WS.

See Also:
Serialized Form

Constructor Summary
BusinessDelegate(WebServiceSyncSource syncSource)
          Create the BusinessDelegate and lookup the WS.
 
Method Summary
 Item addItem(java.lang.String sessionId, Item item)
          Calls addItem method of the WS
 java.lang.String beginSync(java.lang.Long principalId, java.lang.Integer syncMode)
          Calls beginSync method of the WS
 java.lang.String beginSync(java.lang.Long principalId, java.lang.Integer syncMode, com.funambol.framework.filter.FilterClause filterClause)
          Calls beginSync method of the WS
 void endSync(java.lang.String sessionId)
          Calls endSync method of the WS
 java.lang.String[] getAllItemKeys(java.lang.String sessionId)
          Calls getAllItemKeys method of the WS
 java.lang.String[] getDeletedItemKeys(java.lang.String sessionId, java.lang.String since, java.lang.String until)
          Calls getDeletedItemKeys method of the WS
 Item getItemFromId(java.lang.String sessionId, java.lang.String itemKey)
          Calls getItemFromId method of the WS
 java.lang.String[] getItemKeysFromTwin(Item item)
          Calls getItemKeysFromTwin method of the
 char getItemStateFromId(java.lang.String sessionId, java.lang.String itemKey)
          Calls getItemStateFromId method of the WS
 java.lang.String[] getNewItemKeys(java.lang.String sessionId, java.lang.String since, java.lang.String until)
          Calls getNewItemKeys method of the WS
 java.lang.String[] getUpdatedItemKeys(java.lang.String sessionId, java.lang.String since, java.lang.String until)
          Calls beginSync method of the WS
 boolean isItemInFilterClause(java.lang.String sessionId, java.lang.String itemKey)
          Calls isItemInFilterClause method of the WS
 boolean mergeItems(java.lang.String serverKey, Item clientItem)
          Calls mergeItems method of the WS
 void removeItem(java.lang.String sessionId, java.lang.String itemKey, java.lang.String timestamp, boolean softDeletion)
          Calls removeItem method of the WS
 void setOperationStatus(java.lang.String sessionId, java.lang.String operation, int statusCode, java.lang.String[] itemKeys)
          Calls setOperationStatus method of the WS
 Item updateItem(java.lang.String sessionId, Item item)
          Calls updateItem method of the WS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BusinessDelegate

public BusinessDelegate(WebServiceSyncSource syncSource)
                 throws com.funambol.framework.engine.source.SyncSourceException
Create the BusinessDelegate and lookup the WS.

Parameters:
syncSource - the WebServiceSyncSource
Throws:
com.funambol.framework.engine.source.SyncSourceException - if an error occurs
Method Detail

beginSync

public java.lang.String beginSync(java.lang.Long principalId,
                                  java.lang.Integer syncMode,
                                  com.funambol.framework.filter.FilterClause filterClause)
                           throws com.funambol.framework.engine.source.SyncSourceException
Calls beginSync method of the WS

Parameters:
principalId - the user and device relation identifier
syncMode - the synchronization mode
filterClause - the items filter clause
Returns:
a new session id for a sync process
Throws:
com.funambol.framework.engine.source.SyncSourceException

beginSync

public java.lang.String beginSync(java.lang.Long principalId,
                                  java.lang.Integer syncMode)
                           throws com.funambol.framework.engine.source.SyncSourceException
Calls beginSync method of the WS

Parameters:
principalId - the user and device relation identifier
syncMode - the synchronization mode
Returns:
a new session id for a sync process
Throws:
com.funambol.framework.engine.source.SyncSourceException

getItemFromId

public Item getItemFromId(java.lang.String sessionId,
                          java.lang.String itemKey)
                   throws com.funambol.framework.engine.source.SyncSourceException
Calls getItemFromId method of the WS

Parameters:
sessionId - The session id
itemKey - The item key
Returns:
the item with the given session id and item key or null if it doesn't exists
Throws:
com.funambol.framework.engine.source.SyncSourceException

getAllItemKeys

public java.lang.String[] getAllItemKeys(java.lang.String sessionId)
                                  throws com.funambol.framework.engine.source.SyncSourceException
Calls getAllItemKeys method of the WS

Parameters:
sessionId - The session id
Returns:
all sync item keys from the source for a given session id
Throws:
com.funambol.framework.engine.source.SyncSourceException

getNewItemKeys

public java.lang.String[] getNewItemKeys(java.lang.String sessionId,
                                         java.lang.String since,
                                         java.lang.String until)
                                  throws com.funambol.framework.engine.source.SyncSourceException
Calls getNewItemKeys method of the WS

Parameters:
sessionId - The point of sta
since - The time start point
until - The time end poin
Returns:
sync item keys created in the time frame sinceTs - untilTs
Throws:
com.funambol.framework.engine.source.SyncSourceException

getUpdatedItemKeys

public java.lang.String[] getUpdatedItemKeys(java.lang.String sessionId,
                                             java.lang.String since,
                                             java.lang.String until)
                                      throws com.funambol.framework.engine.source.SyncSourceException
Calls beginSync method of the WS

Parameters:
sessionId - The point of sta
since - The time start point
until - The time end poin
Returns:
sync item keys updated in the time frame sinceTs - untilTs
Throws:
com.funambol.framework.engine.source.SyncSourceException

getDeletedItemKeys

public java.lang.String[] getDeletedItemKeys(java.lang.String sessionId,
                                             java.lang.String since,
                                             java.lang.String until)
                                      throws com.funambol.framework.engine.source.SyncSourceException
Calls getDeletedItemKeys method of the WS

Parameters:
sessionId - The point of sta
since - The time start point
until - The time end poin
Returns:
sync item keys deleted in the time frame sinceTs - untilTs
Throws:
com.funambol.framework.engine.source.SyncSourceException

addItem

public Item addItem(java.lang.String sessionId,
                    Item item)
             throws com.funambol.framework.engine.source.SyncSourceException
Calls addItem method of the WS

Parameters:
sessionId - The session id
item - The new item to be stored
Returns:
saved item
Throws:
com.funambol.framework.engine.source.SyncSourceException

updateItem

public Item updateItem(java.lang.String sessionId,
                       Item item)
                throws com.funambol.framework.engine.source.SyncSourceException
Calls updateItem method of the WS

Parameters:
sessionId - The session id
item - The updated item to replace the older one
Returns:
updated item
Throws:
com.funambol.framework.engine.source.SyncSourceException

removeItem

public void removeItem(java.lang.String sessionId,
                       java.lang.String itemKey,
                       java.lang.String timestamp,
                       boolean softDeletion)
                throws com.funambol.framework.engine.source.SyncSourceException
Calls removeItem method of the WS

Parameters:
sessionId - The session id
itemKey - the key of the item to remove
timestamp - the time of the deletion
softDeletion - is a soft delete ?
Throws:
com.funambol.framework.engine.source.SyncSourceException

endSync

public void endSync(java.lang.String sessionId)
             throws com.funambol.framework.engine.source.SyncSourceException
Calls endSync method of the WS

Parameters:
sessionId - The session id which will be closed
Throws:
com.funambol.framework.engine.source.SyncSourceException

setOperationStatus

public void setOperationStatus(java.lang.String sessionId,
                               java.lang.String operation,
                               int statusCode,
                               java.lang.String[] itemKeys)
                        throws com.funambol.framework.engine.source.SyncSourceException
Calls setOperationStatus method of the WS

Parameters:
sessionId - The session id
operation - the name of the operation.
statusCode - the status of the operation
itemKeys - the keys of the items
Throws:
com.funambol.framework.engine.source.SyncSourceException

getItemStateFromId

public char getItemStateFromId(java.lang.String sessionId,
                               java.lang.String itemKey)
                        throws com.funambol.framework.engine.source.SyncSourceException
Calls getItemStateFromId method of the WS

Parameters:
sessionId - The session id
itemKey - the key of the SyncItem to return
Returns:
char the state of the item with the given key.
Throws:
com.funambol.framework.engine.source.SyncSourceException

isItemInFilterClause

public boolean isItemInFilterClause(java.lang.String sessionId,
                                    java.lang.String itemKey)
                             throws com.funambol.framework.engine.source.SyncSourceException
Calls isItemInFilterClause method of the WS

Parameters:
sessionId - The session id
itemKey - the item key to check
Returns:
true is the item satisfies the fiter, false otherwise
Throws:
com.funambol.framework.engine.source.SyncSourceException

mergeItems

public boolean mergeItems(java.lang.String serverKey,
                          Item clientItem)
                   throws com.funambol.framework.engine.source.SyncSourceException
Calls mergeItems method of the WS

Parameters:
serverKey -
clientItem -
Returns:
the result of the call
Throws:
com.funambol.framework.engine.source.SyncSourceException

getItemKeysFromTwin

public java.lang.String[] getItemKeysFromTwin(Item item)
                                       throws com.funambol.framework.engine.source.SyncSourceException
Calls getItemKeysFromTwin method of the

Parameters:
item -
Returns:
the result of the call
Throws:
com.funambol.framework.engine.source.SyncSourceException


Copyright © 2005-2006 Funambol.