Module org.elasticsearch.xcore
Class SourceDestValidator
java.lang.Object
org.elasticsearch.xpack.core.common.validation.SourceDestValidator
Validation of source indexes and destination index.
Validations are separated into validators to choose from, e.g. you want to run different types of validations for
preview/create/start with or without support for remote clusters
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final SourceDestValidator.SourceDestValidationstatic final SourceDestValidator.SourceDestValidationstatic final SourceDestValidator.SourceDestValidationstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final SourceDestValidator.SourceDestValidationstatic final Stringstatic final SourceDestValidator.SourceDestValidationstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionSourceDestValidator(IndexNameExpressionResolver indexNameExpressionResolver, RemoteClusterService remoteClusterService, RemoteClusterLicenseChecker remoteClusterLicenseChecker, IngestService ingestService, String nodeName, String license) Create a new Source Dest Validator -
Method Summary
Modifier and TypeMethodDescriptionvoidvalidate(ClusterState clusterState, String[] source, String destIndex, String destPipeline, List<SourceDestValidator.SourceDestValidation> validations, ActionListener<Boolean> listener) Run validation against source and destIndex.validateRequest(ActionRequestValidationException validationException, String destIndex) Validate request.
-
Field Details
-
SOURCE_INDEX_MISSING
- See Also:
-
DEST_IN_SOURCE
- See Also:
-
DEST_LOWERCASE
- See Also:
-
NEEDS_REMOTE_CLUSTER_SEARCH
-
ERROR_REMOTE_CLUSTER_SEARCH
- See Also:
-
UNKNOWN_REMOTE_CLUSTER_LICENSE
- See Also:
-
FEATURE_NOT_LICENSED_REMOTE_CLUSTER_LICENSE
- See Also:
-
REMOTE_CLUSTER_LICENSE_INACTIVE
- See Also:
-
REMOTE_SOURCE_INDICES_NOT_SUPPORTED
- See Also:
-
REMOTE_CLUSTERS_TRANSPORT_TOO_OLD
- See Also:
-
PIPELINE_MISSING
- See Also:
-
SOURCE_MISSING_VALIDATION
-
DESTINATION_IN_SOURCE_VALIDATION
-
DESTINATION_SINGLE_INDEX_VALIDATION
-
REMOTE_SOURCE_NOT_SUPPORTED_VALIDATION
-
DESTINATION_PIPELINE_MISSING_VALIDATION
public static final SourceDestValidator.SourceDestValidation DESTINATION_PIPELINE_MISSING_VALIDATION
-
-
Constructor Details
-
SourceDestValidator
public SourceDestValidator(IndexNameExpressionResolver indexNameExpressionResolver, RemoteClusterService remoteClusterService, RemoteClusterLicenseChecker remoteClusterLicenseChecker, IngestService ingestService, String nodeName, String license) Create a new Source Dest Validator- Parameters:
indexNameExpressionResolver- A valid IndexNameExpressionResolver objectremoteClusterService- A valid RemoteClusterService objectremoteClusterLicenseChecker- A RemoteClusterLicenseChecker or null if CCS is disablednodeName- the name of this nodelicense- the license of the feature validated for
-
-
Method Details
-
validate
public void validate(ClusterState clusterState, String[] source, String destIndex, @Nullable String destPipeline, List<SourceDestValidator.SourceDestValidation> validations, ActionListener<Boolean> listener) Run validation against source and destIndex.- Parameters:
clusterState- The current ClusterStatesource- an array of source indexesdestIndex- destination indexdestPipeline- destination pipelinevalidations- list of of validations to runlistener- result listener
-
validateRequest
public static ActionRequestValidationException validateRequest(@Nullable ActionRequestValidationException validationException, @Nullable String destIndex) Validate request. This runs a couple of simple validations at request time, to be executed from aActionRequest} implementation. Note: Source can not be validated at request time as it might contain expressions.- Parameters:
validationException- an ActionRequestValidationException for collection validation problem, can be nulldestIndex- destination index, null if validation shall be skipped
-