MyCQ.UserManager Interface Reference
Manages users of a MyCQ Server.
More...
List of all members.
Public Member Functions |
void | createUser (string username, string password, UserType userType) |
| Create a new user.
|
void | deleteUser (string username) |
| Delete a user.
|
void | changePassword (string username, string password) |
| Change the password of a user.
|
void | changeUserType (string username, UserType userType) |
| Change the type of a user.
|
List< UserInfo > | getAllUserInfo () |
| Get the user information list of a MyCQ Server.
|
Detailed Description
Manages users of a MyCQ Server.
using System;
using System.Collections.Generic;
using MyCQ;
namespace MyCQClientNETExample
{
class ExamUserManager
{
public void sample()
{
MyCQClient client = MyCQFactory.getMyCQClient();
try
{
client.connect("localhost", 3030, "root", "1234");
UserManager userManager = client.getUserManager();
userManager.createUser("user1", "password1", UserType.SUPER_USER);
userManager.changeUserType("user1", UserType.NORMAL_USER);
userManager.changePassword("user1", "password2");
List<UserInfo> result = userManager.getAllUserInfo();
foreach(UserInfo userInfo in result)
{
Console.WriteLine(userInfo.username);
if(userInfo.type == UserType.SUPER_USER)
{
Console.WriteLine("super user");
}
else
{
Console.WriteLine("normal user");
}
}
userManager.deleteUser("user1");
}
catch(MyCQException ex)
{
Console.WriteLine("code:" + ex.getCode() + ", message:" + ex.getMessage());
}
client.close();
}
}
}
Member Function Documentation
void MyCQ.UserManager.changePassword |
( |
string |
username, |
|
|
string |
password | |
|
) |
| | |
Change the password of a user.
- Parameters:
-
| username | A user name of a MyCQ Server to change the password. |
| password | A password of a user to change. (size:= under 64). |
- Exceptions:
-
| MyCQException | An error occurred while changing the password of a user. |
void MyCQ.UserManager.changeUserType |
( |
string |
username, |
|
|
UserType |
userType | |
|
) |
| | |
Change the type of a user.
- Parameters:
-
| username | A user name of a MyCQ Server to change the user type. |
| userType | A user type of a user to change. |
- Exceptions:
-
| MyCQException | An error occurred while changing the user type of a user. |
void MyCQ.UserManager.createUser |
( |
string |
username, |
|
|
string |
password, |
|
|
UserType |
userType | |
|
) |
| | |
Create a new user.
- Parameters:
-
| username | A user name of a MyCQ Server to create. (size:= under 64). A user name is a combination of alphabets and numerics which starts with alphabet character. |
| password | A password of a user to create. (size:= under 64). |
| userType | A user type of a user to create. |
- Exceptions:
-
void MyCQ.UserManager.deleteUser |
( |
string |
username |
) |
|
Delete a user.
- Parameters:
-
| username | A user name of a MyCQ Server to delete. |
- Exceptions:
-
List<UserInfo> MyCQ.UserManager.getAllUserInfo |
( |
|
) |
|
Get the user information list of a MyCQ Server.
- Returns:
- User information list.
- Exceptions:
-
| MyCQException | An error occurred while getting the user information list. |
The documentation for this interface was generated from the following file: