| org.mmbase.bridge.Cloud
All known Subclasses: org.mmbase.bridge.implementation.BasicCloud,
Cloud | public interface Cloud (Code) | | A Cloud is a collection of Nodes (and relations that are also nodes).
A Cloud is part of a CloudContexts.
author: Rob Vermeulen author: Pierre van Rooden author: Jaco de Groot version: $Id: Cloud.java,v 1.66 2008/03/17 10:05:02 michiel Exp $ |
Method Summary | |
public Query | createAggregatedQuery() | public NodeList | createNodeList() | public NodeManagerList | createNodeManagerList() | public NodeQuery | createNodeQuery() Create an empty NodeQuery, which can be filled, and used in
NodeManager.getList(NodeQuery) or
Cloud.getList(Query) (but then no 'real' node are returned). | public Query | createQuery() Create an empty Query, which can be filled, and used in
Cloud.getList(Query) . | public RelationList | createRelationList() | public RelationManagerList | createRelationManagerList() | public Transaction | createTransaction() Creates a transaction on this cloud. | public Transaction | createTransaction(String name) Creates a transaction on this cloud with a specified name. | public Transaction | createTransaction(String name, boolean overwrite) Creates a transaction on this cloud with a specified name. | public CloudContext | getCloudContext() Returns the context to which this cloud belongs. | public String | getDescription() This may return
Cloud.getName , but in principable it could have been localized using the
value also returned by
Cloud.getLocale . | public Function> | getFunction(String setName, String functionName) Returns a Function object from a function set. | public Collection<Function<?>> | getFunctions(String setName) Returns all Function objects from a function set. | public NodeList | getList(String startNodes, String nodePath, String fields, String constraints, String orderby, String directions, String searchDir, boolean distinct) Returns a list of virtual nodes that are composed by fields of other
nodes.
Starting at one or more specified nodes traversals are made according to
a specified path. | public NodeList | getList(Query query) Executes a query and returns the result as a Cluster Node List (also if the query is a
NodeQuery ). | public Locale | getLocale() Gets the locale assocatied with this Cloud instance. | public String | getName() Returns the name of this cloud. | public Node | getNode(int number) Returns the node with the specified number from this cloud. | public Node | getNode(String number) Returns the node with the specified number from this cloud. | public Node | getNodeByAlias(String alias) Returns the node with the specified alias from this cloud. | public NodeManager | getNodeManager(String name) Returns the specified node manager. | public NodeManager | getNodeManager(int nodeManagerId) Returns the specified node manager. | public NodeManagerList | getNodeManagers() Returns all node managers available in this cloud. | public Cloud | getNonTransactionalCloud() | public StringList | getPossibleContexts() Contacts the security implementation to find out to which possible contexts are
available to the current user. | public Map<Object, Object> | getProperties() Retrieves all properties previously set for this cloud. | public Object | getProperty(Object key) Retrieves a property previously set for this cloud. | public Relation | getRelation(int number) Returns the relation with the specified number from this cloud. | public Relation | getRelation(String number) Returns the relation with the specified number from this cloud. | public RelationManager | getRelationManager(int relationManagerId) Returns the specified relation manager. | public RelationManager | getRelationManager(String sourceManagerName, String destinationManagerName, String roleName) Returns the specified relation manager. | public RelationManager | getRelationManager(NodeManager sourceManager, NodeManager destinationManager, String roleName) Returns the specified relation manager. | public RelationManager | getRelationManager(String roleName) Returns the specified relation manager. | public RelationManagerList | getRelationManagers() Returns all relation managers available in this cloud. | public RelationManagerList | getRelationManagers(String sourceManagerName, String destinationManagerName, String roleName) Returns all relation managers available in this cloud that follow the specified filter. | public RelationManagerList | getRelationManagers(NodeManager sourceManager, NodeManager destinationManager, String roleName) Returns all relation managers available in this cloud that follow the specified filter. | public Transaction | getTransaction(String name) Returnes the transaction with the specified name. | public UserContext | getUser() Who is using this cloud. | public boolean | hasNode(int number) Determines whether a node with the specified number exists in this cloud. | public boolean | hasNode(String number) Determines whether a node with the specified number is available from this cloud. | public boolean | hasNodeManager(String name) Returns whether the specified node manager exists. | public boolean | hasRelation(int number) Determines whether a relation with the specified number exists in this cloud. | public boolean | hasRelation(String number) Determines whether a relation with the specified number is available from this cloud. | public boolean | hasRelationManager(String sourceManagerName, String destinationManagerName, String roleName) Returns whether the specified relation manager exists. | public boolean | hasRelationManager(NodeManager sourceManager, NodeManager destinationManager, String roleName) Returns whether the specified relation manager exists. | public boolean | hasRelationManager(String roleName) Returns whether the specified relation manager exists. | public boolean | hasRole(String roleName) Returns whether the specified role exists. | public boolean | may(org.mmbase.security.Action action, org.mmbase.util.functions.Parameters parameters) | public boolean | mayRead(int number) Determines whether a node with the specified number is accessible for the user - that is,
the user has sufficient rights to read the node. | public boolean | mayRead(String number) Determines whether a node with the specified number is accessible for the user - that is,
the user has sufficient rights to read the node. | public void | setLocale(Locale locale) Sets a locale for this Cloud instance.
Parameters: locale - To which locale it must be set. | public void | setProperty(Object key, Object value) Sets a property for this cloud object. |
PROP_IGNOREVALIDATION | final public static String PROP_IGNOREVALIDATION(Code) | | If you set this property on the cloud to true, validation errors will not be fatal, and nodes
can be saved anyways.
since: MMBase-1.8.6 |
PROP_SESSIONNAME | final public static String PROP_SESSIONNAME(Code) | | |
createAggregatedQuery | public Query createAggregatedQuery()(Code) | | |
createNodeList | public NodeList createNodeList()(Code) | | Returns a new, empty node list for this cloud
The empty list since: MMBase-1.8 |
createNodeManagerList | public NodeManagerList createNodeManagerList()(Code) | | Returns a new, empty node manager list for this cloud
The empty list since: MMBase-1.8 |
createRelationList | public RelationList createRelationList()(Code) | | Returns a new, empty relation list for this cloud
The empty list since: MMBase-1.8 |
createRelationManagerList | public RelationManagerList createRelationManagerList()(Code) | | Returns a new, empty relation manager list for this cloud
The empty list since: MMBase-1.8 |
createTransaction | public Transaction createTransaction()(Code) | | Creates a transaction on this cloud. The returned
Transaction will have a generic ID.
a Transaction on this cloud |
createTransaction | public Transaction createTransaction(String name) throws AlreadyExistsException(Code) | | Creates a transaction on this cloud with a specified name.
Parameters: name - an unique name to use for the transaction a Transaction on this cloud throws: AlreadyExistsException - if a transaction with the specified name allready exists |
createTransaction | public Transaction createTransaction(String name, boolean overwrite) throws AlreadyExistsException(Code) | | Creates a transaction on this cloud with a specified name.
Parameters: name - an unique name to use for the transaction Parameters: overwrite - if true , cancels and replacesany existing transaction of this name for the current user a Transaction on this cloud throws: AlreadyExistsException - if a transaction with the specified name allreadyexists and overwrite is false |
getCloudContext | public CloudContext getCloudContext()(Code) | | Returns the context to which this cloud belongs.
a CloudContext to which this cloud belongs |
getDescription | public String getDescription()(Code) | | This may return
Cloud.getName , but in principable it could have been localized using the
value also returned by
Cloud.getLocale .
the description of this cloud |
getList | public NodeList getList(String startNodes, String nodePath, String fields, String constraints, String orderby, String directions, String searchDir, boolean distinct)(Code) | | Returns a list of virtual nodes that are composed by fields of other
nodes.
Starting at one or more specified nodes traversals are made according to
a specified path. One traversal makes up one virtual node. All possible
traversals that can be made starting at one or more nodes of the same
type and following a specified path are stored in the returned list.
Suppose we have defined the following:
- A node manager recordcompany containing a field name.
- A node manager artist containing a field name.
- A node manager url containing a field description and url.
- A relation type related between recordcompany and artist.
- A relation type related between artist and url.
- A relation type homepagerel between artist and url.
If node 100 has a node manager called recordcompany we can do
the following to get a list of the record company's artists and all urls
belonging
to these artist (including nodes found through the related relation and
the homepagerel relation):
getList("100", "recordcompany,artist,url",
"artist.name,description,url", null, null, null, null, true);
This call returns a list of virtual nodes with the fields artist.name,
description and url for every valid traversal.
If we only want to list homepage urls of the artists we do:
getList("100", "recordcompany,artist,url",
"artist.name,description,homepagerel,url", null, null, null,
null, true);
If we want to list all url's except the the homepage urls we do:
getList("100", "recordcompany,artist,url",
"artist.name,description,related,url", null, null, null, null, true);
If node 200 also has a node manager with name recordcompany we can get
the info from their artist together with the info of the artist from the
first company by also putting number 200 in the first parameter:
getList("100,200", "recordcompany,artist,url",
"artist.name,description,related,url", null, null, null, null, true);
For more information about the constraints parameter consult
NodeManager.getList(String constraintsString orderbyString directions) .
Parameters: startNodes - A comma separated list of node numbers that shouldbe used as a starting point for all traversalsor null if all nodes of the first nodemanager in nodePath should be used. Parameters: nodePath - A comma separated list of node manager nameswhich specifies the path that should be followed.It is possible to explicitly specify a relationmanager that should be used to go from one node toan other. If no relation manager is specifiedbetween two nodes, all possible relation managersthat can be used to go to the next specified node inthe path are followed. Parameters: fields - A comma separated list of field names that will makeup the returned virtualnodes. A fieldname can be prefixed with theoriginal node manager name of the field and a dotin cases where more than one node manager in thepath has a field with the same name. Parameters: constraints - Constraints to prevent nodes from beingincluded in the resulting list which would normallyby included or null if no constraintsshould be applied. Parameters: orderby - A comma separated list of field names on which thereturned list should be sorted or null if the order of the returned virtual nodes doesn'tmatter. Parameters: directions - A comma separated list of values indicating wetherto sort up (ascending) or down (descending) on thecorresponding field in the orderby parameter or null if sorting on allfields should be up.The value DOWN (case insensitive) indicatesthat sorting on the corresponding field should bedown, all other values (including theempty value) indicate that sorting on thecorresponding field should be up.If the number of values found in this parameter areless than the number of fields in theorderby parameter, all fields thatdon't have a corresponding direction value aresorted according to the last specified directionvalue. Parameters: searchDir - Determines how directionality affects the search.This is a string with the following possible values:
"both" , which is the default, searches for allvalid relations through a path, checking full directionalityof relations where appropriate."destination" searches for only those relationsin a path where valid relations exist from source to destination,in the order of the nodemanagers given in the nodePath."source" searches for only those relationsin a path where valid relations exist from destination to source,in the order of the nodemanagers given in the nodePath."all" searches all existing relations, and doesnot check on directionality.A value of null or any other values than thoselisted above are ignored. In that case, search istreated as if the default ("both" ) was specified. Parameters: distinct - true if nodes who allready exist inthe list should not be added to the list.false if all nodes should be added tothe list even if a node with exactly the same fieldvalues is allready present. a list of virtual nodes |
getLocale | public Locale getLocale()(Code) | | Gets the locale assocatied with this Cloud instance.
Locale of this Cloud instance since: MMBase-1.6 |
getName | public String getName()(Code) | | Returns the name of this cloud. The name of the cloud is the string "mmbase" unless this
Cloud is a
Transaction .
the name of this cloud |
getNode | public Node getNode(int number) throws NotFoundException(Code) | | Returns the node with the specified number from this cloud. The returned
node is a new instance of Node with a reference to this
instance of Cloud .
Parameters: number - the number of the requested node the requested node throws: NotFoundException - if the specified node could not be found |
getNode | public Node getNode(String number) throws NotFoundException(Code) | | Returns the node with the specified number from this cloud.
If the string passed is not a number, the string is assumed to be an alias.
The returned node is a new instance of Node with a reference to this
instance of Cloud .
Parameters: number - a string containing the number or alias of the requested node the requested node throws: NotFoundException - if the specified node could not be found |
getNodeByAlias | public Node getNodeByAlias(String alias) throws NotFoundException(Code) | | Returns the node with the specified alias from this cloud. The returned
node is a new instance of Node with a reference to this
instance of Cloud .
Parameters: alias - the alias of the requested node the requested node throws: NotFoundException - if the specified node could not be found |
getNodeManager | public NodeManager getNodeManager(String name) throws NotFoundException(Code) | | Returns the specified node manager.
Parameters: name - the name of the requested node manager the requested node manager throws: NotFoundException - if the specified node manager could not be found |
getNodeManager | public NodeManager getNodeManager(int nodeManagerId) throws NotFoundException(Code) | | Returns the specified node manager.
Parameters: nodeManagerId - Unique ID of the NodeManager to retrieve the requested node manager throws: NotFoundException - if the specified node manager could not be found since: MMBase-1.6 |
getNodeManagers | public NodeManagerList getNodeManagers()(Code) | | Returns all node managers available in this cloud.
a NodeManagerList containing all node managersavailable in this cloud. |
getNonTransactionalCloud | public Cloud getNonTransactionalCloud()(Code) | | |
getPossibleContexts | public StringList getPossibleContexts()(Code) | | Contacts the security implementation to find out to which possible contexts are
available to the current user.
A StringList containing the contexts which can be used by teh suer throws: SecurityException - When appropriate rights to perform this are lacking (read rights) |
getProperties | public Map<Object, Object> getProperties()(Code) | | Retrieves all properties previously set for this cloud.
all properties since: MMBase-1.8 |
getProperty | public Object getProperty(Object key)(Code) | | Retrieves a property previously set for this cloud. If this Cloud has a 'parent' cloud
(ie. this Cloud is a
Transaction ), then this will also mirror properties in this
parent cloud.
See Also: Cloud.setProperty(Object,Object) Parameters: key - the key of the property the property value since: MMBase-1.8 |
getRelation | public Relation getRelation(int number) throws NotFoundException(Code) | | Returns the relation with the specified number from this cloud. The returned
node is a new instance of Relation with a reference to this
instance of Cloud .
Parameters: number - the number of the requested node the requested node throws: NotFoundException - if the specified node could not be found throws: ClassCastException - if the specified node is not a relation since: MMBase-1.6 |
getRelation | public Relation getRelation(String number) throws NotFoundException(Code) | | Returns the relation with the specified number from this cloud.
If the string passed is not a number, the string is assumed to be an alias.
The returned node is a new instance of Relation with a reference to this
instance of Cloud .
Parameters: number - a string containing the number or alias of the requested node the requested node throws: NotFoundException - if the specified node could not be found throws: ClassCastException - if the specified node is not a relation since: MMBase-1.6 |
getRelationManager | public RelationManager getRelationManager(int relationManagerId) throws NotFoundException(Code) | | Returns the specified relation manager.
Parameters: relationManagerId - Unique ID of the RelationManager to retrieve the requested relation manager throws: NotFoundException - if the specified relation manager could not be found since: MMBase-1.6 |
getRelationManager | public RelationManager getRelationManager(String sourceManagerName, String destinationManagerName, String roleName) throws NotFoundException(Code) | | Returns the specified relation manager.
Parameters: sourceManagerName - name of the node manager of the source node Parameters: destinationManagerName - name of the node manager of the destination node Parameters: roleName - name of the role the requested relation manager throws: NotFoundException - if the specified relation manager could not be found |
getRelationManager | public RelationManager getRelationManager(NodeManager sourceManager, NodeManager destinationManager, String roleName) throws NotFoundException(Code) | | Returns the specified relation manager.
Parameters: sourceManager - the node manager of the source node Parameters: destinationManager - the node manager of the destination node Parameters: roleName - name of the role the requested relation manager throws: NotFoundException - if the specified relation manager could not be found since: MMBase-1.7 |
getRelationManagers | public RelationManagerList getRelationManagers()(Code) | | Returns all relation managers available in this cloud.
a RelationManagerList containing all relationmanagers available in this cloud |
getRelationManagers | public RelationManagerList getRelationManagers(String sourceManagerName, String destinationManagerName, String roleName) throws NotFoundException(Code) | | Returns all relation managers available in this cloud that follow the specified filter.
Parameters: sourceManagerName - the name of the manager for the source of the relation Parameters: destinationManagerName - the name of the manager for the destination of the relation Parameters: roleName - the rolename a RelationManagerList containing all relationmanagers that follow this filter throws: NotFoundException - if one of the specified relation managers or the rolename could not be found |
getRelationManagers | public RelationManagerList getRelationManagers(NodeManager sourceManager, NodeManager destinationManager, String roleName) throws NotFoundException(Code) | | Returns all relation managers available in this cloud that follow the specified filter.
Parameters: sourceManager - the manager for the source of the relation Parameters: destinationManager - the manager for the destination of the relation Parameters: roleName - the rolename a RelationManagerList containing all relationmanagers that follwo thsi filter throws: NotFoundException - if one of the specified relation managers or the rolename could not be found |
getTransaction | public Transaction getTransaction(String name)(Code) | | Returnes the transaction with the specified name.
If no active transaction exists, a new transaction is created.
Parameters: name - the name of the requested transaction the requested transaction |
getUser | public UserContext getUser()(Code) | | Who is using this cloud.
the User object describing who is using this cloud now. |
hasNode | public boolean hasNode(int number)(Code) | | Determines whether a node with the specified number exists in this cloud.
Note that this method does not determien whether you may actually access (read) this node,
use
Cloud.mayRead(int) to determine this.
Parameters: number - the number of the node true if the node exists since: MMBase-1.6 |
hasNode | public boolean hasNode(String number)(Code) | | Determines whether a node with the specified number is available from this cloud.
If the string passed is not a number, the string is assumed to be an alias.
Note that this method does not determien whether you may actually access (read) this node,
use
Cloud.mayRead(int) to determine this.
Parameters: number - a string containing the number or alias of the requested node true if the node exists since: MMBase-1.6 |
hasNodeManager | public boolean hasNodeManager(String name)(Code) | | Returns whether the specified node manager exists.
Parameters: name - the name of the requested node manager true if the specified node manager exists |
hasRelation | public boolean hasRelation(int number)(Code) | | Determines whether a relation with the specified number exists in this cloud.
The node returns true if a Node exists and is a relation.
Note that this method does not determien whether you may actually access (read) this node,
use
Cloud.mayRead(int) to determine this.
Parameters: number - the number of the node true if the relation exists since: MMBase-1.6 |
hasRelation | public boolean hasRelation(String number)(Code) | | Determines whether a relation with the specified number is available from this cloud.
If the string passed is not a number, the string is assumed to be an alias.
The node returns true if a Node exists and is a relation.
Note that this method does not determien whether you may actually access (read) this node,
use
Cloud.mayRead(int) to determine this.
Parameters: number - a string containing the number or alias of the requested node true if the relation exists since: MMBase-1.6 |
hasRelationManager | public boolean hasRelationManager(String sourceManagerName, String destinationManagerName, String roleName)(Code) | | Returns whether the specified relation manager exists.
Parameters: sourceManagerName - name of the node manager of the source node Parameters: destinationManagerName - name of the node manager of the destination node Parameters: roleName - name of the role true if the specified relation manager could be found |
hasRelationManager | public boolean hasRelationManager(NodeManager sourceManager, NodeManager destinationManager, String roleName)(Code) | | Returns whether the specified relation manager exists.
Parameters: sourceManager - name of the node manager of the source node Parameters: destinationManager - name of the node manager of the destination node Parameters: roleName - name of the role true if the specified relation manager could be found since: MMBase-1.7 |
hasRelationManager | public boolean hasRelationManager(String roleName)(Code) | | Returns whether the specified relation manager exists.
Parameters: roleName - name of the role true if the specified relation manager exists |
hasRole | public boolean hasRole(String roleName)(Code) | | Returns whether the specified role exists.
Parameters: roleName - name of the role true if the specified role could be found since: MMBase-1.7 |
mayRead | public boolean mayRead(int number)(Code) | | Determines whether a node with the specified number is accessible for the user - that is,
the user has sufficient rights to read the node.
The node must exist - the method throws an exception if it doesn't.
Parameters: number - the number of the requested node true if the node is accessible throws: NotFoundException - if the specified node could not be found since: MMBase-1.6 |
mayRead | public boolean mayRead(String number)(Code) | | Determines whether a node with the specified number is accessible for the user - that is,
the user has sufficient rights to read the node.
If the string passed is not a number, the string is assumed to be an alias.
The node must exist - the method throws an exception if it doesn't.
Parameters: number - a string containing the number or alias of the requested node true if the node is accessible throws: NotFoundException - if the specified node could not be found since: MMBase-1.6 |
setLocale | public void setLocale(Locale locale)(Code) | | Sets a locale for this Cloud instance.
Parameters: locale - To which locale it must be set. It can be null, in which case it will be reset to a default. since: MMBase-1.6 |
setProperty | public void setProperty(Object key, Object value)(Code) | | Sets a property for this cloud object.
This can be used as a kind of 'environment' variables.
Parameters: key - the key of the property Parameters: value - the property value since: MMBase-1.8 |
|
|