org.dspace.embargo
Class DefaultEmbargoSetter
java.lang.Object
org.dspace.embargo.DefaultEmbargoSetter
- All Implemented Interfaces:
- EmbargoSetter
- Direct Known Subclasses:
- DayTableEmbargoSetter
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
termsOpen
protected String termsOpen
DefaultEmbargoSetter
public DefaultEmbargoSetter()
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 contextitem - the item to embargoterms - 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 contextitem - the item to embargo
- Throws:
SQLException
AuthorizeException
IOException
generatePolicies
protected void generatePolicies(Context context,
Date embargoDate,
String reason,
DSpaceObject dso,
Collection owningCollection)
throws SQLException,
AuthorizeException
- Throws:
SQLException
AuthorizeException
checkEmbargo
public void checkEmbargo(Context context,
Item item)
throws SQLException,
AuthorizeException,
IOException
- Check that embargo is properly set on Item: no read access to bitstreams.
- Specified by:
checkEmbargo in interface EmbargoSetter
- Parameters:
context - the DSpace contextitem - the item to embargo
- Throws:
SQLException
AuthorizeException
IOException
Copyright © 2012 DuraSpace. All Rights Reserved.