NETCONF: Added support for NETCONF to ODL-SIMPLE 82/91582/1
authorTejas Nevrekar <tnevrekar@luminanetworks.com>
Wed, 18 Sep 2019 10:25:47 +0000 (15:55 +0530)
committerTejas Nevrekar <tejas.nevrekar@gmail.com>
Thu, 23 Jul 2020 10:30:32 +0000 (16:00 +0530)
JIRA: ODLMICRO-27
Signed-off-by: Tejas Nevrekar <tejas.nevrekar@gmail.com>
Change-Id: I1e07df46297ec31c46bb48ce1dcdb033e701ed5c

19 files changed:
pom.xml
src/main/java/org/opendaylight/aaa/simple/AAAModule.java
src/main/java/org/opendaylight/controller/simple/GlobalBossGroup.java [new file with mode: 0644]
src/main/java/org/opendaylight/controller/simple/GlobalEventExecutor.java [new file with mode: 0644]
src/main/java/org/opendaylight/controller/simple/GlobalTimer.java [new file with mode: 0644]
src/main/java/org/opendaylight/controller/simple/GlobalWorkerGroup.java [new file with mode: 0644]
src/main/java/org/opendaylight/controller/simple/InMemoryControllerModule.java
src/main/java/org/opendaylight/netconf/simple/NetconfMain.java [new file with mode: 0644]
src/main/java/org/opendaylight/netconf/simple/NetconfModule.java [new file with mode: 0644]
src/main/java/org/opendaylight/netconf/simple/annotations/AggregatedNetconfOperationServiceFactory.java [new file with mode: 0644]
src/main/java/org/opendaylight/netconf/simple/annotations/AggregatedNetconfOperationServiceFactoryMappers.java [new file with mode: 0644]
src/main/java/org/opendaylight/netconf/simple/annotations/GlobalNetconfProcessingExecutor.java [new file with mode: 0644]
src/main/java/org/opendaylight/netconf/simple/annotations/GlobalNetconfSshScheduledExecutor.java [new file with mode: 0644]
src/main/java/org/opendaylight/netconf/simple/annotations/MapperAggregatorRegistry.java [new file with mode: 0644]
src/main/java/org/opendaylight/netconf/simple/annotations/MdsalNetconfConnector.java [new file with mode: 0644]
src/main/java/org/opendaylight/netconf/simple/annotations/NetconfAuthProvider.java [new file with mode: 0644]
src/main/java/org/opendaylight/netconf/simple/annotations/NetconfClientDispatcher.java [new file with mode: 0644]
src/main/java/org/opendaylight/openflowplugin/simple/OpenflowPluginMain.java [new file with mode: 0644]
src/main/resources/log4j2.properties

diff --git a/pom.xml b/pom.xml
index 67371016b39037c5a483099a35ea99ba753ee690..19c10104cd88ced928f4cb358e71088d22b9e3b7 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
   <parent>
     <groupId>org.opendaylight.infrautils</groupId>
     <artifactId>parent</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
+    <version>1.5.0</version>
     <relativePath />
   </parent>
 
@@ -34,7 +34,7 @@
       <dependency>
         <groupId>org.opendaylight.infrautils</groupId>
         <artifactId>infrautils-artifacts</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
+        <version>1.5.0</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
+      <dependency>
+        <groupId>org.opendaylight.aaa</groupId>
+        <artifactId>aaa-artifacts</artifactId>
+        <version>0.9.0</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
       <dependency>
         <groupId>org.opendaylight.controller</groupId>
         <artifactId>mdsal-artifacts</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.0</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
+      <dependency>
+        <groupId>org.opendaylight.netconf</groupId>
+        <artifactId>netconf-artifacts</artifactId>
+        <version>1.6.0</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
       <dependency>
         <groupId>org.opendaylight.netconf</groupId>
         <artifactId>restconf-artifacts</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.0</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
       <dependency>
         <groupId>org.opendaylight.neutron</groupId>
         <artifactId>neutron-artifacts</artifactId>
-        <version>0.10.0-SNAPSHOT</version>
+        <version>0.10.0</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
       <dependency>
         <groupId>org.opendaylight.daexim</groupId>
         <artifactId>daexim-artifacts</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.3.0</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
       <dependency>
         <groupId>org.opendaylight.netvirt</groupId>
         <artifactId>netvirt-artifacts</artifactId>
-        <version>0.8.0-SNAPSHOT</version>
+        <version>0.8.0</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
     <dependency>
       <groupId>org.opendaylight.neutron</groupId>
       <artifactId>integration-test-standalone</artifactId>
-      <version>0.12.0-SNAPSHOT</version>
+      <version>0.12.0</version>
       <scope>test</scope>
     </dependency>
 -->
       </exclusions>
  -->
     </dependency>
+
+    <dependency>
+       <groupId>org.opendaylight.aaa</groupId>
+       <artifactId>aaa-shiro</artifactId>
+       <version>0.9.0</version>
+    </dependency>
+
+    <!--dependency>
+       <groupId>org.opendaylight.aaa</groupId>
+       <artifactId>aaa-shiro-api</artifactId>
+       <version>0.9.0</version>
+    </dependency>
+
+    <dependency>
+       <groupId>org.opendaylight.aaa</groupId>
+       <artifactId>aaa-shiro-act</artifactId>
+       <version>0.9.0</version>
+    </dependency-->
+
+    <dependency>
+      <groupId>org.opendaylight.aaa</groupId>
+      <artifactId>aaa-authn-api</artifactId>
+       <version>0.9.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>aaa-authn-odl-plugin</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>netconf-api</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>netconf-config</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>netconf-mapping-api</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>netconf-impl</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>netconf-topology</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>netconf-topology-singleton</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>netconf-client</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>sal-netconf-connector</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>mdsal-netconf-connector</artifactId>
+    </dependency>
+
     <dependency>
       <groupId>org.opendaylight.netconf</groupId>
       <artifactId>restconf-nb-rfc8040</artifactId>
     <dependency>
       <groupId>org.opendaylight.aaa.web</groupId>
       <artifactId>web-jetty-impl</artifactId>
