Interface DataStore

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 Type
    Method
    Description
    default <DS extends DataStore>
    DS
    Casts this instance to the required type without checking whether a cast is possible.
    default boolean
    Checks whether this store can be opened.
    default void
     
    default boolean
     
    default DataFlow
     
    default boolean
     
    default boolean
    Indicates whether this data store can only be accessed by the current running application.
    default boolean
     
    default boolean
     
    default void
    Performs a validation of this data store.
  • Method Details

    • shouldPersist

      default boolean shouldPersist()
    • shouldSave

      default boolean shouldSave()
    • isComplete

      default boolean isComplete()
    • getFlow

      default DataFlow getFlow()
    • canOpen

      default boolean canOpen() throws Exception
      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

      default void validate() throws Exception
      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

      default void checkComplete() throws Exception
      Throws:
      Exception
    • delete

      default boolean delete()
    • asNeeded

      default <DS extends DataStore> DS asNeeded()
      Casts this instance to the required type without checking whether a cast is possible.