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.api.monitoring.NetconfMonitoringService;
5 import org.opendaylight.controller.netconf.impl.CommitNotifier;
6 import org.opendaylight.controller.netconf.impl.NetconfServerDispatcherImpl;
7 import org.opendaylight.controller.netconf.impl.NetconfServerSessionNegotiatorFactory;
8 import org.opendaylight.controller.netconf.impl.SessionIdProvider;
9 import org.opendaylight.controller.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
10 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory;
12 public class NetconfServerDispatcherModule extends org.opendaylight.controller.config.yang.config.netconf.northbound.impl.AbstractNetconfServerDispatcherModule {
13 public NetconfServerDispatcherModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
14 super(identifier, dependencyResolver);
17 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) {
18 super(identifier, dependencyResolver, oldModule, oldInstance);
22 public void customValidation() {
23 JmxAttributeValidationException.checkCondition(getConnectionTimeoutMillis() > 0, "Invalid connection timeout", connectionTimeoutMillisJmxAttribute);
27 public java.lang.AutoCloseable createInstance() {
29 final AggregatedNetconfOperationServiceFactory aggregatedOpProvider = getAggregatedOpProvider();
30 final NetconfMonitoringService monitoringService = getServerMonitorDependency();
31 final NetconfServerSessionNegotiatorFactory serverNegotiatorFactory = new NetconfServerSessionNegotiatorFactory(
32 getTimerDependency(), aggregatedOpProvider, new SessionIdProvider(), getConnectionTimeoutMillis(), CommitNotifier.NoopCommitNotifier.getInstance(), monitoringService);
33 final NetconfServerDispatcherImpl.ServerChannelInitializer serverChannelInitializer = new NetconfServerDispatcherImpl.ServerChannelInitializer(
34 serverNegotiatorFactory);
36 return new NetconfServerDispatcherImpl(serverChannelInitializer, getBossThreadGroupDependency(), getWorkerThreadGroupDependency()) {
40 // NOOP, close should not be present here, the deprecated method closes injected evet loop groups
46 private AggregatedNetconfOperationServiceFactory getAggregatedOpProvider() {
47 final AggregatedNetconfOperationServiceFactory netconfOperationProvider = new AggregatedNetconfOperationServiceFactory();
48 for (final NetconfOperationServiceFactory netconfOperationServiceFactory : getMappersDependency()) {
49 netconfOperationProvider.onAddNetconfOperationServiceFactory(netconfOperationServiceFactory);
51 return netconfOperationProvider;