Java Doc for ClusterNode.java in  » Database-ORM » MMBase » org » mmbase » module » core » 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 » Database ORM » MMBase » org.mmbase.module.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.mmbase.module.core.MMObjectNode
      org.mmbase.module.core.VirtualNode
         org.mmbase.module.core.ClusterNode

ClusterNode
public class ClusterNode extends VirtualNode (Code)
ClusterNode combines fields of different nodes in a single "virtual" node. This corresponds to the way that an SQL "join" select statement combines fields of different tables in result rows.

The individual fields are retrieved from a set of related nodes using a multilevel query, i.e. a query joining tables using the relations between the tables.

This class overrides a number of methods, allowing direct access to data in the nodes which form the 'virtual' node.
In future releases, data will NOT be stored directkly in this node anymore. Instead, it will be stored in the underlying MMObjectNodes. For reasons of optiomalization, however, we cannot do this right now. MMObjectNode will need a status field that allows us to recognize whether it is fully loaded, partially loaded, or being edited. This can then be checked in 'retrievevalue'. In addition, to prevent caching conflicts, nodes will need to maintain their references. This allows for a secure caching mechanism.
Among other things, this allows one to change values in a multilevel node, or to access functionality that would otherwise be restricted to 'real' nodes.
author:
   Pierre van Rooden
version:
   $Id: ClusterNode.java,v 1.29 2007/07/23 13:51:02 michiel Exp $
See Also:   ClusterBuilder




Constructor Summary
public  ClusterNode(ClusterBuilder parent)
     Main contructor.
public  ClusterNode(ClusterBuilder parent, int nrofnodes)
     Main contructor.

Method Summary
public  booleancommit()
     commit : commits the node to the database or other storage system. This can only be done on a existing (inserted) node.
public  MMObjectBuildergetBuilder()
    
protected  StringgetBuilderName(String fieldName)
     Determines the builder name of a specified fieldname, i.e.
public  byte[]getByteValue(String fieldName)
     Get a binary value of a certain field.
public  MMObjectNodegetRealNode(String builderName)
     Obtain the 'real' nodes, associated with a specified objectbuilder.
public  Enumeration<MMObjectNode>getRelations()
     Return the relations of this node.
public  longgetSize(String fieldName)
    
public  StringgetStringValue(String fieldName)
     Get a value of a certain field. The value is returned as a String.
public  ObjectgetValue(String fieldName)
     Get a value of a certain field.
public  booleanisChanged()
     Tests whether one of the values of this node was changed since the last commit/insert.
public  booleansetValue(String fieldName, Object fieldValue)
     Sets a key/value pair in the main values of this node.
public  voidstoreValue(String fieldName, Object fieldValue)
     Stores a value in the values hashtable.
public  voidtestValidData()
     Tests whether the data in a node is valid (throws an exception if this is not the case). The call is performed on all loaded 'real' nodes.


Constructor Detail
ClusterNode
public ClusterNode(ClusterBuilder parent)(Code)
Main contructor.
Parameters:
  parent - the node's parent



ClusterNode
public ClusterNode(ClusterBuilder parent, int nrofnodes)(Code)
Main contructor.
Parameters:
  parent - the node's parent
Parameters:
  nrofnodes - Nr of referenced nodes.




Method Detail
commit
public boolean commit()(Code)
commit : commits the node to the database or other storage system. This can only be done on a existing (inserted) node. it will use the changed Vector as its base of what to commit/changed true if the commit was succesfull, false is it failed



getBuilder
public MMObjectBuilder getBuilder()(Code)



getBuilderName
protected String getBuilderName(String fieldName)(Code)
Determines the builder name of a specified fieldname, i.e. "news" in "news.title",
Parameters:
  fieldName - the name of the field the buidler name of the field



getByteValue
public byte[] getByteValue(String fieldName)(Code)
Get a binary value of a certain field.
Parameters:
  fieldName - the name of the field who's data to return the field's value as an byte [] (binary/blob field)



getRealNode
public MMObjectNode getRealNode(String builderName)(Code)
Obtain the 'real' nodes, associated with a specified objectbuilder.
Parameters:
  builderName - the name of the builder of the requested node, as knownwithin the virtual node the node, or null if it does not exist or is unknown



