Java Doc for Node.java in  » Web-Framework » helma » helma » objectmodel » db » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » helma » helma.objectmodel.db 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   helma.objectmodel.db.Node

Node
final public class Node implements INode,Serializable(Code)
An implementation of INode that can be stored in the internal database or an external relational database.


Field Summary
protected  booleananonymous
    
protected  longcreated
    
transient  DbMappingdbmap
    
transient  longlastNameCheck
    
transient  longlastParentSet
    
transient  longlastSubnodeChange
    
transient  longlastSubnodeCount
    
transient  longlastSubnodeFetch
    
protected  longlastmodified
    
transient  WrappedNodeManagernmgr
    
protected  NodeHandleparentHandle
    
transient  KeyprimaryKey
    
final static  longserialVersionUID
    
transient  intsubnodeCount
    
transient  StringsubnodeRelation
    
protected  shortversion
    

Constructor Summary
protected  Node()
     Creates an empty, uninitialized Node.
protected  Node(long timestamp)
     Creates an empty, uninitialized Node with the given create and modify time.
public  Node(String name, String id, String prototype, WrappedNodeManager nmgr)
     Creates a new Node with the given name.
public  Node(String name, String id, String prototype, WrappedNodeManager nmgr, long created, long lastmodified)
     Constructor used to create a Node with a given name from a embedded database.
public  Node(Node home, String propname, WrappedNodeManager nmgr, String prototype)
     Constructor used for virtual nodes.
public  Node(String name, String prototype, WrappedNodeManager nmgr)
     Creates a new Node with the given name.

Method Summary
public  INodeaddNode(INode elem)
    
public  INodeaddNode(INode elem, int where)
     Add a node to this Node's subnodes, making the added node persistent if it hasn't been before and this Node is already persistent.
synchronized  voidcheckWriteLock()
     Get the write lock on this node, throwing a ConcurrencyException if the lock is already held by another thread.
public synchronized  voidclearCacheNode()
     Reset the cache node for this node.
synchronized  voidclearWriteLock()
     Clear the write lock on this node.
public  intcontains(INode n)
     Check if the given node is contained in this node's child list.
public  INodecreateNode()
    
public  INodecreateNode(int where)
    
Parameters:
  where - ...
public  INodecreateNode(String nm)
    
Parameters:
  nm - ...
public  INodecreateNode(String nm, int where)
    
Parameters:
  nm - ...
Parameters:
  where - ...
public  SubnodeListcreateSubnodeList()
     Retrieve an empty subnodelist.
public  longcreated()
    
protected  voiddeepRemoveNode()
     Delete the node from the db.
public  voiddump()
    
public  IPropertyget(String propname)
    
Parameters:
  propname - ...
public  booleangetBoolean(String propname)
    
Parameters:
  propname - ...
public synchronized  INodegetCacheNode()
     Get the cache node for this node.
public  NodegetCachedParent()
     Get parent, using cached info if it exists.
public  IPathElementgetChildElement(String name)
    
public  DategetDate(String propname)
    
Parameters:
  propname - ...
public  DbMappinggetDbMapping()
    
public  StringgetElementName()
     Get something to identify this node within a URL.
public  doublegetFloat(String propname)
    
Parameters:
  propname - ...
public  StringgetFullName()
    
public  StringgetFullName(INode root)
    
Parameters:
  root - ...
protected  NodegetGroupbySubnode(String sid, boolean create)
    
Parameters:
  sid - ...
Parameters:
  create - ...
public  NodeHandlegetHandle()
    
public  StringgetID()
     Get the ID of this Node.
public  longgetInteger(String propname)
    
Parameters:
  propname - ...
public  ObjectgetJavaObject(String propname)
    
Parameters:
  propname - ...
public  KeygetKey()
    
 longgetLastSubnodeChange(Relation subRel)
    
public  StringgetName()
    
public  INodegetNode(String propname)
    
Parameters:
  propname - ...
public  NodegetNonVirtualParent()
     This method walks down node path to the first non-virtual node and return it.
public  INodegetParent()
     Get parent, retrieving it if necessary.
public  IPathElementgetParentElement()
    
public  StringgetParentInfo()
    
public  HashtablegetPropMap()
    
