|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.mmbase.module.core.MMObjectNode
|
+--org.mmbase.module.core.VirtualNode
|
+--org.mmbase.module.core.ClusterNode
ClusterNode is a representation of a 'cluster' of objectnodes.
It represents a set of related nodes, retrieved using a multilevel query.
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.
| Field Summary | |
boolean |
initializing
Determines whether the node is being loaded. |
protected java.util.Hashtable |
nodes
Holds the name - value pairs of related nodes in this virtual node. |
| Fields inherited from class org.mmbase.module.core.MMObjectNode |
alias, changed, parent, prefix, properties, values, virtual |
| Constructor Summary | |
ClusterNode(MMObjectBuilder parent)
Main contructor. |
|
ClusterNode(MMObjectBuilder parent,
int nrofnodes)
Main contructor. |
|
| Method Summary | |
boolean |
commit()
commit : commits the node to the database or other storage system this can only be done on a existing (inserted) node. |
protected java.lang.String |
getBuilderName(java.lang.String fieldname)
Determines the builder name of a specified fieldname, i.e. |
byte[] |
getByteValue(java.lang.String fieldname)
Get a binary value of a certain field. |
MMObjectNode |
getRealNode(java.lang.String buildername)
Obtain the 'real' nodes, associated with a specified objectbuilder. |
java.util.Enumeration |
getRelations()
Return the relations of this node. |
java.lang.String |
getStringValue(java.lang.String fieldname)
Get a value of a certain field. |
java.lang.Object |
getValue(java.lang.String fieldname)
Get a value of a certain field. |
boolean |
isChanged()
Tests whether one of the values of this node was changed since the last commit/insert. |
boolean |
setValue(java.lang.String fieldname,
java.lang.Object fieldvalue)
Sets a key/value pair in the main values of this node. |
protected void |
storeValue(java.lang.String fieldname,
java.lang.Object fieldvalue)
Stores a value in the values hashtable. |
void |
testValidData()
Tests whether the data in a node is valid (throws an exception if this is not the case). |
| Methods inherited from class org.mmbase.module.core.VirtualNode |
getAge, getRelationCount, getRelationCount, hasRelations, insert |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.util.Hashtable nodes
public boolean initializing
| Constructor Detail |
public ClusterNode(MMObjectBuilder parent)
parent - the node's parent, generally an instance of the ClusterBuilder builder.
public ClusterNode(MMObjectBuilder parent,
int nrofnodes)
parent - the node's parent, generally an instance of the ClusterBuilder builder.rnofnodes - Nr of referenced nodes.| Method Detail |
public void testValidData()
throws InvalidDataException
testValidData in class MMObjectNodeInvalidDataException - If the data was unrecoverably invalid
(the references did not point to existing objects)public boolean commit()
commit in class VirtualNodetrue if the commit was succesfull, false is it failedpublic MMObjectNode getRealNode(java.lang.String buildername)
buildername - the name of the builder of the requested node, as known
within the virtual nodenull if it does not exist or is unknown
protected void storeValue(java.lang.String fieldname,
java.lang.Object fieldvalue)
storeValue in class MMObjectNodefieldname - the name of the field to changefieldValue - the value to assign
public boolean setValue(java.lang.String fieldname,
java.lang.Object fieldvalue)
setValue in class MMObjectNodefieldname - the name of the field to changefieldValue - the value to assigntrueprotected java.lang.String getBuilderName(java.lang.String fieldname)
fieldname - the name of the fieldpublic java.lang.Object getValue(java.lang.String fieldname)
getValue in class MMObjectNodefieldname - the name of the field who's data to returnObjectpublic java.lang.String getStringValue(java.lang.String fieldname)
getStringValue in class MMObjectNodefieldname - the name of the field who's data to returnStringpublic byte[] getByteValue(java.lang.String fieldname)
getByteValue in class MMObjectNodefieldname - the name of the field who's data to returnbyte [] (binary/blob field)public boolean isChanged()
isChanged in class MMObjectNodetrue if changes have been made, false otherwisepublic java.util.Enumeration getRelations()
getRelations in class VirtualNodeRuntimeException -
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||