Class ResourcePolicyUtils
java.lang.Object
org.dspace.app.rest.repository.patch.operation.resourcePolicy.ResourcePolicyUtils
Util class for shared methods between the ResourcePolicy patches.
- Author:
- Maria Verdonck (Atmire) on 14/02/2020, Andrea Bollini (andrea.bollini at 4science.it)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckResourcePolicyForConsistentEndDateValue(ResourcePolicy resource, Operation operation) Throws PatchBadRequestException if the value for endDate is not consistent with the startDate value, if present (smaller than).voidcheckResourcePolicyForConsistentStartDateValue(ResourcePolicy resource, Operation operation) Throws PatchBadRequestException if the value for startDate is not consistent with the endDate value, if present (greater than).voidcheckResourcePolicyForExistingDescriptionValue(ResourcePolicy resource, Operation operation) Throws PatchBadRequestException for missing value in the /description path.voidcheckResourcePolicyForExistingEndDateValue(ResourcePolicy resource, Operation operation) Throws PatchBadRequestException for missing value in the /endDate path.voidcheckResourcePolicyForExistingNameValue(ResourcePolicy resource, Operation operation) Throws PatchBadRequestException for missing value in the /startDate path.voidcheckResourcePolicyForExistingStartDateValue(ResourcePolicy resource, Operation operation) Throws PatchBadRequestException for missing value in the /startDate path.
-
Field Details
-
OPERATION_PATH_STARTDATE
Paths in json body of patched that use these resourcePolicy operations- See Also:
-
OPERATION_PATH_ENDDATE
- See Also:
-
OPERATION_PATH_DESCRIPTION
- See Also:
-
OPERATION_PATH_NAME
- See Also:
-
OPERATION_PATH_POLICY_TYPE
- See Also:
-
OPERATION_PATH_ACTION
- See Also:
-
-
Constructor Details
-
ResourcePolicyUtils
public ResourcePolicyUtils()
-
-
Method Details
-
checkResourcePolicyForExistingStartDateValue
public void checkResourcePolicyForExistingStartDateValue(ResourcePolicy resource, Operation operation) Throws PatchBadRequestException for missing value in the /startDate path.- Parameters:
resource- the resource to updateoperation- the operation to apply
-
checkResourcePolicyForExistingEndDateValue
public void checkResourcePolicyForExistingEndDateValue(ResourcePolicy resource, Operation operation) Throws PatchBadRequestException for missing value in the /endDate path.- Parameters:
resource- the resource to updateoperation- the operation to apply
-
checkResourcePolicyForExistingNameValue
Throws PatchBadRequestException for missing value in the /startDate path.- Parameters:
resource- the resource to updateoperation- the operation to apply
-
checkResourcePolicyForExistingDescriptionValue
public void checkResourcePolicyForExistingDescriptionValue(ResourcePolicy resource, Operation operation) Throws PatchBadRequestException for missing value in the /description path.- Parameters:
resource- the resource to updateoperation- the operation to apply
-
checkResourcePolicyForConsistentStartDateValue
public void checkResourcePolicyForConsistentStartDateValue(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 updateoperation- the operation to apply
-
checkResourcePolicyForConsistentEndDateValue
public void checkResourcePolicyForConsistentEndDateValue(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 updateoperation- the operation to apply
-