public interface BackupProvider
Modifier and Type | Interface and Description |
---|---|
static class |
BackupProvider.KeysPage |
static interface |
BackupProvider.ProgressListener |
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.CompletableFuture<java.lang.Void> |
deleteObject(java.lang.String key)
Delete the object at the given key in the backup provider.
|
<T extends java.io.InputStream> |
getObject(java.lang.String key)
Get the contents of the key stored in the backup provider.
|
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
hasKey(java.lang.String key)
Predicate for key existing in the provider.
|
java.util.concurrent.CompletableFuture<BackupProvider.KeysPage> |
listKeys(java.lang.String prefix,
java.lang.Boolean recursive,
java.lang.Object paginationKey)
List all keys with the given prefix.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
putObject(java.lang.String key,
java.io.InputStream contents,
java.lang.Long contentLength)
Put the contents of path to the backup provider at the given key.
|
void |
setProgressListener(BackupProvider.ProgressListener listener)
Set the progress listener.
|
void setProgressListener(BackupProvider.ProgressListener listener)
listener
- a ProgressListener instance.
The progress listener should be called by the non-blocking
implementations of the methods, e.g. putObject, that interact with the
backup provider, to show that they are still running.
The listener should be called as frequently as possible.<T extends java.io.InputStream> java.util.concurrent.CompletableFuture<T> getObject(java.lang.String key)
key
- the path at which to recover the contents.java.util.concurrent.CompletableFuture<java.lang.Void> putObject(java.lang.String key, java.io.InputStream contents, java.lang.Long contentLength)
key
- the path at which to recover the contents.contents
- an input-stream which provides the contents to upload.contentLength
- the number of bytes in the contents input stream.java.util.concurrent.CompletableFuture<java.lang.Boolean> hasKey(java.lang.String key)
key
- path to check for existence.java.util.concurrent.CompletableFuture<BackupProvider.KeysPage> listKeys(java.lang.String prefix, java.lang.Boolean recursive, java.lang.Object paginationKey)
prefix
- the path to start listing keys.recursive
- a Boolean flag for listing paths recursively.paginationKey
- token controlling pagination.java.util.concurrent.CompletableFuture<java.lang.Void> deleteObject(java.lang.String key)
key
- the path of the object to delete.