@Test public void should_register_rpki_repositories() { TrustAnchor ta = factory.createRipeNccTrustAnchor(); wtx(tx -> this.getTrustAnchors().add(tx, ta)); subject.validate(ta.key().asLong()); List<CertificateTreeValidationRun> completed = rtx(tx -> this.getValidationRuns().findAll(tx, CertificateTreeValidationRun.class)); assertThat(completed).hasSize(1); CertificateTreeValidationRun result = completed.get(0); assertThat(result.getStatus()).isEqualTo(SUCCEEDED); rtx0(tx -> { final List<RpkiRepository> all = this.getRpkiRepositories().findAll(tx, ta.key()).collect(toList()); assertEquals(RpkiRepository.Status.PENDING, all.get(0).getStatus()); assertEquals("https: assertThat(ta.isInitialCertificateTreeValidationRunCompleted()).as("trust anchor initial validation run completed").isFalse(); assertThat(this.getSettings().isInitialValidationRunCompleted(tx)).as("validator initial validation run completed").isFalse(); }); }
public void validate(long trustAnchorId) { Optional<TrustAnchor> maybeTrustAnchor = storage.readTx(tx -> trustAnchors.get(tx, Key.of(trustAnchorId))); if (maybeTrustAnchor.isPresent()) { final TrustAnchor trustAnchor = maybeTrustAnchor.get(); Bench.mark0("validateTa " + trustAnchor.getName(), () -> validateTa(trustAnchor)); } else { log.error("Couldn't find trust anchor {}", trustAnchorId); } }
CertificateTreeValidationService { public void validate(long trustAnchorId) { Optional<TrustAnchor> maybeTrustAnchor = storage.readTx(tx -> trustAnchors.get(tx, Key.of(trustAnchorId))); if (maybeTrustAnchor.isPresent()) { final TrustAnchor trustAnchor = maybeTrustAnchor.get(); Bench.mark0("validateTa " + trustAnchor.getName(), () -> validateTa(trustAnchor)); } else { log.error("Couldn't find trust anchor {}", trustAnchorId); } } }
CertificateTreeValidationService { public void validate(long trustAnchorId) { Optional<TrustAnchor> maybeTrustAnchor = storage.readTx(tx -> trustAnchors.get(tx, Key.of(trustAnchorId))); if (maybeTrustAnchor.isPresent()) { final TrustAnchor trustAnchor = maybeTrustAnchor.get(); Bench.mark0("validateTa " + trustAnchor.getName(), () -> validateTa(trustAnchor)); } else { log.error("Couldn't find trust anchor {}", trustAnchorId); } } @Autowired  CertificateTreeValidationService(RpkiObjects rpkiObjects,
                                            RpkiRepositories rpkiRepositories,
                                            Settings settings,
                                            ValidationScheduler validationScheduler,
                                            ValidationRuns validationRuns,
                                            TrustAnchors trustAnchors,
                                            ValidatedRpkiObjects validatedRpkiObjects,
                                            Storage storage,
                                            TrustAnchorState trustAnchorState,
                                            TrustAnchorMetricsService taMetricsService,
                                            ValidationConfig validationConfig); }
CertificateTreeValidationService { public void validate(long trustAnchorId) { Optional<TrustAnchor> maybeTrustAnchor = storage.readTx(tx -> trustAnchors.get(tx, Key.of(trustAnchorId))); if (maybeTrustAnchor.isPresent()) { final TrustAnchor trustAnchor = maybeTrustAnchor.get(); Bench.mark0("validateTa " + trustAnchor.getName(), () -> validateTa(trustAnchor)); } else { log.error("Couldn't find trust anchor {}", trustAnchorId); } } @Autowired  CertificateTreeValidationService(RpkiObjects rpkiObjects,
                                            RpkiRepositories rpkiRepositories,
                                            Settings settings,
                                            ValidationScheduler validationScheduler,
                                            ValidationRuns validationRuns,
                                            TrustAnchors trustAnchors,
                                            ValidatedRpkiObjects validatedRpkiObjects,
                                            Storage storage,
                                            TrustAnchorState trustAnchorState,
                                            TrustAnchorMetricsService taMetricsService,
                                            ValidationConfig validationConfig); void validate(long trustAnchorId); }
CertificateTreeValidationService { public void validate(long trustAnchorId) { Optional<TrustAnchor> maybeTrustAnchor = storage.readTx(tx -> trustAnchors.get(tx, Key.of(trustAnchorId))); if (maybeTrustAnchor.isPresent()) { final TrustAnchor trustAnchor = maybeTrustAnchor.get(); Bench.mark0("validateTa " + trustAnchor.getName(), () -> validateTa(trustAnchor)); } else { log.error("Couldn't find trust anchor {}", trustAnchorId); } } @Autowired  CertificateTreeValidationService(RpkiObjects rpkiObjects,
                                            RpkiRepositories rpkiRepositories,
                                            Settings settings,
                                            ValidationScheduler validationScheduler,
                                            ValidationRuns validationRuns,
                                            TrustAnchors trustAnchors,
                                            ValidatedRpkiObjects validatedRpkiObjects,
                                            Storage storage,
                                            TrustAnchorState trustAnchorState,
                                            TrustAnchorMetricsService taMetricsService,
                                            ValidationConfig validationConfig); void validate(long trustAnchorId); final long LONG_DURATION_WARNING_MS; }