<parent>
<groupId>org.opendaylight.infrautils</groupId>
<artifactId>parent</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0</version>
<relativePath />
</parent>
<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>
*/
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 {
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;
+ }
+ };
+ }
}
--- /dev/null
+/*
+ * (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 {
+
+}
--- /dev/null
+/*
+ * (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 {
+
+}
--- /dev/null
+/*
+ * (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 {
+
+}
--- /dev/null
+/*
+ * (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 {
+
+}
*/
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;
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 {
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();
--- /dev/null
+/*
+ * (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();
+ }
+}
--- /dev/null
+/*
+ * (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
+
+}
--- /dev/null
+/*
+ * (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 {
+
+}
--- /dev/null
+/*
+ * (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 {
+
+}
--- /dev/null
+/*
+ * (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 {
+
+}
--- /dev/null
+/*
+ * (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 {
+
+}
--- /dev/null
+/*
+ * (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 {
+
+}
--- /dev/null
+/*
+ * (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 {
+
+}
--- /dev/null
+/*
+ * (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 {
+
+}
--- /dev/null
+/*
+ * (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 {
+
+}
--- /dev/null
+/*
+ * (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();
+ }
+}
# 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
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