Package com.yahoo.config.application.api
Class ValidationOverrides
java.lang.Object
com.yahoo.config.application.api.ValidationOverrides
A set of allows which suppresses specific validations in limited time periods.
This is useful to be able to complete a deployment in cases where the application
owner believes that the changes to be deployed have acceptable consequences.
Immutable.
- Author:
- bratseth
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA validation override which allows a particular change.static classA deployment validation exception. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionValidationOverrides(List<ValidationOverrides.Allow> overrides) Creates a validation overrides which does not have an XML form -
Method Summary
Modifier and TypeMethodDescriptionbooleanallows(ValidationId validationId, Instant now) Returns whether the given (assumed invalid) change is allowed by this at the momentstatic ValidationOverridesReturns a ValidationOverrides instance with the content of the given Reader.static ValidationOverridesReturns a ValidationOverrides instance with the content of the given XML string.voidinvalid(ValidationId validationId, String message, Instant now) Throws a ValidationException unless this validation is overridden at this timevoidinvalid(Map<ValidationId, ? extends Collection<String>> messagesByValidationId, Instant now) Throws a ValidationException unless all given validation is overridden at this timeinvalidException(Map<ValidationId, ? extends Collection<String>> messagesByValidationId, Instant now) static StringbooleanValidates overrides (checks 'until' date')voidValidates overrides (checks 'until' date')xmlForm()Returns the XML form of this, or null if it was not created by fromXml, nor is empty
-
Field Details
-
empty
-
-
Constructor Details
-
ValidationOverrides
Creates a validation overrides which does not have an XML form
-
-
Method Details
-
invalid
public void invalid(Map<ValidationId, ? extends Collection<String>> messagesByValidationId, Instant now) Throws a ValidationException unless all given validation is overridden at this time -
invalid
Throws a ValidationException unless this validation is overridden at this time -
invalidException
public Optional<ValidationOverrides.ValidationException> invalidException(Map<ValidationId, ? extends Collection<String>> messagesByValidationId, Instant now) -
allows
Returns whether the given (assumed invalid) change is allowed by this at the moment -
validate
Validates overrides (checks 'until' date') -
validate
Validates overrides (checks 'until' date') -
xmlForm
Returns the XML form of this, or null if it was not created by fromXml, nor is empty -
toAllowMessage
-
fromXml
Returns a ValidationOverrides instance with the content of the given Reader.- Parameters:
reader- the reader containing a validation-overrides XML structure- Returns:
- a ValidationOverrides from the argument
- Throws:
IllegalArgumentException- if the validation-allows.xml file exists but is invalid
-
fromXml
Returns a ValidationOverrides instance with the content of the given XML string. An empty ValidationOverrides is returned if the argument is empty.- Parameters:
xmlForm- the string which optionally contains a validation-overrides XML structure- Returns:
- a ValidationOverrides from the argument
- Throws:
IllegalArgumentException- if the validation-allows.xml file exists but is invalid
-