Index

DKPrivilegeGroupICM

Purpose:

A privilege group is a logical grouping of privileges. Privilege groups can be used to combine privileges before being added as a whole into a privilege set. The DKPrivilegeGroupICM class represents privilege groups in Content Manager.

See Also: DKPrivilegetICM, DKPrivilegeSetICM

Since: Version 8

Class summary:

class DKEXPORT DKPrivilegeGroupICM : public dkPrivilegeGroup
 {
 public:
   DKPrivilegeGroupICM();
   DKPrivilegeGroupICM(dkDatastore* ds);
   virtual ~DKPrivilegeGroupICM();
   virtual void addPrivilege(dkPrivilege* privObj);
   virtual void clearCache ();
   long getID();
   DKBoolean isRetrieved();
   virtual DKString* listPrivilegeNames(long& arraySize);
   virtual dkCollection* listPrivileges();
   void removePrivilege(long privId);
   virtual void removePrivilege(const char* privName);
   void setID(long id);
   void setRetrieved(DKBoolean isRetrieved);
 
 };

Members:

Constructors and destructor
DKPrivilegeGroupICM()

Default constructor. Constructs and initializes a privilege group instance that is not currently associated with any datastore instance.

DKPrivilegeGroupICM(dkDatastore* ds)

Constructor that takes a datastore instance as a parameter. The created privilege group instance is associated with the datastore instance. Equivalent to calling the default constructor followed by the setDatastore method on the created privilege group instance.Parameters:ds - datastore reference. Should be an instance of DKDatastoreICM

virtual ~DKPrivilegeGroupICM()

Destructor for this object.

Member functions

addPrivilege
Adds a new privilege to the in-memory (cached) representation of the privilege group instance. No datastore call is initiated as a result of calling this method.

Parameters:privObj - a valid DKPriviligeICM instance

Throws:DKAlreadyExitsException - if the privObj already exists in this DKPrivilegeGroupICM object. DKException - when error occurs

virtual void addPrivilege(dkPrivilege* privObj);

clearCache
Clears the privilege group cache by removing all contained privileges from the in-memory (cached) representation of this privilege set . No datastore call is initiated as a result of calling this method.
virtual void clearCache ();

getID
Retrieves the identifier associated with this privilege group object.

Returns:identifier for this privilege group object

long getID();

isRetrieved
Checks to see if the privileges comprising this privilege group have been retrieved from the persistent store.

Returns:true if the privileges have already retrieved, false otherwise

DKBoolean isRetrieved(); 

listPrivilegeNames
Retrieves the names of all the privileges associated with this privilege group from the persistent store when caching is turned off or if caching is on but the privilege names have not yet been retrieved into the in-memory cache. If caching is turned on and the privilege names have already been retrieved into the in-memory cache, then return the privilege names from the in-memory cache.

Parameters:arraySize - array size of names of the privileges associated with this privilege group

Returns:an array of names for all the privileges associated with this privilege group

Throws:DKException - when error occurs in the server

virtual DKString* listPrivilegeNames(long& arraySize);

listPrivileges
Retrieves the list of privileges that comprise this privilege group from the persistent store when caching is turned off or if caching is on but the privileges have not yet been retrieved into the in-memory cache. If caching is turned on and the privileges have already been retrieved into the in-memory cache, then return the privileges from the in-memory cache.

Returns:Each item in the returned collection is an instance of type DKPrivilegeICM

Throws:DKException - when error occurs in the server

virtual dkCollection* listPrivileges();

removePrivilege
Removes the privilege object corresponding to the privilege name specified in the input parameter, from the in-memory representation of this privilege group instance. No datastore call is initiated as a result of calling this method.

Parameters:privName - name of the privilege to be removed

Returns:Each item in the returned collection is an instance of type DKPrivilegeICM

Throws:DKNotExistException - if the privilege name does not exist in this privilege groupDKException - when error occurs in the server

virtual void removePrivilege(const char* privName);

removePrivilege
Removes the privilege object instance corresponding to the privilege identifier specified in the input parameter, from the in-memory representation of this privilege group instance. No datastore call is initiated as a result of calling this method.

Parameters:priv_id - identifier of the privilege to be removed

Returns:Each item in the returned collection is an instance of type DKPrivilegeICM

Throws:DKNotExistException - if the privilege does not exist in this privilege group. DKException - when error occurs in the serverDKException - when error occurs in the server

virtual void removePrivilege(long priv_id);

setID
Sets the privilege group ID.

Parameters:id - new ID to be associated with this privilege group instance.

void setID(long id);

setRetrieved
Sets the value that determines whether the privilege group was retrieved from the persistent store or not.

Parameters:isRetrieved - if true, indicates that this privilege group has already been retrieved; if false, indicates that the privilege group has not yet been retrieved.

void setRetrieved(DKBoolean isRetrieved);

(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.