public interface CustomRestrictionPolicyContext
CustomRestrictionPolicyContext
interface provides access to
information about the running query and the corresponding custom policy.
The following information is available:
The CustomRestrictionPolicyContext
interface also provides a JMX
connection to query VDP Server MBeans and logging capabilities.
Modifier and Type | Interface and Description |
---|---|
static class |
CustomRestrictionPolicyContext.CredentialsType
Type of the credential which is assigned the custom policy to
|
static class |
CustomRestrictionPolicyContext.ElementType
Type of the element which is assigned the custom policy to
|
static class |
CustomRestrictionPolicyContext.LogLevel
Severity level of the registered events in the log
|
Modifier and Type | Field and Description |
---|---|
static String |
CACHE_INVALIDATE_PROPERTY
Platform property which indicates whether the cache is invalidated.
|
static String |
CACHE_PRELOAD_PROPERTY
Platform property which indicates whether the results of this query is
used to populate the cache of the executing view.
|
static String |
DELEGATE_UNNAMED_VIEWS_PROPERTY
Platform property which indicates whether unnamed views should be
delegated.
|
static String |
I18N_PROPERTY
Platform property which defines the internationalization configuration
that will be used for the results of the query.
|
static String |
MEMORY_LIMIT_PROPERTY
Platform property which defines a limit on the memory usage of the query
in megabytes.
|
static String |
QUERY_LIMIT_PROPERTY
Platform property which defines a limit on the number of rows obtained
from the result set.
|
static String |
QUERY_TIMEOUT_PROPERTY
Platform property which defines the maximum time (in milliseconds) the
client is prepared to wait for the statement to complete.
|
static String |
SWAP_PROPERTY
Platform property which indicates whether swapping is enabled for the
query.
|
static String |
SWAP_SIZE_PROPERTY
Platform property which defines the maximum size (in megabytes) an
intermediate result obtained by running this query can reach without
swapping to disk.
|
static String |
USER_AGENT_PROPERTY
Platform property which indicates the user agent used to query the view.
|
static String |
USER_NAME_PROPERTY
Platform property which indicates the user name used to query the view
instead of the one you have used to connect to the VDP Server.
|
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
getAdditionalAuthenticationInformation()
Returns a map with extra authentication information, if it was provided by
the authentication mechanism or an empty map if no information was provided.
|
String |
getCurrentDatabaseName()
Returns the name of the database to which the client application is connected.
|
String |
getCurrentUserAgent()
Returns the user agent who executes the query
|
String |
getCurrentUserName()
Returns the name of the user who executes the query
|
Set<String> |
getCurrentUserRoles()
Returns the names of all the roles assigned to the user who executes the
query.
|
String |
getElementDatabase()
Returns the name of the database of the element to which the policy is assigned.
|
String |
getElementName()
Returns the name of the element which is assigned the custom policy to
|
Collection<String> |
getElementTags()
Returns a collection with the assigned tags to the element.
|
CustomRestrictionPolicyContext.ElementType |
getElementType()
Returns the type of the element which is assigned the custom policy to
|
Set<String> |
getFieldsInQuery()
Returns the set of fields in the view or stored procedure involved in the query.
|
Map<String,Collection<String>> |
getFieldsTags()
Returns a map with the assigned tags to the fields from the element.
|
JmxConnection |
getJmxConnection()
Returns a JMX connection to query VDP Server MBeans
|
String |
getPolicyCredentialsName()
Returns the name of the credential which is assigned the custom policy to
|
CustomRestrictionPolicyContext.CredentialsType |
getPolicyCredentialsType()
Returns the type of the credential which is assigned the custom policy to
|
String |
getProperty(String name)
Returns a textual representation of the value of a platform property
present in the context of the query.
|
String |
getQuery()
Returns the running query
|
String |
getVariable(String name)
Returns a textual representation of the value of a user-defined variable
that is present in the context of the query.
|
boolean |
isIncompatibleWithQuery(String condition)
Checks if the given condition is incompatible with the condition specified on a query over the
view affected by this policy
|
boolean |
isLogLevelEnabled(CustomRestrictionPolicyContext.LogLevel level)
Checks if the specified level is enabled.
|
void |
log(CustomRestrictionPolicyContext.LogLevel level,
String logMessage)
Registers an event in the log of the VDP Server with the specified level.
|
void |
setProperty(String name,
String value)
Sets the value of a platform property that is used in the context of the
query.
|
void |
setVariable(String name,
String value)
Sets the value of a user-defined variable in the context of the query.
|
static final String CACHE_INVALIDATE_PROPERTY
true
, false
.static final String CACHE_PRELOAD_PROPERTY
true
, false
.static final String DELEGATE_UNNAMED_VIEWS_PROPERTY
yes
, no
.static final String I18N_PROPERTY
es_euro
).static final String QUERY_LIMIT_PROPERTY
static final String QUERY_TIMEOUT_PROPERTY
static final String SWAP_PROPERTY
on
,
off
.static final String SWAP_SIZE_PROPERTY
static final String USER_NAME_PROPERTY
WITH PASS-THROUGH SESSION CREDENTIALS
. This
property takes a valid user name for the data source as a value.static final String USER_AGENT_PROPERTY
static final String MEMORY_LIMIT_PROPERTY
String getCurrentUserName()
String getCurrentUserAgent()
Map<String,Object> getAdditionalAuthenticationInformation()
String
that represents the name of the attribute.NULL
) is an Object value that can encapsulate one
of the following types:
Boolean
String
Number
List<Object>
Map<String, Object>
Set<String> getCurrentUserRoles()
String getCurrentDatabaseName()
This can be different from the database of the queried view. For example, if the client
application establishes the connection with the database admin
but executes the query
SELECT * FROM customer360.customer
, this method will return admin
, not
customer360
.
String getElementDatabase()
String getPolicyCredentialsName()
CustomRestrictionPolicyContext.CredentialsType getPolicyCredentialsType()
String getElementName()
CustomRestrictionPolicyContext.ElementType getElementType()
String getQuery()
Set<String> getFieldsInQuery()
JmxConnection getJmxConnection()
String getProperty(String name)
name
- the name of the platform property. The following properties
are supported:
IllegalArgumentException
- if name
is not a supported property namevoid setProperty(String name, String value)
name
- the name of the platform property. The following properties
are supported:
value
- a textual representation of the value of the platform propertyIllegalArgumentException
- if name
is not a supported property nameIllegalArgumentException
- if value
is not a valid value for the propertyString getVariable(String name)
name
- the name of the user-defined variable.void setVariable(String name, String value)
name
- the name of the user-defined variablevalue
- a textual representation of the value of the user-defined
variableboolean isIncompatibleWithQuery(String condition) throws ConditionEvaluationException
condition
- condition to checkConditionEvaluationException
- if the condition is invalid. For example, it is
syntactically incorrect.void log(CustomRestrictionPolicyContext.LogLevel level, String logMessage)
level
- the severity level of the eventlogMessage
- the message to be loggedboolean isLogLevelEnabled(CustomRestrictionPolicyContext.LogLevel level)
level
- the log level to checktrue
if the specified level is enabled, false
otherwise.Collection<String> getElementTags()
Map<String,Collection<String>> getFieldsTags()
Copyright © 2024 Denodo Technologies. All rights reserved.