Class QueryContext

java.lang.Object
com.denodo.common.custom.elements.QueryContext

public class QueryContext extends Object
Class that provides methods to obtain:
  • The user name that executes the query
  • The set of roles granted to this user
  • The Denodo database to which the user is connected when executing the query that uses this function

To obtain an instance of this class, invoke the method CustomElementsUtil.getQueryContext()

Since:
6.0 Update 20160429
  • Constructor Details

  • Method Details

    • getCurrentUserRoles

      public Set<String> getCurrentUserRoles()

      Returns the names of all the roles granted directly or indirectly to the user who executes the query.
      Roles indirectly granted to the user are roles that have been granted to one of the roles of the user and not the user itself.

      For example, if the user that executes this function is granted role1, role2 is granted to role1 and role3 is granted to role2, this function will return a set with role1, role2 and role3. The Set is not sorted, so the order is not guaranteed.
      Returns:
      the names of all the roles assigned to the user who executes the query. An empty Set if the user does not have any role assigned.
    • getCurrentDatabaseName

      public String getCurrentDatabaseName()
      Returns the name of the database where the query is executed
      Returns:
      the name of the database where the query is executed
    • getCurrentUserName

      public String getCurrentUserName()
      Returns the name of the user who executes the query
      Returns:
      the name of the user who executes the query