Interface MorpheusSynchronousDataService<M extends MorpheusModel,I extends MorpheusModel>
- Type Parameters:
M
- TheMorpheusModel
class type for this service to query against
- All Known Subinterfaces:
MorpheusSynchronousAccountCertificateService
,MorpheusSynchronousAccountCredentialService
,MorpheusSynchronousAccountCredentialTypeService
,MorpheusSynchronousAccountDiscoveryService
,MorpheusSynchronousAccountIntegrationService
,MorpheusSynchronousAccountInventoryService
,MorpheusSynchronousAccountInvoiceItemService
,MorpheusSynchronousAccountInvoiceService
,MorpheusSynchronousAccountPriceService
,MorpheusSynchronousAccountPriceSetService
,MorpheusSynchronousAccountResourceService
,MorpheusSynchronousAccountResourceTypeService
,MorpheusSynchronousApplianceService
,MorpheusSynchronousAppService
,MorpheusSynchronousBackupJobService
,MorpheusSynchronousBackupProviderService
,MorpheusSynchronousBackupProviderTypeService
,MorpheusSynchronousBackupRepositoryService
,MorpheusSynchronousBackupRestoreService
,MorpheusSynchronousBackupResultService
,MorpheusSynchronousBackupService
,MorpheusSynchronousBackupTypeService
,MorpheusSynchronousCloudFolderService
,MorpheusSynchronousCloudPoolService
,MorpheusSynchronousCloudRegionService
,MorpheusSynchronousCloudService
,MorpheusSynchronousCloudTypeService
,MorpheusSynchronousCodeRepositoryService
,MorpheusSynchronousComputePortService
,MorpheusSynchronousComputeServerAccessService
,MorpheusSynchronousComputeServerInterfaceService
,MorpheusSynchronousComputeServerService
,MorpheusSynchronousComputeSiteService
,MorpheusSynchronousComputeTypeSetService
,MorpheusSynchronousContainerTypeService
,MorpheusSynchronousDashboardService
,MorpheusSynchronousDatastoreService
,MorpheusSynchronousExecuteScheduleService
,MorpheusSynchronousExecuteScheduleTypeService
,MorpheusSynchronousInstanceService
,MorpheusSynchronousInstanceTypeLayoutService
,MorpheusSynchronousInstanceTypeService
,MorpheusSynchronousKeyPairService
,MorpheusSynchronousLoadBalancerInstanceService
,MorpheusSynchronousLoadBalancerMonitorService
,MorpheusSynchronousLoadBalancerNodeService
,MorpheusSynchronousLoadBalancerPolicyService
,MorpheusSynchronousLoadBalancerPoolService
,MorpheusSynchronousLoadBalancerProfileService
,MorpheusSynchronousLoadBalancerScriptService
,MorpheusSynchronousLoadBalancerTypeService
,MorpheusSynchronousMetadataTagService
,MorpheusSynchronousMetadataTagTypeService
,MorpheusSynchronousNetworkDomainRecordService
,MorpheusSynchronousNetworkDomainService
,MorpheusSynchronousNetworkLoadBalancerService
,MorpheusSynchronousNetworkPoolIpService
,MorpheusSynchronousNetworkPoolRangeService
,MorpheusSynchronousNetworkPoolService
,MorpheusSynchronousNetworkProxyService
,MorpheusSynchronousNetworkRouterService
,MorpheusSynchronousNetworkRouteService
,MorpheusSynchronousNetworkRouteTableService
,MorpheusSynchronousNetworkService
,MorpheusSynchronousNetworkSubnetService
,MorpheusSynchronousNetworkTypeService
,MorpheusSynchronousOperationDataService
,MorpheusSynchronousOperationNotificationService
,MorpheusSynchronousOsTypeService
,MorpheusSynchronousPermissionService
,MorpheusSynchronousPolicyService
,MorpheusSynchronousPricePlanPriceSetService
,MorpheusSynchronousPricePlanService
,MorpheusSynchronousReferenceDataService
,MorpheusSynchronousReplicationGroupService
,MorpheusSynchronousReplicationService
,MorpheusSynchronousReplicationSiteService
,MorpheusSynchronousReplicationTypeService
,MorpheusSynchronousResourcePermissionService
,MorpheusSynchronousResourceSpecService
,MorpheusSynchronousSecurityGroupLocationService
,MorpheusSynchronousSecurityGroupRuleApplicationService
,MorpheusSynchronousSecurityGroupRuleDestinationService
,MorpheusSynchronousSecurityGroupRuleLocationService
,MorpheusSynchronousSecurityGroupRuleProfileService
,MorpheusSynchronousSecurityGroupRuleScopeService
,MorpheusSynchronousSecurityGroupRuleService
,MorpheusSynchronousSecurityGroupRuleSourceService
,MorpheusSynchronousSecurityGroupService
,MorpheusSynchronousServicePlanPriceSetService
,MorpheusSynchronousServicePlanService
,MorpheusSynchronousSettingService
,MorpheusSynchronousSettingTypeService
,MorpheusSynchronousSnapshotService
,MorpheusSynchronousStorageBucketService
,MorpheusSynchronousStorageControllerService
,MorpheusSynchronousStorageControllerTypeService
,MorpheusSynchronousStorageServerService
,MorpheusSynchronousStorageVolumeService
,MorpheusSynchronousStorageVolumeTypeService
,MorpheusSynchronousTaskService
,MorpheusSynchronousUserService
,MorpheusSynchronousVirtualImageLocationService
,MorpheusSynchronousVirtualImageService
,MorpheusSynchronousVirtualImageTypeService
,MorpheusSynchronousWikiPageService
,MorpheusSynchronousWorkloadService
,MorpheusSynchronousWorkloadStateService
,MorpheusSynchronousWorkloadTypeService
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 (dropdown and type-ahead components in UI option types).
An example interface that leverages this one is the MorpheusSynchronousUserService
Example:
public interface MorpheusSynchronousUserService extends MorpheusSynchronousDataService<User>, MorpheusSynchronousIdentityService<UserIdentity> {
}
Often times this interface is used in conjunction with the MorpheusSynchronousIdentityService
for providing
an efficient way to sync objects via the MorpheusSynchronousIdentityService.listIdentityProjections(DataQuery)
method.
Another implementation also exists for asynchronous rxjava querying of the objects called the
MorpheusDataService
. Typically, both should be implemented for use within the plugin api.
It is recommended that the Asynchronous version of the service class is used where possible as it is the most efficient.
An example of where this may be more useful would be in UI rendering methods which are already blocking as is.
Note: This object requires its asynchronous counterpart be implemented as it acts as a simple delegate to that service.
- Since:
- 0.15.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault BulkCreateResult<M>
bulkCreate
(List<M> items) Persists a collection of new model objects in a batch to the Morpheus database.default BulkRemoveResult<I>
bulkRemove
(List<I> items) Removes a collection of previously created model objects in a batch to the Morpheus database.default BulkSaveResult<M>
Persists a collection of previously created model objects in a batch to the Morpheus database.default Long
Performs a query operation based on the filters set in theDataQuery
object passed and returns a simple total count of the results.default Boolean
Deprecated.default M
Persists a new model object into the Morpheus database.default M
Performs a query operation on the database returning the first result as aMorpheusModel
object.default M
Fetches a singleMorpheusModel
by its Identifier (id) field.Reference to the asynchronous data serviceMorpheusDataService
implementation as this interface acts as a simple delegate blocking wrapper for it.Performs a query operation on the database returning the results asMorpheusModel
objects.Fetches a stream ofMorpheusModel
objects based on a collection of Identifiers (id).listOptions
(DataQuery query) Performs a query operation on the database returning the results as Map objects typically containing keys of (name,value) for use in dropdown or type-ahead components within the UI.default Boolean
Removes a persistedMorpheusModel
object from the database.default Boolean
Deprecated.default Boolean
Deprecated.default M
Persists any changes to an existingMorpheusModel
object.default DataQueryResult
Performs a query operation on the database just likeMorpheusDataQueryService.list(DataQuery)
with a query, but the result is no longer a stream of individualMorpheusModel
.
-
Method Details
-
getDataService
MorpheusDataService<M,I> getDataService()Reference to the asynchronous data serviceMorpheusDataService
implementation as this interface acts as a simple delegate blocking wrapper for it.- Returns:
- the asynchronous data service to be used by the default method implementations in this interface.
-
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.- Parameters:
item
- theMorpheusModel
object we want to persist into the database.- Returns:
- a
MorpheusModel
saved object including its new persisted id.
-
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.- 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:
-
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.- 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.
-
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).- Parameters:
item
- the previously existingMorpheusModel
object we want to persist into the database.- Returns:
- a
MorpheusModel
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.- Parameters:
items
- a collection of previously createdMorpheusModel
objects we want to persist into the database.- Returns:
- a BulkSaveResult 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.- 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.- Parameters:
item
- the previously existingMorpheusModel
object to be removed from the database.- Returns:
- a Boolean object that will confirm the success or failure of the removal
-
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:
-
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.- 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.
-
count
-
get
Fetches a singleMorpheusModel
by its Identifier (id) field. For more advanced single object fetches please refer toMorpheusDataQueryService.find(DataQuery)
.Note: This method does not factor in any sort of access/security control and should not be used in areas where this is required.
- Parameters:
id
- the database identifier to fetch an object by.- Returns:
- a representation of a
MorpheusModel
depending on if the object was found or not.
-
listById
Fetches a stream ofMorpheusModel
objects based on a collection of Identifiers (id). This is often used in conjunction with theMorpheusSynchronousIdentityService.listIdentityProjections(DataQuery)
and theSyncTask
for efficiently only fetching batches of objects we want to perform update operations on.Note: This method does not factor in any sort of access/security control and should not be used in areas where this is required.
- Parameters:
ids
- a collection of Identifiers (ids) to fetch the objects by.- Returns:
- A List of
MorpheusModel
objects based on the ids passed in
-
list
Performs a query operation on the database returning the results asMorpheusModel
objects. These queries can be scoped to anAccountIdentity
orUserIdentity
as well as various filters on arbitrary fields in the database.Note: For more information on how to query please refer to the documentation for the
DataQuery
class.- Parameters:
query
- An instance of theDataQuery
object used for filtering results. This should often include an account / user scope for security but does not always need to if being used for sync or multi-tenant reporting.- Returns:
- A List of
MorpheusModel
objects based on the passed in query.
-
listOptions
Performs a query operation on the database returning the results as Map objects typically containing keys of (name,value) for use in dropdown or type-ahead components within the UI. This would typically be paired with aDatasetProvider
. Queries can be scoped to anAccountIdentity
orUserIdentity
as well as various filters on arbitrary fields in the database.Note: For more information on how to query please refer to the documentation for the
DataQuery
class.- Parameters:
query
- An instance of theDataQuery
object used for filtering results. This should often include an account / user scope for security but does not always need to if being used for sync or multi-tenant reporting.- Returns:
- A List of Map objects based on the passed in query containing name,value pairs.
-
find
Performs a query operation on the database returning the first result as aMorpheusModel
object. These queries can be scoped to anAccountIdentity
orUserIdentity
as well as various filters on arbitrary fields in the database.Note: For more information on how to query please refer to the documentation for the
DataQuery
class.- Parameters:
query
- An instance of theDataQuery
object used for filtering results. This should often include an account / user scope for security but does not always need to if being used for sync or multi-tenant reporting.- Returns:
- A
MorpheusModel
object based on the passed in query.
-
search
Performs a query operation on the database just likeMorpheusDataQueryService.list(DataQuery)
with a query, but the result is no longer a stream of individualMorpheusModel
.Note: This is a reactive method and will not perform any operation until subscribed or blockingGet() is called on it.
Note: For more information on how to query please refer to the documentation for the
DataQuery
class.- Parameters:
query
- An instance of theDataQuery
object used for filtering results. This should often include an account / user scope for security but does not always need to if being used for sync or multi-tenant reporting.- Returns:
- a Single DataQueryResult representing a collection of result objects along with the metadata about the result. This could be paging data for example.
-