Interface StorageEngine

  • All Superinterfaces:
    AutoCloseable
    All Known Implementing Classes:
    AbstractFileStorageEngine, AbstractStorageEngine

    public interface StorageEngine
    extends AutoCloseable
    StorageEngines that give access to a permanent storage should implement this interface. The storage engine should open the connection on its constructor and be responsible for managing and storing the data.
    Author:
    Vasilis Vryniotis
    • Method Detail

      • rename

        boolean rename​(String newStorageName)
        Renames the storage. Returns true if the operation was completed and false if it was not necessary.
        Parameters:
        newStorageName -
        Returns:
      • isClosed

        boolean isClosed()
        Checks if the storage engine is closed.
        Returns:
      • clear

        void clear()
        Clears all the data stored in the storage while keeping the connection open.
      • existsObject

        boolean existsObject​(String name)
        Checks if an object exists with the particular name.
        Parameters:
        name -
        Returns:
      • loadObject

        <T extends Serializable> T loadObject​(String name,
                                              Class<T> klass)
        Loads a serializable object from the storage.
        Type Parameters:
        T -
        Parameters:
        name -
        klass -
        Returns:
      • getBigMap

        <K,​V> Map<K,​V> getBigMap​(String name,
                                             Class<K> keyClass,
                                             Class<V> valueClass,
                                             StorageEngine.MapType type,
                                             StorageEngine.StorageHint storageHint,
                                             boolean isConcurrent,
                                             boolean isTemporary)
        Creates or loads a Big Map collection.
        Type Parameters:
        K -
        V -
        Parameters:
        name -
        keyClass -
        valueClass -
        type -
        storageHint -
        isConcurrent -
        isTemporary -
        Returns:
      • dropBigMap

        <T extends Map> void dropBigMap​(String name,
                                        T map)
        Drops the Big Map.
        Type Parameters:
        T -
        Parameters:
        name -
        map -
      • getStorageName

        String getStorageName()
        Returns the name of the storage.
        Returns: