| java.lang.Object org.mmbase.bridge.implementation.BasicCloud
All known Subclasses: org.mmbase.bridge.implementation.BasicTransaction,
BasicCloud | public class BasicCloud implements Cloud,Cloneable,Comparable<Cloud>,SizeMeasurable,Serializable(Code) | | Basic implementation of Cloud. It wraps a.o. the core's ClusterBuilder and Typedef functionalities.
author: Rob Vermeulen author: Pierre van Rooden author: Michiel Meeuwissen version: $Id: BasicCloud.java,v 1.181 2008/02/27 11:47:54 michiel Exp $ |
Inner Class :class BasicCloudStarter implements Runnable | |
Method Summary | |
protected void | _readObject(ObjectInputStream in) | protected void | _writeObject(ObjectOutputStream out) | void | add(String currentObjectContext) Ignored by basic cloud. | int | add(BasicNode node) Ignored by basic cloud. | boolean | check(Operation operation, int nodeID) Checks access rights. | boolean | check(Operation operation, int nodeID, int srcNodeID, int dstNodeID) Checks access rights. | protected void | checkAlias(String aliasName) | void | checkNodes(BasicNodeList resultNodeList, Query query) | public int | compareTo(Cloud o) Compares this cloud to the passed object. | boolean | contains(MMObjectNode node) Checks wether the current transaction contains the given node. | public Query | createAggregatedQuery() | void | createAlias(BasicNode node, String aliasName) | public NodeList | createNodeList() | public NodeManagerList | createNodeManagerList() | public NodeQuery | createNodeQuery() | public Query | createQuery() | public RelationList | createRelationList() | public RelationManagerList | createRelationManagerList() | public Transaction | createTransaction() | public Transaction | createTransaction(String name) | public Transaction | createTransaction(String name, boolean overwrite) | public boolean | equals(Object o) Compares this cloud to the passed object, and returns true if they are equal. | String | getAccount() | BasicNodeManager | getBasicNodeManager(MMObjectBuilder bul) | BasicNodeManager | getBasicNodeManager(String nodeManagerName) | public int | getByteSize() | public int | getByteSize(SizeOf sizeof) | public CloudContext | getCloudContext() | protected List<MMObjectNode> | getClusterNodes(Query query) Result with all Cluster - MMObjectNodes, with cache. | public String | getDescription() | public Function | getFunction(String setName, String functionName) | public Collection<Function<?>> | getFunctions(String setName) | protected NodeList | getLastStepList(Query query) Based on multi-level query. | public NodeList | getList(Query query) | public NodeList | getList(String startNodes, String nodePath, String fields, String constraints, String orderby, String directions, String searchDir, boolean distinct) | public Locale | getLocale() | public String | getName() | public Node | getNode(String nodeNumber) | final public Node | getNode(int nodeNumber) | final public Node | getNodeByAlias(String aliasname) | final public NodeManager | getNodeManager(String nodeManagerName) | public NodeManager | getNodeManager(int nodeManagerId) | public NodeManagerList | getNodeManagers() | public StringList | getPossibleContexts() | public Map<Object, Object> | getProperties() | public Object | getProperty(Object key) | final public Relation | getRelation(int nodeNumber) | final public Relation | getRelation(String nodeNumber) | RelationManager | getRelationManager(int sourceManagerId, int destinationManagerId, int roleId) Retrieves a RelationManager. | public RelationManager | getRelationManager(int number) | public RelationManager | getRelationManager(String sourceManagerName, String destinationManagerName, String roleName) | public RelationManager | getRelationManager(NodeManager source, NodeManager destination, String roleName) | public RelationManager | getRelationManager(String roleName) | public RelationManagerList | getRelationManagers() | public RelationManagerList | getRelationManagers(String sourceManagerName, String destinationManagerName, String roleName) | public RelationManagerList | getRelationManagers(NodeManager sourceManager, NodeManager destinationManager, String roleName) | protected NodeList | getResultNodeList(Query query) Aggregating query result. | protected NodeList | getSecureList(Query query) | public Transaction | getTransaction(String name) | public UserContext | getUser() | public boolean | hasNode(int nodeNumber) | public boolean | hasNode(String nodeNumber) | public boolean | hasNodeManager(String nodeManagerName) | public boolean | hasRelation(int nodeNumber) | public boolean | hasRelation(String nodeNumber) | public boolean | hasRelationManager(String sourceManagerName, String destinationManagerName, String roleName) | public boolean | hasRelationManager(NodeManager source, NodeManager destination, String roleName) | public boolean | hasRelationManager(String roleName) | public boolean | hasRole(String roleName) | static boolean | isTemporaryId(int id) Test if a node id is a temporay id. | BasicNode | makeNode(MMObjectNode node, String nodeNumber) | public boolean | may(org.mmbase.security.Action action, org.mmbase.util.functions.Parameters parameters) | public boolean | mayRead(int nodeNumber) | public boolean | mayRead(String nodeNumber) | void | remove(String currentObjectContext) Ignored by basic cloud. | void | remove(MMObjectNode node) | public void | setLocale(Locale l) | public void | setProperty(Object key, Object value) | boolean | setSecurityConstraint(Query query) | public String | toString() | static synchronized int | uniqueId() Create unique temporary node number. | void | verify(Operation operation, int nodeID) Asserts access rights. | void | verify(Operation operation, int nodeID, int srcNodeID, int dstNodeID) Asserts access rights. |
count | final protected long count(Code) | | |
BasicCloud | BasicCloud(String cloudName, BasicCloud cloud)(Code) | | basic constructor for descendant clouds (i.e. Transaction)
Parameters: cloudName - name of cloud Parameters: cloud - parent cloud |
BasicCloud | BasicCloud(String name, String authenticationType, Map loginInfo, CloudContext cloudContext)(Code) | | Parameters: name - name of cloud Parameters: authenticationType - authentication type Parameters: loginInfo - Map with login credentials Parameters: cloudContext - cloudContext of cloud throws: NotFoundException - If MMBase not yet started, or shutting down. throws: BridgeException - No security could be obtained. throws: SecurityException - Could not perform login |
BasicCloud | BasicCloud(String name, UserContext user, BasicCloudContext cloudContext)(Code) | | Parameters: name - name of cloud Parameters: authenticationType - authentication type Parameters: loginInfo - Map with login credentials Parameters: cloudContext - cloudContext of cloud throws: NotFoundException - If MMBase not yet started, or shutting down. throws: BridgeException - No security could be obtained. throws: SecurityException - Could not perform login |
check | boolean check(Operation operation, int nodeID)(Code) | | Checks access rights.
Parameters: operation - the operation to check (READ, WRITE, CREATE, OWN) Parameters: nodeID - the node on which to check the operation true if access is granted, false otherwise |
check | boolean check(Operation operation, int nodeID, int srcNodeID, int dstNodeID)(Code) | | Checks access rights.
Parameters: operation - the operation to check (CREATE, CHANGE_RELATION) Parameters: nodeID - the node on which to check the operation Parameters: srcNodeID - the source node for this relation Parameters: dstNodeID - the destination node for this relation true if access is granted, false otherwise |
checkAlias | protected void checkAlias(String aliasName)(Code) | | Throws exception if node alias already exists
since: MMBase-1.8.4 |
compareTo | public int compareTo(Cloud o)(Code) | | Compares this cloud to the passed object.
Returns 0 if they are equal, -1 if the object passed is a Cloud and larger than this cloud,
and +1 if the object passed is a Cloud and smaller than this cloud.
Parameters: o - the object to compare it with compare number |
contains | boolean contains(MMObjectNode node)(Code) | | Checks wether the current transaction contains the given node.
|
createAggregatedQuery | public Query createAggregatedQuery()(Code) | | |
equals | public boolean equals(Object o)(Code) | | Compares this cloud to the passed object, and returns true if they are equal.
Parameters: o - the object to compare it with is equal |
getAccount | String getAccount()(Code) | | Retrieves the current user accountname (unique)
the account name |
getByteSize | public int getByteSize()(Code) | | |
getClusterNodes | protected List<MMObjectNode> getClusterNodes(Query query)(Code) | | Result with all Cluster - MMObjectNodes, with cache. Security is not considered here (the
query is executed thoughtlessly). The security check is done in getSecureNodes, which calls
this one.
Parameters: query - query to execute list of cluster nodes since: MMBase-1.7 |
getLastStepList | protected NodeList getLastStepList(Query query)(Code) | | Based on multi-level query. Returns however 'normal' nodes based on the last step. This is a
protected function, which is used in the implemetnedion of getRelatedNodes, getRelations of
NodeManager
Before it executes the query, the fields of the query are checked. All and only fields of the
'last' NodeManager and the relation should be queried. If fields are present already, but
not like this, an exception is thrown. If not fields are present, the rights fields are added
first (if the query is still unused, otherwise trhows Exception).
Parameters: query - query to execute list of normal nodes throws: BridgeException - If wrong fields in query or could not be added. since: MMBase-1.7 |
getNodeManager | public NodeManager getNodeManager(int nodeManagerId) throws NotFoundException(Code) | | Retrieves a node manager
Parameters: nodeManagerId - ID of the NodeManager to retrieve the requested NodeManager if the manager exists, null otherwise throws: NotFoundException - node manager not found |
getRelationManager | RelationManager getRelationManager(int sourceManagerId, int destinationManagerId, int roleId)(Code) | | Retrieves a RelationManager.
Note that you can retrieve a manager with source and destination reversed.
Parameters: sourceManagerId - number of the NodeManager of the source node Parameters: destinationManagerId - number of the NodeManager of the destination node Parameters: roleId - number of the role the requested RelationManager |
getResultNodeList | protected NodeList getResultNodeList(Query query)(Code) | | Aggregating query result.
Parameters: query - query to execute list of nodes since: MMBase-1.7 |
getSecureList | protected NodeList getSecureList(Query query)(Code) | | Result with Cluster Nodes (checked security)
Parameters: query - query to execute lisr of cluster nodes since: MMBase-1.7 |
hasNode | public boolean hasNode(int nodeNumber)(Code) | | |
hasNodeManager | public boolean hasNodeManager(String nodeManagerName)(Code) | | |
hasRelation | public boolean hasRelation(int nodeNumber)(Code) | | |
hasRelation | public boolean hasRelation(String nodeNumber)(Code) | | |
hasRelationManager | public boolean hasRelationManager(String sourceManagerName, String destinationManagerName, String roleName)(Code) | | |
hasRelationManager | public boolean hasRelationManager(String roleName)(Code) | | |
isTemporaryId | static boolean isTemporaryId(int id)(Code) | | Test if a node id is a temporay id.
Parameters: id - the id (node numebr) to test true if the id is a temporary id since: MMBase-1.5 |
mayRead | public boolean mayRead(int nodeNumber)(Code) | | |
setSecurityConstraint | boolean setSecurityConstraint(Query query)(Code) | | Parameters: query - add security constaint to this query is query secure since: MMBase-1.7 |
uniqueId | static synchronized int uniqueId()(Code) | | Create unique temporary node number.
The Id starts at - 2 and is decremented each time a new id is asked
until Integer.MINVALUE is reached (after which counting starts again at -2).
the temporary id as an integer |
verify | void verify(Operation operation, int nodeID)(Code) | | Asserts access rights. throws an exception if an operation is not allowed.
Parameters: operation - the operation to check (READ, WRITE, CREATE, OWN) Parameters: nodeID - the node on which to check the operation |
verify | void verify(Operation operation, int nodeID, int srcNodeID, int dstNodeID)(Code) | | Asserts access rights. throws an exception if an operation is not allowed.
Parameters: operation - the operation to check (CREATE, CHANGE_RELATION) Parameters: nodeID - the node on which to check the operation Parameters: srcNodeID - the source node for this relation Parameters: dstNodeID - the destination node for this relation |
|
|