public interface BinaryDatabase extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
Duration |
addBinary(@NonNull UUID binaryTransferUuid,
byte[] bytes,
@NonNull String parameterIdentifier)
Add a binary into the database
|
Duration |
addBinary(UUID binaryTransferUuid,
InputStream stream,
@NonNull String parameterIdentifier)
Add a binary into the database
|
static BinaryDatabase |
current()
Get a reference to the current
BinaryDatabase from the Context.current() |
Duration |
extendBinaryExpiration(UUID binaryTransferUuid)
Extend the expiration date of a binary
|
Binary |
getBinary(UUID binaryTransferUuid)
Get a binary by its identifier
|
BinaryInfo |
getBinaryInfo(UUID binaryTransferUuid)
Get the information of a binary by its identifier
|
boolean |
hasBinary(UUID binaryTransferUuid)
Check if the specified binary transfer UUID exists
|
void |
removeAllBinaries()
Remove all binaries from the database
|
void |
removeBinary(UUID binaryTransferUuid)
Remove a binary from the database
|
closestatic BinaryDatabase current()
BinaryDatabase from the Context.current()BinaryDatabaseBinary getBinary(UUID binaryTransferUuid) throws BinaryDatabaseException
binaryTransferUuid - The binary transfer identifierBinaryDatabaseException - when the binary does not exist or cannot be retrievedBinaryInfo getBinaryInfo(UUID binaryTransferUuid) throws BinaryDatabaseException
binaryTransferUuid - the binary transfer identifierBinaryDatabaseException - when the binary does not exist or cannot be retrievedboolean hasBinary(UUID binaryTransferUuid) throws BinaryDatabaseException
binaryTransferUuid - the binary transfer identifierBinaryDatabaseException - if enable to check the existance of the binary in the databaseDuration addBinary(@NonNull @NonNull UUID binaryTransferUuid, byte[] bytes, @NonNull @NonNull String parameterIdentifier) throws BinaryDatabaseException
binaryTransferUuid - The binary transfer identifierbytes - The data to save in the databaseparameterIdentifier - The fully qualified parameter identifierBinaryDatabaseException - when the binary cannot be added into databaseDuration addBinary(UUID binaryTransferUuid, InputStream stream, @NonNull @NonNull String parameterIdentifier) throws BinaryDatabaseException
binaryTransferUuid - The binary transfer identifierstream - The data stream to save in the databaseparameterIdentifier - The fully qualified parameter identifierBinaryDatabaseException - when the binary cannot be added into databaseDuration extendBinaryExpiration(UUID binaryTransferUuid) throws BinaryDatabaseException
binaryTransferUuid - The binary transfer identifierBinaryDatabaseException - when the binary expiration cannot be extendedvoid removeAllBinaries()
throws BinaryDatabaseException
BinaryDatabaseException - when the binaries cannot be removed from the databasevoid removeBinary(UUID binaryTransferUuid) throws BinaryDatabaseException
binaryTransferUuid - The binary transfer identifier to removeBinaryDatabaseException - when the binary cannot be removed from the databaseCopyright © 2022 SiLA Java Developers. All rights reserved.