| 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 |
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. |
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 |
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 |
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.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)
|
|
|