Interface GuardrailsConfigProvider
- All Known Implementing Classes:
GuardrailsConfigProvider.Default
public interface GuardrailsConfigProvider
Provider of
GuardrailsConfigs 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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classDefault implementation ofGuardrailsConfigProviderthat always returns theGuardrailsConfigparsed fromcassandra.yaml, independently of theClientState. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.CUSTOM_GUARDRAILS_CONFIG_PROVIDER_CLASS.getKey() must be used instead.static final GuardrailsConfigProvider -
Method Summary
Modifier and TypeMethodDescriptionstatic GuardrailsConfigProviderCreates an instance of the custom guardrails config provider of the given class.getOrCreate(ClientState state) Returns theGuardrailsConfigto be used for the specifiedClientState.
-
Field Details
-
CUSTOM_IMPLEMENTATION_PROPERTY
Deprecated.CUSTOM_GUARDRAILS_CONFIG_PROVIDER_CLASS.getKey() must be used instead. See CASSANDRA-17797 -
instance
-
-
Method Details
-
getOrCreate
Returns theGuardrailsConfigto be used for the specifiedClientState.- Parameters:
state- a client state, maybenullif the guardrails check for which we are getting the config is for a background process that is not associated to a user query.- Returns:
- the configuration to be used for
state
-
build
Creates an instance of the custom guardrails config provider of the given class.- Parameters:
customImpl- the fully qualified classname of the guardrails config provider to be instantiated- Returns:
- a new instance of the specified custom guardrails config provider of the given class.
-