public final class Account
extends java.lang.Object
| Constructor and Description |
|---|
Account(PAMService service,
APIRequestHandler rest) |
| Modifier and Type | Method and Description |
|---|---|
org.json.JSONObject |
createAccount(java.lang.String resourceName,
java.util.List<AccountModel> accountModels)
Create an account under a resource
|
boolean |
deleteAccount(java.lang.String resourceName,
java.lang.String accountName)
Delete an account under a resource using resource and account name
|
boolean |
editAccount(java.lang.String resourceName,
java.lang.String currentAccountName,
AccountModel accountModel)
Edit an existing account under a resource using resource name and account name
|
AccountDetails |
getDetails(long resourceID,
long accountID)
Get the details of an account in a resource
|
AccountDetails |
getDetails(java.lang.String resourceName,
java.lang.String accountName)
Get the details of an account under a resource
|
boolean |
shareAccountToUser(java.lang.String resourceName,
java.lang.String accountName,
java.lang.String userName,
sdkEnumConstants.AccessPermission accessPermission)
Share the account to a particular user using resource, account and user names
|
boolean |
shareAccountToUserGroup(java.lang.String resourceName,
java.lang.String accountName,
java.lang.String userGroupName,
sdkEnumConstants.AccessPermission accessPermission)
Share the account to a particular usergroup using resource, account and user names
|
public Account(PAMService service, APIRequestHandler rest) throws SDKRegistrationException
SDKRegistrationExceptionpublic AccountDetails getDetails(long resourceID, long accountID) throws SDKConnectionException, SDKOperationFailedException, SDKInvalidArgumentException
resourceID - mandatory,non negative, unique id of resourceaccountID - mandatory,id of account inside the resource whose details is to be fetchedAccountDetailsSDKConnectionException - 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 AccountDetails getDetails(java.lang.String resourceName, java.lang.String accountName) throws SDKConnectionException, SDKOperationFailedException, SDKInvalidArgumentException
resourceName - mandatory,not null, non empty unique name of resourceaccountName - mandatory,not null, non empty unique name of account inside the resource whose details is to be fetchedAccountDetailsSDKConnectionException - 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 deleteAccount(java.lang.String resourceName,
java.lang.String accountName)
throws SDKInvalidArgumentException,
SDKConnectionException,
SDKOperationFailedException
resourceName - mandatory, not null, non empty name of resourceaccountName - mandatory, not null, non empty name of account inside the resource 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 createAccount(java.lang.String resourceName,
java.util.List<AccountModel> accountModels)
throws SDKConnectionException,
SDKOperationFailedException,
SDKInvalidArgumentException,
SDKRegistrationException
resourceName - mandatory,mandatory not null name of resourceaccountModels - mandatory,an instance of AccountModel containing necessary information about accountSDKConnectionException - 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 providedSDKRegistrationExceptionpublic boolean editAccount(java.lang.String resourceName,
java.lang.String currentAccountName,
AccountModel accountModel)
throws SDKInvalidArgumentException,
SDKConnectionException,
SDKOperationFailedException
resourceName - mandatory, not null, non empty unique name of resourcecurrentAccountName - mandatory, not null, non empty unique name of account inside the resource which is to be editedaccountModel - mandatory, AccountModel object containing necessary detailsSDKConnectionException - 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 shareAccountToUser(java.lang.String resourceName,
java.lang.String accountName,
java.lang.String userName,
sdkEnumConstants.AccessPermission accessPermission)
throws SDKInvalidArgumentException,
SDKConnectionException,
SDKOperationFailedException
resourceName - mandatory, not null, non empty name of resourceaccountName - mandatory, not null, non empty name of resource of account to be shareduserName - mandatory, not null, non empty name of user to whom the account is to be sharedaccessPermission - mandatory, the access type/level to be provided to 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 boolean shareAccountToUserGroup(java.lang.String resourceName,
java.lang.String accountName,
java.lang.String userGroupName,
sdkEnumConstants.AccessPermission accessPermission)
throws SDKInvalidArgumentException,
SDKConnectionException,
SDKOperationFailedException
resourceName - mandatory, not null, non empty name of resourceaccountName - mandatory, not null, non empty name of resource of account to be shareduserGroupName - mandatory, not null, non empty name of usergroup to whom the account is to be sharedaccessPermission - mandatory, the access type/level to be provided to 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 provided