org.dspace.embargo
Interface EmbargoSetter

All Known Implementing Classes:
DefaultEmbargoSetter

public interface EmbargoSetter

Plugin interface for the embargo setting function.

Author:
Larry Stone, Richard Rodgers

Method Summary
 void checkEmbargo(Context context, Item item)
          Check that embargo is properly set on Item, e.g.
 DCDate 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 e.g.
 

Method Detail

parseTerms

DCDate parseTerms(Context context,
                  Item item,
                  String terms)
                  throws SQLException,
                         AuthorizeException,
                         IOException
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
AuthorizeException
IOException

setEmbargo

void setEmbargo(Context context,
                Item item)
                throws SQLException,
                       AuthorizeException,
                       IOException
Enforce embargo by e.g. turning off all read access to bitstreams in this Item.

Parameters:
context - the DSpace context
item - the item to embargo
Throws:
SQLException
AuthorizeException
IOException

checkEmbargo

void checkEmbargo(Context context,
                  Item item)
                  throws SQLException,
                         AuthorizeException,
                         IOException
Check that embargo is properly set on Item, e.g. no read access to bitstreams. It is expected to report any noteworthy discrepencies 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:
SQLException
AuthorizeException
IOException


Copyright © 2010 DuraSpace. All Rights Reserved.