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
Abstract service for interacting with a kernel service
- Author:
- whikloj, bseeger
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.fcrepo.kernel.api.ContainmentIndexprotected org.fcrepo.config.FedoraPropsConfigprotected org.fcrepo.kernel.api.services.MembershipServiceprotected org.fcrepo.kernel.api.services.ReferenceServiceprotected org.fcrepo.search.api.SearchIndexprotected org.fcrepo.kernel.api.cache.UserTypesCache -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 voidlockParent(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 Details
-
containmentIndex
@Autowired @Qualifier("containmentIndex") protected org.fcrepo.kernel.api.ContainmentIndex containmentIndex -
referenceService
@Autowired @Qualifier("referenceService") protected org.fcrepo.kernel.api.services.ReferenceService referenceService -
membershipService
-
searchIndex
-
fedoraPropsConfig
-
userTypesCache
-
-
Constructor Details
-
AbstractService
public AbstractService()
-
-
Method Details
-
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
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) -
lockParent
protected void lockParent(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.persistence.api.PersistentStorageSession pSession, org.fcrepo.kernel.api.identifiers.FedoraId parentId)
-