public final class ResourceGroup
extends java.lang.Object
| Constructor and Description |
|---|
ResourceGroup(PAMService service,
APIRequestHandler rest) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
associateResources(java.util.ArrayList<java.lang.String> resourceNames,
java.lang.String groupName,
java.lang.String userName)
associate the resources to static group
|
boolean |
associateResources(java.util.ArrayList resourceIds,
java.lang.Long groupId)
associate the resources to static group
|
boolean |
createResourceGroup(ResourceGroupModel resourceGroupModel)
Create a dynamic resource group based on criteria and static group
|
boolean |
deleteResourceGroup(long groupId)
Delete the Resourcegroup using resource id
|
boolean |
deleteResourceGroup(java.lang.String groupName,
java.lang.String userName)
Delete the Resourcegroup using group name
|
boolean |
disassociateResources(java.util.ArrayList<java.lang.String> resourceNames,
java.lang.String groupName,
java.lang.String userName)
disassociate the resources to static group
|
boolean |
disassociateResources(java.util.ArrayList resourceIds,
java.lang.Long groupId)
disassociate the resources to static group
|
org.json.JSONArray |
fetchAllResourceGroups(long limit,
long startIndex,
sdkEnumConstants.SearchType searchType,
sdkEnumConstants.SearchColumn searchColumn,
java.lang.String searchValue)
to fetch all resource groups matching the given value under given column name
|
long |
getResourceGroupID(java.lang.String groupName,
java.lang.String userName)
Get the ID of the particular group
|
public ResourceGroup(PAMService service, APIRequestHandler rest) throws SDKRegistrationException
SDKRegistrationExceptionpublic boolean createResourceGroup(ResourceGroupModel resourceGroupModel) throws SDKConnectionException, SDKOperationFailedException, SDKInvalidArgumentException
resourceGroupModel - mandatory,not null instance of ResourceGroupModel 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 boolean associateResources(java.util.ArrayList<java.lang.String> resourceNames,
java.lang.String groupName,
java.lang.String userName)
throws SDKInvalidArgumentException,
SDKConnectionException,
SDKOperationFailedException
resourceNames - mandatory not null,arrayList of names of the resource to be associatedgroupName - mandatory not null,the name to which resource have to be associateduserName - mandatory not null,the name of the user owning the resourceSDKConnectionException - 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 associateResources(java.util.ArrayList resourceIds,
java.lang.Long groupId)
throws SDKInvalidArgumentException,
SDKOperationFailedException,
SDKConnectionException
resourceIds - mandatory,list of ids to be associated mandatory, non negative ID of the resourcegroupId - mandatory, non negative ID of the groupSDKConnectionException - 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 disassociateResources(java.util.ArrayList<java.lang.String> resourceNames,
java.lang.String groupName,
java.lang.String userName)
throws SDKInvalidArgumentException,
SDKConnectionException,
SDKOperationFailedException
resourceNames - mandatory not null,arrayList of names of the resource to be disassociatedgroupName - mandatory, not null,the name to which resource have to be disassociateduserName - mandatory,not null,the name of the user owning the resourceSDKConnectionException - 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 disassociateResources(java.util.ArrayList resourceIds,
java.lang.Long groupId)
throws SDKInvalidArgumentException,
SDKOperationFailedException,
SDKConnectionException
groupId - mandatory, non negative ID of the groupresourceIds - mandatory,list of ids to be associated mandatory, non negative ID of the resourceSDKConnectionException - 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 deleteResourceGroup(long groupId)
throws SDKConnectionException,
SDKOperationFailedException,
SDKInvalidArgumentException
groupId - mandatory, non negative ID of the resourceSDKConnectionException - 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 deleteResourceGroup(java.lang.String groupName,
java.lang.String userName)
throws SDKConnectionException,
SDKOperationFailedException,
SDKInvalidArgumentException
groupName - mandatory, non null, non empty name of the resourceuserName - mandatory,non null,non empty ame 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 long getResourceGroupID(java.lang.String groupName,
java.lang.String userName)
throws SDKConnectionException,
SDKOperationFailedException,
SDKInvalidArgumentException
groupName - mandatory not null, non empty name of the resourcegroupuserName - 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 org.json.JSONArray fetchAllResourceGroups(long limit,
long startIndex,
sdkEnumConstants.SearchType searchType,
sdkEnumConstants.SearchColumn searchColumn,
java.lang.String searchValue)
throws SDKInvalidArgumentException,
SDKConnectionException,
SDKOperationFailedException
limit - mandatory,number of rows to be fetchedstartIndex - mandatory,index number from which the response row will be displayedsearchType - mandatory,group type wether static or dynamic or all to be fetchedsearchColumn - mandatory,column name to be searchedsearchValue - mandatory,value to be searched under the columnSDKConnectionException - 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