Index

dkUserManagement

Purpose:

dkUserManagement provides a generic interface to manage user and group of users for the datastore, which includes functions such as managing user-ids, passwords, and groups, and so forth. It must be subclassed for each datastore implementation, for example:

Class summary:

 class dkUserManagement
 {
   public:
      virtual ~dkUserManagement();
      virtual dkDatastore* getDatastore();
      virtual void setDatastore(dkDatastore* ds);
      virtual dkUserDef* retrieveUserDef(const char* userName);
      virtual void add(dkUserDef* userDefObj);
      // deprecated replaced by add(dkUserDef)
      virtual void addUser(const char* userId, const char* password);
      virtual void addUser(const char* userId, const char* password, dkProfile* profile);
      virtual dkUserDef* createUserDef();
      virtual void update(dkUserDef* userDefObj);
      virtual void changePassword(const char* userId, const char* oldPwd, const char* newPwd);
      virtual void delUser(const char* userId);
      virtual void del(dkUserDef* userDefObj);
      virtual void deleteUserDef(const char* userId);
      virtual DKBoolean isAdminUser(const char* userId);
      virtual DKString* listUsers(long& arraySize);
      virtual DKString* listUserGroups(long& arraySize);
      virtual dkCollection* listUserDefs();
      virtual dkCollection* listUserGroupDefs();
      virtual dkUserGroupDef* createUserGroupDef();
      virtual dkUserGroupDef* retrieveUserGroupDef(const char* userGroupName);
      virtual void add(dkUserGroupDef* userGrpDef);
      // deprecated replaced by add(dkUserGroupDef) 
      virtual void addUserGroup(const char* groupName);
      // deprecated replaced by add(dkUserGroupDef) 
      virtual void addUserGroup(const char* groupName, dkProfile* groupProfile);
      virtual void update(dkUserGroupDef* userGrpDef);
      virtual void del(dkUserGroupDef* userGrpDef);
      // deprecated replaced by deleteUserGroupDef(const char*) 
      virtual void delUserGroup(const char* userGrp);
      virtual void deleteUserGroupDef(const char* userGrp);
      // deprecated replaced by update(dkUserGroupDef) 
      virtual void addToGroup(const char* group, const char* userid);
      // deprecated replaced by update(dkUserGroupDef) 
      virtual void removeFromGroup(const char* group, const char* userid);
      virtual void clearCache();
 };

Members:

Member functions

setDatastore
Sets the reference to the owner datastore object.
virtual dkDatastore* getDatastore();

getDatastore
Gets the reference to the owner datastore object and returns it.
virtual void setDatastore(dkDatastore* ds);

retrieveUserDef
Gets a user.
virtual dkUserDef* retrieveUserDef(const char* userName);

add
Adds a user.
virtual void add(dkUserDef* userDefObj);

Note:
DKUsageError exception thrown if method is not implemented.

addUser
The first form creates a new user ID (with default information). The second form creates a new user ID according to a given profile. The profile is a datastore specific information about the user. Parameters.

Parameters
userId -- The preferred user ID.
password -- The preferred password.
profile -- The datastore specific profile object.

Exceptions
DKException -- An error occurs in the datastore.

 virtual void addUser(const char* userId, const char* password);
virtual void addUser(const char* userId, const char* password, dkProfile* profile);

Note:
DKUsageError exception thrown if method is not implemented.

createUserDef
Create user definition.
virtual dkUserDef* createUserDef();

Note:
DKUsageError exception thrown if method is not implemented.

update
Update user definition.
virtual void update(dkUserDef* userDefObj);

Note:
DKUsageError exception thrown if method is not implemented.

changePassword
Changes the password of a given user ID.

Parameters
userId -- The user ID.
oldPwd -- The old password.
newPwd -- The new password.

Exceptions
DKException -- An error occurs in the datastore.

virtual void changePassword(const char* userId, const char* oldPwd, const char* newPwd);

