- All Known Subinterfaces:
ExpandedLifecycleStore,FilenameStore,FileSystemStore,FixedChildStore,FixedHierarchyStore,KnownFormatStreamDataStore,LaunchableStore,ShellStore,StatefulDataStore,StreamDataStore
- All Known Implementing Classes:
FileStore,InMemoryStore,InputStreamStore,InternalStreamStore,LocalDirectoryDataStore,LocalStore,NamedStore,OutputStreamStore,StdinDataStore,StdoutDataStore
public interface DataStore
A data store represents some form of a location where data is stored, e.g. a file or a database.
It does not contain any information on what data is stored,
how the data is stored inside, or what part of the data store makes up the actual data source.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault <DS extends DataStore>
DSasNeeded()Casts this instance to the required type without checking whether a cast is possible.default booleancanOpen()Checks whether this store can be opened.default voiddefault booleandelete()default DataFlowgetFlow()default booleandefault booleanIndicates whether this data store can only be accessed by the current running application.default booleandefault booleandefault voidvalidate()Performs a validation of this data store.
-
Method Details
-
shouldPersist
default boolean shouldPersist() -
shouldSave
default boolean shouldSave() -
isComplete
default boolean isComplete() -
getFlow
-
canOpen
Checks whether this store can be opened. This can be not the case for example if the underlying store does not exist.- Throws:
Exception
-
isContentExclusivelyAccessible
default boolean isContentExclusivelyAccessible()Indicates whether this data store can only be accessed by the current running application. One example are standard in and standard out stores.- See Also:
-
validate
Performs a validation of this data store.This validation can include one of multiple things: - Sanity checks of individual properties - Existence checks - Connection checks
All in all, a successful execution of this method should almost guarantee that the data store can be successfully accessed in the near future.
Note that some checks may take a long time, for example if a connection has to be validated. The caller should therefore expect a runtime of multiple seconds when calling this method.
- Throws:
Exception- if any part of the validation went wrong
-
checkComplete
- Throws:
Exception
-
delete
default boolean delete() -
asNeeded
Casts this instance to the required type without checking whether a cast is possible.
-