protected  PropertygetProperty(String propname)
    
Parameters:
  propname - ...
public  StringgetPrototype()
    
public  intgetState()
    
public  StringgetString(String propname)
    
Parameters:
  propname - ...
public  INodegetSubnode(String subid)
    
Parameters:
  subid - ...
public  INodegetSubnodeAt(int index)
    
Parameters:
  index - ...
public  SubnodeListgetSubnodeList()
    
public synchronized  StringgetSubnodeRelation()
    
public  EnumerationgetSubnodes()
    
public  inthashCode()
     We overwrite hashCode to make it dependant from the prototype.
public synchronized  voidinit(DbMapping dbm, String id, String name, String prototype, Hashtable propMap, WrappedNodeManager nmgr)
     Initializer used for nodes being instanced from an embedded or relational database.
public  voidinvalidate()
    
public  voidinvalidateNode(String key)
    
public  booleanisAnonymous()
    
public  booleanisNullNode()
     Instances of this class may be used to mark an entry in the object cache as null.
public  booleanisParentOf(Node n)
     Check if the given node is contained in this node's child list.
public  booleanisRelational()
     Tell whether this node is stored inside a relational db.
public  longlastModified()
    
public  voidloadNodes()
     Make sure the subnode index is loaded for subnodes stored in a relational data source.
 voidmarkAs(int s)
     Set this node's state, registering it with the transactor if necessary.
public  voidmarkSubnodesChanged()
    
 voidnotifyPropertyChange(String propname)
     Notify the node's parent that its child collection needs to be reloaded in case the changed property has an affect on collection order or content.
public  intnumberOfNodes()
     Count the subnodes of this node.
public  voidpersist()
     Public method to make a node persistent.
public  voidprefetchChildren(int startIndex, int length)
    
public  voidprefetchChildren(Key[] keys)
    
public  Enumerationproperties()
     Get all properties of this node.
 voidregisterSubnodeChange()
     Register this node as parent node with the transactor so that setLastSubnodeChange is called when the transaction completes.
protected  voidreleaseNode(Node node)
     "Locally" remove a subnode from the subnodes table.
public  booleanremove()
    
public  voidremoveNode(INode node)
    
protected  voidset(String propname, Object value, int type)
    
public  voidsetBoolean(String propname, boolean value)
    
public  voidsetDate(String propname, Date value)
    
public  voidsetDbMapping(DbMapping dbmap)
    
public  voidsetFloat(String propname, double value)
    
public  voidsetInteger(String propname, long value)
    
public  voidsetJavaObject(String propname, Object value)
    
public  voidsetName(String name)
    
public  voidsetNode(String propname, INode value)
    
public  voidsetParent(Node parent)
     Set this node's parent node.
public  voidsetParentHandle(NodeHandle parent)
     Set this node's parent node to the node referred to by the NodeHandle.
public synchronized  voidsetPropMap(Hashtable propMap)
    
public  voidsetPrototype(String proto)
    
public  voidsetState(int s)
    
public  voidsetString(String propname, String value)
    
public synchronized  voidsetSubnodeRelation(String rel)
    
public synchronized  voidsetSubnodes(SubnodeList subnodes)
    
public  voidsetWrappedNodeManager(WrappedNodeManager nmgr)
    
public  StringtoString()
     Return a string representation for this node.
public  voidunset(String propname)
     Remove a property.
public  intupdateSubnodes()
     This method get's called from the JavaScript environment (HopObject.updateSubnodes() or HopObject.collection.updateSubnodes())) The subnode-collection will be updated with a selectstatement getting all Nodes having a higher id than the highest id currently contained within this Node's subnoderelation.

Field Detail
anonymous
protected boolean anonymous(Code)



created
protected long created(Code)



dbmap
transient DbMapping dbmap(Code)



lastNameCheck
transient long lastNameCheck(Code)



lastParentSet
transient long lastParentSet(Code)



lastSubnodeChange
transient long lastSubnodeChange(Code)



lastSubnodeCount
transient long lastSubnodeCount(Code)



lastSubnodeFetch
transient long lastSubnodeFetch(Code)



lastmodified
protected long lastmodified(Code)



