Package org.dspace.embargo
Class DefaultEmbargoSetter
java.lang.Object
org.dspace.embargo.DefaultEmbargoSetter
- All Implemented Interfaces:
EmbargoSetter
- Direct Known Subclasses:
DayTableEmbargoSetter
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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckEmbargo(Context context, Item item) Check that embargo is properly set on Item: no read access to bitstreams.protected voidgeneratePolicies(Context context, LocalDate embargoDate, String reason, DSpaceObject dso, Collection owningCollection) parseTerms(Context context, Item item, String terms) Parse the terms into a definite date.voidsetEmbargo(Context context, Item item) Enforce embargo by turning off all read access to bitstreams in this Item.
-
Field Details
-
authorizeService
-
resourcePolicyService
-
-
Constructor Details
-
DefaultEmbargoSetter
public DefaultEmbargoSetter()
-
-
Method Details
-
parseTerms
public DCDate parseTerms(Context context, Item item, String terms) throws SQLException, AuthorizeException 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:
parseTermsin interfaceEmbargoSetter- Parameters:
context- the DSpace contextitem- the item to embargoterms- the embargo terms- Returns:
- parsed date in DCDate format
- 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
Enforce embargo by turning off all read access to bitstreams in this Item.- Specified by:
setEmbargoin interfaceEmbargoSetter- Parameters:
context- the DSpace contextitem- 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.
-
generatePolicies
protected void generatePolicies(Context context, LocalDate embargoDate, String reason, DSpaceObject dso, Collection owningCollection) throws SQLException, AuthorizeException - Throws:
SQLExceptionAuthorizeException
-
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:
checkEmbargoin interfaceEmbargoSetter- Parameters:
context- the DSpace contextitem- 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.IOException- A general class of exceptions produced by failed or interrupted I/O operations.
-