Class PatchOperation<M>
- java.lang.Object
-
- org.dspace.app.rest.repository.patch.operation.PatchOperation<M>
-
- Direct Known Subclasses:
BundleMoveOperation,DSpaceObjectMetadataAddOperation,DSpaceObjectMetadataCopyOperation,DSpaceObjectMetadataMoveOperation,DSpaceObjectMetadataRemoveOperation,DSpaceObjectMetadataReplaceOperation,EPersonCertificateReplaceOperation,EPersonEmailReplaceOperation,EPersonLoginReplaceOperation,EPersonNetidReplaceOperation,EPersonPasswordReplaceOperation,ItemDiscoverableReplaceOperation,ItemWithdrawReplaceOperation,ResourcePolicyDescriptionAddOperation,ResourcePolicyDescriptionRemoveOperation,ResourcePolicyDescriptionReplaceOperation,ResourcePolicyEndDateAddOperation,ResourcePolicyEndDateRemoveOperation,ResourcePolicyEndDateReplaceOperation,ResourcePolicyNameAddOperation,ResourcePolicyNameRemoveOperation,ResourcePolicyNameReplaceOperation,ResourcePolicyStartDateAddOperation,ResourcePolicyStartDateRemoveOperation,ResourcePolicyStartDateReplaceOperation
public abstract class PatchOperation<M> extends Object
Base class for all resource patch operations.
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringOPERATION_ADDprotected static StringOPERATION_COPYprotected static StringOPERATION_MOVEprotected static StringOPERATION_REMOVEprotected static StringOPERATION_REPLACE
-
Constructor Summary
Constructors Constructor Description PatchOperation()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcheckOperationValue(Object value)Throws PatchBadRequestException for missing operation value.abstract Mperform(Context context, M resource, Operation operation)Updates the rest model by applying the patch operation.abstract booleansupports(Object objectToMatch, Operation operation)Determines whether or not this Patch Operation can do this patch (Object of operation and path gets checked)
-
-
-
Field Detail
-
OPERATION_REPLACE
protected static final String OPERATION_REPLACE
- See Also:
- Constant Field Values
-
OPERATION_ADD
protected static final String OPERATION_ADD
- See Also:
- Constant Field Values
-
OPERATION_COPY
protected static final String OPERATION_COPY
- See Also:
- Constant Field Values
-
OPERATION_MOVE
protected static final String OPERATION_MOVE
- See Also:
- Constant Field Values
-
OPERATION_REMOVE
protected static final String OPERATION_REMOVE
- See Also:
- Constant Field Values
-
-
Method Detail
-
perform
public abstract M perform(Context context, M resource, Operation operation) throws SQLException
Updates the rest model by applying the patch operation.- Parameters:
context- context of patch operationresource- the dso.operation- the patch operation.- Returns:
- the patched dso
- Throws:
DSpaceBadRequestExceptionSQLException
-
checkOperationValue
public void checkOperationValue(Object value)
Throws PatchBadRequestException for missing operation value.- Parameters:
value- the value to test
-
supports
public abstract boolean supports(Object objectToMatch, Operation operation)
Determines whether or not this Patch Operation can do this patch (Object of operation and path gets checked)- Parameters:
objectToMatch- Object whose class must be instance of type object for which this PatchOperation was createdoperation- Operation of the patch, should match this type of Patch Operation- Returns:
- True if this PatchOperation class can do the patch for this given dso type and Path
-
-