|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Node
Describes an object in the cloud.
| Field Summary | |
|---|---|
static String |
CLOUD_COMMITNODE_KEY
During commit of the node, this property of the cloud, should contain the node number of the node |
| Method Summary | |
|---|---|
void |
cancel()
Cancel changes to a node This fails if the current node is not in edit mode. |
void |
commit()
Commit the node to the database. |
int |
countRelatedNodes(NodeManager otherNodeManager,
String role,
String searchDir)
|
int |
countRelatedNodes(String nodeManager)
Returns the number of related nodes that have a specific node manager. |
int |
countRelations()
Returns the number of relations this node has with other nodes. |
int |
countRelations(String relationManager)
Returns the number of relation nodes attached to this node that have a specific relation manager. |
void |
createAlias(String alias)
Create an alias for this node. |
Parameters |
createParameters(String functionName)
Creates a parameter list for a function. |
Relation |
createRelation(Node destinationNode,
RelationManager relationManager)
Adds a relation between this node and a specified node to the cloud. |
void |
delete()
Removes the Node. |
void |
delete(boolean deleteRelations)
Removes the Node. |
void |
deleteAlias(String alias)
Delete an alias for this node. |
void |
deleteRelations()
Removes all relation nodes attached to this node. |
void |
deleteRelations(String relationManager)
Removes all relation nodes with a certain relation manager that are attached to this node. |
StringList |
getAliases()
Returns all aliases for this node. |
boolean |
getBooleanValue(String fieldName)
Returns the value of the specified field as a boolean. |
byte[] |
getByteValue(String fieldName)
Returns the value of the specified field as a byte array. |
Set<String> |
getChanged()
A Set of Strings containing the names of all changed fields. |
Cloud |
getCloud()
Returns the cloud this node belongs to. |
String |
getContext()
Get the security context of the current Node |
Date |
getDateValue(String fieldName)
|
BigDecimal |
getDecimalValue(String fieldName)
|
double |
getDoubleValue(String fieldName)
Returns the value of the specified field as a double. |
FieldValue |
getFieldValue(Field field)
Returns the value of the specified field as a FieldValue object. |
FieldValue |
getFieldValue(String fieldName)
Returns the value of the specified field as a FieldValue object. |
float |
getFloatValue(String fieldName)
Returns the value of the specified field as a float. |
Function<?> |
getFunction(String functionName)
Returns a Fuction object. |
Collection<Function<?>> |
getFunctions()
Returns all the Function objects of this Node |
FieldValue |
getFunctionValue(String functionName,
List<?> parameters)
Returns the value of the specified function on the node. |
InputStream |
getInputStreamValue(String fieldName)
Returns the value of the specified field as a java.io.InputStream This is
especially useful for large byte-array fields. |
int |
getIntValue(String fieldName)
Returns the value of the specified field as an int. |
List<?> |
getListValue(String fieldName)
|
long |
getLongValue(String fieldName)
Returns the value of the specified field as a long. |
NodeManager |
getNodeManager()
Returns the node manager for this node. |
Node |
getNodeValue(String fieldName)
Returns the value of the specified field as a Node. |
int |
getNumber()
Returns the unique number for this node. |
Object |
getObjectValue(String fieldName)
Returns the field's value as an object. |
StringList |
getPossibleContexts()
Contacts the security implementation to find out to which other possible contexts the context of this node may be set. |
NodeList |
getRelatedNodes()
Returns all related nodes. |
NodeList |
getRelatedNodes(NodeManager nodeManager)
Returns all related nodes that have a specific node manager. |
NodeList |
getRelatedNodes(NodeManager nodeManager,
String role,
String searchDir)
Returns all related nodes that have a specific node manager and role. |
NodeList |
getRelatedNodes(String nodeManager)
Returns all related nodes that have a specific node manager. |
NodeList |
getRelatedNodes(String nodeManager,
String role,
String searchDir)
Returns all related nodes that have a specific node manager and role. |
RelationList |
getRelations()
Returns all relation nodes attached to this node. |
RelationList |
getRelations(String role)
Returns all relation nodes attached to this node that have a specific role |
RelationList |
getRelations(String role,
NodeManager nodeManager)
Returns all relation nodes attached to this node that have a specific role, or refer a node from a specific nodemanager |
RelationList |
getRelations(String role,
NodeManager nodeManager,
String searchDir)
|
RelationList |
getRelations(String role,
String nodeManager)
Returns all relation nodes attached to this node that have a specific role, or refer a node from a specific nodemanager |
long |
getSize(String fieldName)
Returns the 'size' (e.g. |
String |
getStringValue(String fieldName)
Returns the value of the specified field as a String. |
Object |
getValue(String fieldName)
Returns the value of the specified field as an object. |
Object |
getValueWithoutProcess(String fieldName)
Like getObjectValue, but skips any processing that MMBase would normally perform on a field. |
Document |
getXMLValue(String fieldName)
Returns the value of the specified field as a dom.Document
If the node value is not itself a Document, the method attempts to
attempts to convert the String value into an XML. |
Element |
getXMLValue(String fieldName,
Document tree)
Returns the value of the specified field as a dom.Element
If the node value is not itself a Document, the method attempts to
attempts to convert the String value into an XML. |
boolean |
hasRelations()
Checks whether this node has any relations. |
boolean |
isChanged()
Whether field values were changed since the last commit. |
boolean |
isChanged(String fieldName)
Whether a certain field's value was changed since the last commit. |
boolean |
isNew()
Whether this Node is new (not yet committed). |
boolean |
isNodeManager()
Determine whether this Node is a NodeManager. |
boolean |
isNull(String fieldName)
Whether the value for the specified field is null. |
boolean |
isRelation()
Determine whether this Node is a Relation. |
boolean |
isRelationManager()
Determine whether this Node is a RelationManager. |
boolean |
mayChangeContext()
Check context-change rights on this node. |
boolean |
mayDelete()
Check delete rights on this node. |
boolean |
mayWrite()
Check write rights on this node. |
void |
setBooleanValue(String fieldName,
boolean value)
Sets the value of the specified field using an boolean. |
void |
setByteValue(String fieldName,
byte[] value)
Sets the value of the specified field using a byte array. |
void |
setContext(String context)
Sets the security context of this Node (AKA the 'owner' field) |
void |
setDateValue(String fieldName,
Date value)
Sets the value of the specified field using a Date. |
void |
setDecimalValue(String fieldName,
BigDecimal value)
Sets the value of the specified field using a BigDecimal. |
void |
setDoubleValue(String fieldName,
double value)
Sets the value of the specified field using a double. |
void |
setFloatValue(String fieldName,
float value)
Sets the value of the specified field using a float. |
void |
setInputStreamValue(String fieldName,
InputStream value,
long size)
Sets the value of the specified field using a java.io.InputStream. |
void |
setIntValue(String fieldName,
int value)
Sets the value of the specified field using an int. |
void |
setListValue(String fieldName,
List<?> value)
Sets the value of the specified field using a List. |
void |
setLongValue(String fieldName,
long value)
Sets the value of the specified field using a long. |
void |
setNodeManager(NodeManager nm)
Sets the node manager of this node. |
void |
setNodeValue(String fieldName,
Node value)
Sets the value of the specified field using an Node. |
void |
setObjectValue(String fieldName,
Object value)
Sets the value of the specified field using an object, but without dispatching to the right type first. |
void |
setStringValue(String fieldName,
String value)
Sets the value of the specified field using a String. |
void |
setValue(String fieldName,
Object value)
Sets the value of the specified field using an object, but delegated to the right set--Value depending on the type of the field. |
void |
setValueWithoutProcess(String fieldName,
Object value)
Like setValue, but skips any processing that MMBase would normally perform on a field. |
void |
setXMLValue(String fieldName,
Document value)
Set's the value of the specified field as a dom.Element |
NodeManager |
toNodeManager()
Returns this as a NodeManager. |
Relation |
toRelation()
Returns this as a Relation. |
RelationManager |
toRelationManager()
Returns this as a RelationManager. |
String |
toString()
Converts the node to a string |
Collection<String> |
validate()
Validates a node by checking the values from it's fields against the constraints of each field's datatype. |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Field Detail |
|---|
static final String CLOUD_COMMITNODE_KEY
| Method Detail |
|---|
Cloud getCloud()
NodeManager getNodeManager()
void setNodeManager(NodeManager nm)
SecurityException - If you are not allowed to change this node, or not allowed to
create nodes of the destination type.int getNumber()
createAlias(String alias)boolean isRelation()
true if this Node is a Relation.Relation toRelation()
Relation object
ClassCastException - if the Node is not a Relationboolean isNodeManager()
true if this Node is a NodeManager.NodeManager toNodeManager()
NodeManager object
ClassCastException - if the Node is not a NodeManagerboolean isRelationManager()
true if this Node is a RelationManager.RelationManager toRelationManager()
NodeManager object
ClassCastException - if the Node is not a RelationManager
void setValue(String fieldName,
Object value)
int can be set using an
Integer.
This change will not be visible to the cloud until the commit method is
called.
fieldName - the name of the field to be updatedvalue - the new value for the given field
void setValueWithoutProcess(String fieldName,
Object value)
fieldName - name of fieldvalue - new value of the field
void setObjectValue(String fieldName,
Object value)
fieldName - the name of the field to be updatedvalue - the new value for the given field
void setBooleanValue(String fieldName,
boolean value)
boolean.
This change will not be visible to the cloud until the commit method is
called.
fieldName - the name of the field to be updatedvalue - the new value for the given field
void setNodeValue(String fieldName,
Node value)
Node.
This change will not be visible to the cloud until the commit method is
called.
fieldName - the name of the field to be updatedvalue - the new value for the given field
void setIntValue(String fieldName,
int value)
int.
This change will not be visible to the cloud until the commit method is
called.
fieldName - the name of the field to be updatedvalue - the new value for the given field
void setFloatValue(String fieldName,
float value)
float.
This change will not be visible to the cloud until the commit method is
called.
fieldName - the name of the field to be updatedvalue - the new value for the given field
void setDoubleValue(String fieldName,
double value)
double.
This change will not be visible to the cloud until the commit method is
called.
fieldName - the name of the field to be updatedvalue - the new value for the given field
void setByteValue(String fieldName,
byte[] value)
byte array.
This change will not be visible to the cloud until the commit method is
called.
fieldName - the name of the field to be updatedvalue - the new value for the given field
void setInputStreamValue(String fieldName,
InputStream value,
long size)
java.io.InputStream.
fieldName - the name of the field to be updatedvalue - the new value for the given fieldsize - size of input stream
void setLongValue(String fieldName,
long value)
long.
This change will not be visible to the cloud until the commit method is
called.
fieldName - the name of the field to be updatedvalue - the new value for the given field
void setStringValue(String fieldName,
String value)
String.
This change will not be visible to the cloud until the commit method is
called.
fieldName - the name of the field to be updatedvalue - the new value for the given field
void setDateValue(String fieldName,
Date value)
Date.
This change will not be visible to the cloud until the commit method is
called.
fieldName - the name of the field to be updatedvalue - the new value for the given field
void setDecimalValue(String fieldName,
BigDecimal value)
BigDecimal.
This change will not be visible to the cloud until the commit method is
called.
fieldName - the name of the field to be updatedvalue - the new value for the given field
void setListValue(String fieldName,
List<?> value)
List.
This change will not be visible to the cloud until the commit method is
called.
fieldName - the name of the field to be updatedvalue - the new value for the given field
// not yet workingboolean isNull(String fieldName)
null. This avoids acquiring the
complete value if you only want to check if for emptiness.
fieldName - the name of the field
true when value is nulllong getSize(String fieldName)
fieldName - the name of the field
Object getValue(String fieldName)
int is returned as an Integer.
The object type may vary and is dependent on how data was stored in a field.
I.e. It may be possible for an Integer field to return it's value as a String
if it was stored that way in the first place.
fieldName - the name of the field to be returned
IllegalArgumentException - if mmbase is 'in development' (i.e. 'strict' mode) and the
field does not exist.Object getObjectValue(String fieldName)
fieldName - name of the field
IllegalArgumentException - if mmbase is 'in development' (i.e. 'strict' mode) and the
field does not exist.Object getValueWithoutProcess(String fieldName)
fieldName - name of field
IllegalArgumentException - if mmbase is 'in development' (i.e. 'strict' mode) and the
field does not exist.boolean getBooleanValue(String fieldName)
boolean.
If the actual value is numeric, this call returns true
if the value is a positive, non-zero, value. In other words, values '0'
and '-1' are considered false.
If the value is a string, this call returns true if
the value is "true" or "yes" (case-insensitive).
In all other cases (including calling byte fields), false
is returned.
fieldName - the name of the field to be returned
IllegalArgumentException - if mmbase is 'in development' (i.e. 'strict' mode) and the
field does not exist.Node getNodeValue(String fieldName)
Node.
If the value is not itself a Node, this call attempts to convert the
original field value to a Node, by trying to retrieve a Node using
the field value as a Node number or alias.null.
null lets the
Node return a reference to itself, regardless of the actual value of the
number field or status of the Node.
fieldName - the name of the field to be returned
IllegalArgumentException - if mmbase is 'in development' (i.e. 'strict' mode) and the
field does not exist.Cloud.getList(String, String, String, String, String, String, String, boolean)int getIntValue(String fieldName)
int.
Numeric fields are simply converted. Double and float values may be truncated.
For Node values, the numeric key is returned.
Long values return -1 of the value is too large.
Boolean fields return 0 if false, and 1 if true.
String fields are parsed.
If a parsed string contains an error, ot the field value is not of a type that can be converted
(i.e. a byte array), this function returns -1
fieldName - the name of the field to be returned
IllegalArgumentException - if mmbase is 'in development' (i.e. 'strict' mode) and the
field does not exist.float getFloatValue(String fieldName)
float.
This function attempts to convert the value to a float.
Numeric fields are simply converted.
Boolean fields return 0.0 if false, and 1.0 if true.
String fields are parsed.
If a parsed string contains an error, ot the field value is not of a type that can be converted
(i.e. a byte array), this function returns -1.0.
fieldName - the name of the field to be returned
long getLongValue(String fieldName)
long.
This function attempts to convert the value to a long.
Numeric fields are simply converted. Double and float values may be truncated.
Boolean fields return 0 if false, and 1 if true.
String fields are parsed.
If a parsed string contains an error, ot the field value is not of a type that can be converted
(i.e. a byte array), this function returns -1
fieldName - the name of the field to be returned
IllegalArgumentException - if mmbase is 'in development' (i.e. 'strict' mode) and the
field does not exist.double getDoubleValue(String fieldName)
double.
This function attempts to convert the value to a double.
Numeric fields are simply converted. Double may be truncated.
Boolean fields return 0.0 if false, and 1.0 if true.
String fields are parsed.
If a parsed string contains an error, ot the field value is not of a type that can be converted
(i.e. a byte array), this function returns -1.0.
fieldName - the name of the field to be returned
IllegalArgumentException - if mmbase is 'in development' (i.e. 'strict' mode) and the
field does not exist.byte[] getByteValue(String fieldName)
byte array.
This function returns either the value of a byte field, or the byte value of a string
(converted using the default encoding, i.e. UTF8)
Other types of values return an empty byte-array.
fieldName - the name of the field to be returned
IllegalArgumentException - if mmbase is 'in development' (i.e. 'strict' mode) and the
field does not exist.InputStream getInputStreamValue(String fieldName)
java.io.InputStream This is
especially useful for large byte-array fields. By this you can avoid them to be completely
stored in memory.
fieldName - the name of the field
IllegalArgumentException - if mmbase is 'in development' (i.e. 'strict' mode) and the
field does not exist.String getStringValue(String fieldName)
String.
Byte arrays are converted to string using the default encoding (UTF8).
Node values return a string representation of their numeric key.
For other values the result is calling the toString() method on the actual object.
fieldName - the name of the field to be returned
IllegalArgumentException - if mmbase is 'in development' (i.e. 'strict' mode) and the
field does not exist.Date getDateValue(String fieldName)
fieldName - the name of the field to be returned
IllegalArgumentException - if mmbase is 'in development' (i.e. 'strict' mode) and the
field does not exist.BigDecimal getDecimalValue(String fieldName)
fieldName - the name of the field to be returned
IllegalArgumentException - if mmbase is 'in development' (i.e. 'strict' mode) and the
field does not exist.List<?> getListValue(String fieldName)
fieldName - the name of the field to be returned
IllegalArgumentException - if mmbase is 'in development' (i.e. 'strict' mode) and the
field does not exist.
not yet working
FieldValue getFieldValue(String fieldName)
throws NotFoundException
FieldValue object.
fieldName - the name of the field whose value to return
NotFoundException - is the field does not exist and MMBase 'in development'
(i.e. strict mode)FieldValue getFieldValue(Field field)
FieldValue object.
field - the Field object whose value to return
Collection<String> validate()
commit() method, after commit processors are run.
Note that because commit processors may make necessary changes to field values, it is possible for
validate() to fail when used outside the commit process if the constraints are set too strict.
String (in the current locale of the cloud) or an empty collection if everything ok.void commit()
BridgeException
IllegalArgumentException - If a certain value of the node is invalid according to it's data type.void cancel()
void delete()
boolean isNew()
true when newboolean isChanged(String fieldName)
fieldName - the name of the field
true when field's value was changedSet<String> getChanged()
boolean isChanged()
true when changedvoid delete(boolean deleteRelations)
deleteRelations - a boolean. If true, then first all
existing relations with this node will be removed.String toString()
toString in class Object
Document getXMLValue(String fieldName)
throws IllegalArgumentException
dom.Document
If the node value is not itself a Document, the method attempts to
attempts to convert the String value into an XML.
This included the empty string, but not the 'null' value.
If the value is null, this method returns null
fieldName - the name of the field to be returned
null
IllegalArgumentException - if the value cannot be converted to xml, or the field does
not exist.
Element getXMLValue(String fieldName,
Document tree)
throws IllegalArgumentException
dom.Element
If the node value is not itself a Document, the method attempts to
attempts to convert the String value into an XML.
This method fails (throws a IllegalArgumentException) if the Field is not of type TYPE_XML.
If the value cannot be converted, this method returns null
fieldName - the name of the field to be returnedtree - the DOM Document to which the Element is added
(as the document root element)
null
IllegalArgumentException - if the value cannot be converted to xml.
void setXMLValue(String fieldName,
Document value)
dom.Element
fieldName - the name of the field to be returnedvalue - the DOM Document to has to be set, if not correct doc-type,
system will try to convert it to the wanted type.boolean hasRelations()
true if the node has relationsvoid deleteRelations()
void deleteRelations(String relationManager)
relationManager - the name of the relation manager the removed
relation nodes should haveRelationList getRelations()
RelationList getRelations(String role)
role - the name of the role the returned
relation nodes should have
RelationList getRelations(String role,
String nodeManager)
role - the name of the role the returned
relation nodes should havenodeManager - the name of the nodemanager for the nodes the returned
relation nodes should have a relation to
RelationList getRelations(String role,
NodeManager nodeManager)
role - the name of the role the returned
relation nodes should havenodeManager - the nodemanager for the nodes the returned
relation nodes should have a relation to (can be null)
RelationList getRelations(String role,
NodeManager nodeManager,
String searchDir)
role - forward role of a relationnodeManager - node manager on the other side of the relationsearchDir - the direction of the relation
int countRelations()
int countRelations(String relationManager)
relationManager - relation manager
NodeList getRelatedNodes()
NodeList getRelatedNodes(String nodeManager)
nodeManager - the name of the node manager the returned nodes
should have
NodeList getRelatedNodes(NodeManager nodeManager)
nodeManager - the node manager the returned nodes should have, can be null
NodeList getRelatedNodes(String nodeManager,
String role,
String searchDir)
nodeManager - the name of the node manager the returned nodes
should haverole - the role of the relationsearchDir - the direction of the relation
NodeList getRelatedNodes(NodeManager nodeManager,
String role,
String searchDir)
nodeManager - the node manager the returned nodes should haverole - the role of the relationsearchDir - the direction of the relation
int countRelatedNodes(String nodeManager)
nodeManager - the name of the node manager the counted nodes
should have
int countRelatedNodes(NodeManager otherNodeManager,
String role,
String searchDir)
otherNodeManager - the node manager the nodes should haverole - the role of the relationsearchDir - the direction of the relation
StringList getAliases()
void createAlias(String alias)
alias - the alias to be created for this node
BridgeException - if the alias allready existsvoid deleteAlias(String alias)
alias - the alias to be removed for this node
Relation createRelation(Node destinationNode,
RelationManager relationManager)
destinationNode - the node to which you want to relate this noderelationManager - the relation manager you want to use
BridgeException - if the relation manager is not the right one
for this type of relationvoid setContext(String context)
context - The security context to which this node should belong,
SecurityException - When appropriate rights to perform this are lacking (write / change context rights)String getContext()
SecurityException - When appropriate rights to perform this are lacking (read rights)StringList getPossibleContexts()
SecurityException - When appropriate rights to perform this are lacking (read rights)boolean mayWrite()
boolean mayDelete()
boolean mayChangeContext()
Collection<Function<?>> getFunctions()
Function objects.Function<?> getFunction(String functionName)
Function object.
You need to explixitly cast the result to this object, since not all bridge
implementations (i.e. the RMMCI) support this class.
functionName - name of the function
Function object.
NotFoundException - if the function does not existParameters createParameters(String functionName)
functionName - name of the function
Parameters object.
NotFoundException - if the function does not exist
FieldValue getFunctionValue(String functionName,
List<?> parameters)
functionName - name of the functionparameters - list with parameters for the fucntion
NotFoundException - if the function does not exist
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||