Class AbstractConfigurationValidator
- java.lang.Object
-
- com.floragunn.searchguard.dlic.rest.validation.AbstractConfigurationValidator
-
- Direct Known Subclasses:
ActionGroupValidator,BlocksValidator,InternalUsersValidator,LicenseValidator,NoOpValidator,RolesMappingValidator,RolesValidator,SgConfigValidator,TenantValidator
public abstract class AbstractConfigurationValidator extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractConfigurationValidator.DataTypestatic classAbstractConfigurationValidator.ErrorType
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,AbstractConfigurationValidator.DataType>allowedKeysDefine the various keys for this validatorprotected org.elasticsearch.common.bytes.BytesReferencecontentprotected AbstractConfigurationValidator.ErrorTypeerrorTypeThe error typeprotected org.elasticsearch.common.settings.SettingsesSettingsstatic StringINVALID_KEYS_KEYprotected Set<String>invalidKeysprotected ExceptionlastExceptionprotected org.apache.logging.log4j.Loggerlogprotected Set<String>mandatoryKeysprotected Set<String>mandatoryOrKeysprotected org.elasticsearch.rest.RestRequest.Methodmethodstatic StringMISSING_MANDATORY_KEYS_KEYstatic StringMISSING_MANDATORY_OR_KEYS_KEYprotected Set<String>missingMandatoryKeysContain errorneous keysprotected Set<String>missingMandatoryOrKeysprotected Object[]paramprotected booleanpayloadAllowedprotected booleanpayloadMandatoryBehaviour regarding payloadprotected org.elasticsearch.rest.RestRequestrequestprotected Map<String,String>wrongDatatypes
-
Constructor Summary
Constructors Constructor Description AbstractConfigurationValidator(org.elasticsearch.rest.RestRequest request, org.elasticsearch.common.bytes.BytesReference ref, org.elasticsearch.common.settings.Settings esSettings, Object... param)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.elasticsearch.xcontent.XContentBuildererrorsAsXContent(org.elasticsearch.rest.RestChannel channel)com.fasterxml.jackson.databind.JsonNodegetContentAsNode()protected booleanhasParams()booleanvalidate()protected ExceptionvalidationError(IOException e)
-
-
-
Field Detail
-
INVALID_KEYS_KEY
public static final String INVALID_KEYS_KEY
- See Also:
- Constant Field Values
-
MISSING_MANDATORY_KEYS_KEY
public static final String MISSING_MANDATORY_KEYS_KEY
- See Also:
- Constant Field Values
-
MISSING_MANDATORY_OR_KEYS_KEY
public static final String MISSING_MANDATORY_OR_KEYS_KEY
- See Also:
- Constant Field Values
-
log
protected final org.apache.logging.log4j.Logger log
-
allowedKeys
protected final Map<String,AbstractConfigurationValidator.DataType> allowedKeys
Define the various keys for this validator
-
errorType
protected AbstractConfigurationValidator.ErrorType errorType
The error type
-
lastException
protected Exception lastException
-
payloadMandatory
protected boolean payloadMandatory
Behaviour regarding payload
-
payloadAllowed
protected boolean payloadAllowed
-
method
protected final org.elasticsearch.rest.RestRequest.Method method
-
content
protected final org.elasticsearch.common.bytes.BytesReference content
-
esSettings
protected final org.elasticsearch.common.settings.Settings esSettings
-
request
protected final org.elasticsearch.rest.RestRequest request
-
param
protected final Object[] param
-
-
Constructor Detail
-
AbstractConfigurationValidator
public AbstractConfigurationValidator(org.elasticsearch.rest.RestRequest request, org.elasticsearch.common.bytes.BytesReference ref, org.elasticsearch.common.settings.Settings esSettings, Object... param)
-
-
Method Detail
-
getContentAsNode
public com.fasterxml.jackson.databind.JsonNode getContentAsNode()
-
validate
public boolean validate()
- Returns:
- false if validation fails
-
validationError
protected Exception validationError(IOException e)
-
errorsAsXContent
public org.elasticsearch.xcontent.XContentBuilder errorsAsXContent(org.elasticsearch.rest.RestChannel channel)
-
hasParams
protected final boolean hasParams()
-
-