-      <version>0.9.0-SNAPSHOT</version>
+      <version>0.9.0</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.aaa.web</groupId>
       <artifactId>servlet-jersey2</artifactId>
-      <version>0.9.0-SNAPSHOT</version>
+      <version>0.9.0</version>
     </dependency>
 
     <!-- TODO Align dropwizard.metrics in odlparent, controller and infrautils and ditch this -->
     <dependency>
       <groupId>org.opendaylight.aaa.web</groupId>
       <artifactId>testutils</artifactId>
-      <version>0.9.0-SNAPSHOT</version>
+      <version>0.9.0</version>
       <scope>test</scope>
     </dependency>
     <dependency>
index 8f0d18bdafe63c694058f485657aea113d0975ac..3367d8b0026357f9b01c36d4187e5c175111b065 100644 (file)
@@ -7,7 +7,18 @@
  */
 package org.opendaylight.aaa.simple;
 
+import javax.annotation.Nullable;
+import javax.inject.Singleton;
+
+import org.opendaylight.aaa.api.AuthenticationException;
+import org.opendaylight.aaa.api.Claim;
+import org.opendaylight.aaa.api.CredentialAuth;
+import org.opendaylight.aaa.api.PasswordCredentials;
+import org.opendaylight.aaa.shiro.tokenauthrealm.auth.ClaimBuilder;
+import org.opendaylight.aaa.shiro.tokenauthrealm.auth.PasswordCredentialBuilder;
+
 import com.google.inject.AbstractModule;
+import com.google.inject.Provides;
 
 public class AAAModule extends AbstractModule {
 
@@ -17,4 +28,22 @@ public class AAAModule extends AbstractModule {
         install(new ShiroModule());
     }
 
+    @Provides
+       @Singleton
+       CredentialAuth<PasswordCredentials> getPasswordCredentialAuth() {
+       PasswordCredentials passwordCredentials = new PasswordCredentialBuilder().setUserName("admin").setPassword("admin").setDomain("").build();
+       return new CredentialAuth<PasswordCredentials>() {
+
+                       @Nullable
+                       @Override
+                       public Claim authenticate(PasswordCredentials cred) throws AuthenticationException {
+                               if (cred.equals(passwordCredentials)) {
+                                       return new ClaimBuilder()
+                                                       .setUser("admin")
+                                                       .build();
+                               }
+                               return null;
+                       }
+               };
+       }
 }
diff --git a/src/main/java/org/opendaylight/controller/simple/GlobalBossGroup.java b/src/main/java/org/opendaylight/controller/simple/GlobalBossGroup.java
new file mode 100644 (file)
index 0000000..dc6f2fa
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * (C) 2019 Lumina Networks, Inc.
+ * 2077 Gateway Place, Suite 500, San Jose, CA 95110.
+ * All rights reserved.
+ *
+ * Use of the software files and documentation is subject to license terms.
+ */
+package org.opendaylight.controller.simple;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import io.netty.channel.EventLoopGroup;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ * PingPong {@link EventLoopGroup} dependency injection annotation.
+ *
+ * <p>USAGE: <pre> {@literal @}Singleton
+ * public class Thing {
+ *     {@literal @}Inject
+ *     public Thing({@literal @}GlobalBossGroup EventLoopGroup eventLoopGroup) {
+ *         ...
+ *     }
+ * }</pre>
+ */
+@Qualifier
+@Documented
+@Retention(RUNTIME)
+@Target({ PARAMETER, METHOD, FIELD })
+public @interface GlobalBossGroup {
+
+}
diff --git a/src/main/java/org/opendaylight/controller/simple/GlobalEventExecutor.java b/src/main/java/org/opendaylight/controller/simple/GlobalEventExecutor.java
new file mode 100644 (file)
index 0000000..7f2519e
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * (C) 2019 Lumina Networks, Inc.
+ * 2077 Gateway Place, Suite 500, San Jose, CA 95110.
+ * All rights reserved.
+ *
+ * Use of the software files and documentation is subject to license terms.
+ */
+package org.opendaylight.controller.simple;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+import io.netty.util.concurrent.EventExecutor;
+
+/**
+ * PingPong {@link EventExecutor} dependency injection annotation.
+ *
+ * <p>USAGE: <pre> {@literal @}Singleton
+ * public class Thing {
+ *     {@literal @}Inject
+ *     public Thing({@literal @}GlobalEventExecutor {@link EventExecutor} eventExecutor) {
+ *         ...
+ *     }
+ * }</pre>
+ */
+@Qualifier
+@Documented
+@Retention(RUNTIME)
+@Target({ PARAMETER, METHOD, FIELD })
+public @interface GlobalEventExecutor {
+
+}
diff --git a/src/main/java/org/opendaylight/controller/simple/GlobalTimer.java b/src/main/java/org/opendaylight/controller/simple/GlobalTimer.java
new file mode 100644 (file)
index 0000000..4ad2e53
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * (C) 2019 Lumina Networks, Inc.
+ * 2077 Gateway Place, Suite 500, San Jose, CA 95110.
+ * All rights reserved.
+ *
+ * Use of the software files and documentation is subject to license terms.
+ */
+package org.opendaylight.controller.simple;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import io.netty.util.Timer;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ * PingPong {@link Timer} dependency injection annotation.
+ *
+ * <p>USAGE: <pre> {@literal @}Singleton
+ * public class Thing {
+ *     {@literal @}Inject
+ *     public Thing({@literal @}GlobalTimer Timer timer) {
+ *         ...
+ *     }
+ * }</pre>
+ */
+@Qualifier
+@Documented
+@Retention(RUNTIME)
+@Target({ PARAMETER, METHOD, FIELD })
+public @interface GlobalTimer {
+
+}
diff --git a/src/main/java/org/opendaylight/controller/simple/GlobalWorkerGroup.java b/src/main/java/org/opendaylight/controller/simple/GlobalWorkerGroup.java
new file mode 100644 (file)
index 0000000..c587558
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * (C) 2019 Lumina Networks, Inc.
+ * 2077 Gateway Place, Suite 500, San Jose, CA 95110.
+ * All rights reserved.
+ *
+ * Use of the software files and documentation is subject to license terms.
+ */
+package org.opendaylight.controller.simple;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import io.netty.channel.EventLoopGroup;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ * PingPong {@link EventLoopGroup} dependency injection annotation.
+ *
+ * <p>USAGE: <pre> {@literal @}Singleton
+ * public class Thing {
+ *     {@literal @}Inject
+ *     public Thing({@literal @}GlobalWorkerGroup EventLoopGroup eventLoopGroup) {
+ *         ...
+ *     }
+ * }</pre>
+ */
+@Qualifier
+@Documented
+@Retention(RUNTIME)
+@Target({ PARAMETER, METHOD, FIELD })
+public @interface GlobalWorkerGroup {
+
+}
index 145fe4ae04fa87d90d70444e7adc69631721e354..e998616e09aba0cca29a221528047468aa1c7e58 100644 (file)
@@ -7,7 +7,11 @@
  */
 package org.opendaylight.controller.simple;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import javax.inject.Singleton;
