org.dspace.embargo
Class EmbargoManager

java.lang.Object
  extended by org.dspace.embargo.EmbargoManager

public class EmbargoManager
extends Object

Public interface to the embargo subsystem. Configuration properties: (with examples) # DC metadata field to hold the user-supplied embargo terms embargo.field.terms = dc.embargo.terms # DC metadata field to hold computed "lift date" of embargo embargo.field.lift = dc.date.available # String to indicate indefinite (forever) embargo in terms embargo.terms.open = Indefinite # implementation of embargo setter plugin plugin.single.org.dspace.embargo.EmbargoSetter = edu.my.Setter # implementation of embargo lifter plugin plugin.single.org.dspace.embargo.EmbargoLifter = edu.my.Lifter

Author:
Larry Stone, Richard Rodgers

Field Summary
static DCDate FOREVER
          Special date signalling an Item is to be embargoed forever.
 
Constructor Summary
EmbargoManager()
           
 
Method Summary
static DCDate getEmbargoDate(Context context, Item item)
          Get the embargo lift date for an Item, if any.
static void liftEmbargo(Context context, Item item)
          Lift the embargo on an item which is assumed to be under embargo.
static void main(String[] argv)
          Command-line service to scan for every Items with an expired embargo, and then lift that embargo.
static void setEmbargo(Context context, Item item, DCDate lift)
          Put an Item under embargo until the specified lift date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FOREVER

public static final DCDate FOREVER
Special date signalling an Item is to be embargoed forever. The actual date is the first day of the year 10,000 UTC.

Constructor Detail

EmbargoManager

public EmbargoManager()
Method Detail

setEmbargo

public static void setEmbargo(Context context,
                              Item item,
                              DCDate lift)
                       throws SQLException,
                              AuthorizeException,
                              IOException
Put an Item under embargo until the specified lift date. Calls EmbargoSetter plugin to adjust Item access control policies.

Parameters:
context - the DSpace context
item - the item to embargo
lift - date on which the embargo is to be lifted.
Throws:
SQLException
AuthorizeException
IOException

getEmbargoDate

public static DCDate getEmbargoDate(Context context,
                                    Item item)
                             throws SQLException,
                                    AuthorizeException,
                                    IOException
Get the embargo lift date for an Item, if any. This looks for the metadata field configured to hold embargo terms, and gives it to the EmbargoSetter plugin's method to interpret it into an absolute timestamp. This is intended to be called at the time the Item is installed into the archive.

Note that the plugin is *always* called, in case it gets its cue for the embargo date from sources other than, or in addition to, the specified field.

Parameters:
context - the DSpace context
item - the item to embargo
Returns:
lift date on which the embargo is to be lifted, or null if none
Throws:
SQLException
AuthorizeException
IOException

liftEmbargo

public static void liftEmbargo(Context context,
                               Item item)
                        throws SQLException,
                               AuthorizeException,
                               IOException
Lift the embargo on an item which is assumed to be under embargo. Call the plugin to manage permissions in its own way, then delete the administrative metadata fields that dictated embargo date.

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

main

public static void main(String[] argv)
Command-line service to scan for every Items with an expired embargo, and then lift that embargo. Options: -c,--check Function: ONLY check the state of embargoed Items, do NOT lift any embargoes. -h,--help help -i,--identifier Process ONLY this Handle identifier(s), which must be an Item. Can be repeated. -l,--lift Function: ONLY lift embargoes, do NOT check the state of any embargoed Items. -n,--dryrun Do not change anything in the data model, print message instead. -v,--verbose Print a line describing action taken for each embargoed Item found. -q,--quiet No output except upon error



Copyright © 2010 DuraSpace. All Rights Reserved.