org.jboss.cache.optimistic
Interface WorkspaceNode<K,V>

All Known Implementing Classes:
WorkspaceNodeImpl

Deprecated. will be removed along with optimistic and pessimistic locking.

@Deprecated
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.

Typically used when the cache mode configured is Configuration.NodeLockingScheme.OPTIMISTIC

Since:
1.3.0
Author:
Manik Surtani (manik AT jboss DOT org), Steve Woodcock (stevew@jofti.com)

Method Summary
 void addChild(WorkspaceNode<K,V> workspaceNode)
          Deprecated. Adds a given WorkspaceNode to the current node's child map
 void clearData()
          Deprecated.  
 NodeSPI createChild(Object child_name, NodeSPI<K,V> parent, CacheSPI<K,V> cache, DataVersion version)
          Deprecated. Creates a child node.
 V get(K key)
          Deprecated.  
 NodeSPI<K,V> getChildDirect(Fqn f)
          Deprecated. Overrides Node.getChild(Fqn) to return a NodeSPI rather than a Node
 NodeSPI<K,V> getChildDirect(Object o)
          Deprecated. Overrides Node.getChild(Object) to return a NodeSPI rather than a Node
 Set<Object> getChildrenNames()
          Deprecated.  
 Map<K,V> getData()
          Deprecated.  
 Fqn getFqn()
          Deprecated.  
 Set<K> getKeys()
          Deprecated.  
 List<Set<Fqn>> getMergedChildren()
          Deprecated. Returns 2 Sets - a set of children added (first set) and a set of children removed.
 Map<K,V> getMergedData()
          Deprecated. Attempts to merge data changed during the current transaction with the data in the underlying tree.
 NodeSPI<K,V> getNode()
          Deprecated. Retrieves a reference to the underlying NodeSPI instance.
 TransactionWorkspace getTransactionWorkspace()
          Deprecated. Retrieves a TransactionWorkspace instance associated with the current transaction, which the current WorkspaceNode instance lives in.
 DataVersion getVersion()
          Deprecated. Retrieves the data version of the in-memory node.
 boolean isChildrenLoaded()
          Deprecated.  
 boolean isChildrenModified()
          Deprecated.  
 boolean isCreated()
          Deprecated.  
 boolean isDirty()
          Deprecated. A convenience method that returns whether a node is dirty, i.e., it has been created, deleted or modified.
 boolean isModified()
          Deprecated. A node is considered modified if its data map has changed.
 boolean isRemoved()
          Deprecated.  
 boolean isResurrected()
          Deprecated.  
 boolean isVersioningImplicit()
          Deprecated. 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()
          Deprecated. Marks the instance as having been created in the current transaction.
 void markAsRemoved(boolean marker, boolean recursive)
          Deprecated.  
 void markAsResurrected(boolean resurrected)
          Deprecated. Marks a node as resurrected, i.e., deleted and created again within the same transaction
 V put(K key, V value)
          Deprecated.  
 void putAll(Map<K,V> data)
          Deprecated.  
 V remove(K removeKey)
          Deprecated.  
 boolean removeChild(Object nodeName)
          Deprecated.  
 void setRemoved(boolean marker)
          Deprecated.  
 void setVersion(DataVersion version)
          Deprecated. Sets the data version of this workspace node.
 void setVersioningImplicit(boolean b)
          Deprecated. 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))
 

Method Detail

getFqn

Fqn getFqn()
Deprecated. 

getMergedChildren

List<Set<Fqn>> getMergedChildren()
Deprecated. 
Returns 2 Sets - a set of children added (first set) and a set of children removed.

Returns:
a merged map of child names and Nodes

getVersion

DataVersion getVersion()
Deprecated. 
Retrieves the data version of the in-memory node.

Returns:
A data version

setVersion

void setVersion(DataVersion version)
Deprecated. 
Sets the data version of this workspace node.

Parameters:
version - a DataVersion implementation.

isModified

boolean isModified()
Deprecated. 
A node is considered modified if its 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()
Deprecated. 
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

Map<K,V> getMergedData()
Deprecated. 
Attempts to merge data changed during the current transaction with the data in the underlying tree.

Returns:
a merged map of key/value pairs.

getNode

NodeSPI<K,V> getNode()
Deprecated. 
Retrieves a reference to the underlying NodeSPI instance.

Returns:
a node

getTransactionWorkspace

TransactionWorkspace getTransactionWorkspace()
Deprecated. 
Retrieves a TransactionWorkspace instance associated with the current transaction, which the current WorkspaceNode instance lives in.

Returns:
a TransactionWorkspace.

isCreated

boolean isCreated()
Deprecated. 
Returns:
true if the instance was created in the current transaction; i.e., it did not exist in the underlying data tree.

markAsCreated

void markAsCreated()
Deprecated. 
Marks the instance as having been created in the current transaction.


createChild

NodeSPI createChild(Object child_name,
                    NodeSPI<K,V> parent,
                    CacheSPI<K,V> cache,
                    DataVersion version)
Deprecated. 
Creates a child node.

Parameters:
child_name - Object name of the child to create
parent - A reference to the parent node
cache - CacheSPI instance to create this node in
version - DataVersion to apply to the child. If null, DefaultDataVersion.ZERO will be used.
Returns:
a NodeSPI pointing to the newly created child.

isVersioningImplicit

boolean isVersioningImplicit()
Deprecated. 
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))

Returns:
true if versioning is implicit.

setVersioningImplicit

void setVersioningImplicit(boolean b)
Deprecated. 
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))

Parameters:
b - set to true if versioning is implicit, false otherwise.

getChildDirect

NodeSPI<K,V> getChildDirect(Object o)
Deprecated. 
Overrides Node.getChild(Object) to return a NodeSPI rather than a Node

Parameters:
o - node name
Returns:
a child node

getChildDirect

NodeSPI<K,V> getChildDirect(Fqn f)
Deprecated. 
Overrides Node.getChild(Fqn) to return a NodeSPI rather than a Node

Parameters:
f - node fqn
Returns:
a child node

addChild

void addChild(WorkspaceNode<K,V> workspaceNode)
Deprecated. 
Adds a given WorkspaceNode to the current node's child map

Parameters:
workspaceNode -

isChildrenModified

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

isChildrenLoaded

boolean isChildrenLoaded()
Deprecated. 
Returns:
true if the child map has been loaded from the underlying data structure into the workspace.

isResurrected

boolean isResurrected()
Deprecated. 
Returns:
teur if this node has been resurrected, i.e., it was deleted and re-added within the same transaction

markAsResurrected

void markAsResurrected(boolean resurrected)
Deprecated. 
Marks a node as resurrected, i.e., deleted and created again within the same transaction

Parameters:
resurrected -

isRemoved

boolean isRemoved()
Deprecated. 

setRemoved

void setRemoved(boolean marker)
Deprecated. 

markAsRemoved

void markAsRemoved(boolean marker,
                   boolean recursive)
Deprecated. 

clearData

void clearData()
Deprecated. 

getData

Map<K,V> getData()
Deprecated. 

remove

V remove(K removeKey)
Deprecated. 

get

V get(K key)
Deprecated. 

getKeys

Set<K> getKeys()
Deprecated. 

getChildrenNames

Set<Object> getChildrenNames()
Deprecated. 

removeChild

boolean removeChild(Object nodeName)
Deprecated. 

putAll

void putAll(Map<K,V> data)
Deprecated. 

put

V put(K key,
      V value)
Deprecated. 


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.