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 Type
    Method
    Description
    Set<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 a Binary 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 store
    boolean
    removeBinary(com.google.common.hash.HashCode hashCode, Connection connection)
    remove a binary from storage
    com.google.common.hash.HashCode
    storeBinary(Binary binary, Connection connection)
    save an object into the store
  • Method Details

    • loadBinary

      Binary loadBinary(com.google.common.hash.HashCode hashCode, Connection connection)
      load an object from the store
      Parameters:
      hashCode - hash/id of the file to load
      connection - 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 a Binary instance without executing an sql query, this method should be used if the data from _nice_binary has already been loaded.
    • storeBinary

      com.google.common.hash.HashCode storeBinary(Binary binary, Connection connection)
      save an object into the store
      Parameters:
      binary - the object to save
      connection - Connection to use for database operations
      Returns:
      the hash/id of the saved object
    • removeBinary

      boolean removeBinary(com.google.common.hash.HashCode hashCode, Connection connection)
      remove a binary from storage
      Parameters:
      hashCode - the hash of the object to remove
      connection - 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