use of net.ripe.rpki.validator3.domain.RpkiRepositoryValidationRun in project rpki-validator-3 by RIPE-NCC.
the class RrdpService method addRpkiObject.
private void addRpkiObject(RpkiRepositoryValidationRun validationRun, String uri, DeltaPublish deltaPublish, final byte[] existingHash) {
final Either<ValidationResult, RpkiObject> maybeRpkiObject = createRpkiObject(uri, deltaPublish.getContent());
if (maybeRpkiObject.isLeft()) {
validationRun.addChecks(maybeRpkiObject.left().value());
} else {
RpkiObject object = maybeRpkiObject.right().value();
if (existingHash == null || !Arrays.equals(object.getSha256(), existingHash)) {
validationRun.addRpkiObject(object);
rpkiObjectRepository.add(object);
} else {
log.debug("The object added is the same {}", object);
}
log.debug("Added to database {}", object);
}
}
Aggregations