|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface WorkspaceNode<K,V>
Represents a type of Node that is to be copied into a TransactionWorkspace for optimistically locked
nodes. Adds versioning and dirty flags over conventional Nodes.
Configuration.NodeLockingScheme.OPTIMISTIC
| Method Summary | |
|---|---|
void |
addChild(WorkspaceNode<K,V> workspaceNode)
Adds a given WorkspaceNode to the current node's child map |
NodeSPI |
createChild(Object child_name,
NodeSPI<K,V> parent,
CacheSPI<K,V> cache,
DataVersion version)
Creates a child node. |
NodeSPI<K,V> |
getChild(Fqn f)
Overrides Node.getChild(Fqn) to return a NodeSPI rather than a Node |
NodeSPI<K,V> |
getChild(Object o)
Overrides Node.getChild(Object) to return a NodeSPI rather than a Node |
Map<K,V> |
getMergedData()
Attempts to merge data changed during the current transaction with the data in the underlying tree. |
List<Set<Fqn>> |
getMergedChildren()
Returns 2 Sets - a set of children added (first set) and a set of children removed. |
NodeSPI<K,V> |
getNode()
Retrieves a reference to the underlying NodeSPI instance. |
TransactionWorkspace |
getTransactionWorkspace()
Retrieves a TransactionWorkspace instance associated with the current transaction, which the current WorkspaceNode instance lives in. |
DataVersion |
getVersion()
Retrieves the data version of the in-memory node. |
boolean |
isCreated()
|
boolean |
isDeleted()
|
boolean |
isDirty()
A convenience method that returns whether a node is dirty, i.e., it has been created, deleted or modified. |
boolean |
isChildrenLoaded()
|
boolean |
isChildrenModified()
|
boolean |
isModified()
A node is considered modified if it's data map has changed. |
boolean |
isResurrected()
|
boolean |
isVersioningImplicit()
Tests whether versioning for the WorkspaceNode instance in the current transaction is implicit (i.e., using DefaultDataVersion
rather than a custom DataVersion passed in using Option.setDataVersion(DataVersion)) |
void |
markAsCreated()
Marks the instance as having been created in the current transaction. |
void |
markAsDeleted(boolean marker)
Marks the node as being deleted (or not) in the current transaction. |
void |
markAsDeleted(boolean marker,
boolean recursive)
Same as markAsDeleted(boolean) except that the option to recurse into children is provided. |
void |
markAsResurrected(boolean resurrected)
Marks a node as resurrected, i.e., deleted and created again within the same transaction |
void |
setVersion(DataVersion version)
Sets the data version of this workspace node. |
void |
setVersioningImplicit(boolean b)
Sets whether versioning for the WorkspaceNode instance in the current transaction is implicit (i.e., using DefaultDataVersion
rather than a custom DataVersion passed in using Option.setDataVersion(DataVersion)) |
| Methods inherited from interface org.jboss.cache.Node |
|---|
addChild, clearData, dataSize, get, getData, getFqn, getChildren, getChildrenNames, getKeys, getParent, hasChild, hasChild, isLockForChildInsertRemove, isResident, isValid, put, putAll, putIfAbsent, releaseObjectReferences, remove, removeChild, removeChild, replace, replace, replaceAll, setLockForChildInsertRemove, setResident |
| Method Detail |
|---|
List<Set<Fqn>> getMergedChildren()
DataVersion getVersion()
void setVersion(DataVersion version)
version - a DataVersion implementation.boolean isModified()
isChildrenModified().
boolean isDirty()
isChildrenModified()
Map<K,V> getMergedData()
NodeSPI<K,V> getNode()
NodeSPI instance.
TransactionWorkspace getTransactionWorkspace()
boolean isCreated()
void markAsCreated()
NodeSPI createChild(Object child_name,
NodeSPI<K,V> parent,
CacheSPI<K,V> cache,
DataVersion version)
child_name - Object name of the child to createparent - A reference to the parent nodecache - CacheSPI instance to create this node inversion - DataVersion to apply to the child. If null, DefaultDataVersion.ZERO will be used.
boolean isVersioningImplicit()
DefaultDataVersion
rather than a custom DataVersion passed in using Option.setDataVersion(DataVersion))
void setVersioningImplicit(boolean b)
DefaultDataVersion
rather than a custom DataVersion passed in using Option.setDataVersion(DataVersion))
b - set to true if versioning is implicit, false otherwise.boolean isDeleted()
void markAsDeleted(boolean marker)
marker - true if the node has been deleted, false if not.
void markAsDeleted(boolean marker,
boolean recursive)
markAsDeleted(boolean) except that the option to recurse into children is provided.
marker - true if the node has been deleted, false if not.recursive - if true, child nodes (and their children) are marked as well.NodeSPI<K,V> getChild(Object o)
Node.getChild(Object) to return a NodeSPI rather than a Node
getChild in interface Node<K,V>o - node name
NodeSPI<K,V> getChild(Fqn f)
Node.getChild(Fqn) to return a NodeSPI rather than a Node
getChild in interface Node<K,V>f - node fqn
void addChild(WorkspaceNode<K,V> workspaceNode)
workspaceNode - boolean isChildrenModified()
boolean isChildrenLoaded()
boolean isResurrected()
void markAsResurrected(boolean resurrected)
resurrected -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||