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
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    default void
    Cleans up the storage starting in the default location in the underlying data store.
    void
    Cleans up the storage starting in the location defined by StorageOptions.
    void
    complete(StorageAddress options, String id, ModelOutput_ dataset)
    Final update of the data set upon completion of solving into location defined by StorageOptions
    default void
    Final update of the data set upon completion of solving into default location in the underlying data store
    void
    create(String location, StorageConfiguration configuration)
    Create required data store specific settings to be able to storage data in given location.
    void
    Deletes data set with given identifier from location defined by StorageOptions
    default void
    Deletes data set with given identifier from the default location in the underlying data store
    void
    Destroy data store specific settings, this will also remove all data stored under given location
    boolean
    Checks if data set with given identifier exists in the location defined by StorageOptions
    default boolean
    Checks if data set with given identifier exists in the default location in the underlying data store
    boolean
    Checks if data set with given identifier exists in the location defined by StorageOptions
    default boolean
    Checks if data set with given identifier exists in the default location in the underlying data store
    get(StorageAddress options, String id)
    Retrieves data set by its unique identifier from location defined by StorageOptions
    default ModelOutput_
    get(String id)
    Retrieves data set by its unique identifier from the default location in the underlying data store
    <T> T
    getSubModel(StorageAddress options, String id, SubModelKind config, com.fasterxml.jackson.core.type.TypeReference<T> configurationClass)
     
    <T> T
    getSubModel(StorageAddress options, String id, SubModelKind subModelKind, Class<T> clazz)
    Retrieves sub resource associated with data set with given identifier in the location defined by StorageOptions
    default <T> T
    getSubModel(String id, SubModelKind config, com.fasterxml.jackson.core.type.TypeReference<T> configurationClass)
     
    default <T> T
    getSubModel(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 store
    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
    default void
    getSubModelStream(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
    default <Score_> List<Metadata<Score_>>
    list(int pageNumber, int pageSize)
    Lists data sets (as statuses) stored in the default location of the underlying data store
    <Score_> List<Metadata<Score_>>
    list(StorageAddress options, int pageNumber, int pageSize)
    Lists data sets (as statuses) stored in the location defined by StorageOptions
    void
    reconfigure(String location, StorageConfiguration configuration)
    Reconfigures already existing storage based on provided configuration
    void
    Restores previously deleted data set with given identifier from location defined by StorageOptions
    default void
    Restores previously deleted set with given identifier from the default location in the underlying data store
    void
    store(StorageAddress options, String id, ModelOutput_ dataset)
    Stores given data set into location defined by StorageOptions
    default void
    store(String id, ModelOutput_ dataset)
    Stores given data set into default location in the underlying data store
    void
    storeSubModel(StorageAddress options, String id, SubModelKind subModelKind, Object subModel)
    Stores sub resource associated with given data set given by identifier in the location defined by StorageOptions
    default void
    storeSubModel(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
    void
    update(StorageAddress options, String id, ModelOutput_ dataset)
    Updates existing data set in the storage into location defined by StorageOptions
    default void
    update(String id, ModelOutput_ dataset)
    Updates existing data set in the storage under default location in the underlying data store
    void
    updateSubModel(StorageAddress options, String id, SubModelKind subModelKind, Object subModel)
    Stores sub resource associated with given data set given by identifier in the location defined by StorageOptions
    default void
    updateSubModel(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

  • Method Details

    • store

      default void store(String id, ModelOutput_ dataset)
      Stores given data set into default location in the underlying data store
      Parameters:
      id - unique identifier of the data set
      dataset - data set to be stored
    • store

      void store(StorageAddress options, String id, ModelOutput_ dataset)
      Stores given data set into location defined by StorageOptions
      Parameters:
      options - storage option to apply during the operation
      id - unique identifier of the data set
      dataset - data set to be stored
    • update

      default void update(String id, ModelOutput_ dataset)
      Updates existing data set in the storage under default location in the underlying data store
      Parameters:
      id - unique identifier of the data set
      dataset - data set to be stored
    • update

      void update(StorageAddress options, String id, ModelOutput_ dataset)
      Updates existing data set in the storage into location defined by StorageOptions
      Parameters:
      options - storage option to apply during the operation
      id - unique identifier of the data set
      dataset - data set to be stored
    • complete

      default void complete(String id, ModelOutput_ dataset)
      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 set
      dataset - data set to be stored
    • complete

      void complete(StorageAddress options, String id, ModelOutput_ dataset)
      Final update of the data set upon completion of solving into location defined by StorageOptions
      Parameters:
      options - storage option to apply during the operation
      id - unique identifier of the data set
      dataset - data set to be stored
    • get

      default ModelOutput_ get(String id)
      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

      ModelOutput_ get(StorageAddress options, String id)
      Retrieves data set by its unique identifier from location defined by StorageOptions
      Parameters:
      options - storage option to apply during the operation
      id - unique identifier of the data set
      Returns:
      loaded data set if found
      Throws:
      ItemNotFoundException - in case given data set does not exist
    • delete

      default void delete(String id)
      Deletes data set with given identifier from the default location in the underlying data store
      Parameters:
      id - unique identifier of the data set
    • delete

      void delete(StorageAddress options, String id)
      Deletes data set with given identifier from location defined by StorageOptions
      Parameters:
      options - storage option to apply during the operation
      id - unique identifier of the data set
    • restore

      default void restore(String id)
      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

      void restore(StorageAddress options, String id)
      Restores previously deleted data set with given identifier from location defined by StorageOptions
      Parameters:
      options - storage option to apply during the operation
      id - unique identifier of the data set
      Throws:
      ItemNotFoundException - in case restore cannot be performed
    • exists

      default boolean exists(String id)
      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

      boolean existsSubModel(StorageAddress options, String id, SubModelKind kind)
      Checks if data set with given identifier exists in the location defined by StorageOptions
      Parameters:
      options - storage option to apply during the operation
      id - unique identifier of the data set
      kind - type of sub model
      Returns:
      true if exists false otherwise
    • existsSubModel

      default boolean existsSubModel(String id, SubModelKind kind)
      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
      kind - type of sub model
      Returns:
      true if exists false otherwise
    • exists

      boolean exists(StorageAddress options, String id)
      Checks if data set with given identifier exists in the location defined by StorageOptions
      Parameters:
      options - storage option to apply during the operation
      id - unique identifier of the data set
      Returns:
      true if exists false otherwise
    • list

      default <Score_> List<Metadata<Score_>> list(int pageNumber, int pageSize)
      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

      <Score_> List<Metadata<Score_>> list(StorageAddress options, int pageNumber, int pageSize)
      Lists data sets (as statuses) stored in the location defined by StorageOptions
      Parameters:
      options - storage option to apply during the operation
      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
    • getSubModelStream

      default void getSubModelStream(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:
      id - unique identifier of the data set
      subModelKind - kind of the sub resource e.g. waypoints
      output - 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 operation
      id - unique identifier of the data set
      subModelKind - kind of the sub resource e.g. waypoints
      output - output stream where data should be written
    • getSubModel

      default <T> T getSubModel(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 store
      Type Parameters:
      T - type representing the returned value
      Parameters:
      id - unique identifier of the data set
      subModelKind - kind of the sub resource e.g. waypoints
      clazz - class that the sub resource should be unmarshalled to
      Returns:
      loaded sub resource or null if no sub resource found
    • getSubModel

      <T> T getSubModel(StorageAddress options, String id, SubModelKind subModelKind, Class<T> clazz)
      Retrieves sub resource associated with data set with given identifier in the location defined by StorageOptions
      Type Parameters:
      T - type representing the returned value
      Parameters:
      options - storage option to apply during the operation
      id - unique identifier of the data set
      subModelKind - kind of the sub resource e.g. waypoints
      clazz - 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

      default void storeSubModel(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
      Parameters:
      id - unique identifier of the data set
      subModelKind - kind of the sub resource e.g. waypoints
      subModel - the sub resource to be stored
    • storeSubModel

      void storeSubModel(StorageAddress options, String id, SubModelKind subModelKind, Object subModel)
      Stores sub resource associated with given data set given by identifier in the location defined by StorageOptions
      Parameters:
      options - storage option to apply during the operation
      id - unique identifier of the data set
      subModelKind - kind of the sub resource e.g. waypoints
      subModel - the sub resource to be stored
    • updateSubModel

      default void updateSubModel(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
      Parameters:
      id - unique identifier of the data set
      subModelKind - kind of the sub resource e.g. waypoints
      subModel - the sub resource to be stored
    • updateSubModel

      void updateSubModel(StorageAddress options, String id, SubModelKind subModelKind, Object subModel)
      Stores sub resource associated with given data set given by identifier in the location defined by StorageOptions
      Parameters:
      options - storage option to apply during the operation
      id - unique identifier of the data set
      subModelKind - kind of the sub resource e.g. waypoints
      subModel - 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

      void clean(StorageAddress options)
      Cleans up the storage starting in the location defined by StorageOptions. Removes all resources regardless of their type e.g. data sets, waypoints etc
      Parameters:
      options - storage option to apply during the operation
    • create

      void create(String location, StorageConfiguration configuration)
      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 bucket
      configuration - storage specific configuration
    • reconfigure

      void reconfigure(String location, StorageConfiguration configuration)
      Reconfigures already existing storage based on provided configuration
      Parameters:
      location - named location to be reconfigured in the underlying storage e.g. name of the bucket
      configuration - storage specific configuration
    • destroy

      void destroy(String id)
      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