Search in sources :

Example 1 with ValidationRunResource

use of net.ripe.rpki.validator3.api.validationruns.ValidationRunResource 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)

Aggregations

TrustAnchor (net.ripe.rpki.validator3.domain.TrustAnchor)1 TrustAnchorValidationRun (net.ripe.rpki.validator3.domain.TrustAnchorValidationRun)1 ValidationRun (net.ripe.rpki.validator3.domain.ValidationRun)1 EmptyResultDataAccessException (org.springframework.dao.EmptyResultDataAccessException)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1