Search in sources :

Example 1 with BmpMonitoringStationImpl

use of org.opendaylight.protocol.bmp.impl.app.BmpMonitoringStationImpl in project bgpcep by opendaylight.

the class BmpDeployerImpl method updateBmpMonitor.

@SuppressWarnings("checkstyle:IllegalCatch")
private synchronized void updateBmpMonitor(final BmpMonitorConfig bmpConfig) {
    final MonitorId monitorId = bmpConfig.getMonitorId();
    final BmpMonitoringStationImpl oldService = this.bmpMonitorServices.remove(monitorId);
    try {
        if (oldService != null) {
            oldService.closeServiceInstance().get(TIMEOUT_NS, TimeUnit.NANOSECONDS);
            oldService.close();
        }
        final Server server = bmpConfig.getServer();
        final InetSocketAddress inetAddress = Ipv4Util.toInetSocketAddress(server.getBindingAddress(), server.getBindingPort());
        final BmpMonitoringStationImpl monitor = new BmpMonitoringStationImpl(this.bmpDeployerDependencies, this.dispatcher, monitorId, inetAddress, bmpConfig.getMonitoredRouter());
        this.bmpMonitorServices.put(monitorId, monitor);
    } catch (final Exception e) {
        LOG.error("Failed to create Bmp Monitor {}.", monitorId, e);
    }
}
Also used : Server(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.config.rev171207.server.config.Server) InetSocketAddress(java.net.InetSocketAddress) MonitorId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.rev171207.MonitorId) BmpMonitoringStationImpl(org.opendaylight.protocol.bmp.impl.app.BmpMonitoringStationImpl)

Aggregations

InetSocketAddress (java.net.InetSocketAddress)1 BmpMonitoringStationImpl (org.opendaylight.protocol.bmp.impl.app.BmpMonitoringStationImpl)1 Server (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.config.rev171207.server.config.Server)1 MonitorId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.rev171207.MonitorId)1