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 Collection
Model - The Model Class that the Projection Class is a subset of. This is the Class that needs to be updated with changes

public class FullModelSyncTask<ApiItem,Model> extends SyncTask<Model,ApiItem,Model>
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.
  • Constructor Details

    • FullModelSyncTask

      public FullModelSyncTask(io.reactivex.rxjava3.core.Observable<Model> domainRecords, Collection<ApiItem> apiItems)