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 PersistentStorageSessionManager
psManager
protected ResourceFactory
resourceFactory
-
Fields inherited from class org.fcrepo.kernel.impl.services.AbstractService
containmentIndex, fedoraPropsConfig, membershipService, referenceService, searchIndex
-
-
Constructor Summary
Constructors Constructor Description AbstractDeleteResourceService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
doAction(Transaction tx, PersistentStorageSession pSession, FedoraId resourceId, String userPrincipal)
Perform the actual delete or purge actionprotected abstract Stream<String>
getContained(Transaction tx, FedoraResource resource)
Get the contained resources to act upon.void
perform(Transaction tx, 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 ResourceFactory resourceFactory
-
psManager
@Inject protected PersistentStorageSessionManager psManager
-
-
Constructor Detail
-
AbstractDeleteResourceService
public AbstractDeleteResourceService()
-
-
Method Detail
-
perform
public void perform(Transaction tx, 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(Transaction tx, 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(Transaction tx, PersistentStorageSession pSession, FedoraId resourceId, String userPrincipal) throws 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:
PersistentStorageException
- if problem performing the action.
-
-