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:
virtual dkDatastore* getDatastore();
virtual void setDatastore(dkDatastore* ds);
virtual dkUserDef* retrieveUserDef(const char* userName);
virtual void add(dkUserDef* userDefObj);
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);
virtual dkUserDef* createUserDef();
virtual void update(dkUserDef* userDefObj);
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);
Parameters
userId -- The user ID.
Exceptions
DKException -- An error occurs in the datastore.
virtual void delUser(const char* userId);
virtual void del(dkUserDef* userDefObj);
virtual void deleteUserDef(const char* userId);
virtual DKBoolean isAdminUser(const char* userId);
Exceptions
DKException -- An error occurs in the datastore.
virtual DKString* listUsers(long& arraySize);
Exceptions
DKException -- An error occurs in the datastore.
virtual DKString* listUserGroups(long& arraySize);
virtual dkCollection* listUserDefs();
virtual dkCollection* listUserGroupDefs();
virtual dkUserGroupDef* createUserGroupDef();
virtual dkUserGroupDef* createUserGroupDef();
virtual void add(dkUserGroupDef* userGrpDef);
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);
virtual void update(dkUserGroupDef* userGrpDef);
virtual void del(dkUserGroupDef* userGrpDef);
Parameters
groupName -- The group name.
Exceptions
DKException -- An error occurs in the datastore.
virtual void delUserGroup(const char* userGrp);
virtual void deleteUserGroupDef(const char* userGrp);
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);
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);
virtual void clearCache();
(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.