Class ResourcePolicyUtils


  • @Component
    public class ResourcePolicyUtils
    extends Object
    Util class for shared methods between the ResourcePolicy patches.
    Author:
    Maria Verdonck (Atmire) on 14/02/2020, Andrea Bollini (andrea.bollini at 4science.it)
    • Constructor Detail

      • ResourcePolicyUtils

        public ResourcePolicyUtils()
    • Method Detail

      • checkResourcePolicyForExistingStartDateValue

        public void checkResourcePolicyForExistingStartDateValue​(org.dspace.authorize.ResourcePolicy resource,
                                                                 Operation operation)
        Throws PatchBadRequestException for missing value in the /startDate path.
        Parameters:
        resource - the resource to update
        operation - the operation to apply
      • checkResourcePolicyForExistingEndDateValue

        public void checkResourcePolicyForExistingEndDateValue​(org.dspace.authorize.ResourcePolicy resource,
                                                               Operation operation)
        Throws PatchBadRequestException for missing value in the /endDate path.
        Parameters:
        resource - the resource to update
        operation - the operation to apply
      • checkResourcePolicyForExistingNameValue

        public void checkResourcePolicyForExistingNameValue​(org.dspace.authorize.ResourcePolicy resource,
                                                            Operation operation)
        Throws PatchBadRequestException for missing value in the /startDate path.
        Parameters:
        resource - the resource to update
        operation - the operation to apply
      • checkResourcePolicyForExistingDescriptionValue

        public void checkResourcePolicyForExistingDescriptionValue​(org.dspace.authorize.ResourcePolicy resource,
                                                                   Operation operation)
        Throws PatchBadRequestException for missing value in the /description path.
        Parameters:
        resource - the resource to update
        operation - the operation to apply
      • checkResourcePolicyForConsistentStartDateValue

        public void checkResourcePolicyForConsistentStartDateValue​(org.dspace.authorize.ResourcePolicy resource,
                                                                   Operation operation)
        Throws PatchBadRequestException if the value for startDate is not consistent with the endDate value, if present (greater than).
        Parameters:
        resource - the resource to update
        operation - the operation to apply
      • checkResourcePolicyForConsistentEndDateValue

        public void checkResourcePolicyForConsistentEndDateValue​(org.dspace.authorize.ResourcePolicy resource,
                                                                 Operation operation)
        Throws PatchBadRequestException if the value for endDate is not consistent with the startDate value, if present (smaller than).
        Parameters:
        resource - the resource to update
        operation - the operation to apply