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 org.fcrepo.kernel.api.ContainmentIndexcontainmentIndexprotected org.fcrepo.config.FedoraPropsConfigfedoraPropsConfigprotected org.fcrepo.kernel.api.services.MembershipServicemembershipServiceprotected org.fcrepo.kernel.api.services.ReferenceServicereferenceServiceprotected org.fcrepo.search.api.SearchIndexsearchIndexprotected org.fcrepo.kernel.api.cache.UserTypesCacheuserTypesCache
-
Constructor Summary
Constructors Constructor Description AbstractService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckAclLinkHeader(List<String> links)Check that we don't try to provide an ACL Link header.protected StringdetermineInteractionModel(List<String> linkTypes, boolean isRdfContentType, boolean contentPresent, boolean isExternalContent)Utility to determine the correct interaction model from elements of a request.protected voidensureValidACLAuthorization(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 voidensureValidDirectContainer(org.fcrepo.kernel.api.identifiers.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 voidlockArchivalGroupResource(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.persistence.api.PersistentStorageSession pSession, org.fcrepo.kernel.api.identifiers.FedoraId fedoraId)protected voidlockArchivalGroupResourceFromParent(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.persistence.api.PersistentStorageSession pSession, org.fcrepo.kernel.api.identifiers.FedoraId parentId)protected voidrecordEvent(org.fcrepo.kernel.api.Transaction transaction, org.fcrepo.kernel.api.identifiers.FedoraId fedoraId, org.fcrepo.kernel.api.operations.ResourceOperation operation)protected voidupdateReferences(org.fcrepo.kernel.api.Transaction transaction, org.fcrepo.kernel.api.identifiers.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 org.fcrepo.kernel.api.ContainmentIndex containmentIndex
-
referenceService
@Autowired @Qualifier("referenceService") protected org.fcrepo.kernel.api.services.ReferenceService referenceService
-
membershipService
@Inject protected org.fcrepo.kernel.api.services.MembershipService membershipService
-
searchIndex
@Inject protected org.fcrepo.search.api.SearchIndex searchIndex
-
fedoraPropsConfig
@Inject protected org.fcrepo.config.FedoraPropsConfig fedoraPropsConfig
-
userTypesCache
@Inject protected org.fcrepo.kernel.api.cache.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 org.fcrepo.kernel.api.exception.RequestWithAclLinkHeaderException
Check that we don't try to provide an ACL Link header.- Parameters:
links- list of the link headers provided.- Throws:
org.fcrepo.kernel.api.exception.RequestWithAclLinkHeaderException- If we provide an rel="acl" link header.
-
ensureValidDirectContainer
protected void ensureValidDirectContainer(org.fcrepo.kernel.api.identifiers.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(org.fcrepo.kernel.api.Transaction transaction, org.fcrepo.kernel.api.identifiers.FedoraId fedoraId, org.fcrepo.kernel.api.operations.ResourceOperation operation)
-
updateReferences
protected void updateReferences(org.fcrepo.kernel.api.Transaction transaction, org.fcrepo.kernel.api.identifiers.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(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.persistence.api.PersistentStorageSession pSession, org.fcrepo.kernel.api.identifiers.FedoraId fedoraId)
-
lockArchivalGroupResourceFromParent
protected void lockArchivalGroupResourceFromParent(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.persistence.api.PersistentStorageSession pSession, org.fcrepo.kernel.api.identifiers.FedoraId parentId)
-
-