Interface BinaryAccessProvider
- All Known Implementing Classes:
AbstractBinaryAccessProvider,S3AccessProvider
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 aBinaryinstance 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 storebooleanremoveBinary(com.google.common.hash.HashCode hashCode, Connection connection) remove a binary from storagecom.google.common.hash.HashCodestoreBinary(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-Connectionto use for database operations- Returns:
- the object
-
loadBinary
Binary loadBinary(com.google.common.hash.HashCode hashCode, long size, String mimeType, String fileExtension) create aBinaryinstance 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-Connectionto 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-Connectionto 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
-