|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.feedhenry.sdk.sync.FHSyncClient
public class FHSyncClient
The sync client is part of the FeedHenry data sync framework. It provides a mechanism to manage bi-direction data synchronization. For more details, please check data sync framewrok docs.
| Field Summary | |
|---|---|
protected static java.lang.String |
LOG_TAG
|
| Constructor Summary | |
|---|---|
FHSyncClient()
|
|
| Method Summary | |
|---|---|
JSONObject |
create(java.lang.String pDataId,
JSONObject pData)
Create a new data record in dataset with pDataId |
JSONObject |
delete(java.lang.String pDataId,
java.lang.String pUID)
Delete a data record in the dataset with pDataId |
void |
destroy()
Stop all sync processes for all the datasets managed by the sync client. |
static FHSyncClient |
getInstance()
Get the singleton instance of the sync client. |
void |
init(android.content.Context pContext,
FHSyncConfig pConfig,
FHSyncListener pListener)
Initialize the sync client. |
JSONObject |
list(java.lang.String pDataId)
List all the data in the dataset with pDataId. |
void |
listCollisions(java.lang.String pDataId,
FHActCallback pCallback)
List sync collisions in dataset with id pDataId |
void |
manage(java.lang.String pDataId,
FHSyncConfig pConfig,
JSONObject pQueryParams)
Use the sync client to manage a dataset. |
JSONObject |
read(java.lang.String pDataId,
java.lang.String pUID)
Read a data record with pUID in dataset with pDataId |
void |
removeCollision(java.lang.String pDataId,
java.lang.String pCollisionHash,
FHActCallback pCallback)
Remove a sync collision record in the dataset with id pDataId |
void |
setListener(FHSyncListener pListener)
Re-set the sync listener |
void |
stop(java.lang.String pDataId)
Stop the sync process for dataset with id pDataId |
JSONObject |
update(java.lang.String pDataId,
java.lang.String pUID,
JSONObject pData)
Update an existing data record in dataset with pDataId |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String LOG_TAG
| Constructor Detail |
|---|
public FHSyncClient()
| Method Detail |
|---|
public static FHSyncClient getInstance()
public void init(android.content.Context pContext,
FHSyncConfig pConfig,
FHSyncListener pListener)
pContext - The app contextpConfig - The sync configurationpListener - The sync listenerpublic void setListener(FHSyncListener pListener)
pListener - the new sync listener
public void manage(java.lang.String pDataId,
FHSyncConfig pConfig,
JSONObject pQueryParams)
throws java.lang.Exception
pDataId - The id of the dataset.pConfig - The sync configuration for the dataset. If not specified, the sync configuration passed in the init method will be usedpQueryParams - Query parameters for the dataset
java.lang.Exceptionpublic JSONObject list(java.lang.String pDataId)
pDataId - The id of the dataset
public JSONObject read(java.lang.String pDataId,
java.lang.String pUID)
pDataId - the id of the datasetpUID - the id of the data record
public JSONObject create(java.lang.String pDataId,
JSONObject pData)
throws java.lang.Exception
pDataId - the id of the datasetpData - the actual data
java.lang.Exception
public JSONObject update(java.lang.String pDataId,
java.lang.String pUID,
JSONObject pData)
throws java.lang.Exception
pDataId - the id of the datasetpUID - the id of the data recordpData - the new content of the data record
java.lang.Exception
public JSONObject delete(java.lang.String pDataId,
java.lang.String pUID)
throws java.lang.Exception
pDataId - the id of the datasetpUID - the id of the data record
java.lang.Exception
public void listCollisions(java.lang.String pDataId,
FHActCallback pCallback)
throws java.lang.Exception
pDataId - the id of the datasetpCallback - the callback function
java.lang.Exception
public void removeCollision(java.lang.String pDataId,
java.lang.String pCollisionHash,
FHActCallback pCallback)
throws java.lang.Exception
pDataId - the id of the datasetpCollisionHash - the hash value of the collision recordpCallback - the callback function
java.lang.Exception
public void stop(java.lang.String pDataId)
throws java.lang.Exception
pDataId - the id of the dataset
java.lang.Exception
public void destroy()
throws java.lang.Exception
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||