Class AbstractDeleteResourceService

java.lang.Object
org.fcrepo.kernel.impl.services.AbstractService
org.fcrepo.kernel.impl.services.AbstractDeleteResourceService
Direct Known Subclasses:
DeleteResourceServiceImpl, PurgeResourceServiceImpl

public abstract class AbstractDeleteResourceService extends AbstractService
Shared delete/purge code.
Author:
whikloj
  • Field Details

    • resourceFactory

      @Inject protected org.fcrepo.kernel.api.models.ResourceFactory resourceFactory
    • psManager

      @Inject protected org.fcrepo.persistence.api.PersistentStorageSessionManager psManager
  • Constructor Details

  • Method Details

    • perform

      public void perform(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.models.FedoraResource fedoraResource, String userPrincipal)
      The starts the service, does initial checks and setups for processing.
      Parameters:
      tx - the transaction.
      fedoraResource - the resource to start delete/purging.
      userPrincipal - the user performing the action.
    • getContained

      protected abstract Stream<String> getContained(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.models.FedoraResource resource)
      Get the contained resources to act upon.
      Parameters:
      tx - the transaction this occurs in.
      resource - the parent resource to find contained resources for.
      Returns:
      stream of child ids.
    • doAction

      protected abstract void doAction(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.persistence.api.PersistentStorageSession pSession, org.fcrepo.kernel.api.identifiers.FedoraId resourceId, String userPrincipal) throws org.fcrepo.persistence.api.exceptions.PersistentStorageException
      Perform the actual delete or purge action
      Parameters:
      tx - the transaction this occurs in.
      pSession - the persistent storage session.
      resourceId - the resource to perform the action on.
      userPrincipal - the user performing the action
      Throws:
      org.fcrepo.persistence.api.exceptions.PersistentStorageException - if problem performing the action.