org.dspace.embargo
Class DefaultEmbargoSetter

java.lang.Object
  extended by org.dspace.embargo.DefaultEmbargoSetter
All Implemented Interfaces:
EmbargoSetter

public class DefaultEmbargoSetter
extends Object
implements EmbargoSetter

Default plugin implementation of the embargo setting function. The parseTerms() provides only very rudimentary terms logic - entry of a configurable string (in terms field) for 'unlimited' embargo, otherwise a standard ISO 8601 (yyyy-mm-dd) date is assumed. Users are encouraged to override this method for enhanced functionality.

Author:
Larry Stone, Richard Rodgers

Constructor Summary
DefaultEmbargoSetter()
           
 
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)
          Parse the terms into a definite date.
 void setEmbargo(Context context, Item item)
          Enforce embargo by turning off all read access to bitstreams in this Item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEmbargoSetter

public DefaultEmbargoSetter()
Method Detail

parseTerms

public DCDate parseTerms(Context context,
                         Item item,
                         String terms)
                  throws SQLException,
                         AuthorizeException,
                         IOException
Parse the terms into a definite date. Terms are expected to consist of either: a token (value configured in 'embargo.terms.open' property) to indicate indefinite embargo, or a literal lift date formatted in ISO 8601 format (yyyy-mm-dd)

Specified by:
parseTerms in interface EmbargoSetter
Parameters:
context - the DSpace context
item - the item to embargo
terms - the embargo terms
Returns:
parsed date in DCDate format
Throws:
SQLException
AuthorizeException
IOException

setEmbargo

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

Specified by:
setEmbargo in interface EmbargoSetter
Parameters:
context - the DSpace context
item - the item to embargo
Throws:
SQLException
AuthorizeException
IOException

checkEmbargo

public 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.

Specified by:
checkEmbargo in interface EmbargoSetter
Parameters:
context - the DSpace context
item - the item to embargo
Throws:
SQLException
AuthorizeException
IOException


Copyright © 2010 DuraSpace. All Rights Reserved.