C
- the type of configuration to be validatedpublic interface ConfigValidator<C extends Configuration>
ConfigurationValidation
interface should be implemented by any class which intends to
validate a new Configuration
, either on its own, or w.r.t. a prior Configuration
.Modifier and Type | Method and Description |
---|---|
java.util.Collection<ConfigValidationError> |
validate(java.util.Optional<C> oldConfig,
C newConfig)
Returns
List of ConfigurationValidationError s for the newly supplied
Configuration object. |
java.util.Collection<ConfigValidationError> validate(java.util.Optional<C> oldConfig, C newConfig)
List
of ConfigurationValidationError
s for the newly supplied
Configuration
object.
A validation can validate a newConfig in following ways:
1. Validate newConfig parameters against the oldConfig paramater.
Ex: If DiskType was ROOT in oldConfig, then it cannot be changed to, ex: MOUNT, in the newConfig.
2. Validate just newConfig parameter(s). Ex: CPU value > 0oldConfig
- Currently persisted Configuration, or an empty Optional
if none is available
(first launch of service)newConfig
- Proposed new Configuration