Class DefaultAccessStatusHelper

java.lang.Object
org.dspace.access.status.DefaultAccessStatusHelper
All Implemented Interfaces:
AccessStatusHelper

public class DefaultAccessStatusHelper extends Object implements AccessStatusHelper
Default plugin implementation of the access status helper. The methods 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 those methods for enhanced functionality.
  • Field Details

  • Constructor Details

    • DefaultAccessStatusHelper

      public DefaultAccessStatusHelper()
  • Method Details

    • getAccessStatusFromItem

      public AccessStatus getAccessStatusFromItem(Context context, Item item, LocalDate threshold, String type) throws SQLException
      Look at the item's primary or first bitstream 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
      type - the type of calculation
      Returns:
      the access status
      Throws:
      SQLException - An exception that provides information on a database access error or other errors.
    • getAccessStatusFromBitstream

      public AccessStatus getAccessStatusFromBitstream(Context context, Bitstream bitstream, LocalDate threshold, String type) throws SQLException
      Look at the bitstream policies to determine an access status value. It is also considering a date threshold for embargoes and restrictions. If the bitstream is null, simply returns the "unknown" value.
      Specified by:
      getAccessStatusFromBitstream in interface AccessStatusHelper
      Parameters:
      context - the DSpace context
      bitstream - the bitstream to check for embargoes
      threshold - the embargo threshold date
      type - the type of calculation
      Returns:
      the access status
      Throws:
      SQLException - An exception that provides information on a database access error or other errors.
    • getAnonymousAccessStatusFromItem

      public AccessStatus getAnonymousAccessStatusFromItem(Context context, Item item, LocalDate threshold) throws SQLException
      Look at the anonymous policies of the primary (or first) bitstream of the item to retrieve its embargo.
      Specified by:
      getAnonymousAccessStatusFromItem in interface AccessStatusHelper
      Parameters:
      context - the DSpace context
      item - the item
      threshold - the embargo threshold date
      Returns:
      the access status
      Throws:
      SQLException - An exception that provides information on a database access error or other errors.