org.jboss.cache.optimistic
Interface WorkspaceNode

All Superinterfaces:
TreeNode
All Known Implementing Classes:
WorkspaceNodeImpl

public interface WorkspaceNode
extends TreeNode

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.

Author:
Manik Surtani (manik@jboss.org), Steve Woodcock (stevew@jofti.com), Galder Zamarreno

Method Summary
 void addChild(WorkspaceNode workspaceNode)
           
 TreeNode createChild(java.lang.Object child_name, Fqn fqn, TreeNode parent, TreeCache cache, DataVersion version)
           
 java.util.Set getChildrenNames()
           
 java.util.Set getKeys()
           
 java.util.List getMergedChildren()
           
 java.util.Map getMergedData()
           
 DataNode getNode()
           
 TransactionWorkspace getTransactionWorkspace()
           
 DataVersion getVersion()
           
 boolean isChildrenModified()
           
 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 isModified()
          A node is considered modified if it's data map has changed.
 boolean isVersioningImplicit()
           
 void markAsCreated()
           
 void markAsDeleted(boolean marker)
           
 void setVersion(DataVersion version)
           
 void setVersioningImplicit(boolean b)
           
 
Methods inherited from interface org.jboss.cache.TreeNode
acquireAll, addChild, childExists, clear, containsKey, createChild, createChild, get, getChild, getChildren, getChildrenLoaded, getData, getDataKeys, getFqn, getImmutableLock, getLock, getName, getOrCreateChild, getParent, hasChildren, isLocked, numAttributes, print, printDetails, printIndent, printLockInfo, put, put, put, release, releaseAll, releaseAllForce, releaseForce, remove, removeAllChildren, removeChild, setChildren, setChildrenLoaded, setRecursiveTreeCacheInstance
 

Method Detail

getMergedChildren

java.util.List getMergedChildren()
Returns:
Returns 2 Sets - a set of children added (first set) and a set of children removed.

getVersion

DataVersion getVersion()

setVersion

void setVersion(DataVersion version)

getKeys

java.util.Set getKeys()

isModified

boolean isModified()
A node is considered modified if it's data map has changed. If children are added or removed, the node is not considered modified - instead, see isChildrenModified().

Returns:
true if the data map has been modified

isDirty

boolean isDirty()
A convenience method that returns whether a node is dirty, i.e., it has been created, deleted or modified. Noe that adding or removing children does not constitute a node being dirty - see isChildrenModified()

Returns:
true if the node has been either created, deleted or modified.

getMergedData

java.util.Map getMergedData()

getNode

DataNode getNode()

getChildrenNames

java.util.Set getChildrenNames()

isDeleted

boolean isDeleted()

markAsDeleted

void markAsDeleted(boolean marker)

getTransactionWorkspace

TransactionWorkspace getTransactionWorkspace()

isCreated

boolean isCreated()

markAsCreated

void markAsCreated()

createChild

TreeNode createChild(java.lang.Object child_name,
                     Fqn fqn,
                     TreeNode parent,
                     TreeCache cache,
                     DataVersion version)

isVersioningImplicit

boolean isVersioningImplicit()

setVersioningImplicit

void setVersioningImplicit(boolean b)

addChild

void addChild(WorkspaceNode workspaceNode)

isChildrenModified

boolean isChildrenModified()
Returns:
true if children have been added to or removed from this node. Not the same as 'dirty'.


Copyright © 1998-2005 JBoss Inc . All Rights Reserved.