Class TransactionImpl

java.lang.Object
org.fcrepo.kernel.impl.TransactionImpl
All Implemented Interfaces:
org.fcrepo.kernel.api.Transaction

public class TransactionImpl extends Object implements org.fcrepo.kernel.api.Transaction
The Fedora Transaction implementation
Author:
mohideen
  • Constructor Details

  • Method Details

    • commit

      public void commit()
      Specified by:
      commit in interface org.fcrepo.kernel.api.Transaction
    • isCommitted

      public boolean isCommitted()
      Specified by:
      isCommitted in interface org.fcrepo.kernel.api.Transaction
    • rollback

      public void rollback()
      Specified by:
      rollback in interface org.fcrepo.kernel.api.Transaction
    • doInTx

      public void doInTx(Runnable runnable)
      Specified by:
      doInTx in interface org.fcrepo.kernel.api.Transaction
    • fail

      public void fail()
      Specified by:
      fail in interface org.fcrepo.kernel.api.Transaction
    • isRolledBack

      public boolean isRolledBack()
      Specified by:
      isRolledBack in interface org.fcrepo.kernel.api.Transaction
    • getId

      public String getId()
      Specified by:
      getId in interface org.fcrepo.kernel.api.Transaction
    • setShortLived

      public void setShortLived(boolean shortLived)
      Specified by:
      setShortLived in interface org.fcrepo.kernel.api.Transaction
    • isShortLived

      public boolean isShortLived()
      Specified by:
      isShortLived in interface org.fcrepo.kernel.api.Transaction
    • isOpenLongRunning

      public boolean isOpenLongRunning()
      Specified by:
      isOpenLongRunning in interface org.fcrepo.kernel.api.Transaction
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface org.fcrepo.kernel.api.Transaction
    • ensureCommitting

      public void ensureCommitting()
      Specified by:
      ensureCommitting in interface org.fcrepo.kernel.api.Transaction
    • isReadOnly

      public boolean isReadOnly()
      Specified by:
      isReadOnly in interface org.fcrepo.kernel.api.Transaction
    • expire

      public void expire()
      Specified by:
      expire in interface org.fcrepo.kernel.api.Transaction
    • hasExpired

      public boolean hasExpired()
      Specified by:
      hasExpired in interface org.fcrepo.kernel.api.Transaction
    • updateExpiry

      public Instant updateExpiry(Duration amountToAdd)
      Specified by:
      updateExpiry in interface org.fcrepo.kernel.api.Transaction
    • getExpires

      public Instant getExpires()
      Specified by:
      getExpires in interface org.fcrepo.kernel.api.Transaction
    • commitIfShortLived

      public void commitIfShortLived()
      Specified by:
      commitIfShortLived in interface org.fcrepo.kernel.api.Transaction
    • refresh

      public void refresh()
      Specified by:
      refresh in interface org.fcrepo.kernel.api.Transaction
    • lockResource

      public void lockResource(org.fcrepo.kernel.api.identifiers.FedoraId resourceId)
      Specified by:
      lockResource in interface org.fcrepo.kernel.api.Transaction
    • lockResourceNonExclusive

      public void lockResourceNonExclusive(org.fcrepo.kernel.api.identifiers.FedoraId resourceId)
      Specified by:
      lockResourceNonExclusive in interface org.fcrepo.kernel.api.Transaction
    • lockResourceAndGhostNodes

      public void lockResourceAndGhostNodes(org.fcrepo.kernel.api.identifiers.FedoraId resourceId)
      If you create an object with ghost nodes above it, we need to lock those paths as well to ensure no other operation alters them while the current transaction is in process.
      Specified by:
      lockResourceAndGhostNodes in interface org.fcrepo.kernel.api.Transaction
      Parameters:
      resourceId - the resource we are creating
    • releaseResourceLocksIfShortLived

      Specified by:
      releaseResourceLocksIfShortLived in interface org.fcrepo.kernel.api.Transaction
    • setBaseUri

      public void setBaseUri(String baseUri)
      Specified by:
      setBaseUri in interface org.fcrepo.kernel.api.Transaction
    • setUserAgent

      public void setUserAgent(String userAgent)
      Specified by:
      setUserAgent in interface org.fcrepo.kernel.api.Transaction
    • suppressEvents

      public void suppressEvents()
      Specified by:
      suppressEvents in interface org.fcrepo.kernel.api.Transaction
    • toString

      public String toString()
      Overrides:
      toString in class Object