Package com.morpheusdata.core.util
Class FullModelSyncTask<ApiItem,Model>
java.lang.Object
com.morpheusdata.core.util.SyncTask<Model,ApiItem,Model>
com.morpheusdata.core.util.FullModelSyncTask<ApiItem,Model>
- Type Parameters:
ApiItem
- The Class Object representing the individual API result object coming back in the CollectionModel
- The Model Class that the Projection Class is a subset of. This is the Class that needs to be updated with changes
This Utility Class provides an rxJava compatible means for syncing remote API objects with local/morpheus backed models
in a persistent database. This handles an efficeint way to match full model objects with api objects and batches
updates to the backend database for efficient sync. This, along with the
SyncTask
should be considered the standard method for caching objects
within a CloudProvider
and many other provider types. The **Key** difference between this and the SyncTask
is that this method does not require
you to define a projection/identity class and can just sync the model itself.-
Nested Class Summary
Nested classes/interfaces inherited from class com.morpheusdata.core.util.SyncTask
SyncTask.MatchFunction<Projection,
ApiItem>, SyncTask.OnAddFunction<ApiItem>, SyncTask.OnDeleteFunction<Projection>, SyncTask.OnErrorfunction, SyncTask.OnLoadObjectDetailsFromFinderFunction<UpdateItemProjection, Model>, SyncTask.OnLoadObjectDetailsFunction<UpdateItemProjection, UpdateItem>, SyncTask.OnUpdateFunction<UpdateItems>, SyncTask.UpdateItem<Model, ApiItem>, SyncTask.UpdateItemDto<Projection, ApiItem> -
Field Summary
Fields inherited from class com.morpheusdata.core.util.SyncTask
syncScheduler, syncSchedulerThreads
-
Constructor Summary
ConstructorsConstructorDescriptionFullModelSyncTask
(io.reactivex.rxjava3.core.Observable<Model> domainRecords, Collection<ApiItem> apiItems) -
Method Summary
Methods inherited from class com.morpheusdata.core.util.SyncTask
addMatchFunction, observe, onAdd, onDelete, onError, onUpdate, setBufferSize, start, startAsync, withBufferSize, withLoadObjectDetails, withLoadObjectDetailsFromFinder
-
Constructor Details
-
FullModelSyncTask
public FullModelSyncTask(io.reactivex.rxjava3.core.Observable<Model> domainRecords, Collection<ApiItem> apiItems)
-