Class DefaultAccessStatusHelper

  • All Implemented Interfaces:
    AccessStatusHelper

    public class DefaultAccessStatusHelper
    extends Object
    implements AccessStatusHelper
    Default plugin implementation of the access status helper. The getAccessStatusFromItem method provides a simple logic to calculate the access status of an item based on the policies of the primary or the first bitstream in the original bundle. Users can override this method for enhanced functionality. The getEmbargoInformationFromItem method provides a simple logic to * retrieve embargo information of bitstreams from an item based on the policies of * the primary or the first bitstream in the original bundle. * Users can override this method for enhanced functionality.
    • Constructor Detail

      • DefaultAccessStatusHelper

        public DefaultAccessStatusHelper()
    • Method Detail

      • getAccessStatusFromItem

        public String getAccessStatusFromItem​(Context context,
                                              Item item,
                                              Date threshold)
                                       throws SQLException
        Look at the item's policies to determine an access status value. It is also considering a date threshold for embargoes and restrictions. If the item is null, simply returns the "unknown" value.
        Specified by:
        getAccessStatusFromItem in interface AccessStatusHelper
        Parameters:
        context - the DSpace context
        item - the item to check for embargoes
        threshold - the embargo threshold date
        Returns:
        an access status value
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • getEmbargoFromItem

        public String getEmbargoFromItem​(Context context,
                                         Item item,
                                         Date threshold)
                                  throws SQLException
        Look at the policies of the primary (or first) bitstream of the item to retrieve its embargo. If the item is null, simply returns an empty map with no embargo information.
        Specified by:
        getEmbargoFromItem in interface AccessStatusHelper
        Parameters:
        context - the DSpace context
        item - the item to embargo
        threshold - the embargo threshold date
        Returns:
        an access status value
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.