code reorg
[csql.git] / include / UserManager.h
blob30ee5919e20b739bf96dace1b794bd6d77d8d9f0
1 /***************************************************************************
2 * Copyright (C) 2007 by www.databasecache.com *
3 * Contact: praba_tuty@databasecache.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 ***************************************************************************/
16 #ifndef USER_MANAGER_H
17 #define USER_MANAGER_H
18 #include<Util.h>
19 /**
20 * @class UserManager
22 * @brief Interface for user management operations.
23 * This manages all the users in the system. Only default dba user <br/>
24 * can create and delete users in the system.<br/>
25 * If user wants to change his password, he should first get the connection and then call<br/>
26 * appropriate method in this object to change his password.<br/>
27 * <br/>
28 * Functionality: <br/>
29 * 1.Add and Delete Users<br/>
30 * 2.Change Password<br/>
31 * <br/>
35 class DllExport UserManager
37 public:
38 /** creates new User in the system.<br/>
39 * Only default dba user is allowed to call this method.
40 * @param name username to be created
41 * @param passwd password for the schema created
42 * @return int return code
44 virtual int createUser(const char *name, const char *passwd)=0;
46 /** deleted user from the system <br/>
47 * Only default dba user is allowed to call this method.
48 * @param name username to be deleted
49 * @return int return code
51 virtual int deleteUser(const char *name)=0;
53 /** changes password for self. Logged in user password is set to <br/>
54 * specified password.
55 * @param newPasswd new password to be set.
56 * @return int return code
58 virtual int changePassword(const char* newPasswd)=0;
60 /** changes the password for specified user.
61 * Only default dba user is allowed to call this method.
62 * @param username username for authentication
63 * @param password password for authentication
64 * @return int return code
66 virtual int changePassword(const char *userName, const char* newPasswd)=0;
68 virtual List getAllUserNames(int *rv=0)=0;
69 virtual ~UserManager(){};
71 #endif