BatchSyncUpTarget

Subclass of SyncUpTarget that batches create/update/delete operations by using composite api

Inheritors

Constructors

Link copied to clipboard
constructor(createFieldlist: List<String>?, updateFieldlist: List<String>?, maxBatchSize: Int)

Construct SyncUpTarget with a different maxBatchSize (NB: cannot exceed MAX_SUB_REQUESTS_COMPOSITE_API)

constructor(createFieldlist: List<String>? = null, updateFieldlist: List<String>? = null, idFieldName: String? = null, modificationDateFieldName: String? = null, externalIdFieldName: String? = null, maxBatchSize: Int = MAX_SUB_REQUESTS_COMPOSITE_API)

Construct BatchSyncUpTarget

constructor(target: JSONObject)

Construct SyncUpTarget from json

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
override var maxBatchSize: Int
Link copied to clipboard

Functions

Link copied to clipboard
fun addSyncId(record: JSONObject, syncId: Long)
Link copied to clipboard

Same as isNewerThanServer but operating over a list of records (expected to be of the same sobject type) Return map from record store id to boolean

Link copied to clipboard
open override fun asJSON(): JSONObject
Link copied to clipboard
fun cleanAndSaveInLocalStore(syncManager: SyncManager, soupName: String, record: JSONObject)

Save cleaned record in local store

Link copied to clipboard
fun cleanAndSaveInSmartStore(smartStore: SmartStore, soupName: String, record: JSONObject, idFieldName: String?, handleTx: Boolean)
Link copied to clipboard
fun cleanRecord(record: JSONObject)
Link copied to clipboard
open fun createOnServer(syncManager: SyncManager, record: JSONObject, fieldlist: List<String>?): String?

Save locally created record back to server

Link copied to clipboard
fun deleteFromLocalStore(syncManager: SyncManager, soupName: String, record: JSONObject)

Delete record from local store

Link copied to clipboard
open fun deleteOnServer(syncManager: SyncManager, record: JSONObject): Int

Delete locally deleted record from server

Link copied to clipboard
fun getDirtyRecordIds(syncManager: SyncManager, soupName: String, idField: String): SortedSet<String>

Return ids of "dirty" records (records locally created/upated or deleted)

Link copied to clipboard
fun getFromLocalStore(syncManager: SyncManager, soupName: String, storeId: String): JSONObject

Get record from local store by storeId

fun getFromLocalStore(syncManager: SyncManager, soupName: String, storeIds: List<String>): List<JSONObject>

Get records from local store by storeId

Link copied to clipboard
fun getIdsOfRecordsToSyncUp(syncManager: SyncManager, soupName: String): Set<String>

Return ids of records to sync up

Link copied to clipboard
fun isDirty(record: JSONObject): Boolean

Given a record, return true if it was locally created/updated or deleted

Link copied to clipboard

Given a record, return true if it was locally created

Link copied to clipboard

Given a record, return true if it was locally deleted

Link copied to clipboard

Given a record, return true if it was locally updated

Link copied to clipboard
open fun isNewerThanServer(syncManager: SyncManager, record: JSONObject): Boolean

Return true if record is more recent than corresponding record on server NB: also return true if both were deleted or if local mod date is missing

Link copied to clipboard
open fun saveRecordsToLocalStore(syncManager: SyncManager, soupName: String, records: JSONArray, syncId: Long)

Save records to local store

Link copied to clipboard

Save record with last error if any

Link copied to clipboard
open override fun syncUpRecords(syncManager: SyncManager, records: List<JSONObject>, fieldlist: List<String>?, mergeMode: SyncState.MergeMode, syncSoupName: String)

Sync up a batch of records

Link copied to clipboard
open fun updateOnServer(syncManager: SyncManager, record: JSONObject, fieldlist: List<String>?): Int

Save locally updated record back to server