Package org.fcrepo.kernel.impl.services
Class AbstractDeleteResourceService
java.lang.Object
org.fcrepo.kernel.impl.services.AbstractService
org.fcrepo.kernel.impl.services.AbstractDeleteResourceService
- Direct Known Subclasses:
DeleteResourceServiceImpl,PurgeResourceServiceImpl
Shared delete/purge code.
- Author:
- whikloj
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.fcrepo.persistence.api.PersistentStorageSessionManagerprotected org.fcrepo.kernel.api.models.ResourceFactoryFields inherited from class org.fcrepo.kernel.impl.services.AbstractService
containmentIndex, fedoraPropsConfig, membershipService, referenceService, searchIndex, userTypesCache -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddoAction(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.persistence.api.PersistentStorageSession pSession, org.fcrepo.kernel.api.identifiers.FedoraId resourceId, String userPrincipal) Perform the actual delete or purge actiongetContained(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.models.FedoraResource resource) Get the contained resources to act upon.voidperform(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.Methods inherited from class org.fcrepo.kernel.impl.services.AbstractService
checkAclLinkHeader, determineInteractionModel, ensureValidACLAuthorization, ensureValidDirectContainer, lockArchivalGroupResource, lockParent, recordEvent, updateReferences
-
Field Details
-
resourceFactory
-
psManager
-
-
Constructor Details
-
AbstractDeleteResourceService
public AbstractDeleteResourceService()
-
-
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.
-