- com
- pcbsys
- nirvana
- nAdminAPI
- nClusterNode
Contains the status and configuration of a Nirvana cluster. More...
#include <nClusterNode.h>
Public Member Functions | |
void | addConnectionListener (nClusterConnectionListener *pListener) |
Adds a nClusterConnectionListener to the cluster to receive callbacks as connections are made or lost to any realms within the cluster. More... | |
void | addConnectionListenerToAllLeafNodes (nAPIConnectionListener *pListener) |
Adds a nConnectionListener to each nLeaNode of each nRealmNode in the cluster. More... | |
void | addListener (nClusterEventListener *pListener) |
Adds a nClusterEventListener to the cluster to receive callbacks as the state of the cluster changes. More... | |
void | addMember (nClusterMemberConfiguration *pNode) |
Adds a new node to an existing cluster. More... | |
bool | canBeMaster (nRealmNode *pNode) |
Tests to see if the supplied node can be master of the cluster. More... | |
void | close () |
Closes connections to all realms for the specified Nirvana Realm server. | |
virtual void | closed (nRealmNode *pNode) |
Called when a realm node is closed, for internal use only. More... | |
void | delConnectionListener (nClusterConnectionListener *pListener) |
Removes a nClusterConnectionListener from the cluster. More... | |
void | deleteMember (nRealmNode *pNode, bool deleteStore=false) |
Removes the specified realm from the cluster. More... | |
void | deleteSite (nClusterSite *pSite) |
Method that allows you to delete a site. More... | |
void | delListener (nClusterEventListener *pListener) |
Deregisters a nClusterEventListener from the cluster for callbacks. More... | |
void | deregisterRemoteCluster (nClusterNode *remoteCluster) |
Removes the remote node given by the parameter remoteCluster from this cluster node. More... | |
void | destroy (bool deleteStore=false) |
Deletes the cluster and removes all known realms from the cluster. More... | |
std::list< nClusterStatus * > & | getClusterConnectionStatus () |
Returns a list of nClusterStatus which contains the current cluster status. More... | |
nRealmNode * | getMaster () |
Returns the current master of the cluster. More... | |
nRealmNode * | getMaster (long timeout) |
Returns the current master of the cluster. More... | |
int | getNoOfSites () |
Returns the number of defined nClusterSite objects. More... | |
nClusterSite * | getSite (const std::string &site) |
Returns an iterator of nClusterSite objects. More... | |
fSortedList< std::string, nClusterSite * > & | getSites () |
Returns a list of nClusterSite objects. More... | |
virtual int | getType () |
Returns the type of node that this object represents. More... | |
bool | hasMember (nRealmNode *pNode) |
Tests to see if the supplied node is part of the cluster. More... | |
bool | hasMember (const std::string &realm) |
Tests to see if the supplied realm name is part of the cluster. More... | |
bool | hasquorum () |
Tests to see if the cluster has quorum and is functioning. More... | |
bool | hasSites () |
Returns true if the cluster uses sites. | |
void | joinRemoteClusterStore (nLeafNode *source, nLeafNode *destination, bool isRouted, int hopCount, std::string selector, bool allowPurge) |
Joins the stores between two different clusters together. More... | |
void | modifyMember (nClusterMemberConfiguration *pConfig) |
Modifies the specified realm in the cluster as far as the CanBeMaster flag. More... | |
nClusterNode (void) | |
Constructs a new nClusterNode. | |
void | registerRemoteCluster (nClusterNode *remoteCluster) |
Adds the realm nodes in the remoteCluster node to this clusterNode, creating a logical connection between them. More... | |
Public Member Functions inherited from com::pcbsys::nirvana::nAdminAPI::nContainer | |
void | addACLEntries (nACL *pAcl, nNode **ppNodes=NULL, int numNode=0) |
Adds an acl to the list of nodes. More... | |
virtual void | addACLEntry (nACLEntry *pEntry, bool bAllChannels=true, bool bAllQueues=true) |
Adds a specific acl entry to all known nodes within the nContainer node. More... | |
virtual nNode * | findNode (std::string name) |
Given a name of the form /container/container/name this function will locate the name object and return it, or null if that object can not be found. More... | |
virtual nNode * | findNode (nNode *pNode) |
Given a name of the form /container/container/name this function will locate the nNode object and return it, or null if that can not be found. More... | |
virtual nNode * | findNode (nNode *pNode, bool searchChildren) |
Given a name of the form /container/container/name this function will locate the name object and return it, or null if that can not be found. More... | |
virtual nNode * | getNextSibling (int idx=0) |
In findnode we were calling getNextSibling and occassionally hitting an nDataStreamNode. More... | |
virtual fSortedList < std::string, nNode * > & | getNodes () |
Returns an fSortedList of all the nodes under this container. More... | |
virtual nRealmNode * | getRealmAt (std::string name) |
Given a mount point this function will return a realm if one exists at the specified mount point. More... | |
virtual int | getTotalNodes () |
Returns the total number of nodes within this container and all subsequent children by traversing the entire structure beneath this container node. More... | |
virtual bool | hasRealmAt (std::string name) |
Given a mount point this function will determine if this container contains a mounted realm at the specified mount point. More... | |
void | modACLEntries (nACL *pAcl, nNode **ppNodes=NULL, int numNode=0) |
Modifies an existing acl for the list of nodes. More... | |
virtual void | modACLEntry (nACLEntry *pEntry, bool bAllChannels=true, bool bAllQueues=true) |
modifies a specific acl entry's permissions for all known nodes within the nContainer node. More... | |
void | removeACLEntries (nACL *pAcl, nNode **ppNodes=NULL, int numNode=0) |
Removes the contents of an acl list from the list of nodes. More... | |
virtual void | removeACLEntry (nACLEntry *pEntry, bool bAllChannels=true, bool bAllQueues=true) |
removes a specific acl entry from all known nodes within the nContainer node. More... | |
virtual void | setACL (nACL *pAcl, bool allChannels=true, bool allQueues=true, bool allServices=true) |
Changes the entire ACL entries for the selected nodes with the new ACL passed in. More... | |
Public Member Functions inherited from com::pcbsys::nirvana::nAdminAPI::nNode | |
virtual BitArray * | convertLong (longlong priv) |
Converts from a long to a bitArray used to specify ACL properties. More... | |
virtual nACLEntry * | createACLEntry (const std::string &subject, BitArray *pBs) |
Adds a specific acl entry to the leaf node acl. More... | |
virtual nACLEntry * | createACLEntry (nSecurityGroup *grp, BitArray *pBs) |
Adds a specific security group to the leaf node acl. More... | |
virtual bool | Equals (nNode *pItem) |
Check if this nNode is the same as the nNode passed in. More... | |
virtual bool | Equals (const std::string &item) |
Check if the string passed in matches the name of this nNode. More... | |
virtual const std::string & | getAbsolutePath () |
This function walks the tree to the root to generate a fully qualified name for this node. More... | |
const std::string & | getInternalName () |
Returns the name of this nNode. More... | |
const std::string & | getName () |
Returns the name of the node. More... | |
virtual nNode * | getParent () |
Returns this nodes parent node. More... | |
virtual std::string | getRelativePath (nNode *pTop) |
This method returns the relative path from this node to the nNode passed. More... | |
virtual bool | IsRemovable () |
Returns true if this nNode can be removed. More... | |
Static Public Member Functions | |
static nClusterNode * | find (const std::string &clusterName) |
Returns the nClusterNode for the specified clusterName. More... | |
static nClusterNode * | getInstance (nSessionAttributes *pAttr) |
Creates an instance of a nClusterNode for any cluster found on the realm specified by the nSessionAttributes. More... | |
static nClusterNode * | getInstance (nSessionAttributes *pAttr, const std::string &username) |
Creates an instance of a nClusterNode for any cluster found on the realm specified by the nSessionAttributes and the username. More... | |
static nClusterNode * | getInstance (std::string &rname) |
Creates an instance of a nClusterNode for any cluster found on the realm specified by the rname. More... | |
static std::list< nClusterNode * > * | getKnownClusters () |
Return a list of nCluster nodes. More... | |
Contains the status and configuration of a Nirvana cluster.
Each Nirvana cluster is made up of multiple Nirvana Realm servers and this group is given a name, the Cluster Name. The class supplies helper functions to query, create and delete clusters.
void com::pcbsys::nirvana::nAdminAPI::nClusterNode::addConnectionListener | ( | nClusterConnectionListener * | pListener | ) |
Adds a nClusterConnectionListener to the cluster to receive callbacks as connections are made or lost to any realms within the cluster.
pListener | to register for callbacks. |
void com::pcbsys::nirvana::nAdminAPI::nClusterNode::addConnectionListenerToAllLeafNodes | ( | nAPIConnectionListener * | pListener | ) |
Adds a nConnectionListener to each nLeaNode of each nRealmNode in the cluster.
pListener | to register for callbacks. |
void com::pcbsys::nirvana::nAdminAPI::nClusterNode::addListener | ( | nClusterEventListener * | pListener | ) |
Adds a nClusterEventListener to the cluster to receive callbacks as the state of the cluster changes.
pListener | to register for callbacks. |
void com::pcbsys::nirvana::nAdminAPI::nClusterNode::addMember | ( | nClusterMemberConfiguration * | pNode | ) |
Adds a new node to an existing cluster.
pNode | details about the new node to add. |
nSessionNotConnectedException | if unable to connect to the new node. |
nRequestTimedOutException | if the node fails to respond within the timout period. |
nSecurityException | if the client has no administration priviliges on the node. |
nBaseClientException | if any unexpected exceptions are raised. |
bool com::pcbsys::nirvana::nAdminAPI::nClusterNode::canBeMaster | ( | nRealmNode * | pNode | ) |
Tests to see if the supplied node can be master of the cluster.
pNode | to test. |
nSecurityException | if the client is not authorized. |
nBaseClientException | if the node is not connected. |
|
virtual |
Called when a realm node is closed, for internal use only.
*pNode | the node which has been closed |
Reimplemented from com::pcbsys::nirvana::nAdminAPI::nContainer.
void com::pcbsys::nirvana::nAdminAPI::nClusterNode::delConnectionListener | ( | nClusterConnectionListener * | pListener | ) |
Removes a nClusterConnectionListener from the cluster.
pListener | to register for callbacks. |
void com::pcbsys::nirvana::nAdminAPI::nClusterNode::deleteMember | ( | nRealmNode * | pNode, |
bool | deleteStore = false |
||
) |
Removes the specified realm from the cluster.
The cluster must be running and all members of the cluster online for this to work correctly.
pNode | to remove from the cluster. |
deleteStore | flag to indicate that the call should also delete ALL cluster stores |
nBaseClientException | if any nodes fail during the process. |
nSessionNotConnectedException | if any of the nodes are not connected. |
nSecurityException | if the client is not authorised. |
void com::pcbsys::nirvana::nAdminAPI::nClusterNode::deleteSite | ( | nClusterSite * | pSite | ) |
Method that allows you to delete a site.
pSite | the cluster site to delete |
Exception | if the site was not able to be created |
void com::pcbsys::nirvana::nAdminAPI::nClusterNode::delListener | ( | nClusterEventListener * | pListener | ) |
Deregisters a nClusterEventListener from the cluster for callbacks.
pListener | to be removed. |
void com::pcbsys::nirvana::nAdminAPI::nClusterNode::deregisterRemoteCluster | ( | nClusterNode * | remoteCluster | ) |
Removes the remote node given by the parameter remoteCluster from this cluster node.
If the remoteCluster is null, or remoteCluster is the same as this cluster node, this method will throw an Exception.
remoteCluster | The remoteCluster to remove from this cluster nodes realm list. |
Exception | If remoteCluster is null, or is the same as this cluster node. |
void com::pcbsys::nirvana::nAdminAPI::nClusterNode::destroy | ( | bool | deleteStore = false | ) |
Deletes the cluster and removes all known realms from the cluster.
deleteStore | flag to indicate that the call should also delete ALL cluster stores |
nBaseClientException | if any nodes fail during the process. |
nSessionNotConnectedException | if any of the nodes are not connected. |
nSecurityException | if the client is not authorised. |
|
static |
Returns the nClusterNode for the specified clusterName.
clusterName | name of the cluster to lookup as a string. |
std::list<nClusterStatus*>& com::pcbsys::nirvana::nAdminAPI::nClusterNode::getClusterConnectionStatus | ( | ) |
Returns a list of nClusterStatus which contains the current cluster status.
|
static |
Creates an instance of a nClusterNode for any cluster found on the realm specified by the nSessionAttributes.
pAttr | Session attributes to connect to the remote Nirvana Realm |
nBaseAdminException | if unable to connect to the remote realm |
|
static |
Creates an instance of a nClusterNode for any cluster found on the realm specified by the nSessionAttributes and the username.
pAttr | Session attributes to connect to the remote Nirvana Realm |
username | to use to authenticate |
nBaseAdminException | if unable to connect to the remote realm |
|
static |
Creates an instance of a nClusterNode for any cluster found on the realm specified by the rname.
rname | Nirvana Realm server URL |
nBaseAdminException | if the user has no administration priviliges |
nIllegalArgumentException | if the rname is not valid |
|
static |
Return a list of nCluster nodes.
nRealmNode* com::pcbsys::nirvana::nAdminAPI::nClusterNode::getMaster | ( | ) |
Returns the current master of the cluster.
timeout | the amount of time in milliseconds to wait for the connection to the master |
nRealmNode* com::pcbsys::nirvana::nAdminAPI::nClusterNode::getMaster | ( | long | timeout | ) |
Returns the current master of the cluster.
timeout | the amount of time in milliseconds to wait for the connection to the master |
int com::pcbsys::nirvana::nAdminAPI::nClusterNode::getNoOfSites | ( | ) |
Returns the number of defined nClusterSite objects.
nClusterSite* com::pcbsys::nirvana::nAdminAPI::nClusterNode::getSite | ( | const std::string & | site | ) |
Returns an iterator of nClusterSite objects.
site | site name. |
fSortedList<std::string, nClusterSite*>& com::pcbsys::nirvana::nAdminAPI::nClusterNode::getSites | ( | ) |
|
virtual |
Returns the type of node that this object represents.
Reimplemented from com::pcbsys::nirvana::nAdminAPI::nContainer.
bool com::pcbsys::nirvana::nAdminAPI::nClusterNode::hasMember | ( | nRealmNode * | pNode | ) |
Tests to see if the supplied node is part of the cluster.
pNode | to test. |
nSecurityException | if the client is not authorized. |
nBaseClientException | if the node is not connected. |
bool com::pcbsys::nirvana::nAdminAPI::nClusterNode::hasMember | ( | const std::string & | realm | ) |
Tests to see if the supplied realm name is part of the cluster.
realm | name to test. |
nBaseClientException | if the node is not connected. |
bool com::pcbsys::nirvana::nAdminAPI::nClusterNode::hasquorum | ( | ) |
Tests to see if the cluster has quorum and is functioning.
Quorin is defined as the cluster having the ( number of realms ) / 2 +1 being online.
void com::pcbsys::nirvana::nAdminAPI::nClusterNode::joinRemoteClusterStore | ( | nLeafNode * | source, |
nLeafNode * | destination, | ||
bool | isRouted, | ||
int | hopCount, | ||
std::string | selector, | ||
bool | allowPurge | ||
) |
Joins the stores between two different clusters together.
Additional parameters specify whether events will be routed, the maximum number of hop counts for events to pass through this join, a selector, and whether or not to allow purging.
source | The source leaf node for this join |
destination | The destination leaf node for this join |
isRouted | boolean which determines if events will be routed |
hopCount | integer specifying the maximum hop count that events may have to pass through this join |
selector | a selector which filters events over this join |
allowPurge | boolean to allow purging of events over this join |
Exception | If source or destination are null, an exception will be thrown. If source or destination are not cluster wide channels/queues, an exception will be thrown. If source and destination reside on the same cluster, an exception will be thrown. |
void com::pcbsys::nirvana::nAdminAPI::nClusterNode::modifyMember | ( | nClusterMemberConfiguration * | pConfig | ) |
Modifies the specified realm in the cluster as far as the CanBeMaster flag.
The cluster must be running and all members of the cluster online for this to work correctly.
pConfig | The ClusterMemberConfiguration object refering to the node and configuration |
nBaseClientException | if any nodes fail during the process. |
nSessionNotConnectedException | if any of the nodes are not connected. |
nSecurityException | if the client is not authorised. |
void com::pcbsys::nirvana::nAdminAPI::nClusterNode::registerRemoteCluster | ( | nClusterNode * | remoteCluster | ) |
Adds the realm nodes in the remoteCluster node to this clusterNode, creating a logical connection between them.
remoteCluster | nClusterNode containing the remote cluster node to add to this cluster node |
Exception | If the remoteCluster is null, or if this cluster is the same as remoteCluster. |