Class ResourceManagerUtil

java.lang.Object
com.ads.api.util.BaseUtil
com.ads.api.util.ResourceManagerUtil

public class ResourceManagerUtil extends com.ads.api.util.BaseUtil
Contains the methods related to perform the operations such as creation, update, deletion and retrieval of Users, Roles, etc.
RequestStatus return type methods will result in being returned as either true or false as its status.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.ads.api.util.BaseUtil

    com.ads.api.util.BaseUtil.TokenType
  • Field Summary

    Fields inherited from class com.ads.api.util.BaseUtil

    AUTH_TOKEN, AUTH_TOKEN_TYPE
  • Method Summary

    Modifier and Type
    Method
    Description
    getRole(String roleName)
    Returns the Role object for the specified roleName i.e all the respective details regarding the role,such as roleName, roleId ,roleDescription and auditHistory.
    getRole(String roleName, int fillOptions)
    Returns the Role object for the specified roleName i.e all the respective details regarding the role,such as roleName,roleId, roleDescription, auditHistory and also returns list of permissions that the role has based on the fillOptions parameter value passed with reference of APIConstants.RSMFillOptions.
    getRoleAs(String roleName, int fillOptions, String outputFormat)
    Returns the Role object for the specified roleName i.e all the respective details regarding the role,such as roleName,roleId, roleDescription, auditHistory and also returns list of permissions that the role has based on the fillOptions parameter value passed with reference of APIConstants.RSMFillOptions.
    getRoleAs(String roleName, String outputFormat)
    Returns the Role object for the specified roleName i.e all the respective details regarding the role,such as roleName,roleId,roleDescription and auditHistory.
    Returns the list of Role objects where each Role object contains details like roleName,roleId,roleDescription and auditHistory.
    getRoles(int fillOptions)
    Returns the list of Role objects where each Role object contains details like roleName,roleId,roleDescription,auditHistory and list of permissions that the role has based on the fillOptions parameter value passed with reference of APIConstants.RSMFillOptions.
    getRolesAs(int fillOptions, String outputFormat)
    Returns the list of Role objects where each Role object contains details like roleName,roleId,roleDescription,auditHistory and list of permissions that the role has based on the fillOptions parameter value passed with reference of APIConstants.RSMFillOptions.
    getRolesAs(String outputFormat)
    Returns the list of Role objects where each Role object contains details like roleName, roleDescription,roleId and auditHistory.
    Returns the list of Role objects for the specified userId where each Role object contains all the respective details such as id,name, description, auditHistory etc..
    getUserRolesAs(String userId, String outputFormat)
    Returns the list of Role objects for the specified userId where each Role object contains all the respective details such as id,name, description, auditHistory etc..

    Methods inherited from class com.ads.api.util.BaseUtil

    getAccessToken, getAccessTokenType, getTokenType, getUserDetails, permissionDeniedMessage, permissionDeniedStatus, setAccessToken, setAccessTokenType

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getRole

      public Role getRole(String roleName) throws Exception
      Returns the Role object for the specified roleName i.e all the respective details regarding the role,such as roleName, roleId ,roleDescription and auditHistory.
      Specifying the roleName is mandatory.
      Parameters:
      roleName - String
      Returns:
      Role Object
      Throws:
      Exception
    • getRole

      public Role getRole(String roleName, int fillOptions) throws Exception
      Returns the Role object for the specified roleName i.e all the respective details regarding the role,such as roleName,roleId, roleDescription, auditHistory and also returns list of permissions that the role has based on the fillOptions parameter value passed with reference of APIConstants.RSMFillOptions.
      Here fillOptions parameter takes value of either APIConstants.RSMFillOptions.ROLE_PERMISSIONS or APIConstants.RSMFillOptions.NONE. If the fillOptions takes value of APIConstants.RSMFillOptions.ROLE_PERMISSIONS i.e 2 then the returned Role object contains role details and the list of role permissions. If the fillOptions takes value of APIConstants.RSMFillOptions.NONE i.e 0 then the returned Role object contains only role details. Specifying the roleName and fillOptions are mandatory.
      Parameters:
      roleName - String
      fillOptions - APIConstants.RSMFillOptions int
      Returns:
      Role Object
      Throws:
      Exception
    • getRoles

      public List<Role> getRoles()
      Returns the list of Role objects where each Role object contains details like roleName,roleId,roleDescription and auditHistory.
      Returns:
      List - role Objects
    • getUserRoles

      public List<Role> getUserRoles(String userId) throws Exception
      Returns the list of Role objects for the specified userId where each Role object contains all the respective details such as id,name, description, auditHistory etc..
      Parameters:
      userId - - String
      Returns:
      List - role Objects
      Throws:
      Exception
      Since:
      11.0
    • getRoles

      public List<Role> getRoles(int fillOptions)
      Returns the list of Role objects where each Role object contains details like roleName,roleId,roleDescription,auditHistory and list of permissions that the role has based on the fillOptions parameter value passed with reference of APIConstants.RSMFillOptions.
      Here fillOptions parameter takes value of either APIConstants.RSMFillOptions.ROLE_PERMISSIONS or APIConstants.RSMFillOptions.NONE.
      If the fillOptions takes value of APIConstants.RSMFillOptions.ROLE_PERMISSIONS i.e 2 then the each Role object contains role details and the list of role permissions. If the fillOptions takes value of APIConstants.RSMFillOptions.NONE i.e 0 then the each Role object contains only role details.
      Specifying the fillOptions is mandatory.
      Parameters:
      fillOptions - APIConstants.RSMFillOptions int
      Returns:
      List - role Objects
    • getRoleAs

      public String getRoleAs(String roleName, String outputFormat)
      Returns the Role object for the specified roleName i.e all the respective details regarding the role,such as roleName,roleId,roleDescription and auditHistory. Specifying the roleName is mandatory.
      OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
      Parameters:
      roleName - String
      outputFormat - String
      Returns:
      String - role Object in the form of JSON or XML String
    • getRoleAs

      public String getRoleAs(String roleName, int fillOptions, String outputFormat)
      Returns the Role object for the specified roleName i.e all the respective details regarding the role,such as roleName,roleId, roleDescription, auditHistory and also returns list of permissions that the role has based on the fillOptions parameter value passed with reference of APIConstants.RSMFillOptions.
      Here fillOptions parameter takes value of either APIConstants.RSMFillOptions.ROLE_PERMISSIONS or APIConstants.RSMFillOptions.NONE. If the fillOptions takes value of APIConstants.RSMFillOptions.ROLE_PERMISSIONS i.e 2 then the returned Role object contains role details and the list of role permissions. If the fillOptions takes value of APIConstants.RSMFillOptions.NONE i.e 0 then the returned Role object contains only role details. Specifying the roleName and fillOptions are mandatory.
      OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
      Parameters:
      roleName - String
      outputFormat - String
      fillOptions - APIConstants.RSMFillOptions int
      Returns:
      String - role Object in the form of JSON or XML String
    • getRolesAs

      public String getRolesAs(String outputFormat)
      Returns the list of Role objects where each Role object contains details like roleName, roleDescription,roleId and auditHistory.
      OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
      Parameters:
      outputFormat -
      Returns:
      String - role Objects in the form of JSON or XML String
    • getRolesAs

      public String getRolesAs(int fillOptions, String outputFormat)
      Returns the list of Role objects where each Role object contains details like roleName,roleId,roleDescription,auditHistory and list of permissions that the role has based on the fillOptions parameter value passed with reference of APIConstants.RSMFillOptions.
      Here fillOptions parameter takes value of either APIConstants.RSMFillOptions.ROLE_PERMISSIONS or APIConstants.RSMFillOptions.NONE.
      If the fillOptions takes value of APIConstants.RSMFillOptions.ROLE_PERMISSIONS i.e 2 then the each Role object contains role details and the list of role permissions. If the fillOptions takes value of APIConstants.RSMFillOptions.NONE i.e 0 then the each Role object contains only role details.
      Specifying the fillOptions is mandatory.
      OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
      Parameters:
      outputFormat -
      fillOptions - APIConstants.RSMFillOptions int
      Returns:
      String - role Objects in the form of JSON or XML String
    • getUserRolesAs

      public String getUserRolesAs(String userId, String outputFormat)
      Returns the list of Role objects for the specified userId where each Role object contains all the respective details such as id,name, description, auditHistory etc..
      OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
      Parameters:
      userId - - String
      outputFormat - - String
      Returns:
      String - role Object in the form of JSON or XML String
      Since:
      11.0