+
+import org.opendaylight.controller.config.yang.netty.eventexecutor.AutoCloseableEventExecutor;
+import org.opendaylight.controller.config.yang.netty.threadgroup.NioEventLoopGroupCloseable;
+import org.opendaylight.controller.config.yang.netty.timer.HashedWheelTimerCloseable;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
@@ -35,6 +39,13 @@ import org.opendaylight.mdsal.dom.broker.DOMRpcRouter;
 import org.opendaylight.mdsal.simple.MdsalModule;
 import org.opendaylight.mdsal.simple.PingPong;
 
+import com.google.inject.Provides;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import io.netty.channel.EventLoopGroup;
+import io.netty.util.Timer;
+import io.netty.util.concurrent.EventExecutor;
+
 @SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
 public class InMemoryControllerModule extends AbstractCloseableModule {
 
@@ -104,6 +115,41 @@ public class InMemoryControllerModule extends AbstractCloseableModule {
                 new HeliumRpcProviderRegistry(bindingDOMRpcServiceAdapter, bindingDOMRpcProviderServiceAdapter));
     }
 
+    // NETCONF
+       // FIXME Add configuration for thread-count
+       @Provides
+       @Singleton
+       @GlobalBossGroup
+       EventLoopGroup getGlobalBossGroup() {
+               return NioEventLoopGroupCloseable.newInstance(0);
+       }
+
+    // NETCONF
+       // FIXME Add configuration for thread-count
+       @Provides
+       @Singleton
+       @GlobalWorkerGroup
+       EventLoopGroup getGlobalWorkerGroup() {
+               return NioEventLoopGroupCloseable.newInstance(0);
+       }
+
+    // NETCONF
+       // FIXME Add configuration for thread-count
+       @Provides
+       @Singleton
+       @GlobalTimer
+       Timer getGlobalTimer() {
+               return HashedWheelTimerCloseable.newInstance(0L, 0);
+       }
+
+    // NETCONF
+       @Provides
+       @Singleton
+       @GlobalEventExecutor
+       EventExecutor getGlobalEventExecutor() {
+               return AutoCloseableEventExecutor.globalEventExecutor();
+       }
+
     @Override
     public void close() throws Exception {
         bindingToNormalizedNodeCodec.close();
diff --git a/src/main/java/org/opendaylight/netconf/simple/NetconfMain.java b/src/main/java/org/opendaylight/netconf/simple/NetconfMain.java
new file mode 100644 (file)
index 0000000..8bd6c45
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * (C) 2019 Lumina Networks, Inc.
+ * 2077 Gateway Place, Suite 500, San Jose, CA 95110.
+ * All rights reserved.
+ *
+ * Use of the software files and documentation is subject to license terms.
+ */
+package org.opendaylight.netconf.simple;
+
+import org.opendaylight.infrautils.inject.guice.GuiceClassPathBinder;
+import org.opendaylight.infrautils.simple.Main;
+
+public final class NetconfMain {
+
+    private NetconfMain() { }
+
+    public static void main(String[] args) {
+        GuiceClassPathBinder classPathBinder = new GuiceClassPathBinder("org.opendaylight");
+        new Main(new NetconfModule(classPathBinder)).awaitShutdown();
+    }
+}
diff --git a/src/main/java/org/opendaylight/netconf/simple/NetconfModule.java b/src/main/java/org/opendaylight/netconf/simple/NetconfModule.java
new file mode 100644 (file)
index 0000000..9870b82
--- /dev/null
@@ -0,0 +1,311 @@
+/*
+ * (C) 2019 Lumina Networks, Inc.
+ * 2077 Gateway Place, Suite 500, San Jose, CA 95110.
+ * All rights reserved.
+ *
+ * Use of the software files and documentation is subject to license terms.
+ */
+package org.opendaylight.netconf.simple;
+
+import java.util.Arrays;
+import java.util.concurrent.TimeUnit;
+
+import javax.inject.Singleton;
+
+import org.opendaylight.aaa.api.CredentialAuth;
+import org.opendaylight.aaa.api.PasswordCredentials;
+import org.opendaylight.aaa.encrypt.AAAEncryptionService;
+import org.opendaylight.aaa.simple.AAAModule;
+import org.opendaylight.controller.config.threadpool.ScheduledThreadPool;
+import org.opendaylight.controller.config.threadpool.ThreadPool;
+import org.opendaylight.controller.config.threadpool.util.FlexibleThreadPoolWrapper;
+import org.opendaylight.controller.config.threadpool.util.NamingThreadPoolFactory;
+import org.opendaylight.controller.config.threadpool.util.ScheduledThreadPoolWrapper;
+import org.opendaylight.controller.simple.GlobalBossGroup;
+import org.opendaylight.controller.simple.GlobalEventExecutor;
+import org.opendaylight.controller.simple.GlobalTimer;
+import org.opendaylight.controller.simple.GlobalWorkerGroup;
+import org.opendaylight.controller.simple.InMemoryControllerModule;
+import org.opendaylight.infrautils.inject.guice.AutoWiringModule;
+import org.opendaylight.infrautils.inject.guice.GuiceClassPathBinder;
+import org.opendaylight.infrautils.inject.guice.testutils.AnnotationsModule;
+import org.opendaylight.infrautils.simple.InfraUtilsModule;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMMountPointService;
+import org.opendaylight.mdsal.dom.api.DOMRpcService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.netconf.api.NetconfServerDispatcher;
+import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
+import org.opendaylight.netconf.auth.AuthProvider;
+import org.opendaylight.netconf.authprovider.CredentialServiceAuthProvider;
+import org.opendaylight.netconf.client.NetconfClientDispatcher;
+import org.opendaylight.netconf.client.NetconfClientDispatcherImpl;
+import org.opendaylight.netconf.impl.NetconfServerDispatcherImpl;
+import org.opendaylight.netconf.impl.NetconfServerSessionNegotiatorFactory;
+import org.opendaylight.netconf.impl.ServerChannelInitializer;
+import org.opendaylight.netconf.impl.SessionIdProvider;
+import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
+import org.opendaylight.netconf.impl.osgi.NetconfMonitoringServiceImpl;
+import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
+import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
+import org.opendaylight.netconf.mdsal.connector.MdsalNetconfOperationServiceFactory;
+import org.opendaylight.netconf.simple.annotations.AggregatedNetconfOperationServiceFactoryMappers;
+import org.opendaylight.netconf.simple.annotations.GlobalNetconfProcessingExecutor;
+import org.opendaylight.netconf.simple.annotations.GlobalNetconfSshScheduledExecutor;
+import org.opendaylight.netconf.simple.annotations.MdsalNetconfConnector;
+import org.opendaylight.netconf.simple.annotations.NetconfAuthProvider;
+import org.opendaylight.netconf.topology.api.NetconfTopology;
+import org.opendaylight.netconf.topology.impl.NetconfTopologyImpl;
+import org.opendaylight.netconf.topology.impl.SchemaRepositoryProviderImpl;
+import org.opendaylight.restconf.simple.RestConfModule;
+import org.opendaylight.serviceutils.simple.ServiceUtilsModule;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.inject.Provides;
+
+import io.netty.channel.EventLoopGroup;
+import io.netty.util.Timer;
+import io.netty.util.concurrent.EventExecutor;
+
+/**
+ * Guice module for NetConf.
+ *
+ */
+public class NetconfModule extends AutoWiringModule {
+
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfModule.class);
+
+    // FIXME Move the config parameters to its own class and cfg files
+    private static final Long CONNECTION_TIMEOUT_MILLIS = 20000L;
+    private static final Integer MONITORING_UPDATE_INTERVAL = 6;
+    private static final String NAME_PREFIX = "remote-connector-processing-executor";
+    private static final Integer MIN_THREAD_COUNT_FLEXIBLE_THREAD_POOL = 1;
+    private static final Integer MAX_THREAD_COUNT_FLEXIBLE_THREAD_POOL = 4;
+    private static final Long KEEP_ALIVE_MILLIS_FLEXIBLE_THREAD_POOL = 600000L;
+    private static final Integer MAX_THREAD_COUNT_SCHEDULED_THREAD_POOL = 8;
+    private static final Integer WRITE_TRANSACTION_IDLE_TIMEOUT_MILLIS = 20;
+
+    public NetconfModule(GuiceClassPathBinder classPathBinder) {
+        super(classPathBinder, "org.opendaylight.netconf");
+    }
+
+    @Override
+    protected void configureMore() {
+        LOG.info("Loading netconf");
+        // Guice
+        install(new AnnotationsModule());
+        // Controller/MD-SAL
+        install(new InMemoryControllerModule());
+        install(new AAAModule());
+        install(new InfraUtilsModule());
+
+        // ServiceUtils
+        install(new ServiceUtilsModule());
+
+        // RESTCONF
+        install(new RestConfModule());
+    }
+
+       // Converted here from netconf-config/src/main/resources/OSGI-INF/blueprint/netconf-config.xml
+       // START
+       @Provides
+       @Singleton
+       NamingThreadPoolFactory getNamingThreadPoolFactory() {
+               return new NamingThreadPoolFactory(NAME_PREFIX);
+       }
+       
+       @Provides
+       @Singleton
+       @GlobalNetconfProcessingExecutor
+       ThreadPool getFlexibleThreadPool(NamingThreadPoolFactory namingThreadPoolFactory) {
+               return new FlexibleThreadPoolWrapper(MIN_THREAD_COUNT_FLEXIBLE_THREAD_POOL,
+                               MAX_THREAD_COUNT_FLEXIBLE_THREAD_POOL,
+                               KEEP_ALIVE_MILLIS_FLEXIBLE_THREAD_POOL,
+                               TimeUnit.valueOf("MILLISECONDS"),
+                               namingThreadPoolFactory);
+       }
+
+       @Provides
+       @Singleton
+       @GlobalNetconfSshScheduledExecutor
+       ScheduledThreadPool getScheduledThreadPool(NamingThreadPoolFactory namingThreadPoolFactory) {
+               return new ScheduledThreadPoolWrapper(MAX_THREAD_COUNT_SCHEDULED_THREAD_POOL, namingThreadPoolFactory);
+       }
+       
+       // Converted here from netconf-config/src/main/resources/OSGI-INF/blueprint/netconf-config.xml
+       // END
+
+       // Converted here from netconf-client/src/main/resources/OSGI-INF/blueprint/netconf-client.xml
+       // START
+    @Provides
+    @Singleton 
+    @org.opendaylight.netconf.simple.annotations.NetconfClientDispatcher
+    NetconfClientDispatcher getNetconfClientDispatcher(
+               @GlobalBossGroup EventLoopGroup globalBossGroup, 
+               @GlobalWorkerGroup EventLoopGroup globalWorkerGroup, 
+               @GlobalTimer Timer globalTimer) {
+        return new NetconfClientDispatcherImpl(globalBossGroup, globalWorkerGroup, globalTimer);
+    }
+       // Converted here from netconf-client/src/main/resources/OSGI-INF/blueprint/netconf-client.xml
+       // END
+
+       // Converted here from mdsal-netconf-impl/src/main/resources/OSGI-INF/blueprint/mdsal-netconf-impl.xml
+       // START
+    @Provides
+    @Singleton
+    @org.opendaylight.netconf.simple.annotations.MapperAggregatorRegistry
+    NetconfOperationServiceFactoryListener getMapperAggregatorRegistry() {
+       return new AggregatedNetconfOperationServiceFactory();
+    }
+
+    @Provides
+    @Singleton
+    @org.opendaylight.netconf.simple.annotations.AggregatedNetconfOperationServiceFactory
+    NetconfOperationServiceFactory getAggregatedNetconfOperationServiceFactoryListener() {
+       return new AggregatedNetconfOperationServiceFactory();
+    }
+
+    @Provides
+    @Singleton
+    @AggregatedNetconfOperationServiceFactoryMappers
+    AggregatedNetconfOperationServiceFactory getAggregatedNetconfOperationServiceFactoryMappers(
+               @org.opendaylight.netconf.simple.annotations.AggregatedNetconfOperationServiceFactory NetconfOperationServiceFactory aggregatedNetconfOperationServiceFactory) {
+               return new AggregatedNetconfOperationServiceFactory(Arrays.asList(aggregatedNetconfOperationServiceFactory));
+       }
+
+    @Provides
+    @Singleton
+    NetconfMonitoringService getNetconfMonitoringService(
+               @org.opendaylight.netconf.simple.annotations.AggregatedNetconfOperationServiceFactory NetconfOperationServiceFactory aggregatedNetconfOperationServiceFactory,
+               @GlobalNetconfSshScheduledExecutor ScheduledThreadPool scheduledThreadPool) {
+       return new NetconfMonitoringServiceImpl(aggregatedNetconfOperationServiceFactory, scheduledThreadPool, MONITORING_UPDATE_INTERVAL);
+    }
+    
+    @Provides
+    @Singleton
+    NetconfServerSessionNegotiatorFactory getNetconfServerSessionNegotiatorFactory(
+               @GlobalTimer Timer globalTimer,
+               @AggregatedNetconfOperationServiceFactoryMappers AggregatedNetconfOperationServiceFactory aggregatedNetconfOperationServiceFactoryMappers,
+               SessionIdProvider sessionIdProvider,
+               NetconfMonitoringService netconfMonitoringService) {
+               return new NetconfServerSessionNegotiatorFactory(globalTimer,
+                               aggregatedNetconfOperationServiceFactoryMappers,
+                               sessionIdProvider,
+                               CONNECTION_TIMEOUT_MILLIS,
+                               netconfMonitoringService);
+       }
+
+    @Provides
+    @Singleton 
+    ServerChannelInitializer getServerChannelInitializer(
+               NetconfServerSessionNegotiatorFactory netconfServerSessionNegotiatorFactory) {
+       return new ServerChannelInitializer(netconfServerSessionNegotiatorFactory);
+    }
+    
+    @Provides
+    @Singleton 
+    NetconfServerDispatcher getNetconfServerDispatcher(
+               ServerChannelInitializer serverChannelInitializer,
+               @GlobalBossGroup EventLoopGroup globalBossGroup, 
+               @GlobalWorkerGroup EventLoopGroup globalWorkerGroup) {
+        return new NetconfServerDispatcherImpl(serverChannelInitializer, globalBossGroup, globalWorkerGroup);
+    }
+       // Converted here from mdsal-netconf-impl/src/main/resources/OSGI-INF/blueprint/mdsal-netconf-impl.xml
+       // END
+
+    // Converted here from netconf-topology/src/main/resources/OSGI-INF/blueprint/netconf-topology.xml
+       // START
+    @Provides
+    @Singleton 
+    SchemaRepositoryProviderImpl getSchemaRepositoryProviderImpl(
+               ServerChannelInitializer serverChannelInitializer,
+               @GlobalBossGroup EventLoopGroup globalBossGroup, 
+               @GlobalWorkerGroup EventLoopGroup globalWorkerGroup) {
+        return new SchemaRepositoryProviderImpl("shared-schema-repository-impl");
+    }
+
+       @Provides
+       @Singleton
+       NetconfTopology getNetconfTopology(@org.opendaylight.netconf.simple.annotations.NetconfClientDispatcher NetconfClientDispatcher clientDispatcherDependency,
+                       @GlobalNetconfSshScheduledExecutor ScheduledThreadPool keepAliveExecutor,
+                       @GlobalNetconfProcessingExecutor ThreadPool processingExecutor,
+                       SchemaRepositoryProviderImpl schemaRepositoryProvider,
+                       @GlobalEventExecutor EventExecutor eventExecutor,
+                       DataBroker dataBroker,
+                       DOMMountPointService mountPointService,
+                       AAAEncryptionService encryptionService) {
+               NetconfTopologyImpl impl= new NetconfTopologyImpl("topology-netconf",
+                               clientDispatcherDependency,
+                               eventExecutor,
+                               keepAliveExecutor,
+                               processingExecutor,
+                               schemaRepositoryProvider,
+                               dataBroker,
+                               mountPointService,
+                               encryptionService);
+               impl.init();
+               return impl;
+       }
+//
+//     @Provides
+//     @Singleton
+//     NetconfTopologySingletonService getNetconfTopologyManager(DataBroker dataBroker,
+//                     DOMRpcProviderService rpcRegistry,
+//                     ClusterSingletonServiceProvider clusterSingletonService,
+//                     @GlobalNetconfSshScheduledExecutor ScheduledThreadPool keepAliveExecutor,
+//                     @GlobalNetconfProcessingExecutor ThreadPool processingExecutor,
+//                     ActorSystemProvider actorSystemProvider,
+//                     @GlobalEventExecutor EventExecutor eventExecutor,
+//                     @org.opendaylight.netconf.simple.NetconfClientDispatcher NetconfClientDispatcher clientDispatcherDependency,
+//                     DOMMountPointService mountPointService,
+//                     AAAEncryptionService encryptionService) {
+//             Config config = new ConfigBuilder().setWriteTransactionIdleTimeout(WRITE_TRANSACTION_IDLE_TIMEOUT_MILLIS)
+//                             .build();
+//             return new NetconfTopologyManager(dataBroker,
+//                             rpcRegistry,
+//                             clusterSingletonService,
+//                             keepAliveExecutor,
+//                             processingExecutor,
+//                             actorSystemProvider,
+//                             eventExecutor,
+//                             clientDispatcherDependency,
+//                             "topology-netconf",
+//                             config,
+//                             mountPointService,
+//                             encryptionService);
+//     }
+
+    // Converted here from netconf-topology/src/main/resources/OSGI-INF/blueprint/netconf-topology.xml
+       // END
+
+       // Converted here from mdsal-netconf-connector/src/main/resources/OSGI-INF/blueprint/mdsal-netconf-connector.xml
+       // START
+
+       @Provides
+       @Singleton
+       @MdsalNetconfConnector
+       NetconfOperationServiceFactory getMdsalNetconfOperationServiceFactory(DOMSchemaService schemaService,
+                       @org.opendaylight.netconf.simple.annotations.MapperAggregatorRegistry NetconfOperationServiceFactoryListener mapperAggregatorRegistry,
+                       DOMDataBroker domDataBroker,
+                       DOMRpcService domRpcService) {
+               return new MdsalNetconfOperationServiceFactory(schemaService, mapperAggregatorRegistry, domDataBroker, domRpcService);
+       }
+
+    // Converted here from mdsal-netconf-connector/src/main/resources/OSGI-INF/blueprint/mdsal-netconf-connector.xml
+       // END
+
+    // Converted here from netconf/aaa-authn-odl-plugin/src/main/resources/OSGI-INF/blueprint/aaa-authn-netconf.xml
+       // START
+
+       @Provides
+       @Singleton
+       @NetconfAuthProvider
+       AuthProvider getNetconfAuthProvider(CredentialAuth<PasswordCredentials> credService) {
+               return new CredentialServiceAuthProvider(credService);
+       }
+    // Converted here from netconf/aaa-authn-odl-plugin/src/main/resources/OSGI-INF/blueprint/aaa-authn-netconf.xml
+       // END
+
+}
diff --git a/src/main/java/org/opendaylight/netconf/simple/annotations/AggregatedNetconfOperationServiceFactory.java b/src/main/java/org/opendaylight/netconf/simple/annotations/AggregatedNetconfOperationServiceFactory.java
new file mode 100644 (file)
index 0000000..d6c1364
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * (C) 2019 Lumina Networks, Inc.
+ * 2077 Gateway Place, Suite 500, San Jose, CA 95110.
+ * All rights reserved.
+ *
+ * Use of the software files and documentation is subject to license terms.
+ */
+package org.opendaylight.netconf.simple.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
+
+/**
+ * PingPong {@link NetconfOperationServiceFactory} dependency injection annotation.
+ *
+ * <p>USAGE: <pre> {@literal @}Singleton
+ * public class Thing {
+ *     {@literal @}Inject
+ *     public Thing({@literal @}AggregatedNetconfOperationServiceFactory NetconfOperationServiceFactory listener) {
+ *         ...
+ *     }
+ * }</pre>
+ */
+@Qualifier
+@Documented
+@Retention(RUNTIME)
+@Target({ PARAMETER, METHOD, FIELD })
+public @interface AggregatedNetconfOperationServiceFactory {
+
+}
diff --git a/src/main/java/org/opendaylight/netconf/simple/annotations/AggregatedNetconfOperationServiceFactoryMappers.java b/src/main/java/org/opendaylight/netconf/simple/annotations/AggregatedNetconfOperationServiceFactoryMappers.java
new file mode 100644 (file)
index 0000000..2e21a28
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * (C) 2019 Lumina Networks, Inc.
+ * 2077 Gateway Place, Suite 500, San Jose, CA 95110.
+ * All rights reserved.
+ *
+ * Use of the software files and documentation is subject to license terms.
+ */
+package org.opendaylight.netconf.simple.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
+
+/**
+ * PingPong {@link NetconfOperationServiceFactory} dependency injection annotation.
+ *
+ * <p>USAGE: <pre> {@literal @}Singleton
+ * public class Thing {
+ *     {@literal @}Inject
+ *     public Thing({@literal @}AggregatedNetconfOperationServiceFactoryMappers NetconfOperationServiceFactory listener) {
+ *         ...
+ *     }
+ * }</pre>
+ */
+@Qualifier
+@Documented
+@Retention(RUNTIME)
+@Target({ PARAMETER, METHOD, FIELD })
+public @interface AggregatedNetconfOperationServiceFactoryMappers {
+
+}
diff --git a/src/main/java/org/opendaylight/netconf/simple/annotations/GlobalNetconfProcessingExecutor.java b/src/main/java/org/opendaylight/netconf/simple/annotations/GlobalNetconfProcessingExecutor.java
new file mode 100644 (file)
index 0000000..a825f22
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * (C) 2019 Lumina Networks, Inc.
+ * 2077 Gateway Place, Suite 500, San Jose, CA 95110.
+ * All rights reserved.
+ *
+ * Use of the software files and documentation is subject to license terms.
+ */
+package org.opendaylight.netconf.simple.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+import org.opendaylight.controller.config.threadpool.ScheduledThreadPool;
+
+/**
+ * PingPong {@link ScheduledThreadPool} dependency injection annotation.
+ *
+ * <p>USAGE: <pre> {@literal @}Singleton
+ * public class Thing {
+ *     {@literal @}Inject
+ *     public Thing({@literal @}GlobalNetconfSshScheduledExecutor ScheduledThreadPool scheduledThreadPool) {
+ *         ...
+ *     }
+ * }</pre>
+ */
+@Qualifier
+@Documented
+@Retention(RUNTIME)
+@Target({ PARAMETER, METHOD, FIELD })
+public @interface GlobalNetconfProcessingExecutor {
+
+}
diff --git a/src/main/java/org/opendaylight/netconf/simple/annotations/GlobalNetconfSshScheduledExecutor.java b/src/main/java/org/opendaylight/netconf/simple/annotations/GlobalNetconfSshScheduledExecutor.java
new file mode 100644 (file)
index 0000000..93840ed
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * (C) 2019 Lumina Networks, Inc.
+ * 2077 Gateway Place, Suite 500, San Jose, CA 95110.
+ * All rights reserved.
+ *
+ * Use of the software files and documentation is subject to license terms.
+ */
+package org.opendaylight.netconf.simple.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+import org.opendaylight.controller.config.threadpool.ScheduledThreadPool;
+
+/**
+ * PingPong {@link ScheduledThreadPool} dependency injection annotation.
+ *
+ * <p>USAGE: <pre> {@literal @}Singleton
+ * public class Thing {
+ *     {@literal @}Inject
+ *     public Thing({@literal @}GlobalNetconfSshScheduledExecutor ScheduledThreadPool scheduledThreadPool) {
+ *         ...
+ *     }
+ * }</pre>
+ */
+@Qualifier
+@Documented
+@Retention(RUNTIME)
+@Target({ PARAMETER, METHOD, FIELD })
+public @interface GlobalNetconfSshScheduledExecutor {
+
+}
diff --git a/src/main/java/org/opendaylight/netconf/simple/annotations/MapperAggregatorRegistry.java b/src/main/java/org/opendaylight/netconf/simple/annotations/MapperAggregatorRegistry.java
new file mode 100644 (file)
index 0000000..093a45a
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * (C) 2019 Lumina Networks, Inc.
+ * 2077 Gateway Place, Suite 500, San Jose, CA 95110.
+ * All rights reserved.
+ *
+ * Use of the software files and documentation is subject to license terms.
+ */
+package org.opendaylight.netconf.simple.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
+
+/**
+ * PingPong {@link NetconfOperationServiceFactoryListener} dependency injection annotation.
+ *
+ * <p>USAGE: <pre> {@literal @}Singleton
+ * public class Thing {
+ *     {@literal @}Inject
+ *     public Thing({@literal @}MapperAggregatorRegistry NetconfOperationServiceFactoryListener listener) {
+ *         ...
+ *     }
+ * }</pre>
+ */
+@Qualifier
+@Documented
+@Retention(RUNTIME)
+@Target({ PARAMETER, METHOD, FIELD })
+public @interface MapperAggregatorRegistry {
+
+}
diff --git a/src/main/java/org/opendaylight/netconf/simple/annotations/MdsalNetconfConnector.java b/src/main/java/org/opendaylight/netconf/simple/annotations/MdsalNetconfConnector.java
new file mode 100644 (file)
index 0000000..bc07d0a
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * (C) 2019 Lumina Networks, Inc.
+ * 2077 Gateway Place, Suite 500, San Jose, CA 95110.
+ * All rights reserved.
+ *
+ * Use of the software files and documentation is subject to license terms.
+ */
+package org.opendaylight.netconf.simple.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
+
+/**
+ * PingPong {@link NetconfOperationServiceFactory} dependency injection annotation.
+ *
+ * <p>USAGE: <pre> {@literal @}Singleton
+ * public class Thing {
+ *     {@literal @}Inject
+ *     public Thing({@literal @}MdsalNetconfConnector NetconfOperationServiceFactory listener) {
+ *         ...
+ *     }
+ * }</pre>
+ */
+@Qualifier
+@Documented
+@Retention(RUNTIME)
+@Target({ PARAMETER, METHOD, FIELD })
+public @interface MdsalNetconfConnector {
+
+}
diff --git a/src/main/java/org/opendaylight/netconf/simple/annotations/NetconfAuthProvider.java b/src/main/java/org/opendaylight/netconf/simple/annotations/NetconfAuthProvider.java
new file mode 100644 (file)
index 0000000..130d1e2
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * (C) 2019 Lumina Networks, Inc.
+ * 2077 Gateway Place, Suite 500, San Jose, CA 95110.
+ * All rights reserved.
+ *
+ * Use of the software files and documentation is subject to license terms.
+ */
+package org.opendaylight.netconf.simple.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+import org.opendaylight.netconf.auth.AuthProvider;
+
+/**
+ * PingPong {@link AuthProvider} dependency injection annotation.
+ *
+ * <p>USAGE: <pre> {@literal @}Singleton
+ * public class Thing {
+ *     {@literal @}Inject
+ *     public Thing({@literal @}NetconfAuthProvider org.opendaylight.netconf.auth.AuthProvider provider) {
+ *         ...
+ *     }
+ * }</pre>
+ */
+@Qualifier
+@Documented
+@Retention(RUNTIME)
+@Target({ PARAMETER, METHOD, FIELD })
+public @interface NetconfAuthProvider {
+
+}
diff --git a/src/main/java/org/opendaylight/netconf/simple/annotations/NetconfClientDispatcher.java b/src/main/java/org/opendaylight/netconf/simple/annotations/NetconfClientDispatcher.java
new file mode 100644 (file)
index 0000000..66ac651
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * (C) 2019 Lumina Networks, Inc.
+ * 2077 Gateway Place, Suite 500, San Jose, CA 95110.
+ * All rights reserved.
+ *
+ * Use of the software files and documentation is subject to license terms.
+ */
+package org.opendaylight.netconf.simple.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ * PingPong {@link NetconfClientDispatcher} dependency injection annotation.
+ *
+ * <p>USAGE: <pre> {@literal @}Singleton
+ * public class Thing {
+ *     {@literal @}Inject
+ *     public Thing({@literal @}NetconfClientDispatcher NetconfClientDispatcher dispatcher) {
+ *         ...
+ *     }
+ * }</pre>
+ */
+@Qualifier
+@Documented
+@Retention(RUNTIME)
+@Target({ PARAMETER, METHOD, FIELD })
+public @interface NetconfClientDispatcher {
+
+}
diff --git a/src/main/java/org/opendaylight/openflowplugin/simple/OpenflowPluginMain.java b/src/main/java/org/opendaylight/openflowplugin/simple/OpenflowPluginMain.java
new file mode 100644 (file)
index 0000000..18058a8
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * (C) 2019 Lumina Networks, Inc.
+ * 2077 Gateway Place, Suite 500, San Jose, CA 95110.
+ * All rights reserved.
+ *
+ * Use of the software files and documentation is subject to license terms.
+ */
+package org.opendaylight.openflowplugin.simple;
+
+import org.opendaylight.infrautils.inject.guice.GuiceClassPathBinder;
+import org.opendaylight.infrautils.simple.ShellMain;
+
+public final class OpenflowPluginMain {
+
+    private OpenflowPluginMain() { }
+
+    public static void main(String[] args) {
+        GuiceClassPathBinder classPathBinder = new GuiceClassPathBinder("org.opendaylight");
+        new ShellMain(new OpenFlowPluginModule(classPathBinder)).awaitShutdown();
+    }
+}
index 92f6a5784a8fc2c029e9a4cfd17b97d09e818a4c..770c644e2a3dd01b5ab207e7e95874ea5a55e4bd 100644 (file)
@@ -2,7 +2,7 @@
 # but ${karaf.data} has been replaced by "data/", all Karaf/OSGi appenders etc. have been removed,
 # the file name changed from karaf.log to opendaylight.log, and the "log4j2." prefix needed to be removed.
 
-rootLogger.level = INFO
+rootLogger.level = DEBUG
 # uncomment to use asynchronous loggers, which require mvn:com.lmax/disruptor/3.3.2 library
 #rootLogger.type = asyncRoot
 #rootLogger.includeLocation = false
@@ -28,3 +28,8 @@ appender.rolling.layout.pattern = %d{ISO8601} | %-5p | %-16t | %-32c{1} | %m%n
 appender.rolling.policies.type = Policies
 appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
 appender.rolling.policies.size.size = 16MB
+
+logger.netconfsal.name = org.opendaylight.controller.sal.connect.netconf
+logger.netconfsal.level = TRACE
+logger.netconf.name = org.opendaylight.netconf
+logger.netconf.level = TRACE