public class KNYObj extends Object implements IKonyObjectSync
Constructor and Description |
---|
KNYObj(String name)
Creates Object Level Sync Object.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelSync(Map<String,Object> options,
KNYCallback syncCallback)
Cancellation of Object level Sync session
|
void |
create(HashMap<String,Object> record,
HashMap<String,Object> options,
KNYCallback syncCallback)
Create method provides ability to create record in local database
|
void |
delete(HashMap<String,Object> options,
KNYCallback syncCallback)
Deletes a record from the local database
|
void |
deleteByPK(HashMap<String,Object> options,
KNYCallback syncCallback)
Delete method provides ability to Delete record by primary key(s) from local Database
|
void |
get(HashMap<String,Object> options,
KNYCallback syncCallback)
Get method provides ability to fetch records from local database
|
void |
getBinary(Map<String,Object> options,
KNYBinaryDownloadCallback knyBinaryDownloadCallback)
Downloads binary for the specified column name and primary key(s) of the object.
|
void |
getPendingRecordsForUpload(HashMap<String,Object> options,
KNYCallback syncCallback)
Object Level getPendingRecordsForUpload
|
void |
getUploadDeferredRecordKeys(KNYCallback syncCallback)
fetches all the differed record primary keys
|
void |
markForUpload(Map<String,Object> options,
KNYCallback syncCallback)
Mark for upload method provides ability to mark a record for upload from local Database
|
void |
rollback(Map<String,Object> primaryKeyValueMap,
KNYCallback syncCallback)
Rollback on Object
|
void |
startSync(Map<String,Object> context,
KNYCallback syncCallback,
KNYProgressCallback konySyncProgressCallback)
Object Level Start Sync Session.
|
void |
update(HashMap<String,Object> record,
HashMap<String,Object> options,
KNYCallback syncCallback)
Updates a record in the local database
|
void |
updateByPK(HashMap<String,Object> record,
HashMap<String,Object> options,
KNYCallback syncCallback)
Update method provides ability to update record by primary key(s) in local database
|
public void startSync(Map<String,Object> context, KNYCallback syncCallback, KNYProgressCallback konySyncProgressCallback) throws Exception
startSync
in interface IKonyObjectSync
context
- the contextsyncCallback
- sync success and error callbackskonySyncProgressCallback
- sync progress callbacksException
- exception in case of any errorspublic void getPendingRecordsForUpload(HashMap<String,Object> options, KNYCallback syncCallback) throws Exception
getPendingRecordsForUpload
in interface IKonyObjectSync
options
- the optionssyncCallback
- getPendingRecordsForUpload success and error callbacksException
- exception in case of any errorspublic void create(HashMap<String,Object> record, HashMap<String,Object> options, KNYCallback syncCallback) throws Exception
IKonyObjectSync
create
in interface IKonyObjectSync
record
- - list of field to be populated in record during creationoptions
- - parameter for future extensibility. MarkforUpload parameter should come through this data structuresyncCallback
- - success and error callback. Success callback returns a primary key map of record created.Exception
public void update(HashMap<String,Object> record, HashMap<String,Object> options, KNYCallback syncCallback) throws Exception
IKonyObjectSync
update
in interface IKonyObjectSync
record
- Map containing the column names and respective values to be updated in the record.options
- User specified options for updating the record.
This includes PrimaryKey(s), Disable change tracking options, MarkForUpload, whereCondition
and whereConditionAsAString.syncCallback
- contains the success and failure callbacks.
On success, returns the count of successfully updated records
On failure, returns an error object containing the error code, domain and userinfo.
The userInfo will contain the actual reason for failure and the stack trace.Exception
- in case of errorspublic void updateByPK(HashMap<String,Object> record, HashMap<String,Object> options, KNYCallback syncCallback) throws Exception
IKonyObjectSync
updateByPK
in interface IKonyObjectSync
record
- Map containing the column names and respective values to be updated in the record.options
- User specified options for updating the record.
This includes PrimaryKey(s), Disable change tracking options and MarkForUploadsyncCallback
- contains the success and failure callbacks.
On success, returns the count of successfully updated records.
On failure, returns an error object containing the error code, domain and userinfo.
The userInfo will contain the actual reason for failure and the stack trace.Exception
- in case of errorspublic void delete(HashMap<String,Object> options, KNYCallback syncCallback) throws Exception
IKonyObjectSync
delete
in interface IKonyObjectSync
options
- User specified options for deleting a record.
This includes PrimaryKey(s), Disable change tracking options, MarkForUpload, whereCondition
and whereConditionAsAString.syncCallback
- contains the success and failure callbacks.
On success, returns true on successful deletion of the record, else false.
On failure, returns an error object containing the error code, domain and userinfo.
The userInfo will contain the actual reason for failure and the stack trace.Exception
- in case of errorspublic void deleteByPK(HashMap<String,Object> options, KNYCallback syncCallback) throws Exception
IKonyObjectSync
deleteByPK
in interface IKonyObjectSync
options
- User specified options for deleting a record.
This includes PrimaryKey(s), Disable change tracking options and MarkForUpload.syncCallback
- contains the success and failure callbacks.
On success, rturns true on successful deletion of the record, else false.
On failure, returns an error object containing the error code, domain and userinfo.
The userInfo will contain the actual reason for failure and the stack trace.Exception
- in case of errorspublic void get(HashMap<String,Object> options, KNYCallback syncCallback) throws Exception
IKonyObjectSync
get
in interface IKonyObjectSync
options
- - Where clause, OrderBy map, Limit, Offset, MarkforUploadsyncCallback
- - success and error callback. Success callback contains a map of the record retrieved.Exception
public void rollback(Map<String,Object> primaryKeyValueMap, KNYCallback syncCallback)
rollback
in interface IKonyObjectSync
primaryKeyValueMap
- of record only for which rollback should happensyncCallback
- for success and error callbackspublic void markForUpload(Map<String,Object> options, KNYCallback syncCallback) throws Exception
IKonyObjectSync
markForUpload
in interface IKonyObjectSync
options
- - Primary key of record, markforUploadsyncCallback
- - success or error callback.
Success call back returns true.Exception
public void getUploadDeferredRecordKeys(KNYCallback syncCallback) throws Exception
IKonyObjectSync
getUploadDeferredRecordKeys
in interface IKonyObjectSync
syncCallback
- - success or error callback.
Success call back returns true.Exception
public void cancelSync(Map<String,Object> options, KNYCallback syncCallback)
IKonyObjectSync
cancelSync
in interface IKonyObjectSync
options
- Options for cancellationsyncCallback
- For success and error callbackspublic void getBinary(Map<String,Object> options, KNYBinaryDownloadCallback knyBinaryDownloadCallback)
getBinary
in interface IKonyObjectSync
options
- - Options specific to the file to be downloaded
binaryColumnName: String
forceDownload: boolean
chunkSize: integer
primaryKeys: Map of column name and value
fileId: ID which user wants to name the file with. This will be appended with timestampknyBinaryDownloadCallback
- - callbacks for download status (BinaryDownloadCallback includes
onFileDownloadStarted, onFileDownloadCompleted
,onStreamDownloadCompleted, onChunkDownloadCompleted
onDownloadFailure )