1 package org.opendaylight.controller.config.yang.config.netconf.northbound.impl;
3 import org.opendaylight.controller.config.api.JmxAttributeValidationException;
4 import org.opendaylight.controller.netconf.impl.CommitNotifier;
5 import org.opendaylight.controller.netconf.impl.NetconfServerDispatcherImpl;
6 import org.opendaylight.controller.netconf.impl.NetconfServerSessionNegotiatorFactory;
7 import org.opendaylight.controller.netconf.impl.SessionIdProvider;
8 import org.opendaylight.controller.netconf.impl.osgi.NetconfMonitoringServiceImpl;
9 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl;
10 import org.opendaylight.controller.netconf.impl.osgi.SessionMonitoringService;
11 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory;
13 public class NetconfServerDispatcherModule extends org.opendaylight.controller.config.yang.config.netconf.northbound.impl.AbstractNetconfServerDispatcherModule {
14 public NetconfServerDispatcherModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
15 super(identifier, dependencyResolver);
18 public NetconfServerDispatcherModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.netconf.northbound.impl.NetconfServerDispatcherModule oldModule, java.lang.AutoCloseable oldInstance) {
19 super(identifier, dependencyResolver, oldModule, oldInstance);
23 public void customValidation() {
24 JmxAttributeValidationException.checkCondition(getConnectionTimeoutMillis() > 0, "Invalid connection timeout", connectionTimeoutMillisJmxAttribute);
28 public java.lang.AutoCloseable createInstance() {
30 final NetconfOperationServiceFactoryListenerImpl aggregatedOpProvider = getAggregatedOpProvider();
31 final SessionMonitoringService monitoringService = startMonitoringService(aggregatedOpProvider);
32 final NetconfServerSessionNegotiatorFactory serverNegotiatorFactory = new NetconfServerSessionNegotiatorFactory(
33 getTimerDependency(), aggregatedOpProvider, new SessionIdProvider(), getConnectionTimeoutMillis(), CommitNotifier.NoopCommitNotifier.getInstance(), monitoringService);
34 final NetconfServerDispatcherImpl.ServerChannelInitializer serverChannelInitializer = new NetconfServerDispatcherImpl.ServerChannelInitializer(
35 serverNegotiatorFactory);
37 return new NetconfServerDispatcherImpl(serverChannelInitializer, getBossThreadGroupDependency(), getWorkerThreadGroupDependency()) {
41 // NOOP, close should not be present here, the deprecated method closes injected evet loop groups
47 private NetconfMonitoringServiceImpl startMonitoringService(final NetconfOperationServiceFactoryListenerImpl netconfOperationProvider) {
48 return new NetconfMonitoringServiceImpl(netconfOperationProvider);
51 private NetconfOperationServiceFactoryListenerImpl getAggregatedOpProvider() {
52 final NetconfOperationServiceFactoryListenerImpl netconfOperationProvider = new NetconfOperationServiceFactoryListenerImpl();
53 for (final NetconfOperationServiceFactory netconfOperationServiceFactory : getMappersDependency()) {
54 netconfOperationProvider.onAddNetconfOperationServiceFactory(netconfOperationServiceFactory);
56 return netconfOperationProvider;