nmgr
transient WrappedNodeManager nmgr(Code)



parentHandle
protected NodeHandle parentHandle(Code)



primaryKey
transient Key primaryKey(Code)



serialVersionUID
final static long serialVersionUID(Code)



subnodeCount
transient int subnodeCount(Code)



subnodeRelation
transient String subnodeRelation(Code)



version
protected short version(Code)




Constructor Detail
Node
protected Node()(Code)
Creates an empty, uninitialized Node. The init() method must be called on the Node before it can do anything useful.



Node
protected Node(long timestamp)(Code)
Creates an empty, uninitialized Node with the given create and modify time. This is used for null-node references in the node cache.
Parameters:
  timestamp -



Node
public Node(String name, String id, String prototype, WrappedNodeManager nmgr)(Code)
Creates a new Node with the given name. Used by NodeManager for creating "root nodes" outside of a Transaction context, which is why we can immediately mark it as CLEAN. Also used by embedded database to re-create an existing Node.



Node
public Node(String name, String id, String prototype, WrappedNodeManager nmgr, long created, long lastmodified)(Code)
Constructor used to create a Node with a given name from a embedded database.



Node
public Node(Node home, String propname, WrappedNodeManager nmgr, String prototype)(Code)
Constructor used for virtual nodes.



Node
public Node(String name, String prototype, WrappedNodeManager nmgr)(Code)
Creates a new Node with the given name. This is used for ordinary transient nodes.




Method Detail
addNode
public INode addNode(INode elem)(Code)
INode-related



addNode
public INode addNode(INode elem, int where)(Code)
Add a node to this Node's subnodes, making the added node persistent if it hasn't been before and this Node is already persistent.
Parameters:
  elem - the node to add to this Nodes subnode-list
Parameters:
  where - the index-position where this node has to be added the added node itselve



checkWriteLock
synchronized void checkWriteLock()(Code)
Get the write lock on this node, throwing a ConcurrencyException if the lock is already held by another thread.



clearCacheNode
public synchronized void clearCacheNode()(Code)
Reset the cache node for this node.



clearWriteLock
synchronized void clearWriteLock()(Code)
Clear the write lock on this node.



contains
public int contains(INode n)(Code)
Check if the given node is contained in this node's child list. If it is contained return its index in the list, otherwise return -1.
Parameters:
  n - a node the node's index position in the child list, or -1



createNode
public INode createNode()(Code)
...



createNode
public INode createNode(int where)(Code)

Parameters:
  where - ... ...



createNode
public INode createNode(String nm)(Code)

Parameters:
  nm - ... ...



createNode
public INode createNode(String nm, int where)(Code)

Parameters:
  nm - ...
Parameters:
  where - ... ...



createSubnodeList
public SubnodeList createSubnodeList()(Code)
Retrieve an empty subnodelist. This empty List is an instance of the Class used for this Nodes subnode-list List an empty List of the type used by this Node



created
public long created()(Code)
...



deepRemoveNode
protected void deepRemoveNode()(Code)
Delete the node from the db. This mainly tries to notify all nodes referring to this that it's going away. For nodes from the embedded db it also does a cascading delete, since it can tell which nodes are actual children and which are just linked in.



dump
public void dump()(Code)



get
public IProperty get(String propname)(Code)

Parameters:
  propname - ... ...



getBoolean
public boolean getBoolean(String propname)(Code)

Parameters:
  propname - ... ...



getCacheNode
public synchronized INode getCacheNode()(Code)
Get the cache node for this node. This can be used to store transient cache data per node from Javascript.



getCachedParent
public Node getCachedParent()(Code)
Get parent, using cached info if it exists.



getChildElement
public IPathElement getChildElement(String name)(Code)
This implements the getChildElement() method of the IPathElement interface



getDate
public Date getDate(String propname)(Code)

Parameters:
  propname - ... ...



getDbMapping
public DbMapping getDbMapping()(Code)
...



getElementName
public String getElementName()(Code)
Get something to identify this node within a URL. This is the ID for anonymous nodes and a property value for named properties.



getFloat
public double getFloat(String propname)(Code)

Parameters:
  propname - ... ...



getFullName
public String getFullName()(Code)
...



getFullName
public String getFullName(INode root)(Code)

