Class PersistenceProvider<V>

java.lang.Object
com.scaleoutsoftware.modules.abstractions.PersistenceProvider<V>
Type Parameters:
V - the type of the SOSS object

public abstract class PersistenceProvider<V> extends Object
PersistenceProvider base class is used to provide external access to a persistent data store.
  • Constructor Details

    • PersistenceProvider

      public PersistenceProvider(String moduleName)
      Instantiate a PersistenceProvider for a specific module.
      Parameters:
      moduleName - the module name.
  • Method Details

    • getModuleName

      public String getModuleName()
      Retrieve the module name.
      Returns:
      the module name.
    • initialize

      public abstract void initialize()
      Initialize the persistence provider.
    • storeAsync

      public abstract CompletableFuture<Void> storeAsync(String id, V object)
      Asynchronously store a SOSS object in a persistent data store.
      Parameters:
      id - the unique SOSS object ID.
      object - the SOSS object.
      Returns:
      a CompletableFuture that will return null for success. An exception is thrown if an access issue occurred (ex: invalid credentials) when attempting to access the persistent data store.
    • loadAsync

      public abstract CompletableFuture<V> loadAsync(String id)
      Asynchronously load a SOSS object from a persistent data store.
      Parameters:
      id - the unique SOSS object ID.
      Returns:
      a CompletableFuture that will return the object for success. An exception is thrown if an access issue occurred (ex: invalid credentials) when attempting to access the persistent data store.
    • deleteAsync

      public abstract CompletableFuture<Void> deleteAsync(String id)
      Asynchronously remove a SOSS object from a persistent data store.
      Parameters:
      id - the unique SOSS object ID.
      Returns:
      a CompletableFuture that will return null for success. An exception is thrown if an access issue occurred (ex: invalid credentials) when attempting to access the persistent data store.