public class PMClient extends CellClient
| Modifier and Type | Field and Description |
|---|---|
static String |
XMLNS |
client, serviceUrl| Constructor and Description |
|---|
PMClient(Li2b2Client client,
URL serviceUrl) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHiveParam(String paramType,
String paramName,
String paramValue) |
void |
addProjectParam(String projectId,
String paramType,
String paramName,
String paramValue) |
void |
addUserParam(String user_name,
String paramType,
String paramName,
String paramValue)
Add a parameter to the specified user's configuration.
|
void |
changePassword(String user,
String domain,
char[] oldPassword,
char[] newPassword)
Change the password of any user.
|
void |
deleteHiveParam(int id)
Delete a global hive parameter
|
void |
deleteProjectParam(int id)
Delete a project specific parameter
|
void |
deleteRole(String user_name,
String role,
String project_id)
Delete one single Role for a specific user for one project.
|
void |
deleteUser(String user_name)
Delete one existing user
|
void |
deleteUserParam(int id)
Delete a user specific parameter.
|
Param[] |
getHiveParams(String project_path)
Retrieve global hive parameters
|
Param[] |
getProjectParams(String projectId)
Retrieve project specific parameters
|
Role[] |
getRoles()
Request the roles for a user for one project
or all roles for one project
or all roles of all users for all projects.
|
Role[] |
getRoles(String project_id) |
String[] |
getRoles(String userId,
String projectId) |
User |
getUser(String user_name)
Request one user specified with user_name
|
Param[] |
getUserParams(String user_name) |
User[] |
getUsers()
Request all existing users
|
UserConfiguration |
requestUserConfiguration()
Request the configuration for the current user.
|
void |
setRole(String user_name,
String role,
String project_id)
Set one Role for a user for one project.
|
void |
setUser(String user_name,
String full_name,
String email,
String password,
boolean is_admin)
Update or create user with username, fullname, email and password
|
void |
setUser(User user) |
appendOptionalElement, appendTextElement, createConnection, createRequest, createRequestMessage, createRequestMessage, createRequestMessage, getOutputCharset, getServiceURL, newBuilder, submitRequest, submitRequest, submitRequestWithResponseContentpublic static final String XMLNS
public PMClient(Li2b2Client client, URL serviceUrl)
public void changePassword(String user, String domain, char[] oldPassword, char[] newPassword) throws ErrorResponseException, HiveException
user - user namedomain - user domainoldPassword - user's old passwordnewPassword - new passwordErrorResponseException - password change operation failedHiveException - server errorpublic UserConfiguration requestUserConfiguration() throws ErrorResponseException, HiveException
ErrorResponseException - application layer error. most commonly authentication failureHiveException - unexpected response bodypublic User[] getUsers() throws HiveException
HiveException - unexpected response bodypublic User getUser(String user_name) throws HiveException
user_name - user nameHiveException - server errorpublic void setUser(User user) throws HiveException
HiveExceptionpublic void setUser(String user_name, String full_name, String email, String password, boolean is_admin) throws HiveException
user_name - String username of the new user, non-nullfull_name - String. Full name for the new user, descriptive (optional)email - String. email of the new user, for contact (optional)password - String password for the new user, non-nullis_admin - whether the user receives administrative privilegesHiveException - for unexpected responseNullPointerException - if user_name or password is nullpublic void deleteUser(String user_name) throws HiveException, ErrorResponseException
user_name - user nameHiveException - unexpected response bodyErrorResponseException - delete failed. If the user does not exist, then the official Server will use status type ERROR and message User not updated, does it exist?.public Role[] getRoles() throws HiveException
HiveException - unexpected response bodypublic Role[] getRoles(String project_id) throws HiveException
HiveExceptionpublic String[] getRoles(String userId, String projectId) throws HiveException
HiveExceptionpublic void setRole(String user_name, String role, String project_id) throws HiveException, ErrorResponseException
user_name - user namerole - roleproject_id - project idHiveException - unexpected response bodyErrorResponseException - if current user does not have sufficient rights (has to be admin / manager)public void deleteRole(String user_name, String role, String project_id) throws HiveException, ErrorResponseException
user_name - user namerole - roleproject_id - project idHiveException - unexpected response bodyErrorResponseException - if user-role-project combination does not existpublic void addUserParam(String user_name, String paramType, String paramName, String paramValue) throws HiveException
user_name - user for whom to set the parameterparamType - parameter type, see ParamType.getCode()paramName - parameter nameparamValue - parameter valueHiveException - errorpublic Param[] getUserParams(String user_name) throws HiveException, ErrorResponseException
HiveExceptionErrorResponseExceptionpublic void deleteUserParam(int id)
throws HiveException
id - id for the parameter to deleteHiveException - communications errorpublic void deleteHiveParam(int id)
throws HiveException
id - id for the parameter to deleteHiveException - communications errorpublic Param[] getHiveParams(String project_path) throws HiveException
project_path - ??? web client always sets this parameter to "/"HiveException - communications errorpublic Param[] getProjectParams(String projectId) throws HiveException
projectId - project id to retrieve params forHiveException - communications errorpublic void deleteProjectParam(int id)
throws HiveException
id - id for the parameter to deleteHiveException - communications errorpublic void addHiveParam(String paramType, String paramName, String paramValue) throws HiveException
HiveExceptionpublic void addProjectParam(String projectId, String paramType, String paramName, String paramValue) throws HiveException
HiveExceptionCopyright © 2013–2020 R.W.Majeed. All rights reserved.