Parameters:
  root - ... ...



getGroupbySubnode
protected Node getGroupbySubnode(String sid, boolean create)(Code)

Parameters:
  sid - ...
Parameters:
  create - ... ...



getHandle
public NodeHandle getHandle()(Code)
...



getID
public String getID()(Code)
Get the ID of this Node. This is the primary database key and used as part of the key for the internal node cache.



getInteger
public long getInteger(String propname)(Code)

Parameters:
  propname - ... ...



getJavaObject
public Object getJavaObject(String propname)(Code)

Parameters:
  propname - ... ...



getKey
public Key getKey()(Code)
...



getLastSubnodeChange
long getLastSubnodeChange(Relation subRel)(Code)
Compute a serial number indicating the last change in subnode collection
Parameters:
  subRel - the subnode relation a serial number that increases with each subnode change



getName
public String getName()(Code)
Return this node' name, which may or may not have some meaning



getNode
public INode getNode(String propname)(Code)

Parameters:
  propname - ... ...



getNonVirtualParent
public Node getNonVirtualParent()(Code)
This method walks down node path to the first non-virtual node and return it. limit max depth to 5, since there shouldn't be more then 2 layers of virtual nodes.



getParent
public INode getParent()(Code)
Get parent, retrieving it if necessary.



getParentElement
public IPathElement getParentElement()(Code)
This implements the getParentElement() method of the IPathElement interface



getParentInfo
public String getParentInfo()(Code)
...



getPropMap
public Hashtable getPropMap()(Code)
...



getProperty
protected Property getProperty(String propname)(Code)

Parameters:
  propname - ... ...



getPrototype
public String getPrototype()(Code)
...



getState
public int getState()(Code)
Gets this node's stateas defined in the INode interface this node's state



getString
public String getString(String propname)(Code)

Parameters:
  propname - ... ...



getSubnode
public INode getSubnode(String subid)(Code)

Parameters:
  subid - ... ...



getSubnodeAt
public INode getSubnodeAt(int index)(Code)

Parameters:
  index - ... ...



getSubnodeList
public SubnodeList getSubnodeList()(Code)
Return this Node's subnode list the subnode list



getSubnodeRelation
public synchronized String getSubnodeRelation()(Code)
...



getSubnodes
public Enumeration getSubnodes()(Code)
...



hashCode
public int hashCode()(Code)
We overwrite hashCode to make it dependant from the prototype. That way, when the prototype changes, the node will automatically get a new ESNode wrapper, since they're cached in a hashtable. You gotta love these hash code tricks ;-)



init
public synchronized void init(DbMapping dbm, String id, String name, String prototype, Hashtable propMap, WrappedNodeManager nmgr)(Code)
Initializer used for nodes being instanced from an embedded or relational database.



invalidate
public void invalidate()(Code)
Mark node as invalid so it is re-fetched from the database



invalidateNode
public void invalidateNode(String key)(Code)
Check for a child mapping and evict the object specified by key from the cache



isAnonymous
public boolean isAnonymous()(Code)
Returns true if this node is accessed by id from its aprent, false if it is accessed by name



isNullNode
public boolean isNullNode()(Code)
Instances of this class may be used to mark an entry in the object cache as null. This method tells the caller whether this is the case.



isParentOf
public boolean isParentOf(Node n)(Code)
Check if the given node is contained in this node's child list. This is similar to contains(INode) but does not load the child index for relational nodes.
Parameters:
  n - a node true if the given node is contained in this node's child list



isRelational
public boolean isRelational()(Code)
Tell whether this node is stored inside a relational db. This doesn't mean it actually is stored in a relational db, just that it would be, if the node was persistent



lastModified
public long lastModified()(Code)
...



loadNodes
public void loadNodes()(Code)
Make sure the subnode index is loaded for subnodes stored in a relational data source. Depending on the subnode.loadmode specified in the type.properties, we'll load just the ID index or the actual nodes.



markAs
void markAs(int s)(Code)
Set this node's state, registering it with the transactor if necessary.



markSubnodesChanged
public void markSubnodesChanged()(Code)
Called by the transactor on registered parent nodes to mark the child index as changed



