Package org.fcrepo.kernel.impl.services
Class AbstractService
- java.lang.Object
-
- org.fcrepo.kernel.impl.services.AbstractService
-
- Direct Known Subclasses:
AbstractDeleteResourceService
,CreateResourceServiceImpl
,FixityServiceImpl
,ReindexServiceImpl
,ReplaceBinariesServiceImpl
,ReplacePropertiesServiceImpl
,UpdatePropertiesServiceImpl
,VersionServiceImpl
,WebacAclServiceImpl
public abstract class AbstractService extends Object
Abstract service for interacting with a kernel service- Author:
- whikloj, bseeger
-
-
Field Summary
Fields Modifier and Type Field Description protected ContainmentIndex
containmentIndex
protected FedoraPropsConfig
fedoraPropsConfig
protected MembershipService
membershipService
protected ReferenceService
referenceService
protected SearchIndex
searchIndex
protected UserTypesCache
userTypesCache
-
Constructor Summary
Constructors Constructor Description AbstractService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkAclLinkHeader(List<String> links)
Check that we don't try to provide an ACL Link header.protected String
determineInteractionModel(List<String> linkTypes, boolean isRdfContentType, boolean contentPresent, boolean isExternalContent)
Utility to determine the correct interaction model from elements of a request.protected void
ensureValidACLAuthorization(org.apache.jena.rdf.model.Model inputModel)
This method does two things: - Throws an exception if an authorization has both accessTo and accessToClass - Adds a default accessTo target if an authorization has neither accessTo nor accessToClassprotected void
ensureValidDirectContainer(FedoraId fedoraId, String interactionModel, org.apache.jena.rdf.model.Model model)
Verifies that DirectContainer properties are valid, throwing exceptions if the triples do not meet LDP requirements or a server managed property is specified as a membership relation.protected void
lockArchivalGroupResource(Transaction tx, PersistentStorageSession pSession, FedoraId fedoraId)
protected void
lockParent(Transaction tx, PersistentStorageSession pSession, FedoraId parentId)
protected void
recordEvent(Transaction transaction, FedoraId fedoraId, ResourceOperation operation)
protected void
updateReferences(Transaction transaction, FedoraId resourceId, String user, org.apache.jena.rdf.model.Model model)
Wrapper to call the referenceService updateReference method
-
-
-
Field Detail
-
containmentIndex
@Autowired @Qualifier("containmentIndex") protected ContainmentIndex containmentIndex
-
referenceService
@Autowired @Qualifier("referenceService") protected ReferenceService referenceService
-
membershipService
@Inject protected MembershipService membershipService
-
searchIndex
@Inject protected SearchIndex searchIndex
-
fedoraPropsConfig
@Inject protected FedoraPropsConfig fedoraPropsConfig
-
userTypesCache
@Inject protected UserTypesCache userTypesCache
-
-
Constructor Detail
-
AbstractService
public AbstractService()
-
-
Method Detail
-
determineInteractionModel
protected String determineInteractionModel(List<String> linkTypes, boolean isRdfContentType, boolean contentPresent, boolean isExternalContent)
Utility to determine the correct interaction model from elements of a request.- Parameters:
linkTypes
- Link headers with rel="type"isRdfContentType
- Is the Content-type a known RDF type?contentPresent
- Is there content present on the request body?isExternalContent
- Is there Link headers that define external content?- Returns:
- The determined or default interaction model.
-
checkAclLinkHeader
protected void checkAclLinkHeader(List<String> links) throws RequestWithAclLinkHeaderException
Check that we don't try to provide an ACL Link header.- Parameters:
links
- list of the link headers provided.- Throws:
RequestWithAclLinkHeaderException
- If we provide an rel="acl" link header.
-
ensureValidDirectContainer
protected void ensureValidDirectContainer(FedoraId fedoraId, String interactionModel, org.apache.jena.rdf.model.Model model)
Verifies that DirectContainer properties are valid, throwing exceptions if the triples do not meet LDP requirements or a server managed property is specified as a membership relation. If no membershipResource or membership relation are specified, defaults will be populated.- Parameters:
fedoraId
- id of the resource describedinteractionModel
- interaction model of the resourcemodel
- model to check
-
ensureValidACLAuthorization
protected void ensureValidACLAuthorization(org.apache.jena.rdf.model.Model inputModel)
This method does two things: - Throws an exception if an authorization has both accessTo and accessToClass - Adds a default accessTo target if an authorization has neither accessTo nor accessToClass- Parameters:
inputModel
- to be checked and updated
-
recordEvent
protected void recordEvent(Transaction transaction, FedoraId fedoraId, ResourceOperation operation)
-
updateReferences
protected void updateReferences(Transaction transaction, FedoraId resourceId, String user, org.apache.jena.rdf.model.Model model)
Wrapper to call the referenceService updateReference method- Parameters:
transaction
- the transaction.resourceId
- the resource's ID.model
- the model of the request body.
-
lockArchivalGroupResource
protected void lockArchivalGroupResource(Transaction tx, PersistentStorageSession pSession, FedoraId fedoraId)
-
lockParent
protected void lockParent(Transaction tx, PersistentStorageSession pSession, FedoraId parentId)
-
-