public class ClusterNode extends VirtualNode
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.
ClusterBuilder,
Serialized Formaliases, initializing, isNew, oldBuilder, parent, sequence, VALUE_SHORTED, values| Constructor and Description |
|---|
ClusterNode(ClusterBuilder parent)
Main contructor.
|
ClusterNode(ClusterBuilder parent,
int nrofnodes)
Main contructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
commit()
commit : commits the node to the database or other storage system.
|
MMObjectBuilder |
getBuilder()
Returns the actual builder of the node.
|
protected String |
getBuilderName(String fieldName)
Determines the builder name of a specified fieldname, i.e.
|
byte[] |
getByteValue(String fieldName)
Get a binary value of a certain field.
|
MMObjectNode |
getRealNode(String builderName)
Obtain the 'real' nodes, associated with a specified objectbuilder.
|
Enumeration<MMObjectNode> |
getRelations()
Return the relations of this node.
|
long |
getSize(String fieldName)
Returns the size (in byte) of the given field.
|
String |
getStringValue(String fieldName)
Get a value of a certain field.
|
Object |
getValue(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(String fieldName,
Object fieldValue)
Sets a key/value pair in the main values of this node.
|
void |
storeValue(String fieldName,
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).
|
checkFieldExistance, getAge, getOType, getRelationCount, getRelationCount, hasRelations, insert, isVirtualcancel, checkSerializable, clearChanged, clone, commit, compareTo, createParameters, defaultEquals, defaultToString, delPropertiesCache, delRelationsCache, delRelationsCache, equals, finish, getAllRelations, getBooleanValue, getByteSize, getByteSize, getChanged, getContext, getDateValue, getDBState, getDBType, getDoubleValue, getFloatValue, getFunction, getFunctions, getFunctionValue, getGUIIndicator, getInputStreamValue, getIntegerValue, getIntValue, getListValue, getLongValue, getName, getNodeValue, getNumber, getOldBuilder, getOldValues, getPossibleContexts, getProperties, getProperty, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelationNodes, getRelations, getRelations, getValues, getXMLValue, hashCode, insert, isNew, isNull, putProperty, remove, removeRelations, retrieveValue, sendFieldChangeSignal, setAlias, setBuilder, setContext, setSize, start, toString, toXML, useAliasespublic ClusterNode(ClusterBuilder parent)
parent - the node's parentpublic ClusterNode(ClusterBuilder parent, int nrofnodes)
parent - the node's parentnrofnodes - Nr of referenced nodes.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(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 unknownpublic void storeValue(String fieldName, Object fieldValue)
storeValue in class MMObjectNodefieldName - the name of the field to changefieldValue - the value to assignpublic boolean setValue(String fieldName, Object fieldValue)
setValue in class MMObjectNodefieldName - the name of the field to changefieldValue - the value to assigntrueprotected String getBuilderName(String fieldName)
fieldName - the name of the fieldpublic MMObjectBuilder getBuilder()
MMObjectNodegetBuilder in class MMObjectNodepublic Object getValue(String fieldName)
getValue in class MMObjectNodefieldName - the name of the field who's data to returnObjectpublic long getSize(String fieldName)
MMObjectNodegetSize in class MMObjectNodepublic String getStringValue(String fieldName)
getStringValue in class MMObjectNodefieldName - the name of the field who's data to returnStringpublic byte[] getByteValue(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 Enumeration<MMObjectNode> getRelations()
getRelations in class VirtualNodeEnumerationRuntimeExceptionMMBase 1.9-SNAPSHOT - ${javadoctimestamp}