java.lang.Object
org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle<org.apache.jena.dboe.trans.data.TransBlob.BlobState>
org.apache.jena.dboe.trans.data.TransBlob
All Implemented Interfaces:
org.apache.jena.dboe.transaction.txn.TransactionalComponent

public class TransBlob extends org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle<org.apache.jena.dboe.trans.data.TransBlob.BlobState>
Manage a single binary (not too large) object. It is written and read from a file in one action, so changes completely replace the original contents. The whole object is written to the journal during prepare.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle

    org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle.ComponentState<X extends Object>
  • Constructor Summary

    Constructors
    Constructor
    Description
    TransBlob(org.apache.jena.dboe.transaction.txn.ComponentId cid, org.apache.jena.dboe.base.file.BufferChannel file)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
     
     
    Get data as string - convenience operation
    void
     
    void
    Set the byte buffer.
    void
    setString(String dataStr)
    Set data from string - convenience operation
    void
     
     

    Methods inherited from class org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle

    abort, attach, begin, commit, commitEnd, commitPrepare, complete, detach, getComponentId, getComponentState, promote, setComponentState, shutdown

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TransBlob

      public TransBlob(org.apache.jena.dboe.transaction.txn.ComponentId cid, org.apache.jena.dboe.base.file.BufferChannel file)
  • Method Details

    • setBlob

      public void setBlob(ByteBuffer bb)
      Set the byte buffer. The byte buffer should not be accessed except by getBlob(). We avoid a copy in and copy out - we trust the caller. The byte buffer should be configured for read if used with getString().
    • getBlob

      public ByteBuffer getBlob()
    • setString

      public void setString(String dataStr)
      Set data from string - convenience operation
    • getString

      public String getString()
      Get data as string - convenience operation
    • startRecovery

      public void startRecovery()
      Specified by:
      startRecovery in interface org.apache.jena.dboe.transaction.txn.TransactionalComponent
      Specified by:
      startRecovery in class org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle<org.apache.jena.dboe.trans.data.TransBlob.BlobState>
    • recover

      public void recover(ByteBuffer ref)
      Specified by:
      recover in interface org.apache.jena.dboe.transaction.txn.TransactionalComponent
      Specified by:
      recover in class org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle<org.apache.jena.dboe.trans.data.TransBlob.BlobState>
    • finishRecovery

      public void finishRecovery()
      Specified by:
      finishRecovery in interface org.apache.jena.dboe.transaction.txn.TransactionalComponent
      Specified by:
      finishRecovery in class org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle<org.apache.jena.dboe.trans.data.TransBlob.BlobState>
    • cleanStart

      public void cleanStart()
    • toString

      public String toString()
      Overrides:
      toString in class Object