public class NodeWriteTrx extends Object implements INodeWriteTrx
Single-threaded instance of only write transaction per session.
All methods throw NullPointerException
s in case of null values for reference parameters.
Modifier and Type | Class and Description |
---|---|
static class |
NodeWriteTrx.HashKind
How is the Hash for this storage computed?
|
Constructor and Description |
---|
NodeWriteTrx(ISession pSession,
IBucketWriteTrx pPageWriteTrx,
NodeWriteTrx.HashKind kind)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Abort all modifications of the exclusive write transaction.
|
static String |
buildName(QName pQName)
Building name consisting out of prefix and name.
|
void |
close()
Closing current NodeWriteTrx.
|
void |
commit()
ICommitStrategy all modifications of the exclusive write transaction.
|
INode |
getNode()
Getting the current node.
|
IBucketWriteTrx |
getPageWtx()
Getting the Page Transaction
|
QName |
getQNameOfCurrentNode()
Getting the name of a current node.
|
String |
getTypeOfCurrentNode()
Getting the type of the current node.
|
String |
getValueOfCurrentNode()
Getting the value of the current node.
|
long |
insertAttribute(QName pQName,
String pValue)
Insert attribute in currently selected node.
|
long |
insertElementAsFirstChild(QName pQName)
Insert new element node as first child of currently selected node.
|
long |
insertElementAsRightSibling(QName pQName)
Insert new element node as right sibling of currently selected node.
|
long |
insertNamespace(QName pQName)
Insert namespace declaration in currently selected node.
|
long |
insertTextAsFirstChild(String pValue)
Insert new text node as first child of currently selected node.
|
long |
insertTextAsRightSibling(String pValue)
Insert new text node as right sibling of currently selected node.
|
boolean |
isClosed()
Is this transaction closed?
|
boolean |
moveTo(long pKey)
Move cursor to a node by its node key.
|
boolean |
moveToAttribute(int pIndex)
Move cursor to attribute by its index.
|
boolean |
moveToNamespace(int pIndex)
Move cursor to namespace declaration by its index.
|
String |
nameForKey(int pKey)
Get name for key.
|
void |
remove()
Remove currently selected node.
|
void |
revertTo(long pRevision)
Reverting all changes to the revision defined.
|
void |
setQName(QName paramName)
Set QName of node.
|
void |
setURI(String paramUri)
Set URI of node.
|
void |
setValue(String pValue)
Set value of node.
|
String |
toString() |
public NodeWriteTrx(ISession pSession, IBucketWriteTrx pPageWriteTrx, NodeWriteTrx.HashKind kind) throws TTException
pSession
- state of the sessionpPageWriteTrx
- state of this transactionTTIOException
- if the reading of the props is failingTTUsageException
- if paramMaxNodeCount < 0 or paramMaxTime < 0TTException
public long insertElementAsFirstChild(QName pQName) throws TTException, NullPointerException
insertElementAsFirstChild
in interface INodeWriteTrx
pQName
- QName
of node to insertTTException
- if element node couldn't be inserted as first childNullPointerException
public long insertElementAsRightSibling(QName pQName) throws TTException
insertElementAsRightSibling
in interface INodeWriteTrx
pQName
- QName
of the new nodeTTException
- if element node couldn't be inserted as right siblingpublic long insertTextAsFirstChild(String pValue) throws TTException
insertTextAsFirstChild
in interface INodeWriteTrx
pValue
- value of node to insertTTException
- if text node couldn't be inserted as first child.public long insertTextAsRightSibling(String pValue) throws TTException
insertTextAsRightSibling
in interface INodeWriteTrx
pValue
- value of node to insertTTException
- if text node couldn't be inserted as right siblingpublic long insertAttribute(QName pQName, String pValue) throws TTException
insertAttribute
in interface INodeWriteTrx
pQName
- QName
referencepValue
- value of inserted nodeTTException
- if attribute couldn't be inserted.public long insertNamespace(QName pQName) throws TTException
insertNamespace
in interface INodeWriteTrx
pQName
- QName
referenceTTException
- if attribute couldn't be inserted.public void remove() throws TTException
remove
in interface INodeWriteTrx
TTException
- if node couldn't be removedpublic void setQName(QName paramName) throws TTException
setQName
in interface INodeWriteTrx
paramName
- New qualified name of node.TTIOException
- If can't set Name in node.TTException
public void setURI(String paramUri) throws TTException
setURI
in interface INodeWriteTrx
paramUri
- new URI of nodeTTIOException
- if URI of node couldn't be setTTException
public void setValue(String pValue) throws TTException
setValue
in interface INodeWriteTrx
pValue
- new value of nodeTTIOException
- if value couldn't be setTTException
public void revertTo(long pRevision) throws TTException
revertTo
in interface INodeWriteTrx
pRevision
- revert to the revisionTTUsageException
- if paramRevision < 0 or paramRevision > maxCommitedRevTTIOException
- if an I/O operation failsTTException
- if couldn't revert to revisionpublic void commit() throws TTException
commit
in interface INodeWriteTrx
TTException
- if this revision couldn't be commitedpublic void abort() throws TTException
abort
in interface INodeWriteTrx
TTIOException
- if this revision couldn't be abortedTTException
public void close() throws TTException
close
in interface INodeReadTrx
close
in interface INodeWriteTrx
TTException
- if write transaction couldn't be closedpublic boolean moveTo(long pKey) throws TTIOException
moveTo
in interface INodeReadTrx
pKey
- Key of node to select.TTIOException
- if retrieval fails (including non-existing of node)public boolean moveToAttribute(int pIndex) throws TTIOException
moveToAttribute
in interface INodeReadTrx
pIndex
- Index of attribute to move to.TTIOException
- if retrieval fails (including non-existing of node)public boolean moveToNamespace(int pIndex) throws TTIOException
moveToNamespace
in interface INodeReadTrx
pIndex
- Index of attribute to move to.TTIOException
- if retrieval fails (including non-existing of node)public String getValueOfCurrentNode()
getValueOfCurrentNode
in interface INodeReadTrx
public QName getQNameOfCurrentNode()
getQNameOfCurrentNode
in interface INodeReadTrx
QName
of the nodepublic String getTypeOfCurrentNode()
getTypeOfCurrentNode
in interface INodeReadTrx
public String nameForKey(int pKey)
nameForKey
in interface INodeReadTrx
pKey
- Key, i.e., local part key, URI key, or prefix key.public INode getNode()
getNode
in interface INodeReadTrx
public boolean isClosed()
isClosed
in interface INodeReadTrx
public IBucketWriteTrx getPageWtx() throws TTException
getPageWtx
in interface INodeWriteTrx
IBucketWriteTrx
.TTException
public static String buildName(QName pQName)
pQName
- the QName
of an elementCopyright © 2013. All Rights Reserved.