public interface BinaryDatabase extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
Duration |
addBinary(UUID binaryId,
InputStream stream)
Add a binary into the database
|
Duration |
extendBinaryExpiration(UUID binaryId)
Extend the expiration date of a binary
|
Binary |
getBinary(UUID binaryId)
Get a binary by its identifier
|
BinaryInfo |
getBinaryInfo(UUID binaryId)
Get the information of a binary by its identifier
|
void |
removeAllBinaries()
Remove all binaries from the database
|
void |
removeBinary(UUID binaryId)
Remove a binary from the database
|
void |
reserveBytes(long length)
Reserve the required resources to store a binary of the specified length
|
closeBinary getBinary(UUID binaryId) throws BinaryDatabaseException
binaryId - the binary identifierBinaryDatabaseException - when the binary does not exist or cannot be retrievedBinaryInfo getBinaryInfo(UUID binaryId) throws BinaryDatabaseException
binaryId - the binary identifierBinaryDatabaseException - when the binary does not exist or cannot be retrievedDuration addBinary(UUID binaryId, InputStream stream) throws BinaryDatabaseException
binaryId - the binary identifierstream - The data stream to save in the databaseBinaryDatabaseException - when the binary cannot be added into databaseDuration extendBinaryExpiration(UUID binaryId) throws BinaryDatabaseException
binaryId - The binary identifierBinaryDatabaseException - when the binary expiration cannot be extendedvoid removeAllBinaries()
throws BinaryDatabaseException
BinaryDatabaseException - when the binaries cannot be removed from the databasevoid removeBinary(UUID binaryId) throws BinaryDatabaseException
binaryId - The binary identifier to removeBinaryDatabaseException - when the binary cannot be removed from the databasevoid reserveBytes(long length)
throws BinaryDatabaseException
length - The length of binary to storeBinaryDatabaseException - when there is not enough resources availableCopyright © 2022 SiLA Java Developers. All rights reserved.