getRelations
public Enumeration<MMObjectNode> getRelations()(Code)
Return the relations of this node. This is not allowed on a cluster node RuntimeException



getSize
public long getSize(String fieldName)(Code)



getStringValue
public String getStringValue(String fieldName)(Code)
Get a value of a certain field. The value is returned as a String. Non-string values are automatically converted to String.
Parameters:
  fieldName - the name of the field who's data to return the field's value as a String



getValue
public Object getValue(String fieldName)(Code)
Get a value of a certain field.
Parameters:
  fieldName - the name of the field who's data to return the field's value as an Object



isChanged
public boolean isChanged()(Code)
Tests whether one of the values of this node was changed since the last commit/insert. true if changes have been made, false otherwise



setValue
public boolean setValue(String fieldName, Object fieldValue)(Code)
Sets a key/value pair in the main values of this node. Note that if this node is a node in cache, the changes are immediately visible to everyone, even if the changes are not committed. The fieldname is added to the (public) 'changed' vector to track changes.
Parameters:
  fieldName - the name of the field to change
Parameters:
  fieldValue - the value to assign always true



storeValue
public void storeValue(String fieldName, Object fieldValue)(Code)
Stores a value in the values hashtable. If the value is not stored in the virtualnode, the 'real' node is used instead.
Parameters:
  fieldName - the name of the field to change
Parameters:
  fieldValue - the value to assign



testValidData
public void testValidData() throws InvalidDataException(Code)
Tests whether the data in a node is valid (throws an exception if this is not the case). The call is performed on all loaded 'real' nodes. If a 'real' node has not previously been forcably loaded, it is assumed to be correct.
throws:
  org.mmbase.module.core.InvalidDataException - If the data was unrecoverably invalid(the references did not point to existing objects)



Methods inherited from org.mmbase.module.core.VirtualNode
protected boolean checkFieldExistance(String fieldName)(Code)(Java Doc)
public boolean commit()(Code)(Java Doc)
public int getAge()(Code)(Java Doc)
public int getOType()(Code)(Java Doc)
public int getRelationCount()(Code)(Java Doc)
public int getRelationCount(String wantedtype)(Code)(Java Doc)
public Enumeration<MMObjectNode> getRelations()(Code)(Java Doc)
public boolean hasRelations()(Code)(Java Doc)
public int insert(String userName)(Code)(Java Doc)
public boolean isVirtual()(Code)(Java Doc)

Fields inherited from org.mmbase.module.core.MMObjectNode
final public static String VALUE_SHORTED(Code)(Java Doc)
protected boolean initializing(Code)(Java Doc)
protected boolean isNew(Code)(Java Doc)
protected MMObjectBuilder parent(Code)(Java Doc)
public Hashtable<String, MMObjectNode> properties(Code)(Java Doc)
protected Map<String, Object> values(Code)(Java Doc)

