Interface EmbargoSetter

All Known Implementing Classes:
DayTableEmbargoSetter, DefaultEmbargoSetter

public interface EmbargoSetter
Plugin interface for the embargo setting function.
Author:
Larry Stone, Richard Rodgers
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    checkEmbargo(Context context, Item item)
    Check that embargo is properly set on Item.
    parseTerms(Context context, Item item, String terms)
    Get lift date of embargo from the "terms" supplied in the metadata (or other available state) of this Item.
    void
    setEmbargo(Context context, Item item)
    Enforce embargo by (for example) turning off all read access to bitstreams in this Item.
  • Method Details

    • parseTerms

      DCDate parseTerms(Context context, Item item, String terms) throws SQLException, AuthorizeException
      Get lift date of embargo from the "terms" supplied in the metadata (or other available state) of this Item. Return null if it is clear this should not be under embargo -- that is to be expected since this method is invoked on all newly-archived Items.

      Note that the value (if any) of the metadata field configured to contain embargo terms is passed explicitly, but this method is free to explore other metadata fields, and even Bitstream contents, to determine the embargo status and lift date.

      Expect this method to be called at the moment before the Item is installed into the archive (i.e. after workflow). This may be significant if the embargo lift date is computed relative to the present.

      Parameters:
      context - the DSpace context
      item - the item to embargo
      terms - value of the metadata field configured as embargo terms, if any.
      Returns:
      absolute date on which the embargo is to be lifted, or null if none
      Throws:
      SQLException - An exception that provides information on a database access error or other errors.
      AuthorizeException - Exception indicating the current user of the context does not have permission to perform a particular action.
    • setEmbargo

      void setEmbargo(Context context, Item item) throws SQLException, AuthorizeException
      Enforce embargo by (for example) turning off all read access to bitstreams in this Item.
      Parameters:
      context - the DSpace context
      item - the item to embargo
      Throws:
      SQLException - An exception that provides information on a database access error or other errors.
      AuthorizeException - Exception indicating the current user of the context does not have permission to perform a particular action.
    • checkEmbargo

      void checkEmbargo(Context context, Item item) throws SQLException, AuthorizeException, IOException
      Check that embargo is properly set on Item. For example: no read access to bitstreams. It is expected to report any noteworthy discrepancies by writing on the stream System.err, although logging is also encouraged. Only report conditions that constitute a risk of exposing Bitstreams that should be under embargo -- e.g. readable Bitstreams or ORIGINAL bundles. A readable bundle named "TEXT" does not constitute a direct risk so long as its member Bitstreams are not readable.
      Parameters:
      context - the DSpace context
      item - the item to embargo
      Throws:
      IOException - A general class of exceptions produced by failed or interrupted I/O operations.
      SQLException - An exception that provides information on a database access error or other errors.
      AuthorizeException - Exception indicating the current user of the context does not have permission to perform a particular action.