Class ValidSubmissionPayload.SubmissionPayloadValidator
- java.lang.Object
-
- app.coronawarn.server.services.submission.validation.ValidSubmissionPayload.SubmissionPayloadValidator
-
- All Implemented Interfaces:
javax.validation.ConstraintValidator<ValidSubmissionPayload,SubmissionPayload>
- Enclosing class:
- ValidSubmissionPayload
public static class ValidSubmissionPayload.SubmissionPayloadValidator extends Object implements javax.validation.ConstraintValidator<ValidSubmissionPayload,SubmissionPayload>
-
-
Constructor Summary
Constructors Constructor Description SubmissionPayloadValidator(SubmissionServiceConfig submissionServiceConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isValid(SubmissionPayload submissionPayload, javax.validation.ConstraintValidatorContext validatorContext)
Validates the following constraints.
-
-
-
Constructor Detail
-
SubmissionPayloadValidator
public SubmissionPayloadValidator(SubmissionServiceConfig submissionServiceConfig)
-
-
Method Detail
-
isValid
public boolean isValid(SubmissionPayload submissionPayload, javax.validation.ConstraintValidatorContext validatorContext)
Validates the following constraints.- StartIntervalNumber values are always at midnight
- There must not be more than allowed maximum number of keys in a payload (see application.yaml/max-number-of-keys)
- The origin country can be missing or the provided value must be of the supported countries (see application.yaml).
- The visited countries can be missing or the provided values must be part of the supported countries.
- Either a value of accepted Transmission Risk Level or an accepted Days Since Onset Of Symptoms
must be present. If one value is missing, the other one can be derived
(see
DiagnosisKeyNormalizer
- Specified by:
isValid
in interfacejavax.validation.ConstraintValidator<ValidSubmissionPayload,SubmissionPayload>
-
-