notifyPropertyChange
void notifyPropertyChange(String propname)(Code)
Notify the node's parent that its child collection needs to be reloaded in case the changed property has an affect on collection order or content.
Parameters:
  propname - the name of the property being changed



numberOfNodes
public int numberOfNodes()(Code)
Count the subnodes of this node. If they're stored in a relational data source, we may actually load their IDs in order to do this.



persist
public void persist()(Code)
Public method to make a node persistent.



prefetchChildren
public void prefetchChildren(int startIndex, int length) throws Exception(Code)

Parameters:
  startIndex - ...
Parameters:
  length - ...
throws:
  Exception - ...



prefetchChildren
public void prefetchChildren(Key[] keys) throws Exception(Code)



properties
public Enumeration properties()(Code)
Get all properties of this node.



registerSubnodeChange
void registerSubnodeChange()(Code)
Register this node as parent node with the transactor so that setLastSubnodeChange is called when the transaction completes.



releaseNode
protected void releaseNode(Node node)(Code)
"Locally" remove a subnode from the subnodes table. The logical stuff necessary for keeping data consistent is done in Node.removeNode(INode) .



remove
public boolean remove()(Code)
...



removeNode
public void removeNode(INode node)(Code)

Parameters:
  node - ...



set
protected void set(String propname, Object value, int type)(Code)
Directly set a property on this node
Parameters:
  propname - ...
Parameters:
  value - ...



setBoolean
public void setBoolean(String propname, boolean value)(Code)

Parameters:
  propname - ...
Parameters:
  value - ...



setDate
public void setDate(String propname, Date value)(Code)

Parameters:
  propname - ...
Parameters:
  value - ...



setDbMapping
public void setDbMapping(DbMapping dbmap)(Code)

Parameters:
  dbmap - ...



setFloat
public void setFloat(String propname, double value)(Code)

Parameters:
  propname - ...
Parameters:
  value - ...



setInteger
public void setInteger(String propname, long value)(Code)

Parameters:
  propname - ...
Parameters:
  value - ...



setJavaObject
public void setJavaObject(String propname, Object value)(Code)

Parameters:
  propname - ...
Parameters:
  value - ...



setName
public void setName(String name)(Code)

Parameters:
  name - ...



setNode
public void setNode(String propname, INode value)(Code)

Parameters:
  propname - ...
Parameters:
  value - ...



setParent
public void setParent(Node parent)(Code)
Set this node's parent node.



setParentHandle
public void setParentHandle(NodeHandle parent)(Code)
Set this node's parent node to the node referred to by the NodeHandle.



setPropMap
public synchronized void setPropMap(Hashtable propMap)(Code)
used by Xml deserialization



setPrototype
public void setPrototype(String proto)(Code)

Parameters:
  proto - ...



setState
public void setState(int s)(Code)
Sets this node's state as defined in the INode interface
Parameters:
  s - this node's new state



setString
public void setString(String propname, String value)(Code)

Parameters:
  propname - ...
Parameters:
  value - ...



setSubnodeRelation
public synchronized void setSubnodeRelation(String rel)(Code)

Parameters:
  rel - ...



setSubnodes
public synchronized void setSubnodes(SubnodeList subnodes)(Code)
used by Xml deserialization



setWrappedNodeManager
public void setWrappedNodeManager(WrappedNodeManager nmgr)(Code)

Parameters:
  nmgr -



toString
public String toString()(Code)
Return a string representation for this node. This tries to call the javascript implemented toString() if it is defined. a string representing this node.



unset
public void unset(String propname)(Code)
Remove a property. Note that this works only for explicitly set properties, not for those specified via property relation.



updateSubnodes
public int updateSubnodes()(Code)
This method get's called from the JavaScript environment (HopObject.updateSubnodes() or HopObject.collection.updateSubnodes())) The subnode-collection will be updated with a selectstatement getting all Nodes having a higher id than the highest id currently contained within this Node's subnoderelation. If this subnodelist has a special order all nodes will be loaded honoring this order. Example: order by somefield1 asc, somefieled2 desc gives a where-clausel like the following: (somefiled1 > theHighestKnownValue value and somefield2 < theLowestKnownValue) the number of loaded nodes within this collection update



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.