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.ContainmentIndex
     
    protected org.fcrepo.config.FedoraPropsConfig
     
    protected org.fcrepo.kernel.api.services.MembershipService
     
    protected org.fcrepo.kernel.api.services.ReferenceService
     
    protected org.fcrepo.search.api.SearchIndex
     
    protected org.fcrepo.kernel.api.cache.UserTypesCache
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    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 accessToClass
    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.
    protected void
    lockArchivalGroupResource(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.persistence.api.PersistentStorageSession pSession, org.fcrepo.kernel.api.identifiers.FedoraId fedoraId)
     
    protected void
    lockParent(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.persistence.api.PersistentStorageSession pSession, org.fcrepo.kernel.api.identifiers.FedoraId parentId)
     
    protected void
    recordEvent(org.fcrepo.kernel.api.Transaction transaction, org.fcrepo.kernel.api.identifiers.FedoraId fedoraId, org.fcrepo.kernel.api.operations.ResourceOperation operation)
     
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      @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 Details

  • 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 described
      interactionModel - interaction model of the resource
      model - 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)
    • lockParent

      protected void lockParent(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.persistence.api.PersistentStorageSession pSession, org.fcrepo.kernel.api.identifiers.FedoraId parentId)