Search in sources :

Example 1 with SlurmLocallyAddedAssertions

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;
}
Also used : SlurmPrefixAssertion(net.ripe.rpki.validator3.api.slurm.dtos.SlurmPrefixAssertion) Slurm(net.ripe.rpki.validator3.api.slurm.dtos.Slurm) SlurmBgpSecFilter(net.ripe.rpki.validator3.api.slurm.dtos.SlurmBgpSecFilter) SlurmLocallyAddedAssertions(net.ripe.rpki.validator3.api.slurm.dtos.SlurmLocallyAddedAssertions) SlurmOutputFilters(net.ripe.rpki.validator3.api.slurm.dtos.SlurmOutputFilters) SlurmPrefixFilter(net.ripe.rpki.validator3.api.slurm.dtos.SlurmPrefixFilter) SlurmBgpSecAssertion(net.ripe.rpki.validator3.api.slurm.dtos.SlurmBgpSecAssertion)

Aggregations

Slurm (net.ripe.rpki.validator3.api.slurm.dtos.Slurm)1 SlurmBgpSecAssertion (net.ripe.rpki.validator3.api.slurm.dtos.SlurmBgpSecAssertion)1 SlurmBgpSecFilter (net.ripe.rpki.validator3.api.slurm.dtos.SlurmBgpSecFilter)1 SlurmLocallyAddedAssertions (net.ripe.rpki.validator3.api.slurm.dtos.SlurmLocallyAddedAssertions)1 SlurmOutputFilters (net.ripe.rpki.validator3.api.slurm.dtos.SlurmOutputFilters)1 SlurmPrefixAssertion (net.ripe.rpki.validator3.api.slurm.dtos.SlurmPrefixAssertion)1 SlurmPrefixFilter (net.ripe.rpki.validator3.api.slurm.dtos.SlurmPrefixFilter)1