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

java.lang.Object
  extended by org.jboss.cache.AbstractNode<K,V>
      extended by org.jboss.cache.UnversionedNode<K,V>
Direct Known Subclasses:
VersionedNode

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

Basic data node class. Throws UnsupportedOperationException for version-specific methods like getVersion() and setVersion(org.jboss.cache.optimistic.DataVersion), defined in NodeSPI.

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

Field Summary
protected static org.apache.commons.logging.Log log
          Debug log.
protected static boolean trace
           
 
Fields inherited from class org.jboss.cache.AbstractNode
deleted, fqn, children, resident
 
Constructor Summary
  UnversionedNode()
          Constructs a new node with an FQN of Root.
protected UnversionedNode(Object child_name, Fqn fqn, Map<K,V> data, boolean mapSafe, CacheSPI<K,V> cache)
          Constructs a new node with a name, etc.
 
Method Summary
 Node<K,V> addChild(Fqn f)
           
 void addChild(Object child_name, Node<K,V> n)
           
 NodeSPI<K,V> addChildDirect(Fqn f)
           
 NodeSPI<K,V> addChildDirect(Fqn f, boolean notify)
           
 void addChildDirect(NodeSPI<K,V> child)
           
 void clearData()
           
 void clearDataDirect()
           
 int dataSize()
           
 V get(K key)
           
 CacheSPI<K,V> getCache()
           
 Map<K,V> getData()
           
 Map<K,V> getDataDirect()
           
 NodeSPI getDelegate()
           
 V getDirect(K key)
           
 Fqn getFqn()
          Returns the name of this node.
 Node<K,V> getChild(Fqn fqn)
           
 Node<K,V> getChild(Object childName)
           
 NodeSPI<K,V> getChildDirect(Fqn fqn)
           
 NodeSPI<K,V> getChildDirect(Object childName)
           
 Set<Node<K,V>> getChildren()
           
 Set<NodeSPI<K,V>> getChildrenDirect()
           
 Set<NodeSPI<K,V>> getChildrenDirect(boolean includeMarkedForRemoval)
           
 Map<Object,Node<K,V>> getChildrenMapDirect()
           
 Set<Object> getChildrenNames()
           
 Set<Object> getChildrenNamesDirect()
           
 Map getInternalState(boolean onlyInternalState)
           
 Set<K> getKeys()
           
 Set<K> getKeysDirect()
           
 IdentityLock getLock()
           
 NodeSPI<K,V> getOrCreateChild(Object child_name, GlobalTransaction gtx, boolean notify)
           
 NodeSPI<K,V> getParent()
          Returns a parent by checking the TreeMap by name.
 DataVersion getVersion()
           
 boolean hasChild(Fqn f)
           
 boolean hasChild(Object o)
           
 boolean hasChildrenDirect()
           
 boolean isDataLoaded()
          Returns true if the data was loaded from the cache loader.
 boolean isChildrenLoaded()
           
 boolean isLockForChildInsertRemove()
           
 boolean isValid()
           
 void print(StringBuffer sb, int indent)
           
 void printDetails(StringBuffer sb, int indent)
           
 V put(K key, V value)
           
 void putAll(Map<K,V> data)
           
 void putAllDirect(Map<K,V> data)
           
 V putDirect(K key, V value)
           
 V putIfAbsent(K k, V v)
           
 V remove(K key)
           
 V removeDirect(K key)
           
 boolean removeChild(Fqn fqn)
           
 boolean removeChild(Object childName)
           
 boolean removeChildDirect(Fqn f)
           
 boolean removeChildDirect(Object childName)
           
 void removeChildrenDirect()
           
 V replace(K key, V value)
           
 boolean replace(K key, V oldValue, V newValue)
           
 void replaceAll(Map<K,V> data)
           
 void setDataLoaded(boolean dataLoaded)
          Sets if the data was loaded from the cache loader.
 void setDelegate(NodeSPI delegate)
           
 void setFqn(Fqn fqn)
           
 void setChildrenLoaded(boolean flag)
           
 void setChildrenMapDirect(Map<Object,Node<K,V>> children)
           
 void setInternalState(Map state)
           
 void setLockForChildInsertRemove(boolean lockForChildInsertRemove)
           
 void setValid(boolean valid, boolean recursive)
           
 void setVersion(DataVersion version)
           
 String toString()
          Returns a debug string.
 
Methods inherited from class org.jboss.cache.AbstractNode
equals, hashCode, isDeleted, isResident, markAsDeleted, markAsDeleted, setResident
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
Debug log.


trace

protected static boolean trace
Constructor Detail

UnversionedNode

public UnversionedNode()
Constructs a new node with an FQN of Root.


