public final class InMemoryTransaction extends Object implements Transaction
InMemoryStorage.Storage.Wrap| Constructor and Description |
|---|
InMemoryTransaction(Storage parent)
Ctor.
|
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
commit()
Commit the transaction.
|
CompletableFuture<Void> |
delete(Key key)
Removes value from storage.
|
CompletableFuture<Boolean> |
exists(Key key)
This file exists?
|
CompletableFuture<Collection<Key>> |
list(Key prefix)
Return the list of keys that start with this prefix, for
example "foo/bar/".
|
CompletableFuture<Void> |
move(Key source,
Key destination)
Moves value from one location to another.
|
CompletableFuture<Void> |
rollback()
Rollback the transaction.
|
CompletableFuture<Void> |
save(Key key,
Content content)
Saves the bytes to the specified key.
|
CompletableFuture<Long> |
size(Key key)
Get value size.
|
CompletableFuture<Transaction> |
transaction(List<Key> keys)
Start a transaction with specified keys.
|
CompletableFuture<Content> |
value(Key key)
Obtain bytes by key.
|
public InMemoryTransaction(Storage parent)
parent - The parentpublic CompletableFuture<Boolean> exists(Key key)
Storagepublic CompletableFuture<Collection<Key>> list(Key prefix)
Storagepublic CompletableFuture<Void> move(Key source, Key destination)
Storagepublic CompletableFuture<Void> save(Key key, Content content)
Storagepublic CompletableFuture<Long> size(Key key)
Storagepublic CompletableFuture<Content> value(Key key)
Storagepublic CompletableFuture<Void> delete(Key key)
Storagepublic CompletableFuture<Transaction> transaction(List<Key> keys)
StorageStorage.save(Key, Content) or Storage.value(Key) only in
the scope of a transaction.transaction in interface Storagekeys - The keys regarding which transaction is atomicpublic CompletableFuture<Void> commit()
Transactioncommit in interface Transactionpublic CompletableFuture<Void> rollback()
Transactionrollback in interface TransactionCopyright © 2019–2020 jcabi.com. All rights reserved.