Interface MorpheusDataService<M extends MorpheusModel,I extends MorpheusModel>
- Type Parameters:
M
- TheMorpheusModel
class type for this service to query against
- All Superinterfaces:
MorpheusDataQueryService<M>
- All Known Subinterfaces:
MorpheusAccountCertificateService
,MorpheusAccountCredentialService
,MorpheusAccountCredentialTypeService
,MorpheusAccountDiscoveryService
,MorpheusAccountIntegrationService
,MorpheusAccountInventoryService
,MorpheusAccountInvoiceItemService
,MorpheusAccountInvoiceService
,MorpheusAccountPriceService
,MorpheusAccountPriceSetService
,MorpheusAccountResourceService
,MorpheusAccountResourceTypeService
,MorpheusApplianceService
,MorpheusAppService
,MorpheusBackupJobService
,MorpheusBackupProviderService
,MorpheusBackupProviderTypeService
,MorpheusBackupRepositoryService
,MorpheusBackupRestoreService
,MorpheusBackupResultService
,MorpheusBackupService
,MorpheusBackupTypeService
,MorpheusCloudFolderService
,MorpheusCloudPoolService
,MorpheusCloudRegionService
,MorpheusCloudService
,MorpheusCloudTypeService
,MorpheusCodeRepositoryService
,MorpheusCodeRepositoryTraitService
,MorpheusComputePortService
,MorpheusComputeServerAccessService
,MorpheusComputeServerInterfaceService
,MorpheusComputeServerService
,MorpheusComputeSiteService
,MorpheusComputeTypeSetService
,MorpheusContainerTypeService
,MorpheusDashboardService
,MorpheusDatastoreService
,MorpheusEnvironmentVariableTypeService
,MorpheusExecuteScheduleService
,MorpheusExecuteScheduleTypeService
,MorpheusInstanceScaleService
,MorpheusInstanceScaleTypeService
,MorpheusInstanceService
,MorpheusInstanceThresholdService
,MorpheusInstanceTypeLayoutService
,MorpheusInstanceTypeLayoutService
,MorpheusInstanceTypeService
,MorpheusKeyPairService
,MorpheusLoadBalancerInstanceService
,MorpheusLoadBalancerMonitorService
,MorpheusLoadBalancerNodeService
,MorpheusLoadBalancerPolicyService
,MorpheusLoadBalancerPoolService
,MorpheusLoadBalancerProfileService
,MorpheusLoadBalancerScriptService
,MorpheusLoadBalancerService
,MorpheusLoadBalancerTypeService
,MorpheusMetadataTagService
,MorpheusMetadataTagTypeService
,MorpheusNetworkDomainRecordService
,MorpheusNetworkDomainService
,MorpheusNetworkPoolIpService
,MorpheusNetworkPoolRangeService
,MorpheusNetworkPoolService
,MorpheusNetworkProxyService
,MorpheusNetworkRouterService
,MorpheusNetworkRouteService
,MorpheusNetworkRouteTableService
,MorpheusNetworkServerService
,MorpheusNetworkService
,MorpheusNetworkSubnetService
,MorpheusNetworkTypeService
,MorpheusOperationDataService
,MorpheusOperationNotificationService
,MorpheusOptionTypeService
,MorpheusOsTypeService
,MorpheusPermissionService
,MorpheusPolicyService
,MorpheusPolicyTypeService
,MorpheusPricePlanPriceSetService
,MorpheusPricePlanService
,MorpheusProcessService
,MorpheusReferenceDataService
,MorpheusReplicationGroupService
,MorpheusReplicationService
,MorpheusReplicationSiteService
,MorpheusReplicationTypeService
,MorpheusResourcePermissionService
,MorpheusResourceSpecService
,MorpheusResourceSpecTemplateService
,MorpheusSecurityGroupLocationService
,MorpheusSecurityGroupRuleApplicationService
,MorpheusSecurityGroupRuleDestinationService
,MorpheusSecurityGroupRuleLocationService
,MorpheusSecurityGroupRuleProfileService
,MorpheusSecurityGroupRuleScopeService
,MorpheusSecurityGroupRuleService
,MorpheusSecurityGroupRuleSourceService
,MorpheusSecurityGroupService
,MorpheusServicePlanPriceSetService
,MorpheusServicePlanService
,MorpheusSettingService
,MorpheusSettingTypeService
,MorpheusSnapshotService
,MorpheusStorageBucketService
,MorpheusStorageControllerService
,MorpheusStorageControllerTypeService
,MorpheusStorageServerService
,MorpheusStorageVolumeService
,MorpheusStorageVolumeTypeService
,MorpheusTaskService
,MorpheusTaskSetService
,MorpheusUserService
,MorpheusVirtualImageLocationService
,MorpheusVirtualImageService
,MorpheusVirtualImageTypeService
,MorpheusWikiPageService
,MorpheusWorkloadActionService
,MorpheusWorkloadScriptService
,MorpheusWorkloadScriptService
,MorpheusWorkloadService
,MorpheusWorkloadStateService
,MorpheusWorkloadTemplateService
,MorpheusWorkloadTemplateService
,MorpheusWorkloadTypeConfigService
,MorpheusWorkloadTypeLogService
,MorpheusWorkloadTypeMountService
,MorpheusWorkloadTypePortService
,MorpheusWorkloadTypeService
,MorpheusWorkloadTypeSetService
,MorpheusWorkspaceService
DataQuery
object. There are methods that can be implemented
to provide both MorpheusModel
related objects as well as Map objects for use in
DatasetProvider
use cases (dropdowns and type-ahead components in UI option types).
An example interface that leverages this one is the MorpheusUserService
Example:
public interface MorpheusUserService extends MorpheusDataService<User>, MorpheusIdentityService<UserIdentity> {
}
Often times this interface is used in conjunction with the MorpheusIdentityService
for providing
an efficient way to sync objects via the MorpheusIdentityService.listIdentityProjections(DataQuery)
method.
Another implementation also exists for synchronous non rxjava querying of the objects called the
MorpheusSynchronousDataService
. Typically, both should be implemented for use within the plugin api.- Since:
- 0.15.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single<BulkCreateResult<M>>
bulkCreate
(List<M> items) Persists a collection of new model objects in a batch to the Morpheus database.io.reactivex.rxjava3.core.Single<BulkRemoveResult<I>>
bulkRemove
(List<I> items) Removes a collection of previously created model objects in a batch to the Morpheus database.io.reactivex.rxjava3.core.Single<BulkSaveResult<M>>
Persists a collection of previously created model objects in a batch to the Morpheus database.default io.reactivex.rxjava3.core.Single<Boolean>
Deprecated.io.reactivex.rxjava3.core.Single<M>
Persists a new model object into the Morpheus database.io.reactivex.rxjava3.core.Single<Boolean>
Removes a persistedMorpheusModel
object from the database.default io.reactivex.rxjava3.core.Single<Boolean>
Deprecated.default io.reactivex.rxjava3.core.Single<Boolean>
Deprecated.io.reactivex.rxjava3.core.Single<M>
Persists any changes to an existingMorpheusModel
object.Methods inherited from interface com.morpheusdata.core.MorpheusDataQueryService
count, find, get, list, list, listById, listOptions, listOptions, search
-
Method Details
-
create
Persists a new model object into the Morpheus database. It is important to note that when persisting more than a single object of the same type, a batch create method also exists. This is useful in batch syncing for efficient operation.Note: this is a reactive method and will not perform any operation until subscribed or blockingGet() is called on it.
- Parameters:
item
- theMorpheusModel
object we want to persist into the database.- Returns:
- a Single subscribable representation of the saved object including its new persisted id.
-
bulkCreate
Persists a collection of new model objects in a batch to the Morpheus database. This is very useful for bulk sync operations. For optimal efficiency 50-100 objects at a time is best. More than this will throw a warning.Note: this is a reactive method and will not perform any operation until subscribed or blockingGet() is called on it.
- Parameters:
items
- a collection ofMorpheusModel
objects we want to persist into the database. These are supposed to be non previously saved objects.- Returns:
- a BulkCreateResult containing information on the items that were successfully persisted as well as the ones that failed.
-
create
Deprecated.Persists a collection of new model objects in a batch to the Morpheus database. This is very useful for bulk sync operations. For optimal efficiency 50-100 objects at a time is best. More than this will throw a warning.Note: this is a reactive method and will not perform any operation until subscribed or blockingGet() is called on it.
- Parameters:
items
- a collection ofMorpheusModel
objects we want to persist into the database. These are supposed to be non previously saved objects.- Returns:
- a Boolean flag that is only true if all objects successfully saved
- See Also:
-
save
Persists any changes to an existingMorpheusModel
object. These objects should already have an Identifier property populated so that it can update it in the database (typically the id property).Note: this is a reactive method and will not perform any operation until subscribed or blockingGet() is called on it.
- Parameters:
item
- the previously existingMorpheusModel
object we want to persist into the database.- Returns:
- a Single subscribable representation of the saved object.
-
bulkSave
Persists a collection of previously created model objects in a batch to the Morpheus database. This is very useful for bulk sync operations. For optimal efficiency 50-100 objects at a time is best. More than this will throw a warning.Note: this is a reactive method and will not perform any operation until subscribed or blockingGet() is called on it.
- Parameters:
items
- a collection of previously createdMorpheusModel
objects we want to persist into the database.- Returns:
- a BulkUpdateResult containing information on the items that were successfully persisted as well as the ones that failed.
-
save
Deprecated.Persists a collection of previously created model objects in a batch to the Morpheus database. This is very useful for bulk sync operations. For optimal efficiency 50-100 objects at a time is best. More than this will throw a warning.Note: this is a reactive method and will not perform any operation until subscribed or blockingGet() is called on it.
- Parameters:
items
- a collection of previously createdMorpheusModel
objects we want to persist into the database.- Returns:
- a Boolean flag stating the full success or not of the save operation
- See Also:
-
remove
Removes a persistedMorpheusModel
object from the database.Note: this is a reactive method and will not perform any operation until subscribed or blockingGet() is called on it.
- Parameters:
item
- the previously existingMorpheusModel
object to be removed from the database.- Returns:
- a single Boolean object that will confirm the success or failure of the removal
-
bulkRemove
Removes a collection of previously created model objects in a batch to the Morpheus database. This is very useful for bulk sync operations. For optimal efficiency 50-100 objects at a time is best. More than this will throw a warning.Note: this is a reactive method and will not perform any operation until subscribed or blockingGet() is called on it.
- Parameters:
items
- a collection of previously createdMorpheusModel
objects we want to remove from the database.- Returns:
- a BulkRemoveResult containing information on the items that were failed to be removed.
-
remove
Deprecated.Removes a collection of previously created model objects in a batch to the Morpheus database. This is very useful for bulk sync operations. For optimal efficiency 50-100 objects at a time is best. More than this will throw a warning.Note: this is a reactive method and will not perform any operation until subscribed or blockingGet() is called on it.
- Parameters:
items
- a collection of previously createdMorpheusModel
objects we want to remove from the database.- Returns:
- a Boolean flag containing if it was fully successful or not.
- See Also:
-