com::pcbsys::nirvana::nAdminAPI::nACL Class Reference

represents a list of nACLEntry classes used by the Nirvana Realm server to control access to secured objects such as Realms, Channels and Queues. More...

#include <nACL.h>

Inherits Observable.

Public Member Functions

virtual void add (nACLEntry *pEntry)
 Adds a new nACLEntry into the list. More...
 
virtual bool contains (const std::string &subject)
 Returns whether an nACLEntry exists the nACL which matches this subject. More...
 
virtual nACLEntryfind (nACLEntry *pEntry)
 Finds an nACLEntry which matches the passed in nACLEntry. More...
 
virtual nACLEntryfind (const std::string &subject)
 Finds an nACLEntry within the list which matches this subject. More...
 
virtual nACLEntryget (int index)
 Returns the nACLEntry specified by the index parameter is useful to examine/walk the list. More...
 
virtual fSortedList
< std::string, nACLEntry * > & 
getEntries ()
 Returns an Enumeration of nACLEntry objects which make up the list. More...
 
virtual void remove (nACLEntry *pEntry)
 Removes the nACLEntry which matches the subject specified the nACLEntry object. More...
 
virtual void remove (const std::string &subject)
 Removes the nACLEntry which matches the subject specified by the string passed in. More...
 
virtual void removeAll ()
 Removes ALL of the nACLEntry objects from the list. More...
 
virtual void replace (nACLEntry *pEntry)
 Replaces the existing nACLEntry privileges with the passed nACLEntry. More...
 
virtual int size ()
 Returns the number of entries within the list. More...
 

Protected Member Functions

 nACL (void)
 Default constructor for nACL. More...
 
 nACL (fSortedList< std::string, nACLEntry * > &acl)
 Constructs a new nACL. More...
 

Detailed Description

represents a list of nACLEntry classes used by the Nirvana Realm server to control access to secured objects such as Realms, Channels and Queues.

See Also
nACLEntry

Constructor & Destructor Documentation

com::pcbsys::nirvana::nAdminAPI::nACL::nACL ( void  )
protected

Default constructor for nACL.

The user should not typically need to call this since all the original lists are supplied by the realm itself.

com::pcbsys::nirvana::nAdminAPI::nACL::nACL ( fSortedList< std::string, nACLEntry * > &  acl)
protected

Constructs a new nACL.

Parameters
aclThe list of nACLEntry to be held by this nACL

Member Function Documentation

virtual void com::pcbsys::nirvana::nAdminAPI::nACL::add ( nACLEntry pEntry)
virtual

Adds a new nACLEntry into the list.

Parameters
*pEntryThe new nACLEntry to add to the list
virtual bool com::pcbsys::nirvana::nAdminAPI::nACL::contains ( const std::string &  subject)
virtual

Returns whether an nACLEntry exists the nACL which matches this subject.

Parameters
subjectString representation of the subject (user@host)
Returns
whether a matching acl entry exists
virtual nACLEntry* com::pcbsys::nirvana::nAdminAPI::nACL::find ( nACLEntry pEntry)
virtual

Finds an nACLEntry which matches the passed in nACLEntry.

The comparison is done on the subject only and not the permissions since the subject must be unique in the list. If it could not find a match it will throw nACLEntryNotFoundException

Parameters
pEntryAn nACLEntry* to locate within the list
Returns
the nACLEntry* which matches
virtual nACLEntry* com::pcbsys::nirvana::nAdminAPI::nACL::find ( const std::string &  subject)
virtual

Finds an nACLEntry within the list which matches this subject.

If it could not find a match it will throw nACLEntryNotFoundException

Parameters
subjectString representation of the subject (user@host)
Returns
the nACLEntry which matched
virtual nACLEntry* com::pcbsys::nirvana::nAdminAPI::nACL::get ( int  index)
virtual

Returns the nACLEntry specified by the index parameter is useful to examine/walk the list.

Parameters
indexthe index position of the nACLEntry to be retrieved
Returns
the nACLEntry* at the specified index
virtual fSortedList<std::string, nACLEntry*>& com::pcbsys::nirvana::nAdminAPI::nACL::getEntries ( )
virtual

Returns an Enumeration of nACLEntry objects which make up the list.

This is useful to examine/walk the list.

Returns
<std::string, nACLEntry*>& of nACLEntry
virtual void com::pcbsys::nirvana::nAdminAPI::nACL::remove ( nACLEntry pEntry)
virtual

Removes the nACLEntry which matches the subject specified the nACLEntry object.

Parameters
entryThe nACLEntry to be removed from the list
virtual void com::pcbsys::nirvana::nAdminAPI::nACL::remove ( const std::string &  subject)
virtual

Removes the nACLEntry which matches the subject specified by the string passed in.

Currently no wild card removals are supported so only a direct match will result in the removal of the nACLEntry

Parameters
subjectString representation of the subject (user@host)
Exceptions
nACLEntryNotFoundExceptionthrown if acl entry is not found
nAdminIllegalArgumentExceptionthrown if acl entry is null
virtual void com::pcbsys::nirvana::nAdminAPI::nACL::removeAll ( )
virtual

Removes ALL of the nACLEntry objects from the list.

WARNING: if you commit an empty nACL you will effectively block ALL access to the secure object. There is no way to override this so be careful when calling this function that you do actually add nACLEntry objects to this to at least allow the administrator back in

virtual void com::pcbsys::nirvana::nAdminAPI::nACL::replace ( nACLEntry pEntry)
virtual

Replaces the existing nACLEntry privileges with the passed nACLEntry.

Useful for changing permissions for a subject within a list

Parameters
*pEntryThe nACLEntry containing the updated privileges
virtual int com::pcbsys::nirvana::nAdminAPI::nACL::size ( )
virtual

Returns the number of entries within the list.

Returns
int size of this list