Class ResourcePolicy

java.lang.Object
org.dspace.authorize.ResourcePolicy
All Implemented Interfaces:
ReloadableEntity<Integer>

@Entity public class ResourcePolicy extends Object implements ReloadableEntity<Integer>
Database entity representation of the ResourcePolicy table
Author:
kevinvandevelde at atmire.com
  • Field Details

    • TYPE_SUBMISSION

      public static String TYPE_SUBMISSION
      This policy was set on submission, to give the submitter access.
    • TYPE_WORKFLOW

      public static String TYPE_WORKFLOW
      This policy was set to allow access by a workflow group.
    • TYPE_CUSTOM

      public static String TYPE_CUSTOM
      This policy was explicitly set on this object.
    • TYPE_INHERITED

      public static String TYPE_INHERITED
      This policy was copied from the containing object's default policies.
  • Constructor Details

    • ResourcePolicy

      protected ResourcePolicy()
      Protected constructor, create object using: org.dspace.authorize.service.ResourcePolicyService#create(Context)
  • Method Details

    • equals

      public boolean equals(Object obj)
      Return true if this object equals obj, false otherwise.
      Overrides:
      equals in class Object
      Parameters:
      obj - object to compare (eperson, group, start date, end date, ...)
      Returns:
      true if ResourcePolicy objects are equal
    • hashCode

      public int hashCode()
      Return a hash code for this object.
      Overrides:
      hashCode in class Object
      Returns:
      int hash of object
    • getID

      public Integer getID()
      Get the ResourcePolicy's internal identifier
      Specified by:
      getID in interface ReloadableEntity<Integer>
      Returns:
      the internal identifier
    • getdSpaceObject

      public DSpaceObject getdSpaceObject()
    • setdSpaceObject

      public void setdSpaceObject(DSpaceObject dSpaceObject)
    • setAction

      public void setAction(int myid)
      set the action this policy authorizes
      Parameters:
      myid - action ID from Constants
    • getAction

      public int getAction()
      Returns:
      get the action this policy authorizes
    • getEPerson

      public EPerson getEPerson()
      Returns:
      eperson, null if EPerson not set
    • setEPerson

      public void setEPerson(EPerson eperson)
      assign an EPerson to this policy
      Parameters:
      eperson - Eperson
    • getGroup

      public Group getGroup()
      gets the Group referred to by this policy
      Returns:
      group, or null if no group set
    • setGroup

      public void setGroup(Group epersonGroup)
      sets the Group referred to by this policy
      Parameters:
      epersonGroup - Group
    • getStartDate

      public LocalDate getStartDate()
      Get the start date of the policy
      Returns:
      start date, or null if there is no start date set (probably most common case)
    • setStartDate

      public void setStartDate(LocalDate d)
      Set the start date for the policy
      Parameters:
      d - date, or null for no start date
    • getEndDate

      public LocalDate getEndDate()
      Get end date for the policy
      Returns:
      end date or null for no end date
    • setEndDate

      public void setEndDate(LocalDate d)
      Set end date for the policy
      Parameters:
      d - end date, or null
    • getRpName

      public String getRpName()
    • setRpName

      public void setRpName(String name)
    • getRpType

      public String getRpType()
    • setRpType

      public void setRpType(String type)
    • getRpDescription

      public String getRpDescription()
    • setRpDescription

      public void setRpDescription(String description)
    • toString

      public String toString()
      Describe the ResourcePolicy in String form. Useful for debugging ResourcePolicy issues in tests or similar.
      Overrides:
      toString in class Object
      Returns:
      String representation of ResourcePolicy object