Switch to controller-provided protocol framework 24/4324/5
authorRobert Varga <rovarga@cisco.com>
Thu, 16 Jan 2014 16:14:28 +0000 (17:14 +0100)
committerRobert Varga <rovarga@cisco.com>
Sun, 19 Jan 2014 12:53:52 +0000 (13:53 +0100)
Change-Id: I378be68986a867477044ef8f35a0f50e410de82f
Signed-off-by: Robert Varga <rovarga@cisco.com>
66 files changed:
bgp/parser-api/pom.xml
bgp/parser-impl/pom.xml
bgp/parser-mock/pom.xml
bgp/parser-spi/pom.xml
bgp/rib-impl/pom.xml
bgp/rib-mock/pom.xml
bgp/testtool/pom.xml
commons/parent/pom.xml
framework/.gitignore [deleted file]
framework/.project [deleted file]
framework/pom.xml [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/AbstractDispatcher.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/AbstractProtocolSession.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/AbstractSessionNegotiator.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/DeserializerException.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/DocumentedException.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/NeverReconnectStrategy.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/ProtocolHandlerFactory.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/ProtocolMessageDecoder.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/ProtocolMessageEncoder.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/ProtocolMessageFactory.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/ProtocolSession.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/ProtocolSessionPromise.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/ReconnectImmediatelyStrategy.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/ReconnectPromise.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/ReconnectStrategy.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/ReconnectStrategyFactory.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/SessionListener.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/SessionListenerFactory.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/SessionNegotiator.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/SessionNegotiatorFactory.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/TerminationReason.java [deleted file]
framework/src/main/java/org/opendaylight/protocol/framework/TimedReconnectStrategy.java [deleted file]
framework/src/test/java/org/opendaylight/protocol/framework/ComplementaryTest.java [deleted file]
framework/src/test/java/org/opendaylight/protocol/framework/ServerTest.java [deleted file]
framework/src/test/java/org/opendaylight/protocol/framework/Session.java [deleted file]
framework/src/test/java/org/opendaylight/protocol/framework/SimpleByteToMessageDecoder.java [deleted file]
framework/src/test/java/org/opendaylight/protocol/framework/SimpleDispatcher.java [deleted file]
framework/src/test/java/org/opendaylight/protocol/framework/SimpleMessage.java [deleted file]
framework/src/test/java/org/opendaylight/protocol/framework/SimpleMessageToByteEncoder.java [deleted file]
framework/src/test/java/org/opendaylight/protocol/framework/SimpleSession.java [deleted file]
framework/src/test/java/org/opendaylight/protocol/framework/SimpleSessionListener.java [deleted file]
framework/src/test/java/org/opendaylight/protocol/framework/SimpleSessionListenerFactory.java [deleted file]
framework/src/test/java/org/opendaylight/protocol/framework/SimpleSessionNegotiator.java [deleted file]
framework/src/test/resources/keystore.jks [deleted file]
framework/src/test/resources/logback-test.xml [deleted file]
integration-tests/pom.xml
integration-tests/src/test/java/org/opendaylight/protocol/integration/AbstractBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/BgpLinkstateBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/BgpParserApiBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/BgpParserImplBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/BgpParserMockBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/BgpParserSpiBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/BgpRibApiBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/BgpRibImplBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/BgpRibMockBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/BgpRibSpiBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/BgpUtilBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/FrameworkBundleTest.java [deleted file]
integration-tests/src/test/java/org/opendaylight/protocol/integration/PcepApiBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/PcepImplBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/PcepSpiBundleTest.java
pcep/api/pom.xml
pcep/impl/pom.xml
pcep/testtool/pom.xml
pom.xml

index 3f1f69566d54e83f2fbde33d278efcd91ea374bf..77a46ecb90471fb26e1c96dbe3a20ae440ac5743 100644 (file)
             <groupId>${project.groupId}</groupId>
             <artifactId>util</artifactId>
         </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>framework</artifactId>
-        </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>bgp-concepts</artifactId>
             <artifactId>slf4j-api</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>protocol-framework</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-binding</artifactId>
index e89b4c12390e5b49ef609589621c93ddc2918a87..bcf36b9370df7dd18eeab1e3feb99eaef1a4b974 100644 (file)
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>framework</artifactId>
+            <artifactId>util</artifactId>
         </dependency>
+
         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>util</artifactId>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>protocol-framework</artifactId>
         </dependency>
 
         <dependency>
index fba58b678ed5a552dbe712d03771af4b068202ce..875155e79430a878730f5cce9fd4bacc24f37e9d 100644 (file)
             <groupId>${project.groupId}</groupId>
             <artifactId>concepts</artifactId>
         </dependency>
+
         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>framework</artifactId>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>protocol-framework</artifactId>
         </dependency>
 
         <dependency>
index 60642f36a74ea70d3c31aa001503214eafff371a..74267f9090510ecb3d7be6b2181b4ecfc82bb970 100644 (file)
             <groupId>${project.groupId}</groupId>
             <artifactId>util</artifactId>
         </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>framework</artifactId>
-        </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>bgp-concepts</artifactId>
             <groupId>${project.groupId}</groupId>
             <artifactId>bgp-parser-api</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>protocol-framework</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
index 8d0312210baf5b9bf53e1847f904583bc6320e80..442ae58780ecd64aa429c809c30b51b54a11de5c 100644 (file)
             <groupId>${project.groupId}</groupId>
             <artifactId>concepts</artifactId>
         </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>framework</artifactId>
-        </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>util</artifactId>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>sal-binding-api</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>protocol-framework</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-binding</artifactId>
index 283be4ad40cc5476916979461c1cac03d1a40ec5..7964681802e4b01853b648986e37de3fa5851ff0 100644 (file)
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>framework</artifactId>
+            <artifactId>util</artifactId>
         </dependency>
+
         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>util</artifactId>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>protocol-framework</artifactId>
         </dependency>
 
         <dependency>
index 8028a37e6c522711c4c3a4f1b41d8d5d17f67d65..1099de83e1d42d9663f48e6a1d4aab4219e856ab 100644 (file)
             <groupId>${project.groupId}</groupId>
             <artifactId>concepts</artifactId>
         </dependency>
+
         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>framework</artifactId>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>protocol-framework</artifactId>
         </dependency>
 
         <dependency>
index 802f44f8dfa65c4528d90981f7708a40d0fcbcf3..e6edf4b7f63011bba685cde1bc96fed01edf1361 100644 (file)
@@ -52,8 +52,9 @@
         <surefire.version>2.15</surefire.version>
 
         <yangtools.version>0.5.9-SNAPSHOT</yangtools.version>
-        <controller.config.version>0.2.3-SNAPSHOT</controller.config.version>
         <yang.binding.version>0.6.0-SNAPSHOT</yang.binding.version>
+
+        <controller.config.version>0.2.3-SNAPSHOT</controller.config.version>
         <ietf.types.version>2010.09.24.2-SNAPSHOT</ietf.types.version>
         <ietf.topology.version>2013.10.21.0-SNAPSHOT</ietf.topology.version>
     </properties>
                 <artifactId>concepts</artifactId>
                 <version>${project.version}</version>
             </dependency>
-            <dependency>
-                <groupId>${project.groupId}</groupId>
-                <artifactId>framework</artifactId>
-                <version>${project.version}</version>
-            </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
                 <artifactId>util</artifactId>
             </dependency>
 
             <!-- Controller infrastructure -->
+            <dependency>
+                <groupId>org.opendaylight.controller</groupId>
+                <artifactId>protocol-framework</artifactId>
+                <version>0.4.0-SNAPSHOT</version>
+            </dependency>
+            <dependency>
+                <groupId>org.opendaylight.controller</groupId>
+                <artifactId>protocol-framework</artifactId>
+                <version>0.4.0-SNAPSHOT</version>
+                <type>test-jar</type>
+                <scope>test</scope>
+            </dependency>
             <dependency>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>config-api</artifactId>
diff --git a/framework/.gitignore b/framework/.gitignore
deleted file mode 100644 (file)
index fc1d35e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-target
-.classpath
-.settings
diff --git a/framework/.project b/framework/.project
deleted file mode 100644 (file)
index c01307d..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>common-protocol</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.m2e.core.maven2Builder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>
-       </natures>
-</projectDescription>
diff --git a/framework/pom.xml b/framework/pom.xml
deleted file mode 100644 (file)
index 330bb48..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-    <scm>
-        <connection>scm:git:ssh://git.opendaylight.org:29418/bgpcep.git</connection>
-        <developerConnection>scm:git:ssh://git.opendaylight.org:29418/bgpcep.git</developerConnection>
-        <url>https://wiki.opendaylight.org/view/BGP_LS_PCEP:Main</url>
-        <tag>HEAD</tag>
-    </scm>
-    <parent>
-        <groupId>org.opendaylight.bgpcep</groupId>
-        <artifactId>commons.parent</artifactId>
-        <version>0.3.0-SNAPSHOT</version>
-        <relativePath>../commons/parent</relativePath>
-    </parent>
-    <prerequisites>
-        <maven>3.0.4</maven>
-    </prerequisites>
-
-    <artifactId>framework</artifactId>
-    <description>Common protocol framework</description>
-    <packaging>bundle</packaging>
-    <name>${project.artifactId}</name>
-
-    <dependencies>
-        <dependency>
-            <groupId>io.netty</groupId>
-            <artifactId>netty-buffer</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.netty</groupId>
-            <artifactId>netty-codec</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.netty</groupId>
-            <artifactId>netty-common</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.netty</groupId>
-            <artifactId>netty-transport</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.google.code.findbugs</groupId>
-            <artifactId>jsr305</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-
-        <!-- Testing dependencies -->
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>mockito-configuration</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
-                    </instructions>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>test-jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-</project>
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/AbstractDispatcher.java b/framework/src/main/java/org/opendaylight/protocol/framework/AbstractDispatcher.java
deleted file mode 100644 (file)
index e19bdba..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.bootstrap.Bootstrap;
-import io.netty.bootstrap.ServerBootstrap;
-import io.netty.channel.ChannelFuture;
-import io.netty.channel.ChannelInitializer;
-import io.netty.channel.ChannelOption;
-import io.netty.channel.EventLoopGroup;
-import io.netty.channel.nio.NioEventLoopGroup;
-import io.netty.channel.socket.SocketChannel;
-import io.netty.channel.socket.nio.NioServerSocketChannel;
-import io.netty.channel.socket.nio.NioSocketChannel;
-import io.netty.util.concurrent.DefaultPromise;
-import io.netty.util.concurrent.EventExecutor;
-import io.netty.util.concurrent.Future;
-import io.netty.util.concurrent.GlobalEventExecutor;
-import io.netty.util.concurrent.Promise;
-
-import java.io.Closeable;
-import java.net.InetSocketAddress;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-
-/**
- * Dispatcher class for creating servers and clients. The idea is to first create servers and clients and the run the
- * start method that will handle sockets in different thread.
- */
-public abstract class AbstractDispatcher<S extends ProtocolSession<?>, L extends SessionListener<?, ?, ?>> implements Closeable {
-
-       protected interface PipelineInitializer<S extends ProtocolSession<?>> {
-               /**
-                * Initializes channel by specifying the handlers in its pipeline. Handlers are protocol specific, therefore this
-                * method needs to be implemented in protocol specific Dispatchers.
-                *
-                * @param channel whose pipeline should be defined, also to be passed to {@link SessionNegotiatorFactory}
-                * @param promise to be passed to {@link SessionNegotiatorFactory}
-                */
-               void initializeChannel(SocketChannel channel, Promise<S> promise);
-       }
-
-
-       private static final Logger LOG = LoggerFactory.getLogger(AbstractDispatcher.class);
-
-       private final EventLoopGroup bossGroup;
-
-       private final EventLoopGroup workerGroup;
-
-       private final EventExecutor executor;
-
-       /**
-        * Internally creates new instances of NioEventLoopGroup, might deplete system resources and result in Too many open files exception.
-        *
-        * @deprecated use {@link AbstractDispatcher#AbstractDispatcher(io.netty.channel.EventLoopGroup, io.netty.channel.EventLoopGroup)} instead.
-        */
-       @Deprecated
-       protected AbstractDispatcher() {
-               this(GlobalEventExecutor.INSTANCE, new NioEventLoopGroup(),new NioEventLoopGroup());
-       }
-
-       protected AbstractDispatcher(final EventLoopGroup bossGroup, final EventLoopGroup workerGroup) {
-               this(GlobalEventExecutor.INSTANCE, bossGroup, workerGroup);
-       }
-
-       protected AbstractDispatcher(final EventExecutor executor, final EventLoopGroup bossGroup, final EventLoopGroup workerGroup) {
-               this.bossGroup = Preconditions.checkNotNull(bossGroup);
-               this.workerGroup = Preconditions.checkNotNull(workerGroup);
-               this.executor = Preconditions.checkNotNull(executor);
-       }
-
-
-       /**
-        * Creates server. Each server needs factories to pass their instances to client sessions.
-        *
-        * @param address address to which the server should be bound
-        * @param initializer instance of PipelineInitializer used to initialize the channel pipeline
-        *
-        * @return ChannelFuture representing the binding process
-        */
-       protected ChannelFuture createServer(final InetSocketAddress address, final PipelineInitializer<S> initializer) {
-               final ServerBootstrap b = new ServerBootstrap();
-               b.group(this.bossGroup, this.workerGroup);
-               b.channel(NioServerSocketChannel.class);
-               b.option(ChannelOption.SO_BACKLOG, 128);
-               b.childHandler(new ChannelInitializer<SocketChannel>() {
-
-                       @Override
-                       protected void initChannel(final SocketChannel ch) {
-                               initializer.initializeChannel(ch, new DefaultPromise<S>(executor));
-                       }
-               });
-               b.childOption(ChannelOption.SO_KEEPALIVE, true);
-
-               // Bind and start to accept incoming connections.
-               final ChannelFuture f = b.bind(address);
-               LOG.debug("Initiated server {} at {}.", f, address);
-               return f;
-
-       }
-
-       /**
-        * Creates a client.
-        *
-        * @param address remote address
-        * @param connectStrategy Reconnection strategy to be used when initial connection fails
-        *
-        * @return Future representing the connection process. Its result represents the combined success of TCP connection
-        *               as well as session negotiation.
-        */
-       protected Future<S> createClient(final InetSocketAddress address, final ReconnectStrategy strategy, final PipelineInitializer<S> initializer) {
-               final Bootstrap b = new Bootstrap();
-               final ProtocolSessionPromise<S> p = new ProtocolSessionPromise<S>(executor, address, strategy, b);
-               b.group(this.workerGroup).channel(NioSocketChannel.class).option(ChannelOption.SO_KEEPALIVE, true).handler(
-                               new ChannelInitializer<SocketChannel>() {
-
-                                       @Override
-                                       protected void initChannel(final SocketChannel ch) {
-                                               initializer.initializeChannel(ch, p);
-                                       }
-                               });
-               p.connect();
-               LOG.debug("Client created.");
-               return p;
-       }
-
-       /**
-        * Creates a client.
-        *
-        * @param address remote address
-        * @param connectStrategyFactory Factory for creating reconnection strategy to be used when initial connection fails
-        * @param reestablishStrategy Reconnection strategy to be used when the already-established session fails
-        *
-        * @return Future representing the reconnection task. It will report completion based on reestablishStrategy, e.g.
-        *               success if it indicates no further attempts should be made and failure if it reports an error
-        */
-       protected Future<Void> createReconnectingClient(final InetSocketAddress address, final ReconnectStrategyFactory connectStrategyFactory,
-                       final ReconnectStrategy reestablishStrategy, final PipelineInitializer<S> initializer) {
-
-               final ReconnectPromise<S, L> p = new ReconnectPromise<S, L>(GlobalEventExecutor.INSTANCE, this, address, connectStrategyFactory, reestablishStrategy, initializer);
-               p.connect();
-
-               return p;
-
-       }
-
-       /**
-        * @deprecated Should only be used with {@link AbstractDispatcher#AbstractDispatcher()}
-        */
-       @Deprecated
-       @Override
-       public void close() {
-               try {
-                       this.workerGroup.shutdownGracefully();
-               } finally {
-                       this.bossGroup.shutdownGracefully();
-               }
-       }
-
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/AbstractProtocolSession.java b/framework/src/main/java/org/opendaylight/protocol/framework/AbstractProtocolSession.java
deleted file mode 100644 (file)
index de77907..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.channel.SimpleChannelInboundHandler;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class AbstractProtocolSession<M> extends SimpleChannelInboundHandler<Object> implements ProtocolSession<M> {
-       private static final Logger LOG = LoggerFactory.getLogger(AbstractProtocolSession.class);
-
-       /**
-        * Handles incoming message (parsing, reacting if necessary).
-        * 
-        * @param msg incoming message
-        */
-       protected abstract void handleMessage(final M msg);
-
-       /**
-        * Called when reached the end of input stream while reading.
-        */
-       protected abstract void endOfInput();
-
-       /**
-        * Called when the session is added to the pipeline.
-        */
-       protected abstract void sessionUp();
-
-       @Override
-       public final void channelInactive(final ChannelHandlerContext ctx) {
-               LOG.debug("Channel {} inactive.", ctx.channel());
-               endOfInput();
-       }
-
-       @Override
-       protected final void channelRead0(final ChannelHandlerContext ctx, final Object msg) {
-               LOG.debug("Message was received: {}", msg);
-               handleMessage((M) msg);
-       }
-
-       @Override
-       public final void handlerAdded(final ChannelHandlerContext ctx) {
-               sessionUp();
-       }
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/AbstractSessionNegotiator.java b/framework/src/main/java/org/opendaylight/protocol/framework/AbstractSessionNegotiator.java
deleted file mode 100644 (file)
index f34ba5a..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.channel.Channel;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.channel.ChannelInboundHandlerAdapter;
-import io.netty.util.concurrent.Promise;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-
-/**
- * Abstract base class for session negotiators. It implements the basic
- * substrate to implement SessionNegotiator API specification, with subclasses
- * needing to provide only
- *
- * @param <M> Protocol message type
- * @param <S> Protocol session type, has to extend ProtocolSession<M>
- */
-public abstract class AbstractSessionNegotiator<M, S extends AbstractProtocolSession<?>> extends ChannelInboundHandlerAdapter implements SessionNegotiator<S> {
-       private final Logger logger = LoggerFactory.getLogger(AbstractSessionNegotiator.class);
-       private final Promise<S> promise;
-       protected final Channel channel;
-
-       public AbstractSessionNegotiator(final Promise<S> promise, final Channel channel) {
-               this.promise = Preconditions.checkNotNull(promise);
-               this.channel = Preconditions.checkNotNull(channel);
-       }
-
-       protected abstract void startNegotiation() throws Exception;
-       protected abstract void handleMessage(M msg) throws Exception;
-
-       protected final void negotiationSuccessful(final S session) {
-               logger.debug("Negotiation on channel {} successful with session {}", channel, session);
-               channel.pipeline().replace(this, "session", session);
-               promise.setSuccess(session);
-       }
-
-       protected final void negotiationFailed(final Throwable cause) {
-               logger.debug("Negotiation on channel {} failed", channel, cause);
-               channel.close();
-               promise.setFailure(cause);
-       }
-
-       @Override
-       public final void channelActive(final ChannelHandlerContext ctx) {
-               logger.debug("Starting session negotiation on channel {}", channel);
-               try {
-                       startNegotiation();
-               } catch (Exception e) {
-                       logger.info("Unexpected negotiation failure", e);
-                       negotiationFailed(e);
-               }
-       }
-
-       @Override
-       public final void channelRead(final ChannelHandlerContext ctx, final Object msg) {
-               logger.debug("Negotiation read invoked on channel {}", channel);
-               try {
-                       handleMessage((M)msg);
-               } catch (Exception e) {
-                       logger.debug("Unexpected exception during negotiation", e);
-                       negotiationFailed(e);
-               }
-       }
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/DeserializerException.java b/framework/src/main/java/org/opendaylight/protocol/framework/DeserializerException.java
deleted file mode 100644 (file)
index ab283d2..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.protocol.framework;
-
-/**
- * Used when something occurs during parsing bytes to java objects.
- *
- * @deprecated This exception no longer carries any special meaning. Users
- * are advised to stop using it and define their own replacement.
- */
-@Deprecated
-public class DeserializerException extends Exception {
-
-       private static final long serialVersionUID = -2247000673438452870L;
-
-       /**
-        * Creates a deserializer exception.
-        * @param err string
-        */
-       public DeserializerException(final String err) {
-               super(err);
-       }
-
-       /**
-        * Creates a deserializer exception.
-        * @param err string
-        * @param e underlying exception
-        */
-       public DeserializerException(final String err, final Throwable e) {
-               super(err, e);
-       }
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/DocumentedException.java b/framework/src/main/java/org/opendaylight/protocol/framework/DocumentedException.java
deleted file mode 100644 (file)
index c56ccf6..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.protocol.framework;
-
-/**
- * Documented exception occurrs when an error is thrown that is documented
- * in any RFC or draft for the specific protocol.
- * 
- * @deprecated This exception no longer carries any special meaning. Users
- * are advised to stop using it and define their own replacement.
- */
-@Deprecated
-public class DocumentedException extends Exception  {
-
-       private static final long serialVersionUID = -3727963789710833704L;
-
-       /**
-        * Creates a documented exception
-        * @param message string
-        */
-       public DocumentedException(final String message) {
-               super(message);
-       }
-
-       /**
-        * Creates a documented exception
-        * @param err string
-        * @param cause the cause (which is saved for later retrieval by the
-        * Throwable.getCause() method). (A null value is permitted, and indicates
-        * that the cause is nonexistent or unknown.)
-        */
-       public DocumentedException(final String err, final Exception cause) {
-               super(err, cause);
-       }
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/NeverReconnectStrategy.java b/framework/src/main/java/org/opendaylight/protocol/framework/NeverReconnectStrategy.java
deleted file mode 100644 (file)
index 35dcc3f..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.util.concurrent.EventExecutor;
-import io.netty.util.concurrent.Future;
-
-import javax.annotation.concurrent.ThreadSafe;
-
-import com.google.common.base.Preconditions;
-
-/**
- * Utility ReconnectStrategy singleton, which will cause the reconnect process
- * to always fail.
- */
-@ThreadSafe
-public final class NeverReconnectStrategy implements ReconnectStrategy {
-       private final EventExecutor executor;
-       private final int timeout;
-
-       public NeverReconnectStrategy(final EventExecutor executor, final int timeout) {
-               Preconditions.checkArgument(timeout >= 0);
-               this.executor = Preconditions.checkNotNull(executor);
-               this.timeout = timeout;
-       }
-
-       @Override
-       public Future<Void> scheduleReconnect(final Throwable cause) {
-               return executor.newFailedFuture(new Throwable());
-       }
-
-       @Override
-       public void reconnectSuccessful() {
-               // Nothing to do
-       }
-
-       @Override
-       public int getConnectTimeout() {
-               return timeout;
-       }
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/ProtocolHandlerFactory.java b/framework/src/main/java/org/opendaylight/protocol/framework/ProtocolHandlerFactory.java
deleted file mode 100644 (file)
index ca3894a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.channel.ChannelHandler;
-
-import com.google.common.base.Preconditions;
-
-/**
- * @deprecated This is an adaptor class for turning ProtocolMessageFactory into
- * Netty encoder/decoder. Use Netty-provided classes directly, by subclassing
- * {@link io.netty.handler.codec.ByteToMessageDecoder} or similar instead.
- */
-@Deprecated
-public class ProtocolHandlerFactory<T> {
-       private final ProtocolMessageEncoder<T> encoder;
-       protected final ProtocolMessageFactory<T> msgFactory;
-
-       public ProtocolHandlerFactory(final ProtocolMessageFactory<T> msgFactory) {
-               this.msgFactory = Preconditions.checkNotNull(msgFactory);
-               this.encoder = new ProtocolMessageEncoder<T>(msgFactory);
-       }
-
-       public ChannelHandler[] getEncoders() {
-               return new ChannelHandler[] { this.encoder };
-       }
-
-       public ChannelHandler[] getDecoders() {
-               return new ChannelHandler[] { new ProtocolMessageDecoder<T>(this.msgFactory) };
-       }
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/ProtocolMessageDecoder.java b/framework/src/main/java/org/opendaylight/protocol/framework/ProtocolMessageDecoder.java
deleted file mode 100644 (file)
index e609cea..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.ByteBufUtil;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.handler.codec.ByteToMessageDecoder;
-
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-
-/**
- * @deprecated This is an adaptor class for turning ProtocolMessageFactory into Netty decoder. Use Netty-provided
- *             classes directly, by subclassing {@link io.netty.handler.codec.ByteToMessageDecoder} or similar instead.
- */
-@Deprecated
-public final class ProtocolMessageDecoder<T> extends ByteToMessageDecoder {
-
-       private static final Logger LOG = LoggerFactory.getLogger(ProtocolMessageDecoder.class);
-
-       private final ProtocolMessageFactory<T> factory;
-
-       public ProtocolMessageDecoder(final ProtocolMessageFactory<T> factory) {
-               this.factory = Preconditions.checkNotNull(factory);
-       }
-
-       @Override
-       protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out) throws Exception {
-               if (in.readableBytes() == 0) {
-                       LOG.debug("No more content in incoming buffer.");
-                       return;
-               }
-               in.markReaderIndex();
-               try {
-                       LOG.trace("Received to decode: {}", ByteBufUtil.hexDump(in));
-                       final byte[] bytes = new byte[in.readableBytes()];
-                       in.readBytes(bytes);
-                       out.add(this.factory.parse(bytes));
-               } catch (DeserializerException | DocumentedException e) {
-                       LOG.debug("Failed to decode protocol message", e);
-                       this.exceptionCaught(ctx, e);
-               }
-               in.discardReadBytes();
-       }
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/ProtocolMessageEncoder.java b/framework/src/main/java/org/opendaylight/protocol/framework/ProtocolMessageEncoder.java
deleted file mode 100644 (file)
index 65894fa..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.channel.ChannelHandler.Sharable;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.handler.codec.MessageToByteEncoder;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @deprecated This is an adaptor class for turning ProtocolMessageFactory into Netty encoder. Use Netty-provided
- *             classes directly, by subclassing {@link io.netty.handler.codec.MessageToByteDecoder} or similar instead.
- */
-@Deprecated
-@Sharable
-public final class ProtocolMessageEncoder<T> extends MessageToByteEncoder<Object> {
-
-       private static final Logger LOG = LoggerFactory.getLogger(ProtocolMessageEncoder.class);
-
-       private final ProtocolMessageFactory<T> factory;
-
-       public ProtocolMessageEncoder(final ProtocolMessageFactory<T> factory) {
-               this.factory = factory;
-       }
-
-       @Override
-       protected void encode(final ChannelHandlerContext ctx, final Object msg, final ByteBuf out) throws Exception {
-               LOG.debug("Sent to encode : {}", msg);
-               final byte[] bytes = this.factory.put((T) msg);
-               out.writeBytes(bytes);
-       }
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/ProtocolMessageFactory.java b/framework/src/main/java/org/opendaylight/protocol/framework/ProtocolMessageFactory.java
deleted file mode 100644 (file)
index b24ab01..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.protocol.framework;
-
-
-/**
- * Interface for factory for parsing and serializing protocol specific messages. Needs to be implemented by a protocol
- * specific message factory. The methods put/parse should delegate parsing to specific message parsers, e.g.
- * OpenMessageParser etc.
- * 
- * @param <T> type of messages created by this factory
- * 
- * @deprecated Interact with Netty 4.0 directly, by subclassing {@link io.netty.handler.codec.ByteToMessageCodec} or
- * similar.
- */
-@Deprecated
-public interface ProtocolMessageFactory<T> {
-
-       /**
-        * Parses message from byte array. Requires specific protocol message header object to parse the header.
-        * 
-        * @param bytes byte array from which the message will be parsed
-        * @return List of specific protocol messages
-        * @throws DeserializerException if some parsing error occurs
-        * @throws DocumentedException if some documented error occurs
-        */
-       T parse(byte[] bytes) throws DeserializerException, DocumentedException;
-
-       /**
-        * Serializes protocol specific message to byte array.
-        * 
-        * @param msg message to be serialized.
-        * @return byte array resulting message
-        */
-       byte[] put(T msg);
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/ProtocolSession.java b/framework/src/main/java/org/opendaylight/protocol/framework/ProtocolSession.java
deleted file mode 100644 (file)
index 0e45f8a..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import java.io.Closeable;
-
-/**
- * Protocol Session represents the finite state machine in underlying protocol, including timers and its purpose is to
- * create a connection between server and client. Session is automatically started, when TCP connection is created, but
- * can be stopped manually. If the session is up, it has to redirect messages to/from user. Handles also malformed
- * messages and unknown requests.
- * 
- * This interface should be implemented by a final class representing a protocol specific session.
- */
-public interface ProtocolSession<T> extends Closeable {
-       @Override
-       void close();
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/ProtocolSessionPromise.java b/framework/src/main/java/org/opendaylight/protocol/framework/ProtocolSessionPromise.java
deleted file mode 100644 (file)
index 7066998..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.bootstrap.Bootstrap;
-import io.netty.channel.ChannelFuture;
-import io.netty.channel.ChannelFutureListener;
-import io.netty.channel.ChannelOption;
-import io.netty.util.concurrent.DefaultPromise;
-import io.netty.util.concurrent.EventExecutor;
-import io.netty.util.concurrent.Future;
-import io.netty.util.concurrent.FutureListener;
-import io.netty.util.concurrent.Promise;
-
-import java.net.InetSocketAddress;
-
-import javax.annotation.concurrent.GuardedBy;
-import javax.annotation.concurrent.ThreadSafe;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-
-@ThreadSafe
-final class ProtocolSessionPromise<S extends ProtocolSession<?>> extends DefaultPromise<S> {
-       private static final Logger LOG = LoggerFactory.getLogger(ProtocolSessionPromise.class);
-       private final ReconnectStrategy strategy;
-       private final InetSocketAddress address;
-       private final Bootstrap b;
-
-       @GuardedBy("this")
-       private Future<?> pending;
-
-       ProtocolSessionPromise(final EventExecutor executor, final InetSocketAddress address, final ReconnectStrategy strategy,
-                       final Bootstrap b) {
-               super(executor);
-               this.strategy = Preconditions.checkNotNull(strategy);
-               this.address = Preconditions.checkNotNull(address);
-               this.b = Preconditions.checkNotNull(b);
-       }
-
-       synchronized void connect() {
-               final Object lock = this;
-
-               try {
-                       final int timeout = this.strategy.getConnectTimeout();
-
-                       LOG.debug("Promise {} attempting connect for {}ms", lock, timeout);
-
-                       this.b.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, timeout);
-                       this.pending = this.b.connect(this.address).addListener(new ChannelFutureListener() {
-                               @Override
-                               public void operationComplete(final ChannelFuture cf) throws Exception {
-                                       synchronized (lock) {
-
-                                               LOG.debug("Promise {} connection resolved", lock);
-
-                                               // Triggered when a connection attempt is resolved.
-                                               Preconditions.checkState(ProtocolSessionPromise.this.pending.equals(cf));
-
-                                               /*
-                                                * The promise we gave out could have been cancelled,
-                                                * which cascades to the connect getting cancelled,
-                                                * but there is a slight race window, where the connect
-                                                * is already resolved, but the listener has not yet
-                                                * been notified -- cancellation at that point won't
-                                                * stop the notification arriving, so we have to close
-                                                * the race here.
-                                                */
-                                               if (isCancelled()) {
-                                                       if (cf.isSuccess()) {
-                                                               LOG.debug("Closing channel for cancelled promise {}", lock);
-                                                               cf.channel().close();
-                                                       }
-                                                       return;
-                                               }
-
-                                               if (!cf.isSuccess()) {
-                                                       LOG.info("Attempt to connect to connect to {} failed", ProtocolSessionPromise.this.address, cf.cause());
-                                                       final Future<Void> rf = ProtocolSessionPromise.this.strategy.scheduleReconnect(cf.cause());
-                                                       rf.addListener(new FutureListener<Void>() {
-                                                               @Override
-                                                               public void operationComplete(final Future<Void> sf) {
-                                                                       synchronized (lock) {
-                                                                               // Triggered when a connection attempt is to be made.
-                                                                               Preconditions.checkState(ProtocolSessionPromise.this.pending.equals(sf));
-
-                                                                               /*
-                                                                                * The promise we gave out could have been cancelled,
-                                                                                * which cascades to the reconnect attempt getting
-                                                                                * cancelled, but there is a slight race window, where
-                                                                                * the reconnect attempt is already enqueued, but the
-                                                                                * listener has not yet been notified -- if cancellation
-                                                                                * happens at that point, we need to catch it here.
-                                                                                */
-                                                                               if (!isCancelled()) {
-                                                                                       if (sf.isSuccess()) {
-                                                                                               connect();
-                                                                                       } else {
-                                                                                               setFailure(sf.cause());
-                                                                                       }
-                                                                               }
-                                                                       }
-                                                               }
-                                                       });
-
-                                                       ProtocolSessionPromise.this.pending = rf;
-                                               } else {
-                                                       LOG.debug("Promise {} connection successful", lock);
-                                               }
-                                       }
-                               }
-                       });
-               } catch (final Exception e) {
-                       LOG.info("Failed to connect to {}", e);
-                       setFailure(e);
-               }
-       }
-
-       @Override
-       public synchronized boolean cancel(final boolean mayInterruptIfRunning) {
-               if (super.cancel(mayInterruptIfRunning)) {
-                       this.pending.cancel(mayInterruptIfRunning);
-                       return true;
-               }
-
-               return false;
-       }
-
-       @Override
-       public synchronized Promise<S> setSuccess(final S result) {
-               LOG.debug("Promise {} completed", this);
-               this.strategy.reconnectSuccessful();
-               return super.setSuccess(result);
-       }
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/ReconnectImmediatelyStrategy.java b/framework/src/main/java/org/opendaylight/protocol/framework/ReconnectImmediatelyStrategy.java
deleted file mode 100644 (file)
index a12dcb2..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.util.concurrent.EventExecutor;
-import io.netty.util.concurrent.Future;
-
-import javax.annotation.concurrent.ThreadSafe;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-
-/**
- * Utility ReconnectStrategy singleton, which will cause the reconnect process
- * to immediately schedule a reconnection attempt.
- */
-@ThreadSafe
-public final class ReconnectImmediatelyStrategy implements ReconnectStrategy {
-       private static final Logger LOG = LoggerFactory.getLogger(ReconnectImmediatelyStrategy.class);
-       private final EventExecutor executor;
-       private final int timeout;
-
-       public ReconnectImmediatelyStrategy(final EventExecutor executor, final int timeout) {
-               Preconditions.checkArgument(timeout >= 0);
-               this.executor = Preconditions.checkNotNull(executor);
-               this.timeout = timeout;
-       }
-
-       @Override
-       public Future<Void> scheduleReconnect(final Throwable cause) {
-               LOG.debug("Connection attempt failed", cause);
-               return executor.newSucceededFuture(null);
-       }
-
-       @Override
-       public void reconnectSuccessful() {
-               // Nothing to do
-       }
-
-       @Override
-       public int getConnectTimeout() {
-               return timeout;
-       }
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/ReconnectPromise.java b/framework/src/main/java/org/opendaylight/protocol/framework/ReconnectPromise.java
deleted file mode 100644 (file)
index 869dc1a..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.channel.ChannelFuture;
-import io.netty.channel.socket.SocketChannel;
-import io.netty.util.concurrent.DefaultPromise;
-import io.netty.util.concurrent.EventExecutor;
-import io.netty.util.concurrent.Future;
-import io.netty.util.concurrent.FutureListener;
-import io.netty.util.concurrent.Promise;
-
-import java.io.Closeable;
-import java.net.InetSocketAddress;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.opendaylight.protocol.framework.AbstractDispatcher.PipelineInitializer;
-
-import com.google.common.base.Preconditions;
-
-final class ReconnectPromise<S extends ProtocolSession<?>, L extends SessionListener<?, ?, ?>> extends DefaultPromise<Void> {
-       private final AbstractDispatcher<S, L> dispatcher;
-       private final InetSocketAddress address;
-       private final ReconnectStrategyFactory strategyFactory;
-       private final ReconnectStrategy strategy;
-       private final PipelineInitializer<S> initializer;
-       private Future<?> pending;
-
-       private final AtomicBoolean negotiationFinished = new AtomicBoolean(false);
-
-       public ReconnectPromise(final EventExecutor executor, final AbstractDispatcher<S, L> dispatcher, final InetSocketAddress address,
-                       final ReconnectStrategyFactory connectStrategyFactory, final ReconnectStrategy reestablishStrategy,
-                       final PipelineInitializer<S> initializer) {
-               super(executor);
-               this.dispatcher = Preconditions.checkNotNull(dispatcher);
-               this.address = Preconditions.checkNotNull(address);
-               this.strategyFactory = Preconditions.checkNotNull(connectStrategyFactory);
-               this.strategy = Preconditions.checkNotNull(reestablishStrategy);
-               this.initializer = Preconditions.checkNotNull(initializer);
-       }
-
-       // FIXME: BUG-190: refactor
-
-       synchronized void connect() {
-               negotiationFinished.set(false);
-
-               final ReconnectStrategy cs = this.strategyFactory.createReconnectStrategy();
-               final ReconnectStrategy rs = new ReconnectStrategy() {
-                       @Override
-                       public Future<Void> scheduleReconnect(final Throwable cause) {
-                               return cs.scheduleReconnect(cause);
-                       }
-
-                       @Override
-                       public void reconnectSuccessful() {
-                               cs.reconnectSuccessful();
-                       }
-
-                       @Override
-                       public int getConnectTimeout() throws Exception {
-                               final int cst = cs.getConnectTimeout();
-                               final int rst = ReconnectPromise.this.strategy.getConnectTimeout();
-
-                               if (cst == 0) {
-                                       return rst;
-                               }
-                               if (rst == 0) {
-                                       return cst;
-                               }
-                               return Math.min(cst, rst);
-                       }
-               };
-
-               final Future<S> cf = this.dispatcher.createClient(this.address, rs, new PipelineInitializer<S>() {
-                       @Override
-                       public void initializeChannel(final SocketChannel channel, final Promise<S> promise) {
-                               addChannelClosedListener(channel.closeFuture());
-                               initializer.initializeChannel(channel, promise);
-                       }
-               });
-
-               final Object lock = this;
-               this.pending = cf;
-
-               cf.addListener(new FutureListener<S>() {
-
-                       @Override
-                       public void operationComplete(final Future<S> future) {
-                               synchronized (lock) {
-                                       if (!future.isSuccess()) {
-                                               final Future<Void> rf = ReconnectPromise.this.strategy.scheduleReconnect(cf.cause());
-
-                                               if(rf == null) {
-                                                       // This should reflect: no more reconnecting strategies, enough
-                                                       // Currently all reconnect strategies fail with exception, should return null
-                                                       return;
-                                               }
-
-                                               ReconnectPromise.this.pending = rf;
-
-                                               rf.addListener(new FutureListener<Void>() {
-                                                       @Override
-                                                       public void operationComplete(final Future<Void> sf) {
-                                                               synchronized (lock) {
-                                                                       /*
-                                                                        * The promise we gave out could have been cancelled,
-                                                                        * which cascades to the reconnect attempt getting
-                                                                        * cancelled, but there is a slight race window, where
-                                                                        * the reconnect attempt is already enqueued, but the
-                                                                        * listener has not yet been notified -- if cancellation
-                                                                        * happens at that point, we need to catch it here.
-                                                                        */
-                                                                       if (!isCancelled()) {
-                                                                               if (sf.isSuccess()) {
-                                                                                       connect();
-                                                                               } else {
-                                                                                       setFailure(sf.cause());
-                                                                               }
-                                                                       }
-                                                               }
-                                                       }
-                                               });
-                                       } else {
-                                               /*
-                                                *  FIXME: BUG-190: we have a slight race window with cancellation
-                                                *         here. Analyze and define its semantics.
-                                                */
-                                               ReconnectPromise.this.strategy.reconnectSuccessful();
-                                               negotiationFinished.set(true);
-                                       }
-                               }
-                       }
-               });
-       }
-
-       private final ClosedChannelListener closedChannelListener = new ClosedChannelListener();
-
-       class ClosedChannelListener implements Closeable, FutureListener<Void> {
-
-               private final AtomicBoolean stop = new AtomicBoolean(false);
-
-               @Override
-               public void operationComplete(final Future<Void> future) throws Exception {
-                       if (stop.get()) {
-                               return;
-                       }
-
-                       // Start reconnecting crashed session after negotiation was successful
-                       if (!negotiationFinished.get()) {
-                               return;
-                       }
-
-                       connect();
-               }
-
-               @Override
-               public void close() {
-                       this.stop.set(true);
-               }
-       }
-
-       private void addChannelClosedListener(final ChannelFuture channelFuture) {
-               channelFuture.addListener(closedChannelListener);
-       }
-
-       @Override
-       public synchronized boolean cancel(final boolean mayInterruptIfRunning) {
-               closedChannelListener.close();
-
-               if (super.cancel(mayInterruptIfRunning)) {
-                       this.pending.cancel(mayInterruptIfRunning);
-                       return true;
-               }
-
-               return false;
-       }
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/ReconnectStrategy.java b/framework/src/main/java/org/opendaylight/protocol/framework/ReconnectStrategy.java
deleted file mode 100644 (file)
index b1de4f6..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.util.concurrent.Future;
-
-/**
- * Interface exposed by a reconnection strategy provider. A reconnection
- * strategy decides whether to attempt reconnection and when to do that.
- * 
- * The proper way of using this API is such that when a connection attempt
- * has failed, the user will call scheduleReconnect() to obtain a future,
- * which tracks schedule of the next connect attempt. The user should add its
- * own listener to be get notified when the future is done. Once the
- * the notification fires, user should examine the future to see whether
- * it is successful or not. If it is successful, the user should immediately
- * initiate a connection attempt. If it is unsuccessful, the user must
- * not attempt any more connection attempts and should abort the reconnection
- * process.
- */
-public interface ReconnectStrategy {
-       /**
-        * Query the strategy for the connect timeout.
-        * 
-        * @return connect try timeout in milliseconds, or
-        *         0 for infinite (or system-default) timeout
-        * @throws Exception if the connection should not be attempted
-        */
-       int getConnectTimeout() throws Exception;
-
-       /**
-        * Schedule a connection attempt. The precise time when the connection
-        * should be attempted is signaled by successful completion of returned
-        * future.
-        * 
-        * @param cause Cause of previous failure
-        * @return a future tracking the schedule, may not be null
-        * @throws IllegalStateException when a connection attempt is currently
-        *         scheduled.
-        */
-       Future<Void> scheduleReconnect(Throwable cause);
-
-       /**
-        * Reset the strategy state. Users call this method once the reconnection
-        * process succeeds.
-        */
-       void reconnectSuccessful();
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/ReconnectStrategyFactory.java b/framework/src/main/java/org/opendaylight/protocol/framework/ReconnectStrategyFactory.java
deleted file mode 100644 (file)
index bafd3ac..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.protocol.framework;
-
-/**
- * Factory interface for creating new ReconnectStrategy instances. This is
- * primarily useful for allowing injection of a specific type of strategy for
- * on-demand use, pretty much like you would use a ThreadFactory.
- */
-public interface ReconnectStrategyFactory {
-       /**
-        * Create a new ReconnectStrategy.
-        *
-        * @return a new reconnecty strategy
-        */
-       ReconnectStrategy createReconnectStrategy();
-}
-
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/SessionListener.java b/framework/src/main/java/org/opendaylight/protocol/framework/SessionListener.java
deleted file mode 100644 (file)
index 2ba0ae5..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import java.util.EventListener;
-
-/**
- * Listener that receives session state informations. This interface should be
- * implemented by a protocol specific abstract class, that is extended by
- * a final class that implements the methods.
- */
-public interface SessionListener<M, S extends ProtocolSession<?>, T extends TerminationReason> extends EventListener {
-       /**
-        * Fired when the session was established successfully.
-        * 
-        * @param remoteParams Peer address families which we accepted
-        */
-       void onSessionUp(S session);
-
-       /**
-        * Fired when the session went down because of an IO error. Implementation should take care of closing underlying
-        * session.
-        * 
-        * @param session that went down
-        * @param e Exception that was thrown as the cause of session being down
-        */
-       void onSessionDown(S session, Exception e);
-
-       /**
-        * Fired when the session is terminated locally. The session has already been closed and transitioned to IDLE state.
-        * Any outstanding queued messages were not sent. The user should not attempt to make any use of the session.
-        * 
-        * @param reason the cause why the session went down
-        */
-       void onSessionTerminated(S session, T reason);
-
-       /**
-        * Fired when a normal protocol message is received.
-        * 
-        * @param message Protocol message
-        */
-       void onMessage(S session, M message);
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/SessionListenerFactory.java b/framework/src/main/java/org/opendaylight/protocol/framework/SessionListenerFactory.java
deleted file mode 100644 (file)
index 56f887e..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.protocol.framework;
-
-
-/**
- * Factory for generating Session Listeners. Used by a server. This interface should be
- * implemented by a protocol specific abstract class, that is extended by
- * a final class that implements the methods.
- */
-public interface SessionListenerFactory<T extends SessionListener<?, ?, ?>> {
-       /**
-        * Returns one session listener
-        * @return specific session listener
-        */
-       T getSessionListener();
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/SessionNegotiator.java b/framework/src/main/java/org/opendaylight/protocol/framework/SessionNegotiator.java
deleted file mode 100644 (file)
index 3de64b0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.channel.ChannelInboundHandler;
-
-/**
- * Session negotiator concepts. A negotiator is responsible for message
- * handling while the exact session parameters are not known. Once the
- * session parameters are finalized, the negotiator replaces itself in
- * the channel pipeline with the session.
- *
- * @param <T> Protocol session type.
- */
-public interface SessionNegotiator<T extends ProtocolSession<?>> extends ChannelInboundHandler {
-
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/SessionNegotiatorFactory.java b/framework/src/main/java/org/opendaylight/protocol/framework/SessionNegotiatorFactory.java
deleted file mode 100644 (file)
index 58a9e47..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.channel.Channel;
-import io.netty.util.concurrent.Promise;
-
-/**
- * A factory class creating SessionNegotiators.
- * 
- * @param <S> session type
- */
-public interface SessionNegotiatorFactory<M, S extends ProtocolSession<?>, L extends SessionListener<?, ?, ?>> {
-       /**
-        * Create a new negotiator attached to a channel, which will notify
-        * a promise once the negotiation completes.
-        * 
-        * @param channel Underlying channel
-        * @param promise Promise to be notified
-        * @return new negotiator instance
-        */
-       SessionNegotiator<S> getSessionNegotiator(SessionListenerFactory<L> factory, Channel channel, Promise<S> promise);
-}
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/TerminationReason.java b/framework/src/main/java/org/opendaylight/protocol/framework/TerminationReason.java
deleted file mode 100644 (file)
index 42a524c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.protocol.framework;
-
-/**
- * Marker interface for grouping session termination cause.
- */
-public interface TerminationReason {
-
-       /**
-        * Get cause of session termination.
-        * @return human-readable cause.
-        */
-       String getErrorMessage();
-}
-
diff --git a/framework/src/main/java/org/opendaylight/protocol/framework/TimedReconnectStrategy.java b/framework/src/main/java/org/opendaylight/protocol/framework/TimedReconnectStrategy.java
deleted file mode 100644 (file)
index 2903c83..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.util.concurrent.EventExecutor;
-import io.netty.util.concurrent.Future;
-
-import java.util.concurrent.Callable;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import javax.annotation.concurrent.GuardedBy;
-import javax.annotation.concurrent.ThreadSafe;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-
-/**
- * Swiss army knife equivalent for reconnect strategies.
- * 
- * This strategy continues to schedule reconnect attempts, each having to complete in a fixed time (connectTime).
- * 
- * Initial sleep time is specified as minSleep. Each subsequent unsuccessful attempt multiplies this time by a constant
- * factor (sleepFactor) -- this allows for either constant reconnect times (sleepFactor = 1), or various degrees of
- * exponential back-off (sleepFactor > 1). Maximum sleep time between attempts can be capped to a specific value
- * (maxSleep).
- * 
- * The strategy can optionally give up based on two criteria:
- * 
- * A preset number of connection retries (maxAttempts) has been reached, or
- * 
- * A preset absolute deadline is reached (deadline nanoseconds, as reported by System.nanoTime(). In this specific case,
- * both connectTime and maxSleep will be controlled such that the connection attempt is resolved as closely to the
- * deadline as possible.
- * 
- * Both these caps can be combined, with the strategy giving up as soon as the first one is reached.
- */
-@ThreadSafe
-public final class TimedReconnectStrategy implements ReconnectStrategy {
-       private static final Logger LOG = LoggerFactory.getLogger(TimedReconnectStrategy.class);
-       private final EventExecutor executor;
-       private final Long deadline, maxAttempts, maxSleep;
-       private final double sleepFactor;
-       private final int connectTime;
-       private final long minSleep;
-
-       @GuardedBy("this")
-       private long attempts;
-
-       @GuardedBy("this")
-       private long lastSleep;
-
-       @GuardedBy("this")
-       private boolean scheduled;
-
-       public TimedReconnectStrategy(final EventExecutor executor, final int connectTime, final long minSleep, final double sleepFactor,
-                       final Long maxSleep, final Long maxAttempts, final Long deadline) {
-               Preconditions.checkArgument(maxSleep == null || minSleep <= maxSleep);
-               Preconditions.checkArgument(sleepFactor >= 1);
-               Preconditions.checkArgument(connectTime >= 0);
-               this.executor = Preconditions.checkNotNull(executor);
-               this.deadline = deadline;
-               this.maxAttempts = maxAttempts;
-               this.minSleep = minSleep;
-               this.maxSleep = maxSleep;
-               this.sleepFactor = sleepFactor;
-               this.connectTime = connectTime;
-       }
-
-       @Override
-       public synchronized Future<Void> scheduleReconnect(final Throwable cause) {
-               LOG.debug("Connection attempt failed", cause);
-
-               // Check if a reconnect attempt is scheduled
-               Preconditions.checkState(!this.scheduled);
-
-               // Get a stable 'now' time for deadline calculations
-               final long now = System.nanoTime();
-
-               // Obvious stop conditions
-               if (this.maxAttempts != null && this.attempts >= this.maxAttempts) {
-                       return this.executor.newFailedFuture(new Throwable("Maximum reconnection attempts reached"));
-               }
-               if (this.deadline != null && this.deadline <= now) {
-                       return this.executor.newFailedFuture(new TimeoutException("Reconnect deadline reached"));
-               }
-
-               /*
-                * First connection attempt gets initialized to minimum sleep,
-                * each subsequent is exponentially backed off by sleepFactor.
-                */
-               if (this.attempts != 0) {
-                       this.lastSleep *= this.sleepFactor;
-               } else {
-                       this.lastSleep = this.minSleep;
-               }
-
-               // Cap the sleep time to maxSleep
-               if (this.maxSleep != null && this.lastSleep > this.maxSleep) {
-                       LOG.debug("Capped sleep time from {} to {}", this.lastSleep, this.maxSleep);
-                       this.lastSleep = this.maxSleep;
-               }
-
-               this.attempts++;
-
-               // Check if the reconnect attempt is within the deadline
-               if (this.deadline != null && this.deadline <= now + TimeUnit.MILLISECONDS.toNanos(this.lastSleep)) {
-                       return this.executor.newFailedFuture(new TimeoutException("Next reconnect would happen after deadline"));
-               }
-
-               LOG.debug("Connection attempt {} sleeping for {} milliseconds", this.attempts, this.lastSleep);
-
-               // If we are not sleeping at all, return an already-succeeded future
-               if (this.lastSleep == 0) {
-                       return this.executor.newSucceededFuture(null);
-               }
-
-               // Need to retain a final reference to this for locking purposes,
-               // also set the scheduled flag.
-               final Object lock = this;
-               this.scheduled = true;
-
-               // Schedule a task for the right time. It will also clear the flag.
-               return this.executor.schedule(new Callable<Void>() {
-                       @Override
-                       public Void call() throws TimeoutException {
-                               synchronized (lock) {
-                                       Preconditions.checkState(TimedReconnectStrategy.this.scheduled);
-                                       TimedReconnectStrategy.this.scheduled = false;
-                               }
-
-                               return null;
-                       }
-               }, this.lastSleep, TimeUnit.MILLISECONDS);
-       }
-
-       @Override
-       public synchronized void reconnectSuccessful() {
-               Preconditions.checkState(!this.scheduled);
-               this.attempts = 0;
-       }
-
-       @Override
-       public int getConnectTimeout() throws TimeoutException {
-               int timeout = this.connectTime;
-
-               if (this.deadline != null) {
-
-                       // If there is a deadline, we may need to cap the connect
-                       // timeout to meet the deadline.
-                       final long now = System.nanoTime();
-                       if (now >= this.deadline) {
-                               throw new TimeoutException("Reconnect deadline already passed");
-                       }
-
-                       final long left = TimeUnit.NANOSECONDS.toMillis(this.deadline - now);
-                       if (left < 1) {
-                               throw new TimeoutException("Connect timeout too close to deadline");
-                       }
-
-                       /*
-                        * A bit of magic:
-                        * - if time left is less than the timeout, set it directly
-                        * - if there is no timeout, and time left is:
-                        *      - less than maximum integer, set timeout to time left
-                        *      - more than maximum integer, set timeout Integer.MAX_VALUE
-                        */
-                       if (timeout > left) {
-                               timeout = (int) left;
-                       } else if (timeout == 0) {
-                               timeout = left <= Integer.MAX_VALUE ? (int) left : Integer.MAX_VALUE;
-                       }
-               }
-               return timeout;
-       }
-}
diff --git a/framework/src/test/java/org/opendaylight/protocol/framework/ComplementaryTest.java b/framework/src/test/java/org/opendaylight/protocol/framework/ComplementaryTest.java
deleted file mode 100644 (file)
index ad47adb..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-@Deprecated
-public class ComplementaryTest {
-
-       @Test
-       public void testExceptions() {
-               final DeserializerException de = new DeserializerException("some error");
-               final DocumentedException ee = new DocumentedException("some error");
-
-               assertEquals(de.getMessage(), ee.getMessage());
-       }
-}
diff --git a/framework/src/test/java/org/opendaylight/protocol/framework/ServerTest.java b/framework/src/test/java/org/opendaylight/protocol/framework/ServerTest.java
deleted file mode 100644 (file)
index cb6c93e..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import io.netty.channel.Channel;
-import io.netty.channel.ChannelFuture;
-import io.netty.channel.nio.NioEventLoopGroup;
-import io.netty.util.concurrent.DefaultPromise;
-import io.netty.util.concurrent.Future;
-import io.netty.util.concurrent.GlobalEventExecutor;
-import io.netty.util.concurrent.Promise;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ServerTest {
-       SimpleDispatcher clientDispatcher, dispatcher;
-
-       final SimpleSessionListener pce = new SimpleSessionListener();
-
-       SimpleSession session = null;
-
-       ChannelFuture server = null;
-
-       InetSocketAddress serverAddress;
-       private NioEventLoopGroup eventLoopGroup;
-
-
-       @Before
-       public void setUp() {
-               final int port = 10000 + (int)(10000 * Math.random());
-               serverAddress = new InetSocketAddress("127.0.0.1", port);
-               eventLoopGroup = new NioEventLoopGroup();
-       }
-
-       @Test
-       public void testConnectionEstablished() throws Exception {
-               final Promise<Boolean> p = new DefaultPromise<>(GlobalEventExecutor.INSTANCE);
-
-               this.dispatcher = new SimpleDispatcher(new SessionNegotiatorFactory<SimpleMessage, SimpleSession, SimpleSessionListener>() {
-
-                       @Override
-                       public SessionNegotiator<SimpleSession> getSessionNegotiator(final SessionListenerFactory<SimpleSessionListener> factory,
-                                       final Channel channel, final Promise<SimpleSession> promise) {
-                               p.setSuccess(true);
-                               return new SimpleSessionNegotiator(promise, channel);
-                       }
-               }, new DefaultPromise<SimpleSession>(GlobalEventExecutor.INSTANCE), eventLoopGroup);
-
-               this.server = this.dispatcher.createServer(this.serverAddress, new SessionListenerFactory<SimpleSessionListener>() {
-                       @Override
-                       public SimpleSessionListener getSessionListener() {
-                               return new SimpleSessionListener();
-                       }
-               });
-
-               this.server.get();
-
-               this.clientDispatcher = new SimpleDispatcher(new SessionNegotiatorFactory<SimpleMessage, SimpleSession, SimpleSessionListener>() {
-                       @Override
-                       public SessionNegotiator<SimpleSession> getSessionNegotiator(final SessionListenerFactory<SimpleSessionListener> factory,
-                                       final Channel channel, final Promise<SimpleSession> promise) {
-                               return new SimpleSessionNegotiator(promise, channel);
-                       }
-               }, new DefaultPromise<SimpleSession>(GlobalEventExecutor.INSTANCE), eventLoopGroup);
-
-               this.session = this.clientDispatcher.createClient(this.serverAddress,
-                               new NeverReconnectStrategy(GlobalEventExecutor.INSTANCE, 5000), new SessionListenerFactory<SimpleSessionListener>() {
-                       @Override
-                       public SimpleSessionListener getSessionListener() {
-                               return new SimpleSessionListener();
-                       }
-               }).get(6, TimeUnit.SECONDS);
-
-               assertEquals(true, p.get(3, TimeUnit.SECONDS));
-       }
-
-       @Test
-       public void testConnectionFailed() throws IOException, InterruptedException, ExecutionException, TimeoutException {
-               final Promise<Boolean> p = new DefaultPromise<>(GlobalEventExecutor.INSTANCE);
-
-               this.dispatcher = new SimpleDispatcher(new SessionNegotiatorFactory<SimpleMessage, SimpleSession, SimpleSessionListener>() {
-
-                       @Override
-                       public SessionNegotiator<SimpleSession> getSessionNegotiator(final SessionListenerFactory<SimpleSessionListener> factory,
-                                       final Channel channel, final Promise<SimpleSession> promise) {
-                               p.setSuccess(true);
-                               return new SimpleSessionNegotiator(promise, channel);
-                       }
-               }, new DefaultPromise<SimpleSession>(GlobalEventExecutor.INSTANCE), eventLoopGroup);
-
-               this.server = this.dispatcher.createServer(this.serverAddress, new SessionListenerFactory<SimpleSessionListener>() {
-                       @Override
-                       public SimpleSessionListener getSessionListener() {
-                               return new SimpleSessionListener();
-                       }
-               });
-
-               this.server.get();
-
-               this.clientDispatcher = new SimpleDispatcher(new SessionNegotiatorFactory<SimpleMessage, SimpleSession, SimpleSessionListener>() {
-                       @Override
-                       public SessionNegotiator<SimpleSession> getSessionNegotiator(final SessionListenerFactory<SimpleSessionListener> factory,
-                                       final Channel channel, final Promise<SimpleSession> promise) {
-                               return new SimpleSessionNegotiator(promise, channel);
-                       }
-               }, new DefaultPromise<SimpleSession>(GlobalEventExecutor.INSTANCE), eventLoopGroup);
-
-               this.session = this.clientDispatcher.createClient(this.serverAddress,
-                               new NeverReconnectStrategy(GlobalEventExecutor.INSTANCE, 5000), new SessionListenerFactory<SimpleSessionListener>() {
-                       @Override
-                       public SimpleSessionListener getSessionListener() {
-                               return new SimpleSessionListener();
-                       }
-               }).get(6, TimeUnit.SECONDS);
-
-               final Future<?> session = this.clientDispatcher.createClient(this.serverAddress,
-                               new NeverReconnectStrategy(GlobalEventExecutor.INSTANCE, 5000), new SessionListenerFactory<SimpleSessionListener>() {
-                       @Override
-                       public SimpleSessionListener getSessionListener() {
-                               return new SimpleSessionListener();
-                       }
-               });
-               assertFalse(session.isSuccess());
-       }
-
-       @After
-       public void tearDown() throws IOException, InterruptedException {
-               this.server.channel().close();
-               this.eventLoopGroup.shutdownGracefully();
-               try {
-                       Thread.sleep(500);
-               } catch (final InterruptedException e) {
-                       throw new RuntimeException(e);
-               }
-       }
-}
diff --git a/framework/src/test/java/org/opendaylight/protocol/framework/Session.java b/framework/src/test/java/org/opendaylight/protocol/framework/Session.java
deleted file mode 100644 (file)
index f2266d7..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.collect.Lists;
-
-public class Session extends AbstractProtocolSession<SimpleMessage> {
-
-       private static final Logger logger = LoggerFactory.getLogger(Session.class);
-
-       public final List<SimpleMessage> msgs = Lists.newArrayList();
-
-       public boolean up = false;
-
-       @Override
-       public void close() {
-
-       }
-
-       @Override
-       public void handleMessage(final SimpleMessage msg) {
-               logger.debug("Message received: {}", msg.getMessage());
-               this.up = true;
-               this.msgs.add(msg);
-               logger.debug(this.msgs.size() + "");
-       }
-
-       @Override
-       public void endOfInput() {
-               logger.debug("End of input reported.");
-       }
-
-       @Override
-       protected void sessionUp() {
-               logger.debug("Session up reported.");
-       }
-}
diff --git a/framework/src/test/java/org/opendaylight/protocol/framework/SimpleByteToMessageDecoder.java b/framework/src/test/java/org/opendaylight/protocol/framework/SimpleByteToMessageDecoder.java
deleted file mode 100644 (file)
index 59452d7..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.handler.codec.ByteToMessageDecoder;
-
-import java.util.List;
-
-import com.google.common.base.Charsets;
-
-/**
- *
- */
-public class SimpleByteToMessageDecoder extends ByteToMessageDecoder {
-       @Override
-       protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out) {
-               out.add(new SimpleMessage(Charsets.UTF_8.decode(in.nioBuffer()).toString()));
-       }
-}
diff --git a/framework/src/test/java/org/opendaylight/protocol/framework/SimpleDispatcher.java b/framework/src/test/java/org/opendaylight/protocol/framework/SimpleDispatcher.java
deleted file mode 100644 (file)
index c4720c7..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.channel.ChannelFuture;
-import io.netty.channel.ChannelOutboundHandler;
-import io.netty.channel.EventLoopGroup;
-import io.netty.channel.socket.SocketChannel;
-import io.netty.util.concurrent.Future;
-import io.netty.util.concurrent.Promise;
-
-import java.net.InetSocketAddress;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-
-public class SimpleDispatcher extends AbstractDispatcher<SimpleSession, SimpleSessionListener> {
-       private static final Logger logger = LoggerFactory.getLogger(SimpleDispatcher.class);
-
-       private final SessionNegotiatorFactory<SimpleMessage, SimpleSession, SimpleSessionListener> negotiatorFactory;
-       private final ChannelOutboundHandler encoder = new SimpleMessageToByteEncoder();
-
-       private final class SimplePipelineInitializer implements PipelineInitializer<SimpleSession> {
-               final SessionListenerFactory<SimpleSessionListener> listenerFactory;
-
-               SimplePipelineInitializer(final SessionListenerFactory<SimpleSessionListener> listenerFactory) {
-                       this.listenerFactory = Preconditions.checkNotNull(listenerFactory);
-               }
-
-               @Override
-               public void initializeChannel(final SocketChannel channel, final Promise<SimpleSession> promise) {
-                       channel.pipeline().addLast(new SimpleByteToMessageDecoder());
-                       channel.pipeline().addLast("negotiator", negotiatorFactory.getSessionNegotiator(listenerFactory, channel, promise));
-                       channel.pipeline().addLast(encoder);
-                       logger.debug("initialization completed for channel {}", channel);
-               }
-
-       }
-
-       public SimpleDispatcher(final SessionNegotiatorFactory<SimpleMessage, SimpleSession, SimpleSessionListener> negotiatorFactory,
-                       final Promise<SimpleSession> promise, final EventLoopGroup eventLoopGroup) {
-               super(eventLoopGroup, eventLoopGroup);
-               this.negotiatorFactory = Preconditions.checkNotNull(negotiatorFactory);
-       }
-
-       public Future<SimpleSession> createClient(final InetSocketAddress address, final ReconnectStrategy strategy, final SessionListenerFactory<SimpleSessionListener> listenerFactory) {
-               return super.createClient(address, strategy, new SimplePipelineInitializer(listenerFactory));
-       }
-
-       public ChannelFuture createServer(final InetSocketAddress address, final SessionListenerFactory<SimpleSessionListener> listenerFactory) {
-               return super.createServer(address, new SimplePipelineInitializer(listenerFactory));
-       }
-
-       @Override
-       public void close() {
-       }
-}
diff --git a/framework/src/test/java/org/opendaylight/protocol/framework/SimpleMessage.java b/framework/src/test/java/org/opendaylight/protocol/framework/SimpleMessage.java
deleted file mode 100644 (file)
index 1ca7c8b..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.protocol.framework;
-
-public class SimpleMessage {
-
-       private final String s;
-
-       public SimpleMessage(final String s) {
-               this.s = s;
-       }
-
-       public String getMessage() {
-               return this.s;
-       }
-}
diff --git a/framework/src/test/java/org/opendaylight/protocol/framework/SimpleMessageToByteEncoder.java b/framework/src/test/java/org/opendaylight/protocol/framework/SimpleMessageToByteEncoder.java
deleted file mode 100644 (file)
index 5b7ee50..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.channel.ChannelHandler.Sharable;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.handler.codec.MessageToByteEncoder;
-
-/**
- *
- */
-@Sharable
-public class SimpleMessageToByteEncoder extends MessageToByteEncoder<SimpleMessage> {
-       @Override
-       protected void encode(final ChannelHandlerContext ctx, final SimpleMessage msg, final ByteBuf out) {
-               out.writeBytes(msg.getMessage().getBytes());
-       }
-}
diff --git a/framework/src/test/java/org/opendaylight/protocol/framework/SimpleSession.java b/framework/src/test/java/org/opendaylight/protocol/framework/SimpleSession.java
deleted file mode 100644 (file)
index d085be8..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.protocol.framework;
-
-public final class SimpleSession extends AbstractProtocolSession<SimpleMessage> {
-
-       public SimpleSession() {
-       }
-
-       @Override
-       public void close() {
-       }
-
-       @Override
-       public void handleMessage(final SimpleMessage msg) {
-       }
-
-       @Override
-       public void endOfInput() {
-       }
-
-       @Override
-       protected void sessionUp() {
-       }
-}
diff --git a/framework/src/test/java/org/opendaylight/protocol/framework/SimpleSessionListener.java b/framework/src/test/java/org/opendaylight/protocol/framework/SimpleSessionListener.java
deleted file mode 100644 (file)
index 722c663..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Simple Session Listener that is notified about messages and changes in the session.
- */
-public class SimpleSessionListener implements SessionListener<SimpleMessage, SimpleSession, TerminationReason> {
-       private static final Logger logger = LoggerFactory.getLogger(SimpleSessionListener.class);
-
-       public List<SimpleMessage> messages = new ArrayList<SimpleMessage>();
-
-       public boolean up = false;
-
-       public boolean failed = false;
-
-       @Override
-       public void onMessage(final SimpleSession session, final SimpleMessage message) {
-               logger.debug("Received message: " + message.getClass() + " " + message);
-               this.messages.add(message);
-       }
-
-       @Override
-       public void onSessionUp(final SimpleSession session) {
-               this.up = true;
-       }
-
-       @Override
-       public void onSessionDown(final SimpleSession session, final Exception e) {
-               this.failed = true;
-               this.notifyAll();
-       }
-
-       @Override
-       public void onSessionTerminated(final SimpleSession session, final TerminationReason reason) {
-               this.failed = true;
-               this.notifyAll();
-       }
-}
diff --git a/framework/src/test/java/org/opendaylight/protocol/framework/SimpleSessionListenerFactory.java b/framework/src/test/java/org/opendaylight/protocol/framework/SimpleSessionListenerFactory.java
deleted file mode 100644 (file)
index 8135a89..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * 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.protocol.framework;
-
-public class SimpleSessionListenerFactory implements SessionListenerFactory<SimpleSessionListener> {
-
-       @Override
-       public SimpleSessionListener getSessionListener() {
-               return new SimpleSessionListener();
-       }
-}
diff --git a/framework/src/test/java/org/opendaylight/protocol/framework/SimpleSessionNegotiator.java b/framework/src/test/java/org/opendaylight/protocol/framework/SimpleSessionNegotiator.java
deleted file mode 100644 (file)
index f34829b..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.protocol.framework;
-
-import io.netty.channel.Channel;
-import io.netty.util.concurrent.Promise;
-
-public class SimpleSessionNegotiator extends AbstractSessionNegotiator<SimpleMessage, SimpleSession> {
-
-       public SimpleSessionNegotiator(Promise<SimpleSession> promise, Channel channel) {
-               super(promise, channel);
-       }
-
-       @Override
-       protected void startNegotiation() throws Exception {
-               negotiationSuccessful(new SimpleSession());
-       }
-
-       @Override
-       protected void handleMessage(SimpleMessage msg) throws Exception {
-               throw new IllegalStateException("This method should never be invoked");
-       }
-}
diff --git a/framework/src/test/resources/keystore.jks b/framework/src/test/resources/keystore.jks
deleted file mode 100644 (file)
index e315823..0000000
Binary files a/framework/src/test/resources/keystore.jks and /dev/null differ
diff --git a/framework/src/test/resources/logback-test.xml b/framework/src/test/resources/logback-test.xml
deleted file mode 100644 (file)
index 7ace930..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration>
-
-  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-    <encoder>
-      <Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
-    </encoder>
-  </appender>
-
-  <root level="TRACE">
-    <appender-ref ref="STDOUT" />
-  </root>
-</configuration>
index 938e9df968f359ce1d445d6a526b82634515d6ba..8cf38ea1c0eea5a903a61b8ac0fad9fcd1945dfb 100644 (file)
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>sal-binding-broker-impl</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>protocol-framework</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>concepts</artifactId>
index ab09d97eef2be0753026a2ef7ed9379a727387ef..4750a820cf92835312da3f97af4a21ce0fd62461 100644 (file)
@@ -62,6 +62,7 @@ public abstract class AbstractBundleTest {
 
                ret.add(mavenBundle("org.javassist", "javassist", "3.17.1-GA"));
                ret.add(mavenBundle("org.opendaylight.controller", "config-api", "0.2.3-SNAPSHOT"));
+               ret.add(mavenBundle("org.opendaylight.controller", "protocol-framework", "0.4.0-SNAPSHOT"));
                ret.add(mavenBundle("org.opendaylight.controller", "sal-common-api", "1.0-SNAPSHOT"));
                ret.add(mavenBundle("org.opendaylight.controller", "sal-binding-api", "1.0-SNAPSHOT"));
                ret.add(mavenBundle("org.opendaylight.controller", "sal-binding-broker-impl", "1.0-SNAPSHOT"));
index 145f9215d37a094c44538ba6a5d19adf9233f518..fb7c6987624b0d1a318e70165e5c84811efb0fdd 100644 (file)
@@ -16,7 +16,7 @@ public final class BgpLinkstateBundleTest extends AbstractBundleTest {
        protected Collection<String> prerequisiteBundles() {
                return Lists.newArrayList("bgp-concepts", "bgp-parser-api",
                                "bgp-parser-spi", "bgp-rib-api", "bgp-rib-spi",
-                               "concepts", "framework", "rsvp-api", "util");
+                               "concepts", "rsvp-api", "util");
        }
 
        @Override
index 3cfb6039a49c783bde22f3f8dc9758b63763556f..f4c703d6e0b6871704cc4729ee657b747a1e506f 100644 (file)
@@ -14,7 +14,7 @@ import com.google.common.collect.Lists;
 public final class BgpParserApiBundleTest extends AbstractBundleTest {
        @Override
        protected Collection<String> prerequisiteBundles() {
-               return Lists.newArrayList("bgp-concepts", "bgp-util", "concepts", "framework", "util");
+               return Lists.newArrayList("bgp-concepts", "bgp-util", "concepts", "util");
        }
 
        @Override
index 68ee7e2af97a7e7cf30c5993ca020670aa65f02a..80dd1cd84bb3b0d524a6e857afd8f31e5d93b40e 100644 (file)
@@ -14,7 +14,8 @@ import com.google.common.collect.Lists;
 public final class BgpParserImplBundleTest extends AbstractBundleTest {
        @Override
        protected Collection<String> prerequisiteBundles() {
-               return Lists.newArrayList("bgp-concepts", "bgp-linkstate", "bgp-parser-api", "bgp-parser-spi", "bgp-util", "concepts", "framework", "rsvp-api", "util");
+               return Lists.newArrayList("bgp-concepts", "bgp-linkstate", "bgp-parser-api",
+                               "bgp-parser-spi", "bgp-util", "concepts", "rsvp-api", "util");
        }
 
        @Override
index d94a189088b6d3e371b59d7ea0abc1d3cdaf417a..df42ae9bf02aa5baad516d3dbda94633a8a35830 100644 (file)
@@ -15,7 +15,7 @@ public final class BgpParserMockBundleTest extends AbstractBundleTest {
        @Override
        protected Collection<String> prerequisiteBundles() {
                return Lists.newArrayList("concepts", "bgp-concepts", "bgp-parser-api",
-                               "bgp-parser-spi", "bgp-parser-impl", "framework", "util");
+                               "bgp-parser-spi", "bgp-parser-impl", "util");
        }
 
        @Override
index d663e6e669a4d1f4fc58a844d8244726a95d136d..f2696a26dd101a438ff2a9035fe7939ee2432baa 100644 (file)
@@ -14,7 +14,7 @@ import com.google.common.collect.Lists;
 public final class BgpParserSpiBundleTest extends AbstractBundleTest {
        @Override
        protected Collection<String> prerequisiteBundles() {
-               return Lists.newArrayList("bgp-concepts", "bgp-parser-api", "bgp-util", "concepts", "framework", "util");
+               return Lists.newArrayList("bgp-concepts", "bgp-parser-api", "bgp-util", "concepts", "util");
        }
 
        @Override
index 6a80a542807ccca82e1a2de48f9aaa4378384dca..b4d9b8c6a4dd65b74ff5922f517ad6eabdd6b9fb 100644 (file)
@@ -14,7 +14,7 @@ import com.google.common.collect.Lists;
 public final class BgpRibApiBundleTest extends AbstractBundleTest {
        @Override
        protected Collection<String> prerequisiteBundles() {
-               return Lists.newArrayList("concepts", "bgp-concepts", "bgp-linkstate", "bgp-parser-api", "framework", "util");
+               return Lists.newArrayList("concepts", "bgp-concepts", "bgp-linkstate", "bgp-parser-api", "util");
        }
 
        @Override
index 09357d163c063460914f1d500578f8248dee6f7f..4c5eb468bb47f59efccd79a55563c7f587394f35 100644 (file)
@@ -16,7 +16,7 @@ public final class BgpRibImplBundleTest extends AbstractBundleTest {
        protected Collection<String> prerequisiteBundles() {
                return Lists.newArrayList("concepts", "bgp-concepts", "bgp-linkstate", "bgp-parser-api",
                                "bgp-parser-impl", "bgp-parser-spi", "bgp-rib-api", "bgp-rib-spi",
-                               "bgp-util", "framework", "rsvp-api", "util");
+                               "bgp-util", "rsvp-api", "util");
        }
 
        @Override
index bac6ec0a0fd2730c2e8cd90949be91023463ee57..ecb7292525e72ff8070a03b5132ef62988840430 100644 (file)
@@ -16,7 +16,7 @@ public final class BgpRibMockBundleTest extends AbstractBundleTest {
        protected Collection<String> prerequisiteBundles() {
                return Lists.newArrayList("concepts", "bgp-concepts", "bgp-linkstate", "bgp-parser-api",
                                "bgp-parser-impl", "bgp-parser-spi", "bgp-rib-api", "bgp-rib-impl",
-                               "bgp-rib-spi", "bgp-util", "framework", "rsvp-api", "util");
+                               "bgp-rib-spi", "bgp-util", "rsvp-api", "util");
        }
 
        @Override
index 26c628d13572c43ed7e93c38dd37e7b184b20ddc..2779036fbd8490e08bb15b4f782f1ae9a9daa1a8 100644 (file)
@@ -14,7 +14,7 @@ import com.google.common.collect.Lists;
 public final class BgpRibSpiBundleTest extends AbstractBundleTest {
        @Override
        protected Collection<String> prerequisiteBundles() {
-               return Lists.newArrayList("bgp-concepts", "bgp-parser-api", "bgp-rib-api", "concepts", "framework", "util");
+               return Lists.newArrayList("bgp-concepts", "bgp-parser-api", "bgp-rib-api", "concepts", "util");
        }
 
        @Override
index 261a61fdce77907843c3017b5543594131602ff9..0131644c8baf39950c8d5a1ee79bf5d46330b5cc 100644 (file)
@@ -14,7 +14,7 @@ import com.google.common.collect.Lists;
 public final class BgpUtilBundleTest extends AbstractBundleTest {
        @Override
        protected Collection<String> prerequisiteBundles() {
-               return Lists.newArrayList("concepts", "bgp-concepts", "bgp-parser-api", "framework", "util");
+               return Lists.newArrayList("concepts", "bgp-concepts", "bgp-parser-api", "util");
        }
 
        @Override
diff --git a/integration-tests/src/test/java/org/opendaylight/protocol/integration/FrameworkBundleTest.java b/integration-tests/src/test/java/org/opendaylight/protocol/integration/FrameworkBundleTest.java
deleted file mode 100644 (file)
index 90d2b93..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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.protocol.integration;
-
-import java.util.Collection;
-
-import com.google.common.collect.Lists;
-
-public final class FrameworkBundleTest extends AbstractBundleTest {
-       @Override
-       protected Collection<String> prerequisiteBundles() {
-               return Lists.newArrayList("concepts", "util");
-       }
-
-       @Override
-       protected Collection<String> requiredBundles() {
-               return Lists.newArrayList("framework");
-       }
-}
index 64cda31b0374372cf33cbf4b4fff8558e23634e5..422a69b7357fc3e64375220c5773861db0ab8ae8 100644 (file)
@@ -14,7 +14,7 @@ import com.google.common.collect.Lists;
 public final class PcepApiBundleTest extends AbstractBundleTest {
        @Override
        protected Collection<String> prerequisiteBundles() {
-               return Lists.newArrayList("concepts", "framework", "rsvp-api", "util");
+               return Lists.newArrayList("concepts", "rsvp-api", "util");
        }
 
        @Override
index ea3d07020182f09042d6b84dad7b32600ffbd079..e01f538c0542a2249e23b9b5eda52444e453187e 100644 (file)
@@ -14,7 +14,7 @@ import com.google.common.collect.Lists;
 public final class PcepImplBundleTest extends AbstractBundleTest {
        @Override
        protected Collection<String> prerequisiteBundles() {
-               return Lists.newArrayList("concepts", "framework", "pcep-api", "pcep-spi", "rsvp-api", "util");
+               return Lists.newArrayList("concepts", "pcep-api", "pcep-spi", "rsvp-api", "util");
        }
 
        @Override
index b7dacff7648c7397b3fec34ad3d3d2de241a510c..39b91b4cc9172d80c2fd1875c31b8c319e8ec06e 100644 (file)
@@ -14,7 +14,7 @@ import com.google.common.collect.Lists;
 public final class PcepSpiBundleTest extends AbstractBundleTest {
        @Override
        protected Collection<String> prerequisiteBundles() {
-               return Lists.newArrayList("concepts", "framework", "pcep-api", "rsvp-api", "util");
+               return Lists.newArrayList("concepts", "pcep-api", "rsvp-api", "util");
        }
 
        @Override
index f709772756a7ec0a8cd7d46438f253c2d5b78a32..3cfb0be09a05002b5f88ec8905f5a0dfd61a75f1 100644 (file)
             <groupId>${project.groupId}</groupId>
             <artifactId>concepts</artifactId>
         </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>framework</artifactId>
-        </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>util</artifactId>
             <artifactId>yang-common</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>protocol-framework</artifactId>
+        </dependency>
+
         <!--
              FIXME: these are IETF models which are pre-generated in SAL infra.
                     This should not be here, but rather should somehow be
index b6ea2b82efb662129c8271057c320dfb5c213523..87702a002e26f1b5103fb33ea402e55733f9883a 100644 (file)
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>framework</artifactId>
+            <artifactId>util</artifactId>
         </dependency>
+
         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>util</artifactId>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>protocol-framework</artifactId>
         </dependency>
 
         <dependency>
@@ -86,9 +87,8 @@
             <artifactId>mockito-configuration</artifactId>
         </dependency>
         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>framework</artifactId>
-            <version>${project.version}</version>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>protocol-framework</artifactId>
             <scope>test</scope>
             <type>test-jar</type>
         </dependency>
index f90b8574e904607be05f45c2077d53c58e7f20c8..f19ab900d9f2ce6fc0e940ff9f223c245c395e02 100644 (file)
             <groupId>${project.groupId}</groupId>
             <artifactId>concepts</artifactId>
         </dependency>
+
         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>framework</artifactId>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>protocol-framework</artifactId>
         </dependency>
 
         <dependency>
diff --git a/pom.xml b/pom.xml
index 47af3b85ec0f3bcc925bd5ab99479d66b57cf44f..956dc5fbc096041079ef2f2271f0e5f3cdeda532 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,6 @@
     <modules>
         <!-- Common infra -->
         <module>concepts</module>
-        <module>framework</module>
         <module>util</module>
 
         <!-- Subsystems -->