com.tszadel.qctools4j.clients
Class UserClient

java.lang.Object
  extended by com.tszadel.qctools4j.clients.AbstractClient
      extended by com.tszadel.qctools4j.clients.UserClient

public class UserClient
extends AbstractClient

The client manages the users, groups and permissions.

Author:
tszadel

Field Summary
static int WITH_GROUPS
          Groups have to be added.
 
Fields inherited from class com.tszadel.qctools4j.clients.AbstractClient
connection, NONE, WITH_ATTACHMENTS, WITH_CHILDREN
 
Method Summary
 Map<String,FieldDescription> getFieldDescriptions()
          Overrides getFieldDescriptions.
 List<Group> getGroupsOfUser(String pUsername)
          Returns the groups of the user.
 User getUser(String pUsername)
          Returns a user.
 List<String> getUsernames()
          Returns the available user names .
 List<User> getUsers(int pFlag)
          Returns the available users .
 List<String> getUsersOfProject()
          Returns the list of users of the current project.
 boolean isExistingUser(String pUsername)
          Check if the given user name exists in QC.
 
Methods inherited from class com.tszadel.qctools4j.clients.AbstractClient
canExecuteAction, checkConnection, checkLogin, checkPermission, containsFlag, getEncodedString, loadFields, retrieveAttachments, retrieveCustomFields, storeAttachments, storeFields, toAttachment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WITH_GROUPS

public static final int WITH_GROUPS
Groups have to be added.

See Also:
Constant Field Values
Method Detail

getFieldDescriptions

public Map<String,FieldDescription> getFieldDescriptions()
                                                  throws QcException
Overrides getFieldDescriptions. Returns the descriptions of the fields.

Specified by:
getFieldDescriptions in class AbstractClient
Returns:
The description of the fields (key=name of the field, value=description of the field).
Throws:
QcException - Qc Error.
See Also:
AbstractClient.getFieldDescriptions()

getGroupsOfUser

public List<Group> getGroupsOfUser(String pUsername)
                            throws QcException
Returns the groups of the user.

Parameters:
pUsername - The user.
Returns:
The groups of the users.
Throws:
QcException - Qc Error or user doesn't exist.

getUser

public User getUser(String pUsername)
             throws QcException
Returns a user.

Parameters:
pUsername - The user name.
Returns:
The user or null if not found
Throws:
QcException - QC Error.

getUsernames

public List<String> getUsernames()
                          throws QcException
Returns the available user names .

Returns:
The list of available users.
Throws:
QcException - QC Error.

getUsers

public List<User> getUsers(int pFlag)
                    throws QcException
Returns the available users .

Parameters:
pFlag - Search option.
Returns:
The list of available users.
Throws:
QcException - QC Error.

getUsersOfProject

public List<String> getUsersOfProject()
                               throws QcException
Returns the list of users of the current project.

Returns:
The list of users.
Throws:
QcException - Error.

isExistingUser

public boolean isExistingUser(String pUsername)
                       throws QcException
Check if the given user name exists in QC.

Parameters:
pUsername - The user name.
Returns:
True if the user exists, false otherwise.
Throws:
QcException - Error.