- if (maybeTCPAddress.isPresent()) {
- Optional<SSLContext> maybeSSLContext = Optional.absent();
- InetSocketAddress address = maybeTCPAddress.get();
- NetconfServerDispatcher.ServerSslChannelInitializer serverChannelInitializer = new NetconfServerDispatcher.ServerSslChannelInitializer(
- maybeSSLContext, serverNegotiatorFactory, listenerFactory);
- dispatch = new NetconfServerDispatcher(serverChannelInitializer, eventLoopGroup, eventLoopGroup);
-
- logger.info("Starting TCP netconf server at {}", address);
- dispatch.createServer(address);
- }
- if (maybeTLSConfiguration.isPresent()) {
- Optional<SSLContext> maybeSSLContext = Optional.of(maybeTLSConfiguration.get().getSslContext());
- InetSocketAddress address = maybeTLSConfiguration.get().getAddress();
- NetconfServerDispatcher.ServerSslChannelInitializer serverChannelInitializer = new NetconfServerDispatcher.ServerSslChannelInitializer(
- maybeSSLContext, serverNegotiatorFactory, listenerFactory);
- dispatch = new NetconfServerDispatcher(serverChannelInitializer, eventLoopGroup, eventLoopGroup);
-
- logger.info("Starting TLS netconf server at {}", address);
- dispatch.createServer(address);
- }
+ NetconfServerDispatcher.ServerChannelInitializer serverChannelInitializer = new NetconfServerDispatcher.ServerChannelInitializer(
+ serverNegotiatorFactory);
+
+ NetconfServerDispatcher dispatch = new NetconfServerDispatcher(serverChannelInitializer, eventLoopGroup,
+ eventLoopGroup);
+
+ logger.info("Starting TCP netconf server at {}", address);
+ dispatch.createServer(address);
+
+ context.registerService(NetconfOperationProvider.class, factoriesListener, null);
+ }
+
+ private void startOperationServiceFactoryTracker(final BundleContext context, final NetconfOperationServiceFactoryListenerImpl factoriesListener) {
+ factoriesTracker = new NetconfOperationServiceFactoryTracker(context, factoriesListener);
+ factoriesTracker.open();
+ }
+
+ private NetconfMonitoringServiceImpl startMonitoringService(final BundleContext context, final NetconfOperationServiceFactoryListenerImpl factoriesListener) {
+ final NetconfMonitoringServiceImpl netconfMonitoringServiceImpl = new NetconfMonitoringServiceImpl(factoriesListener);
+ final Dictionary<String, ?> dic = new Hashtable<>();
+ regMonitoring = context.registerService(NetconfMonitoringService.class, netconfMonitoringServiceImpl, dic);
+
+ return netconfMonitoringServiceImpl;