UnversionedNode

protected UnversionedNode(Object child_name,
                          Fqn fqn,
                          Map<K,V> data,
                          boolean mapSafe,
                          CacheSPI<K,V> cache)
Constructs a new node with a name, etc.

Parameters:
mapSafe - true if param data can safely be directly assigned to this object's data field; false if param data's contents should be copied into this object's data field.
Method Detail

getDelegate

public NodeSPI getDelegate()

setDelegate

public void setDelegate(NodeSPI delegate)

getParent

public NodeSPI<K,V> getParent()
Returns a parent by checking the TreeMap by name.


getCache

public CacheSPI<K,V> getCache()

isChildrenLoaded

public boolean isChildrenLoaded()

setChildrenLoaded

public void setChildrenLoaded(boolean flag)

get

public V get(K key)

getDirect

public V getDirect(K key)

getLock

public IdentityLock getLock()

getData

public Map<K,V> getData()

getDataDirect

public Map<K,V> getDataDirect()

put

public V put(K key,
             V value)

putDirect

public V putDirect(K key,
                   V value)

getOrCreateChild

public NodeSPI<K,V> getOrCreateChild(Object child_name,
                                     GlobalTransaction gtx,
                                     boolean notify)

remove

public V remove(K key)

removeDirect

public V removeDirect(K key)

printDetails

public void printDetails(StringBuffer sb,
                         int indent)

toString

public String toString()
Returns a debug string.

Overrides:
toString in class Object

addChild

public Node<K,V> addChild(Fqn f)

addChildDirect

public void addChildDirect(NodeSPI<K,V> child)

addChildDirect

public NodeSPI<K,V> addChildDirect(Fqn f)

addChildDirect

public NodeSPI<K,V> addChildDirect(Fqn f,
                                   boolean notify)

clearData

public void clearData()

clearDataDirect

public void clearDataDirect()

getChild

public Node<K,V> getChild(Fqn fqn)

getChildDirect

public NodeSPI<K,V> getChildDirect(Fqn fqn)

getChildrenNames

public Set<Object> getChildrenNames()

getChildrenNamesDirect

public Set<Object> getChildrenNamesDirect()

getKeys

public Set<K> getKeys()

getKeysDirect

public Set<K> getKeysDirect()

hasChild

public boolean hasChild(Fqn f)

hasChild

public boolean hasChild(Object o)

putIfAbsent

public V putIfAbsent(K k,
                     V v)

replace

public V replace(K key,
                 V value)

replace

public boolean replace(K key,
                       V oldValue,
                       V newValue)

removeChild

public boolean removeChild(Fqn fqn)

dataSize

public int dataSize()

removeChild

public boolean removeChild(Object childName)

removeChildDirect

public boolean removeChildDirect(Object childName)

removeChildDirect

public boolean removeChildDirect(Fqn f)

getChildrenMapDirect

public Map<Object,Node<K,V>> getChildrenMapDirect()

setChildrenMapDirect

public void setChildrenMapDirect(Map<Object,Node<K,V>> children)

putAll

public void putAll(Map<K,V> data)

replaceAll

public void replaceAll(Map<K,V> data)

putAllDirect

public void putAllDirect(Map<K,V> data)

removeChildrenDirect

public void removeChildrenDirect()

print

public void print(StringBuffer sb,
                  int indent)

setVersion

public void setVersion(DataVersion version)

getVersion

public DataVersion getVersion()

addChild

public void addChild(Object child_name,
                     Node<K,V> n)

getFqn

public Fqn getFqn()
Returns the name of this node.


setFqn

public void setFqn(Fqn fqn)

getChild

public Node<K,V> getChild(Object childName)

getChildDirect

public NodeSPI<K,V> getChildDirect(Object childName)

getChildren

public Set<Node<K,V>> getChildren()

getChildrenDirect

public Set<NodeSPI<K,V>> getChildrenDirect()

hasChildrenDirect

public boolean hasChildrenDirect()

getChildrenDirect

public Set<NodeSPI<K,V>> getChildrenDirect(boolean includeMarkedForRemoval)

isDataLoaded

public boolean isDataLoaded()
Returns true if the data was loaded from the cache loader.


setDataLoaded

public void setDataLoaded(boolean dataLoaded)
Sets if the data was loaded from the cache loader.


isValid

public boolean isValid()

setValid

public void setValid(boolean valid,
                     boolean recursive)

isLockForChildInsertRemove

public boolean isLockForChildInsertRemove()

setLockForChildInsertRemove

public void setLockForChildInsertRemove(boolean lockForChildInsertRemove)

setInternalState

public void setInternalState(Map state)

getInternalState

public Map getInternalState(boolean onlyInternalState)


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