Class FedoraBaseResource

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.fcrepo.common.db.DbTransactionExecutor dbTransactionExecutor  
      protected org.fcrepo.http.commons.api.rdf.HttpIdentifierConverter identifierConverter  
      protected org.fcrepo.kernel.api.models.ResourceFactory resourceFactory  
      protected org.fcrepo.kernel.api.models.ResourceHelper resourceHelper  
      protected javax.ws.rs.core.SecurityContext securityContext  
      protected javax.servlet.http.HttpServletRequest servletRequest  
      protected org.fcrepo.kernel.api.TransactionManager txManager  
      • Fields inherited from class org.fcrepo.http.commons.AbstractResource

        defaultPidMinter, fedoraPropsConfig, headers, pidMinter, uriInfo, versionService
    • Field Detail

      • securityContext

        @Context
        protected javax.ws.rs.core.SecurityContext securityContext
      • resourceFactory

        @Inject
        protected org.fcrepo.kernel.api.models.ResourceFactory resourceFactory
      • resourceHelper

        @Inject
        protected org.fcrepo.kernel.api.models.ResourceHelper resourceHelper
      • servletRequest

        @Context
        protected javax.servlet.http.HttpServletRequest servletRequest
      • txManager

        @Inject
        protected org.fcrepo.kernel.api.TransactionManager txManager
      • dbTransactionExecutor

        @Inject
        protected org.fcrepo.common.db.DbTransactionExecutor dbTransactionExecutor
      • identifierConverter

        protected org.fcrepo.http.commons.api.rdf.HttpIdentifierConverter identifierConverter
    • Method Detail

      • identifierConverter

        protected org.fcrepo.http.commons.api.rdf.HttpIdentifierConverter identifierConverter()
      • getFedoraResource

        protected org.fcrepo.kernel.api.models.FedoraResource getFedoraResource​(org.fcrepo.kernel.api.Transaction transaction,
                                                                                org.fcrepo.kernel.api.identifiers.FedoraId fedoraId)
                                                                         throws org.fcrepo.kernel.api.exception.PathNotFoundException
        Gets a fedora resource by id. Uses the provided transaction if it is uncommitted, or uses a new transaction.
        Parameters:
        transaction - the fedora transaction
        fedoraId - identifier of the resource
        Returns:
        the requested FedoraResource
        Throws:
        org.fcrepo.kernel.api.exception.PathNotFoundException
      • doesResourceExist

        protected boolean doesResourceExist​(org.fcrepo.kernel.api.Transaction transaction,
                                            org.fcrepo.kernel.api.identifiers.FedoraId fedoraId,
                                            boolean includeDeleted)
        Parameters:
        transaction - the transaction in which to check
        fedoraId - identifier of the object to check
        includeDeleted - Whether to check for deleted resources too.
        Returns:
        Returns true if an object with the provided id exists
      • isGhostNode

        protected boolean isGhostNode​(org.fcrepo.kernel.api.Transaction transaction,
                                      org.fcrepo.kernel.api.identifiers.FedoraId fedoraId)
        Parameters:
        transaction - the transaction in which to check
        fedoraId - identifier of the object to check
        Returns:
        Returns true if object does not exist but whose ID starts other resources that do exist.
      • transaction

        protected org.fcrepo.kernel.api.Transaction transaction()
      • doInDbTxWithRetry

        protected void doInDbTxWithRetry​(Runnable action)
        Executes the runnable within a DB transaction that will retry entire block on MySQL deadlock exceptions. If the runnable throws an exception, after completing any retires, then the Fedora transaction is marked as failed.
        Parameters:
        action - the code to execute
      • doInDbTx

        protected void doInDbTx​(Runnable action)
        Executes the runnable within a DB transaction. The block is NOT retried on MySQL deadlock exceptions. If the runnable throws an exception, then the Fedora transaction is marked as failed.
        Parameters:
        action - the code to execute