delUser
Deletes a user ID from the system.

Parameters
userId -- The user ID.

Exceptions
DKException -- An error occurs in the datastore.

virtual void delUser(const char* userId);

Note:
DKUsageError exception thrown if method is not implemented.

del
Delete user definition.
virtual void del(dkUserDef* userDefObj);

Note:
DKUsageError exception thrown if method is not implemented.

deleteUserDef
Delete user definition.
virtual void deleteUserDef(const char* userId);

Note:
DKUsageError exception thrown if method is not implemented.

isAdminUser
Is the specified user an administrative user.
virtual DKBoolean isAdminUser(const char* userId);

Note:
DKUsageError exception thrown if method is not implemented.

listUsers
Lists users defined in the system.

Exceptions
DKException -- An error occurs in the datastore.

virtual DKString* listUsers(long& arraySize);

Note:
DKUsageError exception thrown if method is not implemented.

listUserGroups
Lists user groups defined in the system.

Exceptions
DKException -- An error occurs in the datastore.

virtual DKString* listUserGroups(long& arraySize);

Note:
DKUsageError exception thrown if method is not implemented.

listUserDefs
Lists users defined in the system.
virtual dkCollection* listUserDefs();

Note:
DKUsageError exception thrown if method is not implemented.

listUserGroupDefs
Lists user groups defined in the system.
virtual dkCollection* listUserGroupDefs();

Note:
DKUsageError exception thrown if method is not implemented.

createUserGroupDef
Create user group def.
virtual dkUserGroupDef* createUserGroupDef();

Note:
DKUsageError exception thrown if method is not implemented.

retrieveUserGroupDef
Gets a user group.
virtual dkUserGroupDef* createUserGroupDef();

Note:
DKUsageError exception thrown if method is not implemented.

add
Adds a new user-group.
virtual void add(dkUserGroupDef* userGrpDef);

Note:
DKUsageError exception thrown if method is not implemented.

addUserGroup
The first form creates a new user group (with default information). The second form creates a new user-group according to a given profile. The profile is a datastore specific information about the user-group. It may include a privilege set or other relevant information.

Parameters
groupName -- The preferred group name.


groupProf -- The group profile.

Exceptions
DKException -- An error occurs in the datastore.

virtual void addUserGroup(const char* groupName);
virtual void addUserGroup(const char* groupName,
dkProfile* groupProfile);

Note:
DKUsageError exception thrown if method is not implemented.

update
Update a user-group.
virtual void update(dkUserGroupDef* userGrpDef);

Note:
DKUsageError exception thrown if method is not implemented.

del
Deletes a user-group.
virtual void del(dkUserGroupDef* userGrpDef);

Note:
DKUsageError exception thrown if method is not implemented.

delUserGroup
Deletes a user-group from the system.

Parameters
groupName -- The group name.

Exceptions
DKException -- An error occurs in the datastore.

virtual void delUserGroup(const char* userGrp);

Note:
DKUsageError exception thrown if method is not implemented.

deleteUserGroupDef
Deletes a user-group.
virtual void deleteUserGroupDef(const char* userGrp);

Note:
DKUsageError exception thrown if method is not implemented.

addToGroup
Adds a user to a user group.

Parameters
groupName -- The group name.


userId -- The user ID.

Exceptions
DKException -- An error occurs in the datastore.

virtual void deleteUserGroupDef(const char* userGrp);
virtual void addToGroup(const char* groupName, const char* userId);

Note:
DKUsageError exception thrown if method is not implemented.

removeFromGroup
Removes a user from a user group.

Parameters
groupName -- The group name.


userId -- The user ID.

Exceptions
DKException -- An error occurs in the datastore.

virtual void removeFromGroup(const char* groupName, const char* userId);

Note:
DKUsageError exception thrown if method is not implemented.

clearCache
Clear the cache.
virtual void clearCache();

Note:
DKUsageError exception thrown if method is not implemented.

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