org.jboss.cache
Class VersionedNode<K,V>

java.lang.Object
  extended by org.jboss.cache.AbstractNode<K,V>
      extended by org.jboss.cache.UnversionedNode<K,V>
          extended by org.jboss.cache.VersionedNode<K,V>
All Implemented Interfaces:
Node<K,V>, NodeSPI<K,V>

public class VersionedNode<K,V>
extends UnversionedNode<K,V>

VersionedNode extends the UnversionedNode by adding a DataVersion property.

Unlike UnversionedNode, this node supports getVersion() and setVersion(org.jboss.cache.optimistic.DataVersion) defined in NodeSPI

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

Since:
2.0.0
Author:
Manik Surtani (manik@jboss.org)

Field Summary
 
Fields inherited from class org.jboss.cache.AbstractNode
children, deleted, fqn
 
Constructor Summary
protected VersionedNode(Fqn fqn, NodeSPI<K,V> parent, java.util.Map<K,V> data, CacheSPI<K,V> cache)
           
 
Method Summary
 NodeSPI<K,V> getParent()
          Returns the parent.
 DataVersion getVersion()
          Returns the version id of this node.
 void setVersion(DataVersion version)
          Sets the version id of this node.
 
Methods inherited from class org.jboss.cache.UnversionedNode
addChild, addChild, addChildDirect, addChildDirect, clearData, clearDataDirect, dataSize, get, getCache, getChild, getChild, getChildDirect, getChildDirect, getChildren, getChildrenDirect, getChildrenDirect, getChildrenMapDirect, getChildrenNames, getChildrenNamesDirect, getData, getDataDirect, getDirect, getFqn, getKeys, getKeysDirect, getLock, getOrCreateChild, hasChild, hasChild, hasChildrenDirect, isChildrenLoaded, isDataLoaded, isValid, print, printDetails, put, putAll, putAllDirect, putDirect, putIfAbsent, remove, removeChild, removeChild, removeChildDirect, removeChildDirect, removeChildrenDirect, removeDirect, replace, replace, replaceAll, setChildrenLoaded, setChildrenMapDirect, setDataLoaded, setFqn, toString
 
Methods inherited from class org.jboss.cache.AbstractNode
equals, hashCode, isDeleted, markAsDeleted, markAsDeleted
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.cache.NodeSPI
isDeleted, markAsDeleted, markAsDeleted
 

Constructor Detail

VersionedNode

protected VersionedNode(Fqn fqn,
                        NodeSPI<K,V> parent,
                        java.util.Map<K,V> data,
                        CacheSPI<K,V> cache)
Method Detail

getVersion

public DataVersion getVersion()
Returns the version id of this node.

Specified by:
getVersion in interface NodeSPI<K,V>
Overrides:
getVersion in class UnversionedNode<K,V>
Returns:
the version

getParent

public NodeSPI<K,V> getParent()
Returns the parent.

Specified by:
getParent in interface Node<K,V>
Specified by:
getParent in interface NodeSPI<K,V>
Overrides:
getParent in class UnversionedNode<K,V>
Returns:
the parent node, or null if this is the root node
See Also:
Node.getParent()

setVersion

public void setVersion(DataVersion version)
Sets the version id of this node.

Specified by:
setVersion in interface NodeSPI<K,V>
Overrides:
setVersion in class UnversionedNode<K,V>
Parameters:
version -