Search in sources :

Example 41 with TrustAnchor

use of net.ripe.rpki.validator3.domain.TrustAnchor in project rpki-validator-3 by RIPE-NCC.

the class TrustAnchorController method validationResults.

@GetMapping(path = "/{id}/validation-run")
public ResponseEntity<ApiResponse<ValidationRunResource>> validationResults(@PathVariable long id, HttpServletResponse response, Locale locale) throws IOException {
    TrustAnchor trustAnchor = trustAnchorRepository.get(id);
    ValidationRun validationRun = validationRunRepository.findLatestCompletedForTrustAnchor(trustAnchor).orElseThrow(() -> new EmptyResultDataAccessException("latest validation run for trust anchor " + id, 1));
    response.sendRedirect(linkTo(methodOn(ValidationRunController.class).get(validationRun.getId(), locale)).toString());
    return null;
}
Also used : ValidationRun(net.ripe.rpki.validator3.domain.ValidationRun) TrustAnchorValidationRun(net.ripe.rpki.validator3.domain.TrustAnchorValidationRun) TrustAnchor(net.ripe.rpki.validator3.domain.TrustAnchor) EmptyResultDataAccessException(org.springframework.dao.EmptyResultDataAccessException) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 42 with TrustAnchor

use of net.ripe.rpki.validator3.domain.TrustAnchor in project rpki-validator-3 by RIPE-NCC.

the class TrustAnchorService method remove.

public void remove(long trustAnchorId) {
    TrustAnchor trustAnchor = trustAnchors.get(trustAnchorId);
    validationRunRepository.removeAllForTrustAnchor(trustAnchor);
    rpkiRepositories.removeAllForTrustAnchor(trustAnchor);
    trustAnchors.remove(trustAnchor);
    validatedRpkiObjects.remove(trustAnchor);
}
Also used : TrustAnchor(net.ripe.rpki.validator3.domain.TrustAnchor)

Aggregations

TrustAnchor (net.ripe.rpki.validator3.domain.TrustAnchor)36 IntegrationTest (net.ripe.rpki.validator3.IntegrationTest)23 RpkiRepository (net.ripe.rpki.validator3.domain.RpkiRepository)23 Test (org.junit.Test)23 RpkiObject (net.ripe.rpki.validator3.domain.RpkiObject)15 RpkiObjects (net.ripe.rpki.validator3.domain.RpkiObjects)15 ValidationCheck (net.ripe.rpki.validator3.domain.ValidationCheck)14 CertificateTreeValidationRun (net.ripe.rpki.validator3.domain.CertificateTreeValidationRun)10 RrdpRepositoryValidationRun (net.ripe.rpki.validator3.domain.RrdpRepositoryValidationRun)10 Autowired (org.springframework.beans.factory.annotation.Autowired)10 List (java.util.List)9 Transactional (javax.transaction.Transactional)9 TestObjects (net.ripe.rpki.validator3.TestObjects)9 URI (java.net.URI)8 ValidationResult (net.ripe.rpki.commons.validation.ValidationResult)8 EntityManager (javax.persistence.EntityManager)7 Optional (java.util.Optional)6 RpkiRepositories (net.ripe.rpki.validator3.domain.RpkiRepositories)6 TrustAnchors (net.ripe.rpki.validator3.domain.TrustAnchors)6 ValidationRuns (net.ripe.rpki.validator3.domain.ValidationRuns)6