|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.mmbase.bridge.util.AbstractNode
org.mmbase.bridge.implementation.BasicNode
public class BasicNode
Basic implementation of Node. Wraps MMObjectNodes, adds security.
Node,
MMObjectNodeVirtualNode. They probably should share an ancestor (AbstractBasicNode or so) (MMB-1870)| Field Summary | |
|---|---|
protected BasicCloud |
cloud
Reference to the Cloud. |
protected BasicNodeManager |
nodeManager
Reference to the NodeManager |
protected MMObjectNode |
noderef
Reference to actual MMObjectNode object. |
protected MMObjectNode |
originalNoderef
|
protected int |
temporaryNodeId
Temporary node ID. |
| Fields inherited from interface org.mmbase.bridge.Node |
|---|
CLOUD_COMMITNODE_KEY |
| Constructor Summary | |
|---|---|
BasicNode(BasicCloud cloud)
|
|
BasicNode(MMObjectNode node,
BasicCloud cloud)
Instantiates a node, linking it to a specified cloud The NodeManager for the node is requested from the Cloud. |
|
BasicNode(MMObjectNode node,
BasicCloud cloud,
int id)
Instantiates a new node (for insert), using a specified nodeManager. |
|
BasicNode(MMObjectNode node,
BasicNodeManager nodeManager)
Instantiates a node, linking it to a specified node manager. |
|
| Method Summary | |
|---|---|
void |
cancel()
|
protected void |
checkAccount()
|
protected void |
checkCommit()
|
protected void |
checkCreate()
|
protected void |
checkDelete()
|
protected void |
checkWrite()
|
void |
commit()
This implementation checks create rights, then validates the values, then processes the 'commit processors' and then calls BasicCloud.afterCommit(BasicNode) |
int |
countRelatedNodes(NodeManager otherNodeManager,
String role,
String direction)
|
int |
countRelatedNodes(String type)
|
void |
createAlias(String aliasName)
|
protected FieldValue |
createFunctionValue(Object result)
|
Parameters |
createParameters(String functionName)
|
void |
delete(boolean deleteRelations)
|
void |
deleteAlias(String aliasName)
|
void |
deleteRelations(String type)
|
protected void |
finalize()
Reverse the buffers, when changed and not stored... |
StringList |
getAliases()
|
boolean |
getBooleanValue(String fieldName)
|
int |
getByteSize()
|
int |
getByteSize(SizeOf sizeof)
|
byte[] |
getByteValue(String fieldName)
|
Set<String> |
getChanged()
|
Cloud |
getCloud()
|
String |
getContext()
|
Date |
getDateValue(String fieldName)
|
double |
getDoubleValue(String fieldName)
|
float |
getFloatValue(String fieldName)
|
Collection<Function<?>> |
getFunctions()
|
InputStream |
getInputStreamValue(String fieldName)
|
int |
getIntValue(String fieldName)
|
List |
getListValue(String fieldName)
|
long |
getLongValue(String fieldName)
|
protected MMObjectNode |
getNode()
Obtains a reference to the underlying MMObjectNode. |
protected Function<?> |
getNodeFunction(String functionName)
|
NodeManager |
getNodeManager()
|
Node |
getNodeValue(String fieldName)
|
int |
getNumber()
|
StringList |
getPossibleContexts()
|
protected NodeList |
getRelatedNodes(NodeManager otherManager,
String role)
Get related nodes for this node |
NodeList |
getRelatedNodes(NodeManager otherManager,
String role,
String searchDir)
|
RelationList |
getRelations(String role,
NodeManager nodeManager,
String searchDir)
Returns a list of relations of the given node. |
RelationList |
getRelations(String role,
String otherNodeManager)
|
long |
getSize(String fieldName)
|
String |
getStringValue(String fieldName)
|
Object |
getValueWithoutProcess(String fieldName)
Like getObjectValue, but skips any processing that MMBase would normally perform on a field. |
Document |
getXMLValue(String fieldName)
|
boolean |
hasRelations()
|
protected void |
init()
Initializes state in case of a transaction. |
protected void |
invalidateNode()
Invalidates the reference to the underlying MMObjectNode, replacing it with a virtual node that only inherits the number field. |
boolean |
isChanged()
|
boolean |
isChanged(String fieldName)
|
boolean |
isNew()
Returns whether this is a new (not yet committed) node. |
boolean |
isNull(String fieldName)
|
boolean |
mayChangeContext()
|
boolean |
mayDelete()
|
boolean |
mayWrite()
|
void |
setContext(String context)
|
protected void |
setNode(MMObjectNode n)
Sets the reference to the underlying MMObjectNode. |
protected void |
setNodeManager(MMObjectNode node)
Set nodemanager for node |
void |
setNodeManager(NodeManager nm)
|
protected void |
setSize(String fieldName,
long size)
|
protected void |
setValueWithoutChecks(String fieldName,
Object value)
Protected method to be able to set rnumber when creating a relation. |
protected Integer |
toNodeNumber(Object v)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Field Detail |
|---|
protected BasicNodeManager nodeManager
protected final BasicCloud cloud
protected MMObjectNode noderef
protected MMObjectNode originalNoderef
protected int temporaryNodeId
| Constructor Detail |
|---|
BasicNode(BasicCloud cloud)
BasicNode(MMObjectNode node,
BasicNodeManager nodeManager)
node - the MMObjectNode to base the node onnodeManager - the NodeManager to use for administrating this Node
IllegalArgumentException - If node is null
BasicNode(MMObjectNode node,
BasicCloud cloud)
node - the MMObjectNode to base the node oncloud - the cloud to which this node belongs
IllegalArgumentException - If node is null
BasicNode(MMObjectNode node,
BasicCloud cloud,
int id)
node - a temporary MMObjectNode that is the base for the nodecloud - the cloud to create the node inid - the id of the node in the temporary cloud| Method Detail |
|---|
protected void setNodeManager(MMObjectNode node)
node - node to derive nodemanager from.protected void init()
public int getByteSize()
getByteSize in interface SizeMeasurablepublic int getByteSize(SizeOf sizeof)
getByteSize in interface SizeMeasurableprotected final MMObjectNode getNode()
NotFoundException - if no node was specified.protected void invalidateNode()
protected void setNode(MMObjectNode n)
n - the node to set a reference to.
IllegalArgumentException - is n is nullpublic Cloud getCloud()
getCloud in interface Nodepublic NodeManager getNodeManager()
getNodeManager in interface Nodepublic void setNodeManager(NodeManager nm)
setNodeManager in interface NodesetNodeManager in class AbstractNodepublic int getNumber()
getNumber in interface NodegetNumber in class AbstractNodepublic boolean isNew()
isNew in interface NodeisNew in class AbstractNodepublic boolean isChanged(String fieldName)
isChanged in interface NodeisChanged in class AbstractNodepublic boolean isChanged()
isChanged in interface NodeisChanged in class AbstractNodepublic Set<String> getChanged()
getChanged in interface NodegetChanged in class AbstractNodeprotected void checkAccount()
protected void checkDelete()
protected void checkWrite()
checkWrite in class AbstractNodeprotected void checkCreate()
protected void checkCommit()
protected void setValueWithoutChecks(String fieldName,
Object value)
setValueWithoutChecks in class AbstractNodefieldName - name of fieldvalue - new value of fieldprotected Integer toNodeNumber(Object v)
toNodeNumber in class AbstractNode
protected void setSize(String fieldName,
long size)
setSize in class AbstractNodepublic boolean isNull(String fieldName)
isNull in interface NodeisNull in class AbstractNodepublic long getSize(String fieldName)
getSize in interface Nodepublic Object getValueWithoutProcess(String fieldName)
getValueWithoutProcess in interface NodefieldName - name of field
public boolean getBooleanValue(String fieldName)
getBooleanValue in interface NodegetBooleanValue in class AbstractNodepublic Date getDateValue(String fieldName)
getDateValue in interface NodegetDateValue in class AbstractNodepublic List getListValue(String fieldName)
getListValue in interface NodegetListValue in class AbstractNodepublic Node getNodeValue(String fieldName)
getNodeValue in interface NodegetNodeValue in class AbstractNodepublic int getIntValue(String fieldName)
getIntValue in interface NodegetIntValue in class AbstractNodepublic float getFloatValue(String fieldName)
getFloatValue in interface NodegetFloatValue in class AbstractNodepublic long getLongValue(String fieldName)
getLongValue in interface NodegetLongValue in class AbstractNodepublic double getDoubleValue(String fieldName)
getDoubleValue in interface NodegetDoubleValue in class AbstractNodepublic byte[] getByteValue(String fieldName)
getByteValue in interface NodegetByteValue in class AbstractNodepublic InputStream getInputStreamValue(String fieldName)
getInputStreamValue in interface NodegetInputStreamValue in class AbstractNodepublic String getStringValue(String fieldName)
getStringValue in interface NodegetStringValue in class AbstractNodepublic Document getXMLValue(String fieldName)
getXMLValue in interface NodegetXMLValue in class AbstractNodepublic void commit()
BasicCloud.afterCommit(BasicNode)
commit in interface Nodecommit in class AbstractNodepublic void cancel()
cancel in interface Nodecancel in class AbstractNodepublic void delete(boolean deleteRelations)
delete in interface Nodedelete in class AbstractNodepublic String toString()
toString in interface NodetoString in class Object
public void deleteRelations(String type)
throws NotFoundException
deleteRelations in interface NodedeleteRelations in class AbstractNodeNotFoundException
public RelationList getRelations(String role,
String otherNodeManager)
throws NotFoundException
getRelations in interface NodegetRelations in class AbstractNodeNotFoundException
public RelationList getRelations(String role,
NodeManager nodeManager,
String searchDir)
throws NotFoundException
getRelations in interface NodegetRelations in class AbstractNoderole - role of the relationnodeManager - node manager on the other side of the relationsearchDir - direction of the relation
NotFoundException - See Queries.createRelationNodesQuery(Node, NodeManager, String, String)
Should perhaps be implemented with thatpublic boolean hasRelations()
hasRelations in interface NodehasRelations in class AbstractNode
public int countRelatedNodes(NodeManager otherNodeManager,
String role,
String direction)
countRelatedNodes in interface NodecountRelatedNodes in class AbstractNode
protected NodeList getRelatedNodes(NodeManager otherManager,
String role)
otherManager - nodemanager on the other side of the relationrole - name of the relation
public NodeList getRelatedNodes(NodeManager otherManager,
String role,
String searchDir)
getRelatedNodes in interface NodegetRelatedNodes in class AbstractNodeotherManager - node manager on the other side of the relationrole - role of the relationsearchDir - direction of the relation
Should perhaps be implemented with that.public int countRelatedNodes(String type)
countRelatedNodes in interface NodecountRelatedNodes in class AbstractNodepublic StringList getAliases()
getAliases in interface NodegetAliases in class AbstractNodepublic void createAlias(String aliasName)
createAlias in interface NodecreateAlias in class AbstractNodepublic void deleteAlias(String aliasName)
deleteAlias in interface NodedeleteAlias in class AbstractNodepublic void setContext(String context)
setContext in interface NodesetContext in class AbstractNodepublic String getContext()
getContext in interface NodegetContext in class AbstractNodepublic StringList getPossibleContexts()
getPossibleContexts in interface NodegetPossibleContexts in class AbstractNodepublic boolean mayWrite()
mayWrite in interface NodemayWrite in class AbstractNodepublic boolean mayDelete()
mayDelete in interface NodemayDelete in class AbstractNodepublic boolean mayChangeContext()
mayChangeContext in interface NodemayChangeContext in class AbstractNodeprotected void finalize()
finalize in class Objectpublic Collection<Function<?>> getFunctions()
getFunctions in interface NodegetFunctions in class AbstractNodeprotected Function<?> getNodeFunction(String functionName)
getNodeFunction in class AbstractNodepublic Parameters createParameters(String functionName)
createParameters in interface NodecreateParameters in class AbstractNodeprotected FieldValue createFunctionValue(Object result)
createFunctionValue in class AbstractNode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||