</bean>
<bean id="serverChannelInitializer"
- class="org.opendaylight.netconf.impl.NetconfServerDispatcherImpl.ServerChannelInitializer">
+ class="org.opendaylight.netconf.impl.ServerChannelInitializer">
<argument ref="netconfServerSessionNegotiatorFactory"/>
</bean>
<version>1.6.0-SNAPSHOT</version>
<description>Configuration files for netconf</description>
<packaging>bundle</packaging>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Import-Package>
- org.opendaylight.controller.config.threadpool.util,
- org.opendaylight.controller.config.threadpool,
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
*/
package org.opendaylight.netconf.impl;
-import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.local.LocalAddress;
import io.netty.channel.local.LocalServerChannel;
-import io.netty.util.concurrent.Promise;
import java.net.InetSocketAddress;
import org.opendaylight.netconf.api.NetconfServerDispatcher;
-import org.opendaylight.netconf.impl.util.DeserializerExceptionHandler;
-import org.opendaylight.netconf.nettyutil.AbstractChannelInitializer;
import org.opendaylight.netconf.nettyutil.AbstractNetconfDispatcher;
public class NetconfServerDispatcherImpl extends AbstractNetconfDispatcher<NetconfServerSession,
public ChannelFuture createLocalServer(LocalAddress address) {
return super.createServer(address, LocalServerChannel.class, initializer::initialize);
}
-
- public static class ServerChannelInitializer extends AbstractChannelInitializer<NetconfServerSession> {
-
- public static final String DESERIALIZER_EX_HANDLER_KEY = "deserializerExHandler";
-
- private final NetconfServerSessionNegotiatorFactory negotiatorFactory;
-
-
- public ServerChannelInitializer(NetconfServerSessionNegotiatorFactory negotiatorFactory) {
- this.negotiatorFactory = negotiatorFactory;
-
- }
-
- @Override
- protected void initializeMessageDecoder(Channel ch) {
- super.initializeMessageDecoder(ch);
- ch.pipeline().addLast(DESERIALIZER_EX_HANDLER_KEY, new DeserializerExceptionHandler());
- }
-
- @Override
- protected void initializeSessionNegotiator(Channel ch, Promise<NetconfServerSession> promise) {
- ch.pipeline().addAfter(DESERIALIZER_EX_HANDLER_KEY, AbstractChannelInitializer.NETCONF_SESSION_NEGOTIATOR,
- negotiatorFactory.getSessionNegotiator(null, ch, promise));
- }
- }
}
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.netconf.impl;
+
+import io.netty.channel.Channel;
+import io.netty.util.concurrent.Promise;
+import org.opendaylight.netconf.impl.util.DeserializerExceptionHandler;
+import org.opendaylight.netconf.nettyutil.AbstractChannelInitializer;
+
+public class ServerChannelInitializer extends AbstractChannelInitializer<NetconfServerSession> {
+
+ public static final String DESERIALIZER_EX_HANDLER_KEY = "deserializerExHandler";
+
+ private final NetconfServerSessionNegotiatorFactory negotiatorFactory;
+
+
+ public ServerChannelInitializer(NetconfServerSessionNegotiatorFactory negotiatorFactory) {
+ this.negotiatorFactory = negotiatorFactory;
+
+ }
+
+ @Override
+ protected void initializeMessageDecoder(Channel ch) {
+ super.initializeMessageDecoder(ch);
+ ch.pipeline().addLast(DESERIALIZER_EX_HANDLER_KEY, new DeserializerExceptionHandler());
+ }
+
+ @Override
+ protected void initializeSessionNegotiator(Channel ch, Promise<NetconfServerSession> promise) {
+ ch.pipeline().addAfter(DESERIALIZER_EX_HANDLER_KEY, AbstractChannelInitializer.NETCONF_SESSION_NEGOTIATOR,
+ negotiatorFactory.getSessionNegotiator(null, ch, promise));
+ }
+}
.setBaseCapabilities(serverCaps)
.build();
- NetconfServerDispatcherImpl.ServerChannelInitializer serverChannelInitializer =
- new NetconfServerDispatcherImpl.ServerChannelInitializer(serverNegotiatorFactory);
+ ServerChannelInitializer serverChannelInitializer =
+ new ServerChannelInitializer(serverNegotiatorFactory);
final NetconfServerDispatcherImpl dispatch =
new NetconfServerDispatcherImpl(serverChannelInitializer, nettyGroup, nettyGroup);
.setConnectionTimeoutMillis(5000)
.build();
- NetconfServerDispatcherImpl.ServerChannelInitializer serverChannelInitializer =
- new NetconfServerDispatcherImpl.ServerChannelInitializer(serverNegotiatorFactory);
+ ServerChannelInitializer serverChannelInitializer =
+ new ServerChannelInitializer(serverNegotiatorFactory);
dispatch = new NetconfServerDispatcherImpl(
serverChannelInitializer, nettyGroup, nettyGroup);
and is available at http://www.eclipse.org/legal/epl-v10.html
-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
- xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
- odl:use-default-for-reference-types="true">
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0">
<!-- The PID "netconf" is used for backwards-compatibility even though it is
an ambiguous name. -->
import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
import org.opendaylight.netconf.impl.NetconfServerDispatcherImpl;
import org.opendaylight.netconf.impl.NetconfServerSessionNegotiatorFactory;
+import org.opendaylight.netconf.impl.ServerChannelInitializer;
import org.opendaylight.netconf.impl.SessionIdProvider;
import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
configuration.getGenerateConfigsTimeout(),
monitoringService1, serverCapabilities);
- final NetconfServerDispatcherImpl.ServerChannelInitializer serverChannelInitializer =
- new NetconfServerDispatcherImpl.ServerChannelInitializer(serverNegotiatorFactory);
+ final ServerChannelInitializer serverChannelInitializer =
+ new ServerChannelInitializer(serverNegotiatorFactory);
return new NetconfServerDispatcherImpl(serverChannelInitializer, nettyThreadgroup, nettyThreadgroup);
}