public final class User
extends java.lang.Object
| Constructor and Description |
|---|
User(PAMService service,
APIRequestHandler rest) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addToUserGroup(java.lang.String userName,
java.lang.String userGroupName)
Add the user to the user group
|
boolean |
addUserToGroup(java.lang.String userName,
java.lang.String userGroupName)
Add the user to the user group of a particular organization
|
UserDetails |
createUser(UserModel userModel)
Create an user with specified properties
|
boolean |
deleteUser(long userId)
Delete an user using user ID
|
boolean |
deleteUser(java.lang.String userName)
Delete an user using UserName
|
org.json.JSONObject |
deleteuserGroup(java.util.ArrayList<java.lang.String> userGroupNames)
remove the user from the user group of a particular organization
|
org.json.JSONObject |
deleteUserGroup(org.json.JSONArray userGroupIds)
remove the user from the user group of a particular organization
|
UserDetails |
editUser(java.lang.String userName,
UserModel userModel)
Edit a user with specified properties
|
long |
getusergroupID(java.lang.String groupName)
Get the ID of the particular group
|
long |
getUserID(java.lang.String userName)
Get the ID of the particular user
|
static boolean |
isValidEmail(java.lang.String email) |
boolean |
lockUser(java.lang.String username)
Lock a particular user using username
|
UserDetails |
mapJsontoUserDetails(org.json.JSONObject data,
java.lang.String message) |
org.json.JSONObject |
regenerateRestToken()
To regenerate authToken for a user
|
org.json.JSONObject |
removeFromUserGroup(java.util.ArrayList<java.lang.String> userNames,
java.lang.String usergroupName)
remove the user from the user group of a particular organization
|
boolean |
resetMFA(java.lang.String userName)
To reset two-factor authentication for a username.
|
boolean |
unlockUser(java.lang.String username)
Unlock a locked user using username
|
static java.lang.String |
validateExpiryDate(java.lang.String expiryDate) |
public User(PAMService service, APIRequestHandler rest) throws SDKRegistrationException
SDKRegistrationExceptionpublic UserDetails createUser(UserModel userModel) throws SDKConnectionException, SDKOperationFailedException, SDKInvalidArgumentException
userModelmandatory, - instance of UserModel with necessary fields setSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic UserDetails mapJsontoUserDetails(org.json.JSONObject data, java.lang.String message)
public UserDetails editUser(java.lang.String userName, UserModel userModel) throws SDKInvalidArgumentException, SDKOperationFailedException, SDKConnectionException
userName - mandatory,name of the user to be editeduserModel - mandatory,instance of UserModel with necessary fields setSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic long getUserID(java.lang.String userName)
throws SDKConnectionException,
SDKOperationFailedException,
SDKInvalidArgumentException
userName - mandatory,not null, non empty name of the userSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the requestSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic boolean deleteUser(long userId)
throws SDKConnectionException,
SDKOperationFailedException,
SDKInvalidArgumentException
userId - mandatory, non negative unique ID of user to be deletedSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic boolean deleteUser(java.lang.String userName)
throws SDKConnectionException,
SDKOperationFailedException,
SDKInvalidArgumentException
userName - mandatory, not null, non empty login name of the user to be deletedSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic boolean lockUser(java.lang.String username)
throws SDKConnectionException,
SDKOperationFailedException,
SDKInvalidArgumentException
username - mandatory,not null, non empty login name of the user to be lockedSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic boolean unlockUser(java.lang.String username)
throws SDKConnectionException,
SDKOperationFailedException,
SDKInvalidArgumentException
username - mandatory, not null, non empty login name of the user to be unlockedSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic boolean addToUserGroup(java.lang.String userName,
java.lang.String userGroupName)
throws SDKConnectionException,
SDKOperationFailedException,
SDKInvalidArgumentException
userName - mandatory, not null, non empty login name of the useruserGroupName - mandatory, not null, non empty group to which user has to be addedSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic boolean addUserToGroup(java.lang.String userName,
java.lang.String userGroupName)
throws SDKConnectionException,
SDKOperationFailedException,
SDKInvalidArgumentException
userName - mandatory, not null, non empty login name of the useruserGroupName - mandatory, not null, non empty group to which user has to be addedSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic long getusergroupID(java.lang.String groupName)
throws SDKConnectionException,
SDKOperationFailedException,
SDKInvalidArgumentException
groupName - mandatory,not null, non empty name of the usergroupSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the requestSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic org.json.JSONObject removeFromUserGroup(java.util.ArrayList<java.lang.String> userNames,
java.lang.String usergroupName)
throws SDKInvalidArgumentException,
SDKConnectionException,
SDKOperationFailedException
userNames - mandatory,names of user to be removed from particular groupusergroupName - mandatory,name of usergroupSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic org.json.JSONObject deleteuserGroup(java.util.ArrayList<java.lang.String> userGroupNames)
throws SDKInvalidArgumentException,
SDKConnectionException,
SDKOperationFailedException
userGroupNames - mandatory,not null,names of usergroup to be deletedSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic org.json.JSONObject deleteUserGroup(org.json.JSONArray userGroupIds)
throws SDKInvalidArgumentException,
SDKOperationFailedException,
SDKConnectionException
userGroupIds - mandatory,not negative,ids of usergroup to be deletedSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic boolean resetMFA(java.lang.String userName)
throws SDKInvalidArgumentException,
SDKConnectionException,
SDKOperationFailedException
userName - mandatory,not null,name of the userSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic org.json.JSONObject regenerateRestToken()
throws SDKConnectionException,
SDKOperationFailedException
SDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messagepublic static java.lang.String validateExpiryDate(java.lang.String expiryDate)
public static boolean isValidEmail(java.lang.String email)