Interface Storage

  • All Known Subinterfaces:
    Transaction
    All Known Implementing Classes:
    FileStorage, FileSystemTransaction

    public interface Storage
    The storage.

    You are supposed to implement this interface the way you want. It has to abstract the binary storage. You may use FileStorage if you want to work with files. Otherwise, for S3 or something else, you have to implement it yourself.

    Since:
    0.1
    • Method Detail

      • exists

        CompletableFuture<Boolean> exists​(Key key)
        This file exists?
        Parameters:
        key - The key (file name)
        Returns:
        TRUE if exists, FALSE otherwise
      • list

        CompletableFuture<Collection<Key>> list​(String prefix)
        Return the list of object names that start with this prefix, for example "foo/bar/". The prefix must end with a slash.
        Parameters:
        prefix - The prefix, ended with a slash
        Returns:
        List of object keys/names
      • move

        CompletableFuture<Void> move​(Key source,
                                     Key destination)
        Moves value from one location to another.
        Parameters:
        source - Source key.
        destination - Destination key.
        Returns:
        Completion or error signal.
      • transaction

        CompletableFuture<Transaction> transaction​(List<Key> keys)
        Start a transaction with specified keys. These specified keys are the scope of a transaction. You will be able to perform storage operations like save(Key, Flow.Publisher) or value(Key) only in the scope of a transaction.
        Parameters:
        keys - The keys regarding which transaction is atomic
        Returns:
        Transaction