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
public abstract class AbstractDeleteResourceService extends AbstractService
Shared delete/purge code.- Author:
- whikloj
-
-
Field Summary
Fields Modifier and Type Field Description protected org.fcrepo.persistence.api.PersistentStorageSessionManagerpsManagerprotected org.fcrepo.kernel.api.models.ResourceFactoryresourceFactory-
Fields inherited from class org.fcrepo.kernel.impl.services.AbstractService
containmentIndex, fedoraPropsConfig, membershipService, referenceService
-
-
Constructor Summary
Constructors Constructor Description AbstractDeleteResourceService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected 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 actionprotected abstract Stream<String>getContained(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, lockArchivalGroupResourceFromParent, recordEvent, updateReferences
-
-
-
-
Field Detail
-
resourceFactory
@Inject protected org.fcrepo.kernel.api.models.ResourceFactory resourceFactory
-
psManager
@Inject protected org.fcrepo.persistence.api.PersistentStorageSessionManager psManager
-
-
Constructor Detail
-
AbstractDeleteResourceService
public AbstractDeleteResourceService()
-
-
Method Detail
-
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.
-
-