Interface Storage<ModelOutput_>
- Type Parameters:
ModelOutput_- representing a solved data set
- All Known Implementing Classes:
InMemoryStorage
public interface Storage<ModelOutput_>
Storage responsible for persisting
ModelOutput_ and its sub resources into a data store-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionclazz()default voidclean()Cleans up the storage starting in the default location in the underlying data store.voidclean(StorageAddress options) Cleans up the storage starting in the location defined byStorageOptions.voidcomplete(StorageAddress options, String id, ModelOutput_ dataset) Final update of the data set upon completion of solving into location defined byStorageOptionsdefault voidcomplete(String id, ModelOutput_ dataset) Final update of the data set upon completion of solving into default location in the underlying data storevoidcreate(String location, StorageConfiguration configuration) Create required data store specific settings to be able to storage data in given location.voiddelete(StorageAddress options, String id) Deletes data set with given identifier from location defined byStorageOptionsdefault voidDeletes data set with given identifier from the default location in the underlying data storevoidDestroy data store specific settings, this will also remove all data stored under given locationbooleanexists(StorageAddress options, String id) Checks if data set with given identifier exists in the location defined byStorageOptionsdefault booleanChecks if data set with given identifier exists in the default location in the underlying data storebooleanexistsSubModel(StorageAddress options, String id, SubModelKind kind) Checks if data set with given identifier exists in the location defined byStorageOptionsdefault booleanexistsSubModel(String id, SubModelKind kind) Checks if data set with given identifier exists in the default location in the underlying data storeget(StorageAddress options, String id) Retrieves data set by its unique identifier from location defined byStorageOptionsdefault ModelOutput_Retrieves data set by its unique identifier from the default location in the underlying data store<T> TgetSubModel(StorageAddress options, String id, SubModelKind config, com.fasterxml.jackson.core.type.TypeReference<T> configurationClass) <T> TgetSubModel(StorageAddress options, String id, SubModelKind subModelKind, Class<T> clazz) Retrieves sub resource associated with data set with given identifier in the location defined byStorageOptionsdefault <T> TgetSubModel(String id, SubModelKind config, com.fasterxml.jackson.core.type.TypeReference<T> configurationClass) default <T> TgetSubModel(String id, SubModelKind subModelKind, Class<T> clazz) Retrieves sub resource associated with data set with given identifier in the default location in the underlying data storevoidgetSubModelStream(StorageAddress options, String id, SubModelKind subModelKind, OutputStream output) Retrieves sub resource associated with data set with given identifier in the default location in the underlying data store as a stream of datadefault voidgetSubModelStream(String id, SubModelKind subModelKind, OutputStream output) Retrieves sub resource associated with data set with given identifier in the default location in the underlying data store as a stream of datalist(int pageNumber, int pageSize) Lists data sets (as statuses) stored in the default location of the underlying data storelist(StorageAddress options, int pageNumber, int pageSize) Lists data sets (as statuses) stored in the location defined byStorageOptionsvoidreconfigure(String location, StorageConfiguration configuration) Reconfigures already existing storage based on provided configurationvoidrestore(StorageAddress options, String id) Restores previously deleted data set with given identifier from location defined byStorageOptionsdefault voidRestores previously deleted set with given identifier from the default location in the underlying data storevoidstore(StorageAddress options, String id, ModelOutput_ dataset) Stores given data set into location defined byStorageOptionsdefault voidstore(String id, ModelOutput_ dataset) Stores given data set into default location in the underlying data storevoidstoreSubModel(StorageAddress options, String id, SubModelKind subModelKind, Object subModel) Stores sub resource associated with given data set given by identifier in the location defined byStorageOptionsdefault voidstoreSubModel(String id, SubModelKind subModelKind, Object subModel) Stores sub resource associated with given data set given by identifier in the default location of the underlying data storevoidupdate(StorageAddress options, String id, ModelOutput_ dataset) Updates existing data set in the storage into location defined byStorageOptionsdefault voidupdate(String id, ModelOutput_ dataset) Updates existing data set in the storage under default location in the underlying data storevoidupdateSubModel(StorageAddress options, String id, SubModelKind subModelKind, Object subModel) Stores sub resource associated with given data set given by identifier in the location defined byStorageOptionsdefault voidupdateSubModel(String id, SubModelKind subModelKind, Object subModel) Stores sub resource associated with given data set given by identifier in the default location of the underlying data store
-
Field Details
-
DATASETS_PREFIX
- See Also:
-
RUNS_PREFIX
- See Also:
-
-
Method Details
-
store
Stores given data set into default location in the underlying data store- Parameters:
id- unique identifier of the data setdataset- data set to be stored
-
store
Stores given data set into location defined byStorageOptions- Parameters:
options- storage option to apply during the operationid- unique identifier of the data setdataset- data set to be stored
-
update
Updates existing data set in the storage under default location in the underlying data store- Parameters:
id- unique identifier of the data setdataset- data set to be stored
-
update
Updates existing data set in the storage into location defined byStorageOptions- Parameters:
options- storage option to apply during the operationid- unique identifier of the data setdataset- data set to be stored
-
complete
Final update of the data set upon completion of solving into default location in the underlying data store- Parameters:
id- unique identifier of the data setdataset- data set to be stored
-
complete
Final update of the data set upon completion of solving into location defined byStorageOptions- Parameters:
options- storage option to apply during the operationid- unique identifier of the data setdataset- data set to be stored
-
get
Retrieves data set by its unique identifier from the default location in the underlying data store- Parameters:
id- unique identifier of the data set- Returns:
- loaded data set if found
- Throws:
ItemNotFoundException- in case given data set does not exist
-
get
Retrieves data set by its unique identifier from location defined byStorageOptions- Parameters:
options- storage option to apply during the operationid- unique identifier of the data set- Returns:
- loaded data set if found
- Throws:
ItemNotFoundException- in case given data set does not exist
-
delete
Deletes data set with given identifier from the default location in the underlying data store- Parameters:
id- unique identifier of the data set
-
delete
Deletes data set with given identifier from location defined byStorageOptions- Parameters:
options- storage option to apply during the operationid- unique identifier of the data set
-
restore
Restores previously deleted set with given identifier from the default location in the underlying data store- Parameters:
id- unique identifier of the data set- Throws:
ItemNotFoundException- in case restore cannot be performed
-
restore
Restores previously deleted data set with given identifier from location defined byStorageOptions- Parameters:
options- storage option to apply during the operationid- unique identifier of the data set- Throws:
ItemNotFoundException- in case restore cannot be performed
-
exists
Checks if data set with given identifier exists in the default location in the underlying data store- Parameters:
id- unique identifier of the data set- Returns:
- true if exists false otherwise
-
existsSubModel
Checks if data set with given identifier exists in the location defined byStorageOptions- Parameters:
options- storage option to apply during the operationid- unique identifier of the data setkind- type of sub model- Returns:
- true if exists false otherwise
-
existsSubModel
Checks if data set with given identifier exists in the default location in the underlying data store- Parameters:
id- unique identifier of the data setkind- type of sub model- Returns:
- true if exists false otherwise
-
exists
Checks if data set with given identifier exists in the location defined byStorageOptions- Parameters:
options- storage option to apply during the operationid- unique identifier of the data set- Returns:
- true if exists false otherwise
-
list
Lists data sets (as statuses) stored in the default location of the underlying data store- Parameters:
pageNumber- number of page to return (0-based)pageSize- number of data sets to return per page- Returns:
- non null list of found data sets as statuses
-
list
Lists data sets (as statuses) stored in the location defined byStorageOptions- Parameters:
options- storage option to apply during the operationpageNumber- number of page to return (0-based)pageSize- number of data sets to return per page- Returns:
- non null list of found data sets as statuses
-
getSubModelStream
Retrieves sub resource associated with data set with given identifier in the default location in the underlying data store as a stream of data- Parameters:
id- unique identifier of the data setsubModelKind- kind of the sub resource e.g. waypointsoutput- output stream where data should be written
-
getSubModelStream
void getSubModelStream(StorageAddress options, String id, SubModelKind subModelKind, OutputStream output) Retrieves sub resource associated with data set with given identifier in the default location in the underlying data store as a stream of data- Parameters:
options- storage option to apply during the operationid- unique identifier of the data setsubModelKind- kind of the sub resource e.g. waypointsoutput- output stream where data should be written
-
getSubModel
Retrieves sub resource associated with data set with given identifier in the default location in the underlying data store- Type Parameters:
T- type representing the returned value- Parameters:
id- unique identifier of the data setsubModelKind- kind of the sub resource e.g. waypointsclazz- class that the sub resource should be unmarshalled to- Returns:
- loaded sub resource or null if no sub resource found
-
getSubModel
Retrieves sub resource associated with data set with given identifier in the location defined byStorageOptions- Type Parameters:
T- type representing the returned value- Parameters:
options- storage option to apply during the operationid- unique identifier of the data setsubModelKind- kind of the sub resource e.g. waypointsclazz- class that the sub resource should be unmarshalled- Returns:
- loaded sub resource or null if no sub resource found
-
getSubModel
default <T> T getSubModel(String id, SubModelKind config, com.fasterxml.jackson.core.type.TypeReference<T> configurationClass) -
getSubModel
<T> T getSubModel(StorageAddress options, String id, SubModelKind config, com.fasterxml.jackson.core.type.TypeReference<T> configurationClass) -
storeSubModel
Stores sub resource associated with given data set given by identifier in the default location of the underlying data store- Parameters:
id- unique identifier of the data setsubModelKind- kind of the sub resource e.g. waypointssubModel- the sub resource to be stored
-
storeSubModel
Stores sub resource associated with given data set given by identifier in the location defined byStorageOptions- Parameters:
options- storage option to apply during the operationid- unique identifier of the data setsubModelKind- kind of the sub resource e.g. waypointssubModel- the sub resource to be stored
-
updateSubModel
Stores sub resource associated with given data set given by identifier in the default location of the underlying data store- Parameters:
id- unique identifier of the data setsubModelKind- kind of the sub resource e.g. waypointssubModel- the sub resource to be stored
-
updateSubModel
Stores sub resource associated with given data set given by identifier in the location defined byStorageOptions- Parameters:
options- storage option to apply during the operationid- unique identifier of the data setsubModelKind- kind of the sub resource e.g. waypointssubModel- the sub resource to be stored
-
clean
default void clean()Cleans up the storage starting in the default location in the underlying data store. Removes all resources regardless of their type e.g. data sets, waypoints etc -
clean
Cleans up the storage starting in the location defined byStorageOptions. Removes all resources regardless of their type e.g. data sets, waypoints etc- Parameters:
options- storage option to apply during the operation
-
create
Create required data store specific settings to be able to storage data in given location.- Parameters:
location- named location to be created in the underlying storage e.g. name of the bucketconfiguration- storage specific configuration
-
reconfigure
Reconfigures already existing storage based on provided configuration- Parameters:
location- named location to be reconfigured in the underlying storage e.g. name of the bucketconfiguration- storage specific configuration
-
destroy
Destroy data store specific settings, this will also remove all data stored under given location- Parameters:
id- named location to be destroyed in the underlying storage e.g. name of the bucket
-
clazz
Class<ModelOutput_> clazz()
-