use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.config.rev171207.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.rev171207.odl.bmp.monitors.bmp.monitor.config.MonitoredRouter in project bgpcep by opendaylight.
the class BmpMonitoringStationImpl method connectMonitoredRouters.
private void connectMonitoredRouters(final BmpDispatcher pdispatcher) {
if (this.monitoredRouters != null) {
for (final MonitoredRouter mr : this.monitoredRouters) {
if (mr.isActive()) {
requireNonNull(mr.getAddress());
requireNonNull(mr.getPort());
final String s = mr.getAddress().getIpv4Address().getValue();
final InetAddress addr = InetAddresses.forString(s);
final KeyMapping ret;
final Rfc2385Key rfc2385KeyPassword = mr.getPassword();
ret = KeyMapping.getKeyMapping(addr, rfc2385KeyPassword.getValue());
pdispatcher.createClient(Ipv4Util.toInetSocketAddress(mr.getAddress(), mr.getPort()), this.sessionManager, ret);
}
}
}
}
Aggregations