Interface BinaryAccessProvider
- All Known Implementing Classes:
AbstractBinaryAccessProvider
,S3AccessProvider
,S3ProxyAccessProvider
public interface BinaryAccessProvider
Interface for strategies which manage saving/loading of objects/file into some
sort of store.
-
Method Summary
Modifier and TypeMethodDescriptionSet
<com.google.common.hash.HashCode> findUnreferencedBinaries
(Connection connection, @Nullable Integer limit) loadBinary
(com.google.common.hash.HashCode hashCode, long size, String mimeType, String fileExtension) create aBinary
instance without executing an sql query, this method should be used if the data from _nice_binary has already been loaded.loadBinary
(com.google.common.hash.HashCode hashCode, Connection connection) load an object from the storeboolean
removeBinary
(com.google.common.hash.HashCode hashCode, Connection connection) remove a binary from storagecom.google.common.hash.HashCode
storeBinary
(Binary binary, Connection connection) save an object into the store
-
Method Details
-
loadBinary
load an object from the store- Parameters:
hashCode
- hash/id of the file to loadconnection
-Connection
to use for database operations- Returns:
- the object
-
loadBinary
Binary loadBinary(com.google.common.hash.HashCode hashCode, long size, String mimeType, String fileExtension) create aBinary
instance without executing an sql query, this method should be used if the data from _nice_binary has already been loaded. -
storeBinary
save an object into the store- Parameters:
binary
- the object to saveconnection
-Connection
to use for database operations- Returns:
- the hash/id of the saved object
-
removeBinary
remove a binary from storage- Parameters:
hashCode
- the hash of the object to removeconnection
-Connection
to use for database operations
-
findUnreferencedBinaries
Set<com.google.common.hash.HashCode> findUnreferencedBinaries(Connection connection, @Nullable @Nullable Integer limit) - Returns:
- all binary hashes that are no longer referenced and may be removed
-