public interface GuardrailsConfigProvider
GuardrailsConfig
s for a ClientState
.
The GuardrailsConfigProvider.Default
implementation always retuns the GuardrailsConfig
parsed from cassandra.yaml
,
but different implementations can return different configurations based on the specified ClientState
.
Custom implementations can be specified at runtime with the system property CUSTOM_IMPLEMENTATION_PROPERTY
.
These configurations can be used to read the guardrails configuration from some other source, and provide different
configurations depending on the ClientState
or some other factors. However, this mechanism for pluggability
and the related GuardrailsConfig
interface are not officially supported and may change in a minor release.
Modifier and Type | Interface and Description |
---|---|
static class |
GuardrailsConfigProvider.Default
Default implementation of
GuardrailsConfigProvider that always returns the GuardrailsConfig
parsed from cassandra.yaml , independently of the ClientState . |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CUSTOM_IMPLEMENTATION_PROPERTY |
static GuardrailsConfigProvider |
instance |
Modifier and Type | Method and Description |
---|---|
static GuardrailsConfigProvider |
build(java.lang.String customImpl)
Creates an instance of the custom guardrails config provider of the given class.
|
GuardrailsConfig |
getOrCreate(ClientState state)
Returns the
GuardrailsConfig to be used for the specified ClientState . |
static final java.lang.String CUSTOM_IMPLEMENTATION_PROPERTY
static final GuardrailsConfigProvider instance
GuardrailsConfig getOrCreate(@Nullable ClientState state)
GuardrailsConfig
to be used for the specified ClientState
.state
- a client state, maybe null
if the guardrails check for which we are getting the config is
for a background process that is not associated to a user query.state
static GuardrailsConfigProvider build(java.lang.String customImpl)
customImpl
- the fully qualified classname of the guardrails config provider to be instantiatedCopyright © 2009- The Apache Software Foundation