use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.config.rev200120.odl.bmp.monitors.bmp.monitor.config.MonitoredRouter in project bgpcep by opendaylight.
the class KeyConstructorUtil method constructKeys.
public static KeyMapping constructKeys(final List<MonitoredRouter> mrs) {
final KeyMapping ret = KeyMapping.getKeyMapping();
if (mrs != null) {
mrs.stream().filter(Objects::nonNull).filter(KeyConstructorUtil::isNotNullorEmpty).forEach(mr -> {
final Rfc2385Key rfc2385KeyPassword = mr.getPassword();
ret.put(IetfInetUtil.INSTANCE.inetAddressFor(mr.getAddress()), rfc2385KeyPassword.getValue().getBytes(StandardCharsets.US_ASCII));
});
}
return ret;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.config.rev200120.odl.bmp.monitors.bmp.monitor.config.MonitoredRouter in project bgpcep by opendaylight.
the class BmpMonitoringStationImpl method connectMonitoredRouters.
private void connectMonitoredRouters(final BmpDispatcher pdispatcher) {
if (monitoredRouters != null) {
for (final MonitoredRouter mr : monitoredRouters) {
if (mr.getActive()) {
requireNonNull(mr.getAddress());
requireNonNull(mr.getPort());
final String s = mr.getAddress().getIpv4AddressNoZone().getValue();
final InetAddress addr = InetAddresses.forString(s);
final KeyMapping ret;
final Rfc2385Key rfc2385KeyPassword = mr.getPassword();
ret = KeyMapping.of(addr, rfc2385KeyPassword.getValue());
pdispatcher.createClient(Ipv4Util.toInetSocketAddress(mr.getAddress(), mr.getPort()), sessionManager, ret);
}
}
}
}
Aggregations