public interface AsyncDatastore extends DatastoreOperations<CompletionStage<Datastore.OperationResult>,CompletionStage<PropertyBox>,AsyncBulkInsert,AsyncBulkUpdate,AsyncBulkDelete,AsyncQuery>, ConfigurableDatastore, Serializable
DatastoreOperations
API, which can be used to execute the Datastore operations and obtain the
the results asynchronously, using CompletionStage
as operation return type.
Extends DatastoreCommodityHandler
to support DatastoreCommodity
creation by type.
Extends ExpressionResolver.ExpressionResolverSupport
to allow ExpressionResolver
s registration, which can be used to
extend and/or customize the datastore operations.
Datastore
DatastoreOperations.Builder<D extends DatastoreOperations,B extends DatastoreOperations.Builder<D,B>>, DatastoreOperations.WriteOption
Modifier and Type | Method and Description |
---|---|
default AsyncBulkDelete |
bulkDelete(DataTarget<?> target,
DatastoreOperations.WriteOption... options)
Create a
BulkDeleteOperation actuator, which can be used to configure and execute a bulk
DELETE operation. |
default AsyncBulkInsert |
bulkInsert(DataTarget<?> target,
PropertySet<?> propertySet,
DatastoreOperations.WriteOption... options)
Create a
BulkInsertOperation actuator, which can be used to configure and execute a bulk
INSERT operation. |
default AsyncBulkUpdate |
bulkUpdate(DataTarget<?> target,
DatastoreOperations.WriteOption... options)
Create a
BulkUpdateOperation actuator, which can be used to configure and execute a bulk
UPDATE operation. |
default CompletionStage<Datastore.OperationResult> |
delete(DataTarget<?> target,
PropertyBox propertyBox,
DatastoreOperations.WriteOption... options)
Remove a
PropertyBox from the data store, using given target to denote the data store
persistent entity from which the data has to be deleted. |
default CompletionStage<Datastore.OperationResult> |
insert(DataTarget<?> target,
PropertyBox propertyBox,
DatastoreOperations.WriteOption... options)
Insert a
PropertyBox in the data store, using given target to denote the data store
persistent entity into which the data has to be inserted. |
default Optional<AsyncTransactional> |
isTransactional()
Check if this Datastore is
AsyncTransactional , i.e. supports execution of transactional operations. |
default AsyncQuery |
query()
Create a
QueryBuilder actuator, which can be used to configure and execute a query on the data managed by
this Datastore. |
default AsyncQuery |
query(DataTarget<?> target)
Create an
AsyncQuery commodity, setting given target as query data target. |
default CompletionStage<PropertyBox> |
refresh(DataTarget<?> target,
PropertyBox propertyBox)
Refresh a
PropertyBox , updating all its model properties to current value in data store and using given
target to denote the data store persistent entity to use. |
default AsyncTransactional |
requireTransactional()
Requires this Datastore to be
AsyncTransactional , i.e. to support execution of transactional operations,
throwing an IllegalStateException if this Datastore is not transactional. |
default CompletionStage<Datastore.OperationResult> |
save(DataTarget<?> target,
PropertyBox propertyBox,
DatastoreOperations.WriteOption... options)
Save a
PropertyBox in the data store, using given target to denote the data store persistent
entity into which the data has to be saved. |
default CompletionStage<Datastore.OperationResult> |
update(DataTarget<?> target,
PropertyBox propertyBox,
DatastoreOperations.WriteOption... options)
Update a
PropertyBox in the data store, using given target to denote the data store
persistent entity into which the data has to be updated. |
create, getAvailableCommodities, hasCommodity
addExpressionResolver, addExpressionResolvers, removeExpressionResolver
getDataContextId
default CompletionStage<PropertyBox> refresh(DataTarget<?> target, PropertyBox propertyBox)
DatastoreOperations
PropertyBox
, updating all its model properties to current value in data store and using given
target
to denote the data store persistent entity to use.refresh
in interface DatastoreOperations<CompletionStage<Datastore.OperationResult>,CompletionStage<PropertyBox>,AsyncBulkInsert,AsyncBulkUpdate,AsyncBulkDelete,AsyncQuery>
target
- DataTarget
to declare the data store persistent entity from which data has to be refreshedpropertyBox
- The data to refresh, represented using a PropertyBox
(not null)default CompletionStage<Datastore.OperationResult> insert(DataTarget<?> target, PropertyBox propertyBox, DatastoreOperations.WriteOption... options)
DatastoreOperations
PropertyBox
in the data store, using given target
to denote the data store
persistent entity into which the data has to be inserted.insert
in interface DatastoreOperations<CompletionStage<Datastore.OperationResult>,CompletionStage<PropertyBox>,AsyncBulkInsert,AsyncBulkUpdate,AsyncBulkDelete,AsyncQuery>
target
- DataTarget
to declare the data store persistent entity into which the data has to be
inserted (not null)propertyBox
- The data to insert, represented using a PropertyBox
(not null)options
- Optional write options. The write options are specific for each concrete
DatastoreOperations
implementation.default CompletionStage<Datastore.OperationResult> update(DataTarget<?> target, PropertyBox propertyBox, DatastoreOperations.WriteOption... options)
DatastoreOperations
PropertyBox
in the data store, using given target
to denote the data store
persistent entity into which the data has to be updated.update
in interface DatastoreOperations<CompletionStage<Datastore.OperationResult>,CompletionStage<PropertyBox>,AsyncBulkInsert,AsyncBulkUpdate,AsyncBulkDelete,AsyncQuery>
target
- DataTarget
to declare the data store persistent entity into which the data has to be
updated (not null)propertyBox
- The data to update, represented using a PropertyBox
(not null)options
- Optional write options. The write options are specific for each concrete
DatastoreOperations
implementation.default CompletionStage<Datastore.OperationResult> save(DataTarget<?> target, PropertyBox propertyBox, DatastoreOperations.WriteOption... options)
DatastoreOperations
PropertyBox
in the data store, using given target
to denote the data store persistent
entity into which the data has to be saved. The save operation semantics is: insert data if not exists,
update it otherwise.save
in interface DatastoreOperations<CompletionStage<Datastore.OperationResult>,CompletionStage<PropertyBox>,AsyncBulkInsert,AsyncBulkUpdate,AsyncBulkDelete,AsyncQuery>
target
- DataTarget
to declare the data store persistent entity into which the data has to be saved
(not null)propertyBox
- The data to save, represented using a PropertyBox
(not null)options
- Optional write options. The write options are specific for each concrete
DatastoreOperations
implementation.default CompletionStage<Datastore.OperationResult> delete(DataTarget<?> target, PropertyBox propertyBox, DatastoreOperations.WriteOption... options)
DatastoreOperations
PropertyBox
from the data store, using given target
to denote the data store
persistent entity from which the data has to be deleted.delete
in interface DatastoreOperations<CompletionStage<Datastore.OperationResult>,CompletionStage<PropertyBox>,AsyncBulkInsert,AsyncBulkUpdate,AsyncBulkDelete,AsyncQuery>
target
- DataTarget
to declare the data store persistent entity from which the data has to be
deleted (not null)propertyBox
- The data to delete, represented using a PropertyBox
(not null)options
- Optional write options. The write options are specific for each concrete
DatastoreOperations
implementation.default AsyncBulkInsert bulkInsert(DataTarget<?> target, PropertySet<?> propertySet, DatastoreOperations.WriteOption... options)
DatastoreOperations
BulkInsertOperation
actuator, which can be used to configure and execute a bulk
INSERT
operation.bulkInsert
in interface DatastoreOperations<CompletionStage<Datastore.OperationResult>,CompletionStage<PropertyBox>,AsyncBulkInsert,AsyncBulkUpdate,AsyncBulkDelete,AsyncQuery>
target
- DataTarget
to identify data entity to insert (not null)propertySet
- The property set to use to perform insert operations. Only the properties contained in given
property set will be taken into account to insert the PropertyBox
valuesoptions
- Optional write options. The write options are specific for each concrete
DatastoreOperations
implementation.INSERT
operationdefault AsyncBulkUpdate bulkUpdate(DataTarget<?> target, DatastoreOperations.WriteOption... options)
DatastoreOperations
BulkUpdateOperation
actuator, which can be used to configure and execute a bulk
UPDATE
operation.bulkUpdate
in interface DatastoreOperations<CompletionStage<Datastore.OperationResult>,CompletionStage<PropertyBox>,AsyncBulkInsert,AsyncBulkUpdate,AsyncBulkDelete,AsyncQuery>
target
- DataTarget
to identify data entity to update (not null)options
- Optional write options. The write options are specific for each concrete
DatastoreOperations
implementation.UPDATE
operationdefault AsyncBulkDelete bulkDelete(DataTarget<?> target, DatastoreOperations.WriteOption... options)
DatastoreOperations
BulkDeleteOperation
actuator, which can be used to configure and execute a bulk
DELETE
operation.bulkDelete
in interface DatastoreOperations<CompletionStage<Datastore.OperationResult>,CompletionStage<PropertyBox>,AsyncBulkInsert,AsyncBulkUpdate,AsyncBulkDelete,AsyncQuery>
target
- DataTarget
to identify data entity to delete (not null)options
- Optional write options. The write options are specific for each concrete
DatastoreOperations
implementation.DELETE
operationdefault AsyncQuery query()
DatastoreOperations
QueryBuilder
actuator, which can be used to configure and execute a query on the data managed by
this Datastore.query
in interface DatastoreOperations<CompletionStage<Datastore.OperationResult>,CompletionStage<PropertyBox>,AsyncBulkInsert,AsyncBulkUpdate,AsyncBulkDelete,AsyncQuery>
default AsyncQuery query(DataTarget<?> target)
AsyncQuery
commodity, setting given target
as query data target.target
- Query data target (not null)AsyncQuery
instance, which can be used to configure and execute an asynchronous querydefault Optional<AsyncTransactional> isTransactional()
AsyncTransactional
, i.e. supports execution of transactional operations.AsyncTransactional
, or an empty
Optional otherwisedefault AsyncTransactional requireTransactional()
AsyncTransactional
, i.e. to support execution of transactional operations,
throwing an IllegalStateException
if this Datastore is not transactional.AsyncTransactional
IllegalStateException
- If this Datastore is not transactionalCopyright © 2019 The Holon Platform. All rights reserved.