com::pcbsys::nirvana::nAdminAPI::nContainer Class Reference

This represents a node within the Nirvana Realm namespace which contains other nodes, such as a directory or another Realm. More...

#include <nContainer.h>

Inheritance diagram for com::pcbsys::nirvana::nAdminAPI::nContainer:
com::pcbsys::nirvana::nAdminAPI::nNode com::pcbsys::nirvana::nAdminAPI::nClusterNode com::pcbsys::nirvana::nAdminAPI::nDataGroupNode com::pcbsys::nirvana::nAdminAPI::nDataGroupsContainer com::pcbsys::nirvana::nAdminAPI::nLinkNode com::pcbsys::nirvana::nAdminAPI::nRealmNode

Public Member Functions

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, bool bAllServices=true)
 Adds a specific acl entry to all known nodes within the nContainer node. More...
 
virtual void closed (nRealmNode *pNode)
 Called when a realm node is closed, for internal use only. More...
 
virtual nNodefindNode (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 nNodefindNode (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 nNodefindNode (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 nNodegetNextSibling (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 nRealmNodegetRealmAt (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 int getType ()
 Returns the type of this object, for internal use only. 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, bool bAllServices=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, bool bAllServices=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 nACLEntrycreateACLEntry (const std::string &subject, BitArray *pBs)
 Adds a specific acl entry to the leaf node acl. More...
 
virtual nACLEntrycreateACLEntry (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 nNodegetParent ()
 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...
 

Detailed Description

This represents a node within the Nirvana Realm namespace which contains other nodes, such as a directory or another Realm.

nContainer performs no functions other than containing the other nodes and being a placeholder in the namespace.

Member Function Documentation

void com::pcbsys::nirvana::nAdminAPI::nContainer::addACLEntries ( nACL pAcl,
nNode **  ppNodes = NULL,
int  numNode = 0 
)

Adds an acl to the list of nodes.

Parameters
*pAclAn nACL to apply to the list of nodes
ppNodesthe list of nodes to apply the acl to
numNodethe size of the node array
Exceptions
nInsufficientPrivilegesExceptionIf the user is not permitted to perform this operation
nNodeExceptionif the ACLs being set are invalid
nBaseAdminExceptionif unable to perform the operation, check the message for further information
virtual void com::pcbsys::nirvana::nAdminAPI::nContainer::addACLEntry ( nACLEntry pEntry,
bool  bAllChannels = true,
bool  bAllQueues = true,
bool  bAllServices = true 
)
virtual

Adds a specific acl entry to all known nodes within the nContainer node.

Parameters
*pEntryAn nACL entry containing the subject and permissions to apply to all nodes under the container
bAllChannelsif set then all channels within the container will have the acl applied
bAllQueuesif set then all queues within the container will have the acl applied
bAllServicesif set then all services within the container will have the acl applied
Exceptions
nInsufficientPrivilegesExceptionIf the user is not permitted to perform this operation
nNodeExceptionif the ACLs being set are invalid
nBaseAdminExceptionif unable to perform the operation, check the message for further information
virtual void com::pcbsys::nirvana::nAdminAPI::nContainer::closed ( nRealmNode pNode)
virtual

Called when a realm node is closed, for internal use only.

Parameters
*pNodethe node which has been closed

Reimplemented in com::pcbsys::nirvana::nAdminAPI::nLinkNode, and com::pcbsys::nirvana::nAdminAPI::nClusterNode.

virtual nNode* com::pcbsys::nirvana::nAdminAPI::nContainer::findNode ( std::string  name)
virtual

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.

Parameters
namethe name of the node to locate as a String
Returns
a nNode which could be a nRealmNode, nLeafNode or a nContainer
Exceptions
nAdminIllegalArgumentExceptionthrown if null is passed as the nNode
See Also
nRealmNode
nLeafNode
nContainer

Reimplemented in com::pcbsys::nirvana::nAdminAPI::nDataGroupsContainer.

virtual nNode* com::pcbsys::nirvana::nAdminAPI::nContainer::findNode ( nNode pNode)
virtual

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.

This function applies to the part of the namespace relative to the current node. Currently wildcards are NOT supported.

Parameters
pNodethe nNode to be located
Returns
a nNode which could be a nRealmNode, nLeafNode or a nContainer
Exceptions
nAdminIllegalArgumentExceptionthrown if null is passed as the nNode
See Also
nRealmNode
nLeafNode
nContainer

Reimplemented in com::pcbsys::nirvana::nAdminAPI::nRealmNode.

virtual nNode* com::pcbsys::nirvana::nAdminAPI::nContainer::findNode ( nNode pNode,
bool  searchChildren 
)
virtual

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.

The searchChildren flag specifies whether the search should be performed on the current container only or children containers too respectively. This function applies to the part of the namespace relative to the current node. Currently wildcards are NOT supported.

Parameters
pNodethe nNode to be located
searchChildrenspecifies whether to traverse lower levels of the tree or not
Returns
a nNode which could be a nRealmNode, nLeafNode or a nContainer
Exceptions
nAdminIllegalArgumentExceptionthrown if null is passed as the nNode
See Also
nRealmNode
nLeafNode
nContainer

Reimplemented in com::pcbsys::nirvana::nAdminAPI::nRealmNode.

virtual nNode* com::pcbsys::nirvana::nAdminAPI::nContainer::getNextSibling ( int  idx = 0)
virtual

In findnode we were calling getNextSibling and occassionally hitting an nDataStreamNode.

We needed to then step over this node and get the next sibling. This method allows you to specify an offset i.e 1 means get sibling after next

Parameters
idxoffset
Returns
the sibling node for the given index
virtual fSortedList<std::string, nNode*>& com::pcbsys::nirvana::nAdminAPI::nContainer::getNodes ( )
virtual

Returns an fSortedList of all the nodes under this container.

These could be other nContainer nodes, nLeafNode or nRealmNode objects.

Returns
An fSortedList of node name, nNode objects pairs under this container
See Also
nRealmNode
nLeafNode
nContainer
virtual nRealmNode* com::pcbsys::nirvana::nAdminAPI::nContainer::getRealmAt ( std::string  name)
virtual

Given a mount point this function will return a realm if one exists at the specified mount point.

Parameters
namethe mount point as a string as a String
Returns
nRealmNode if container contains realm at that mount point, else null
Exceptions
nAdminIllegalArgumentExceptionthrown if null is passed as the nNode
virtual int com::pcbsys::nirvana::nAdminAPI::nContainer::getTotalNodes ( )
virtual

Returns the total number of nodes within this container and all subsequent children by traversing the entire structure beneath this container node.

Returns
the total number of nodes counted beneath this container and it's children
virtual int com::pcbsys::nirvana::nAdminAPI::nContainer::getType ( )
virtual
virtual bool com::pcbsys::nirvana::nAdminAPI::nContainer::hasRealmAt ( std::string  name)
virtual

Given a mount point this function will determine if this container contains a mounted realm at the specified mount point.

Parameters
namethe mount point as a string as a String
Returns
true if container contains realm at that mount point
Exceptions
nAdminIllegalArgumentExceptionthrown if null is passed as the nNode
void com::pcbsys::nirvana::nAdminAPI::nContainer::modACLEntries ( nACL pAcl,
nNode **  ppNodes = NULL,
int  numNode = 0 
)

Modifies an existing acl for the list of nodes.

Parameters
*pAclAn nACL to apply to the list of nodes
ppNodesthe list of nodes to apply the acl to
numNodethe size of the node array
Exceptions
nInsufficientPrivilegesExceptionIf the user is not permitted to perform this operation
nNodeExceptionif the ACLs being set are invalid
nBaseAdminExceptionif unable to perform the operation, check the message for further information
virtual void com::pcbsys::nirvana::nAdminAPI::nContainer::modACLEntry ( nACLEntry pEntry,
bool  bAllChannels = true,
bool  bAllQueues = true,
bool  bAllServices = true 
)
virtual

modifies a specific acl entry's permissions for all known nodes within the nContainer node.

Parameters
*pEntryAn nACL entry containing the subject and permissions to apply to all nodes under the container
bAllChannelsif set then all channels within the container will have the acl modified
bAllQueuesif set then all queues within the container will have the acl modified
bAllServicesif set then all services within the container will have the acl modified
Exceptions
nInsufficientPrivilegesExceptionIf the user is not permitted to perform this operation
nNodeExceptionif the ACLs being set are invalid
nBaseAdminExceptionif unable to perform the operation, check the message for further information
void com::pcbsys::nirvana::nAdminAPI::nContainer::removeACLEntries ( nACL pAcl,
nNode **  ppNodes = NULL,
int  numNode = 0 
)

Removes the contents of an acl list from the list of nodes.

Parameters
*pAclAn nACL of entries to be applied to the list of nodes
ppNodesthe list of nodes to apply the acl to
numNodethe size of the node array
Exceptions
nInsufficientPrivilegesExceptionIf the user is not permitted to perform this operation
nNodeExceptionif the ACLs being set are invalid
nBaseAdminExceptionif unable to perform the operation, check the message for further information
virtual void com::pcbsys::nirvana::nAdminAPI::nContainer::removeACLEntry ( nACLEntry pEntry,
bool  bAllChannels = true,
bool  bAllQueues = true,
bool  bAllServices = true 
)
virtual

removes a specific acl entry from all known nodes within the nContainer node.

Parameters
*pEntryAn nACL entry containing the subject and permissions to apply to all nodes under the container
bAllChannelsif set then all channels within the container will have the acl removed
bAllQueuesif set then all queues within the container will have the acl removed
bAllServicesif set then all services within the container will have the acl removed
Exceptions
nInsufficientPrivilegesExceptionIf the user is not permitted to perform this operation
nNodeExceptionif the ACLs being set are invalid
nBaseAdminExceptionif unable to perform the operation, check the message for further information
virtual void com::pcbsys::nirvana::nAdminAPI::nContainer::setACL ( nACL pAcl,
bool  allChannels = true,
bool  allQueues = true,
bool  allServices = true 
)
virtual

Changes the entire ACL entries for the selected nodes with the new ACL passed in.

Parameters
pAclAn nACL containing the nAclEntry objects that will be applied to all nodes under the container
allChannelsif set then all channels within the container will have the acl added
allQueuesif set then all queues within the container will have the acl added
allServicesif set then all services within the container will have the acl added
Exceptions
nInsufficientPrivilegesExceptionIf the user is not permissioned to perform this operation
nNodeExceptionif the ACLs being set are invalid
nBaseAdminExceptionif unable to perform the operation, check the message for further information