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_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 |
---|---|
String |
getCurrentDatabaseName()
Returns the name of the database where the query is executed
|
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 |
getElementName()
Returns the name of the element which is assigned the custom policy to
|
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.
|
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
|
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 MEMORY_LIMIT_PROPERTY
String getCurrentUserName()
Set<String> getCurrentUserRoles()
String getCurrentDatabaseName()
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 checkException
ConditionEvaluationException
void log(CustomRestrictionPolicyContext.LogLevel level, String logMessage)
level
- the severity level of the eventlogMessage
- the message to be loggedCopyright © 2019 Denodo Technologies. All rights reserved.