Interface BitStoreService

All Known Implementing Classes:
BaseBitStoreService, DSBitStoreService, JCloudBitStoreService, S3BitStoreService

public interface BitStoreService
A low-level asset store interface
Author:
Richard Rodgers, Peter Dietz
  • Method Summary

    Modifier and Type
    Method
    Description
    about(Bitstream bitstream, List<String> attrs)
    Obtain technical metadata about an asset in the asset store.
    Return an identifier unique to this asset store instance
    get(Bitstream bitstream)
    Retrieve the bits for bitstream
    void
    Initialize the asset store
    default boolean
    Determines if a store is enabled, by default is enabled
    boolean
    Determines if a store has been initialized
    void
    put(Bitstream bitstream, InputStream inputStream)
    Store a stream of bits.
    void
    remove(Bitstream bitstream)
    Remove an asset from the asset store.
  • Method Details

    • init

      void init() throws IOException
      Initialize the asset store
      Throws:
      IOException - A general class of exceptions produced by failed or interrupted I/O operations.
    • generateId

      String generateId()
      Return an identifier unique to this asset store instance
      Returns:
      a unique ID
    • get

      InputStream get(Bitstream bitstream) throws IOException
      Retrieve the bits for bitstream
      Parameters:
      bitstream - DSpace Bitstream object
      Returns:
      The stream of bits
      Throws:
      IOException - If a problem occurs while retrieving the bits, or if no asset with ID exists in the store
    • put

      void put(Bitstream bitstream, InputStream inputStream) throws IOException
      Store a stream of bits.

      If this method returns successfully, the bits have been stored. If an exception is thrown, the bits have not been stored.

      Parameters:
      bitstream - The bitstream object
      inputStream - The stream of bits
      Throws:
      IOException - If a problem occurs while storing the bits
    • about

      Map<String,Object> about(Bitstream bitstream, List<String> attrs) throws IOException
      Obtain technical metadata about an asset in the asset store.
      Parameters:
      bitstream - The bitstream to describe
      attrs - A List of desired metadata fields
      Returns:
      attrs A Map with key/value pairs of desired metadata If file not found, then return null
      Throws:
      IOException - If a problem occurs while obtaining metadata
    • remove

      void remove(Bitstream bitstream) throws IOException
      Remove an asset from the asset store.
      Parameters:
      bitstream - The bitstream of the asset to delete
      Throws:
      IOException - If a problem occurs while removing the asset
    • isInitialized

      boolean isInitialized()
      Determines if a store has been initialized
      Returns:
      boolean true if initialized, false otherwise
    • isEnabled

      default boolean isEnabled()
      Determines if a store is enabled, by default is enabled
      Returns:
      boolean true if enabled, false otherwise