Class PatchOperation<M>

java.lang.Object
org.dspace.app.rest.repository.patch.operation.PatchOperation<M>
Direct Known Subclasses:
BitstreamRemoveOperation, BundleMoveOperation, DSpaceObjectMetadataAddOperation, DSpaceObjectMetadataCopyOperation, DSpaceObjectMetadataMoveOperation, DSpaceObjectMetadataRemoveOperation, DSpaceObjectMetadataReplaceOperation, EPersonCertificateReplaceOperation, EPersonEmailReplaceOperation, EPersonLoginReplaceOperation, EPersonNetidReplaceOperation, EPersonPasswordAddOperation, GroupNameReplaceOperation, ItemDiscoverableReplaceOperation, ItemWithdrawReplaceOperation, NotifyServiceDescriptionAddOperation, NotifyServiceDescriptionRemoveOperation, NotifyServiceDescriptionReplaceOperation, NotifyServiceEnabledReplaceOperation, NotifyServiceInboundPatternAutomaticReplaceOperation, NotifyServiceInboundPatternConstraintAddOperation, NotifyServiceInboundPatternConstraintRemoveOperation, NotifyServiceInboundPatternConstraintReplaceOperation, NotifyServiceInboundPatternPatternAddOperation, NotifyServiceInboundPatternPatternReplaceOperation, NotifyServiceInboundPatternRemoveOperation, NotifyServiceInboundPatternReplaceOperation, NotifyServiceInboundPatternsAddOperation, NotifyServiceInboundPatternsRemoveOperation, NotifyServiceInboundPatternsReplaceOperation, NotifyServiceLdnUrlReplaceOperation, NotifyServiceLowerIpReplaceOperation, NotifyServiceLowerOrUpperRemoveOperation, NotifyServiceNameOrLdnUrlRemoveOperation, NotifyServiceNameReplaceOperation, NotifyServiceScoreAddOperation, NotifyServiceScoreRemoveOperation, NotifyServiceScoreReplaceOperation, NotifyServiceUpperIpReplaceOperation, NotifyServiceUrlAddOperation, NotifyServiceUrlRemoveOperation, NotifyServiceUrlReplaceOperation, NotifyServiceUsesActorEmailIdReplaceOperation, QAEventStatusReplaceOperation, RegistrationEmailPatchOperation, ResearcherProfileAddOrcidOperation, ResearcherProfileRemoveOrcidOperation, ResearcherProfileReplaceOrcidSyncPreferencesOperation, ResearcherProfileVisibleReplaceOperation, ResourcePolicyActionAddOrReplaceOperation, ResourcePolicyDescriptionAddOperation, ResourcePolicyDescriptionRemoveOperation, ResourcePolicyDescriptionReplaceOperation, ResourcePolicyEndDateAddOperation, ResourcePolicyEndDateRemoveOperation, ResourcePolicyEndDateReplaceOperation, ResourcePolicyNameAddOperation, ResourcePolicyNameRemoveOperation, ResourcePolicyNameReplaceOperation, ResourcePolicyPolicyTypeAddOperation, ResourcePolicyPolicyTypeRemoveOperation, ResourcePolicyPolicyTypeReplaceOperation, ResourcePolicyStartDateAddOperation, ResourcePolicyStartDateRemoveOperation, ResourcePolicyStartDateReplaceOperation

public abstract class PatchOperation<M> extends Object
Base class for all resource patch operations.
  • Field Details

  • Constructor Details

    • PatchOperation

      public PatchOperation()
  • Method Details

    • 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 operation
      resource - the dso.
      operation - the patch operation.
      Returns:
      the patched dso
      Throws:
      DSpaceBadRequestException
      SQLException
    • checkOperationValue

      public void checkOperationValue(Object value)
      Throws PatchBadRequestException for missing operation value.
      Parameters:
      value - the value to test
    • getBooleanOperationValue

      protected Boolean getBooleanOperationValue(Object value)
      Allows clients to use either a boolean or a string representation of boolean value.
      Parameters:
      value - the operation value
      Returns:
      the original or derived boolean value
      Throws:
      DSpaceBadRequestException
    • 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 created
      operation - 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