use of net.ripe.rpki.validator3.api.slurm.dtos.SlurmLocallyAddedAssertions in project rpki-validator-3 by RIPE-NCC.
the class SlurmService method get.
public Slurm get() {
final Slurm slurm = new Slurm();
final SlurmLocallyAddedAssertions slurmLocallyAddedAssertions = new SlurmLocallyAddedAssertions();
slurmLocallyAddedAssertions.setPrefixAssertions(roaPrefixAssertionsService.all().map(a -> {
final SlurmPrefixAssertion prefixAssertion = new SlurmPrefixAssertion();
prefixAssertion.setAsn(a.getAsn());
prefixAssertion.setPrefix(a.getPrefix());
prefixAssertion.setMaxPrefixLength(a.getMaximumLength());
prefixAssertion.setComment(a.getComment());
return prefixAssertion;
}).collect(Collectors.toList()));
slurmLocallyAddedAssertions.setBgpsecAssertions(bgpSecAssertionsService.all().map(a -> {
final SlurmBgpSecAssertion bgpSecAssertion = new SlurmBgpSecAssertion();
bgpSecAssertion.setAsn(a.getAsn());
bgpSecAssertion.setSki(a.getSki());
bgpSecAssertion.setPublicKey(a.getPublicKey());
bgpSecAssertion.setComment(a.getComment());
return bgpSecAssertion;
}).collect(Collectors.toList()));
slurm.setLocallyAddedAssertions(slurmLocallyAddedAssertions);
final SlurmOutputFilters filters = new SlurmOutputFilters();
filters.setPrefixFilters(ignoreFilterService.all().map(f -> {
final SlurmPrefixFilter prefixFilter = new SlurmPrefixFilter();
prefixFilter.setAsn(f.getAsn());
prefixFilter.setPrefix(f.getPrefix());
prefixFilter.setComment(f.getComment());
return prefixFilter;
}).collect(Collectors.toList()));
filters.setBgpsecFilters(bgpSecFilterService.all().map(f -> {
final SlurmBgpSecFilter bgpSecFilter = new SlurmBgpSecFilter();
bgpSecFilter.setAsn(f.getAsn());
bgpSecFilter.setRouterSKI(f.getRouterSki());
bgpSecFilter.setComment(f.getComment());
return bgpSecFilter;
}).collect(Collectors.toList()));
slurm.setValidationOutputFilters(filters);
return slurm;
}
Aggregations