X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-tcp%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Ftcp%2Fnetty%2FProxyServer.java;fp=opendaylight%2Fnetconf%2Fnetconf-tcp%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Ftcp%2Fnetty%2FProxyServer.java;h=0000000000000000000000000000000000000000;hp=2e0022cb07257e191a891911ca666e726be66dca;hb=9ba2b4eca79bcc0e78099b133296801c8d45a6c4;hpb=b2e81149739c87f0ecc2ce7f06448d7a5d3162b8 diff --git a/opendaylight/netconf/netconf-tcp/src/main/java/org/opendaylight/controller/netconf/tcp/netty/ProxyServer.java b/opendaylight/netconf/netconf-tcp/src/main/java/org/opendaylight/controller/netconf/tcp/netty/ProxyServer.java deleted file mode 100644 index 2e0022cb07..0000000000 --- a/opendaylight/netconf/netconf-tcp/src/main/java/org/opendaylight/controller/netconf/tcp/netty/ProxyServer.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2014 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.controller.netconf.tcp.netty; - -import io.netty.bootstrap.Bootstrap; -import io.netty.bootstrap.ServerBootstrap; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.local.LocalAddress; -import io.netty.channel.local.LocalChannel; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.channel.socket.SocketChannel; -import io.netty.channel.socket.nio.NioServerSocketChannel; -import io.netty.handler.logging.LogLevel; -import io.netty.handler.logging.LoggingHandler; -import java.net.InetSocketAddress; - -public class ProxyServer implements AutoCloseable { - private final EventLoopGroup bossGroup = new NioEventLoopGroup(); - private final EventLoopGroup workerGroup = new NioEventLoopGroup(); - private final ChannelFuture channelFuture; - - public ProxyServer(InetSocketAddress address, final LocalAddress localAddress) { - // Configure the server. - final Bootstrap clientBootstrap = new Bootstrap(); - clientBootstrap.group(bossGroup).channel(LocalChannel.class); - - ServerBootstrap serverBootstrap = new ServerBootstrap(); - serverBootstrap.group(bossGroup, workerGroup) - .channel(NioServerSocketChannel.class) - .handler(new LoggingHandler(LogLevel.DEBUG)) - .childHandler(new ChannelInitializer() { - @Override - public void initChannel(SocketChannel ch) throws Exception { - ch.pipeline().addLast(new ProxyServerHandler(clientBootstrap, localAddress)); - } - }); - - // Start the server. - channelFuture = serverBootstrap.bind(address).syncUninterruptibly(); - } - - @Override - public void close() { - channelFuture.channel().close(); - bossGroup.shutdownGracefully(); - workerGroup.shutdownGracefully(); - } -}