Methods inherited from org.mmbase.module.core.MMObjectNode
public void cancel()(Code)(Java Doc)
protected boolean checkFieldExistance(String fieldName)(Code)(Java Doc)
public boolean clearChanged()(Code)(Java Doc)
public boolean commit()(Code)(Java Doc)
public boolean commit(UserContext user)(Code)(Java Doc)
public Parameters createParameters(String functionName)(Code)(Java Doc)
public boolean defaultEquals(MMObjectNode n)(Code)(Java Doc)
String defaultToString()(Code)(Java Doc)
public void delPropertiesCache()(Code)(Java Doc)
public void delRelationsCache()(Code)(Java Doc)
public static void delRelationsCache(Integer number)(Code)(Java Doc)
public boolean equals(Object o)(Code)(Java Doc)
public void finish()(Code)(Java Doc)
public int getAge()(Code)(Java Doc)
public Enumeration<MMObjectNode> getAllRelations()(Code)(Java Doc)
public boolean getBooleanValue(String fieldName)(Code)(Java Doc)
public MMObjectBuilder getBuilder()(Code)(Java Doc)
public int getByteSize()(Code)(Java Doc)
public int getByteSize(SizeOf sizeof)(Code)(Java Doc)
public byte[] getByteValue(String fieldName)(Code)(Java Doc)
public Set<String> getChanged()(Code)(Java Doc)
public String getContext(UserContext user)(Code)(Java Doc)
public int getDBState(String fieldName)(Code)(Java Doc)
public int getDBType(String fieldName)(Code)(Java Doc)
public Date getDateValue(String fieldName)(Code)(Java Doc)
public double getDoubleValue(String fieldName)(Code)(Java Doc)
public float getFloatValue(String fieldName)(Code)(Java Doc)
public Function getFunction(String functionName)(Code)(Java Doc)
public Object getFunctionValue(String functionName, List parameters)(Code)(Java Doc)
public Collection<Function<?>> getFunctions()(Code)(Java Doc)
public String getGUIIndicator()(Code)(Java Doc)
public InputStream getInputStreamValue(String fieldName)(Code)(Java Doc)
public int getIntValue(String fieldName)(Code)(Java Doc)
public Integer getIntegerValue(String fieldName)(Code)(Java Doc)
public List getListValue(String fieldName)(Code)(Java Doc)
public long getLongValue(String fieldName)(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public MMObjectNode getNodeValue(String fieldName)(Code)(Java Doc)
public int getNumber()(Code)(Java Doc)
public int getOType()(Code)(Java Doc)
public Map<String, Object> getOldValues()(Code)(Java Doc)
public Set<String> getPossibleContexts(UserContext user)(Code)(Java Doc)
public Hashtable<String, MMObjectNode> getProperties()(Code)(Java Doc)
public MMObjectNode getProperty(String key)(Code)(Java Doc)
public Vector<MMObjectNode> getRelatedNodes()(Code)(Java Doc)
public Vector<MMObjectNode> getRelatedNodes(String type)(Code)(Java Doc)
public Vector<MMObjectNode> getRelatedNodes(String type, int search_type)(Code)(Java Doc)
public Vector<MMObjectNode> getRelatedNodes(String type, String role, int search_type)(Code)(Java Doc)
public int getRelationCount()(Code)(Java Doc)
public int getRelationCount(String wt)(Code)(Java Doc)
protected List<MMObjectNode> getRelationNodes()(Code)(Java Doc)
public Enumeration<MMObjectNode> getRelations()(Code)(Java Doc)
public Enumeration<MMObjectNode> getRelations(int otype)(Code)(Java Doc)
public Enumeration<MMObjectNode> getRelations(String wantedtype)(Code)(Java Doc)
public long getSize(String fieldName)(Code)(Java Doc)
public String getStringValue(String fieldName)(Code)(Java Doc)
public Object getValue(String fieldName)(Code)(Java Doc)
public Map<String, Object> getValues()(Code)(Java Doc)
public Document getXMLValue(String fieldName)(Code)(Java Doc)
public boolean hasRelations()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public int insert(String userName)(Code)(Java Doc)
public int insert(UserContext user)(Code)(Java Doc)
public boolean isChanged()(Code)(Java Doc)
public boolean isNew()(Code)(Java Doc)
public boolean isNull(String fieldName)(Code)(Java Doc)
public boolean isVirtual()(Code)(Java Doc)
public void putProperty(MMObjectNode node)(Code)(Java Doc)
public void remove(UserContext user)(Code)(Java Doc)
public void removeRelations()(Code)(Java Doc)
public Object retrieveValue(String fieldName)(Code)(Java Doc)
public boolean sendFieldChangeSignal(String fieldName)(Code)(Java Doc)
public void setAlias(String alias)(Code)(Java Doc)
public void setContext(UserContext user, String context, boolean now)(Code)(Java Doc)
public void setSize(String fieldName, long size)(Code)(Java Doc)
public boolean setValue(String fieldName, Object fieldValue)(Code)(Java Doc)
public void start()(Code)(Java Doc)
public void storeValue(String fieldName, Object fieldValue)(Code)(Java Doc)
public void testValidData() throws InvalidDataException(Code)(Java Doc)
public String toString()(Code)(Java Doc)
protected Document toXML(Object value, String fieldName)(Code)(Java Doc)
void useAliases()(Code)(Java Doc)

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.