use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.config.rev171025.PcepNodeConfig 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;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.config.rev171025.PcepNodeConfig in project bgpcep by opendaylight.
the class PCEPTopologyProviderUtil method contructKeys.
static KeyMapping contructKeys(@Nonnull final Topology topology) {
final KeyMapping ret = KeyMapping.getKeyMapping();
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().getPassword() != null).filter(node -> !node.getAugmentation(PcepNodeConfig.class).getSessionConfig().getPassword().getValue().isEmpty()).forEach(node -> {
final PcepNodeConfig config = node.getAugmentation(PcepNodeConfig.class);
final Rfc2385Key rfc2385KeyPassword = config.getSessionConfig().getPassword();
final InetAddress address = InetAddresses.forString(node.getNodeId().getValue());
ret.put(address, rfc2385KeyPassword.getValue().getBytes(StandardCharsets.US_ASCII));
});
return ret;
}
Aggregations