Package org.apache.jena.dboe.trans.data
Class TransBlob
- 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:
TransactionalComponent
public class TransBlob extends 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
TransactionalComponentLifecycle.ComponentState<X extends java.lang.Object>
-
-
Constructor Summary
Constructors Constructor Description TransBlob(ComponentId cid, org.apache.jena.dboe.base.file.BufferChannel file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanStart()voidfinishRecovery()java.nio.ByteBuffergetBlob()java.lang.StringgetString()Get data as string - convenience operationvoidrecover(java.nio.ByteBuffer ref)voidsetBlob(java.nio.ByteBuffer bb)Set the byte buffer.voidsetString(java.lang.String dataStr)Set data from string - convenience operationvoidstartRecovery()java.lang.StringtoString()-
Methods inherited from class org.apache.jena.dboe.transaction.txn.TransactionalComponentLifecycle
abort, attach, begin, commit, commitEnd, commitPrepare, complete, detach, getComponentId, getComponentState, promote, setComponentState, shutdown
-
-
-
-
Constructor Detail
-
TransBlob
public TransBlob(ComponentId cid, org.apache.jena.dboe.base.file.BufferChannel file)
-
-
Method Detail
-
setBlob
public void setBlob(java.nio.ByteBuffer bb)
Set the byte buffer. The byte buffer should not be accessed except bygetBlob(). We avoid a copy in and copy out - we trust the caller. The byte buffer should be configured for read if used withgetString().
-
getBlob
public java.nio.ByteBuffer getBlob()
-
setString
public void setString(java.lang.String dataStr)
Set data from string - convenience operation
-
getString
public java.lang.String getString()
Get data as string - convenience operation
-
startRecovery
public void startRecovery()
- Specified by:
startRecoveryin interfaceTransactionalComponent- Specified by:
startRecoveryin classTransactionalComponentLifecycle<org.apache.jena.dboe.trans.data.TransBlob.BlobState>
-
recover
public void recover(java.nio.ByteBuffer ref)
- Specified by:
recoverin interfaceTransactionalComponent- Specified by:
recoverin classTransactionalComponentLifecycle<org.apache.jena.dboe.trans.data.TransBlob.BlobState>
-
finishRecovery
public void finishRecovery()
- Specified by:
finishRecoveryin interfaceTransactionalComponent- Specified by:
finishRecoveryin classTransactionalComponentLifecycle<org.apache.jena.dboe.trans.data.TransBlob.BlobState>
-
cleanStart
public void cleanStart()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-