Search in sources :

Example 1 with SpeakerIdMapping

use of org.opendaylight.protocol.pcep.SpeakerIdMapping in project bgpcep by opendaylight.

the class PCEPTopologyProviderUtil method contructSpeakersId.

static SpeakerIdMapping contructSpeakersId(final Topology topology) {
    final SpeakerIdMapping ret = SpeakerIdMapping.getSpeakerIdMap();
    topology.getNode().stream().filter(Objects::nonNull).filter(node -> node.getAugmentation(PcepNodeConfig.class) != null).filter(node -> node.getAugmentation(PcepNodeConfig.class).getSessionConfig() != null).filter(node -> node.getAugmentation(PcepNodeConfig.class).getSessionConfig().getAugmentation(PcepNodeSyncConfig.class) != null).forEach(node -> {
        final PcepNodeConfig config = node.getAugmentation(PcepNodeConfig.class);
        final PcepNodeSyncConfig nodeSyncConfig = config.getSessionConfig().getAugmentation(PcepNodeSyncConfig.class);
        final InetAddress address = InetAddresses.forString(node.getNodeId().getValue());
        ret.put(address, nodeSyncConfig.getSpeakerEntityIdValue());
    });
    return ret;
}
Also used : PcepNodeSyncConfig(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.sync.optimizations.config.rev171025.PcepNodeSyncConfig) PcepNodeConfig(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.config.rev171025.PcepNodeConfig) Logger(org.slf4j.Logger) KeyMapping(org.opendaylight.protocol.concepts.KeyMapping) TopologyTypes1(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.TopologyTypes1) LoggerFactory(org.slf4j.LoggerFactory) Rfc2385Key(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.rfc2385.cfg.rev160324.Rfc2385Key) InetSocketAddress(java.net.InetSocketAddress) StandardCharsets(java.nio.charset.StandardCharsets) InetAddress(java.net.InetAddress) Objects(java.util.Objects) Topology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology) TopologyTypes(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.TopologyTypes) IetfInetUtil(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IetfInetUtil) PortNumber(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress) SpeakerIdMapping(org.opendaylight.protocol.pcep.SpeakerIdMapping) InetAddresses(com.google.common.net.InetAddresses) Nonnull(javax.annotation.Nonnull) Nullable(javax.annotation.Nullable) PcepNodeSyncConfig(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.sync.optimizations.config.rev171025.PcepNodeSyncConfig) SpeakerIdMapping(org.opendaylight.protocol.pcep.SpeakerIdMapping) Objects(java.util.Objects) PcepNodeConfig(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.config.rev171025.PcepNodeConfig) InetAddress(java.net.InetAddress)

Aggregations

InetAddresses (com.google.common.net.InetAddresses)1 InetAddress (java.net.InetAddress)1 InetSocketAddress (java.net.InetSocketAddress)1 StandardCharsets (java.nio.charset.StandardCharsets)1 Objects (java.util.Objects)1 Nonnull (javax.annotation.Nonnull)1 Nullable (javax.annotation.Nullable)1 KeyMapping (org.opendaylight.protocol.concepts.KeyMapping)1 SpeakerIdMapping (org.opendaylight.protocol.pcep.SpeakerIdMapping)1 IetfInetUtil (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IetfInetUtil)1 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)1 PortNumber (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber)1 Rfc2385Key (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.rfc2385.cfg.rev160324.Rfc2385Key)1 PcepNodeConfig (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.config.rev171025.PcepNodeConfig)1 TopologyTypes1 (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.TopologyTypes1)1 PcepNodeSyncConfig (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.sync.optimizations.config.rev171025.PcepNodeSyncConfig)1 Topology (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology)1 TopologyTypes (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.TopologyTypes)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1