use of net.ripe.rpki.validator3.api.bgpsec.AddBgpSecAssertion in project rpki-validator-3 by RIPE-NCC.
the class SlurmService method process.
@Transactional(Transactional.TxType.REQUIRED)
public void process(final Slurm slurm) {
if (slurm.getLocallyAddedAssertions() != null && slurm.getLocallyAddedAssertions().getPrefixAssertions() != null) {
roaPrefixAssertionsService.clear();
slurm.getLocallyAddedAssertions().getPrefixAssertions().forEach(prefixAsertion -> {
final AddRoaPrefixAssertion add = AddRoaPrefixAssertion.builder().asn(prefixAsertion.getAsn() == null ? null : prefixAsertion.getAsn().toString()).prefix(prefixAsertion.getPrefix()).maximumLength(prefixAsertion.getMaxPrefixLength()).comment(prefixAsertion.getComment()).build();
roaPrefixAssertionsService.execute(add);
});
}
if (slurm.getValidationOutputFilters() != null && slurm.getValidationOutputFilters().getPrefixFilters() != null) {
ignoreFilterService.clear();
slurm.getValidationOutputFilters().getPrefixFilters().forEach(prefixFilter -> {
final AddIgnoreFilter addIgnoreFilter = AddIgnoreFilter.builder().asn(prefixFilter.getAsn() == null ? null : prefixFilter.getAsn().toString()).prefix(prefixFilter.getPrefix()).comment(prefixFilter.getComment()).build();
ignoreFilterService.execute(addIgnoreFilter);
});
}
if (slurm.getLocallyAddedAssertions() != null && slurm.getLocallyAddedAssertions().getBgpsecAssertions() != null) {
bgpSecAssertionsService.clear();
slurm.getLocallyAddedAssertions().getBgpsecAssertions().forEach(bgpSecAssertion -> {
AddBgpSecAssertion add = AddBgpSecAssertion.builder().asn(bgpSecAssertion.getAsn() == null ? null : bgpSecAssertion.getAsn().toString()).publicKey(bgpSecAssertion.getPublicKey()).ski(bgpSecAssertion.getSki()).comment(bgpSecAssertion.getComment()).build();
bgpSecAssertionsService.execute(add);
});
}
if (slurm.getValidationOutputFilters() != null && slurm.getValidationOutputFilters().getBgpsecFilters() != null) {
bgpSecFilterService.clear();
slurm.getValidationOutputFilters().getBgpsecFilters().forEach(bgpSecFilter -> {
AddBgpSecFilter add = AddBgpSecFilter.builder().asn(bgpSecFilter.getAsn() == null ? null : bgpSecFilter.getAsn().toString()).routerSki(bgpSecFilter.getRouterSKI()).comment(bgpSecFilter.getComment()).build();
bgpSecFilterService.execute(add);
});
}
}
Aggregations