Merge "Add netconf-util tests and remove unused classes"
authorJakub Morvay <jmorvay@cisco.com>
Wed, 2 Nov 2016 18:35:29 +0000 (18:35 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 2 Nov 2016 18:35:29 +0000 (18:35 +0000)
100 files changed:
features/netconf-connector/pom.xml
features/netconf-connector/src/main/features/features.xml
features/netconf/pom.xml
features/netconf/src/main/features/features.xml
netconf/aaa-authn-odl-plugin/src/main/java/org/opendaylight/aaa/odl/CredentialServiceAuthProvider.java
netconf/aaa-authn-odl-plugin/src/main/java/org/opendaylight/yang/gen/v1/config/aaa/authn/netconf/plugin/rev150715/AuthProviderModule.java [deleted file]
netconf/aaa-authn-odl-plugin/src/main/java/org/opendaylight/yang/gen/v1/config/aaa/authn/netconf/plugin/rev150715/AuthProviderModuleFactory.java [deleted file]
netconf/aaa-authn-odl-plugin/src/main/resources/org/opendaylight/blueprint/aaa-authn-netconf.xml [new file with mode: 0644]
netconf/aaa-authn-odl-plugin/src/main/yang/aaa-authn-netconf-plugin.yang [deleted file]
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/mapper/NetconfMdsalMapperModule.java [deleted file]
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/mapper/NetconfMdsalMapperModuleFactory.java [deleted file]
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/MdsalNetconfOperationServiceFactory.java
netconf/mdsal-netconf-connector/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-connector.xml [new file with mode: 0644]
netconf/mdsal-netconf-connector/src/main/yang/netconf-mdsal-mapper.yang [deleted file]
netconf/mdsal-netconf-impl/pom.xml [new file with mode: 0644]
netconf/mdsal-netconf-impl/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-impl.xml [new file with mode: 0755]
netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MdSalMonitoringMapperFactory.java [new file with mode: 0644]
netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MonitoringToMdsalWriter.java
netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/NetconfMdsalMonitoringMapperModule.java [deleted file]
netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/NetconfMdsalMonitoringMapperModuleFactory.java [deleted file]
netconf/mdsal-netconf-monitoring/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-monitoring.xml [new file with mode: 0644]
netconf/mdsal-netconf-monitoring/src/main/yang/netconf-mdsal-monitoring.yang [deleted file]
netconf/mdsal-netconf-monitoring/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MonitoringToMdsalWriterTest.java
netconf/mdsal-netconf-notification/pom.xml
netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/CapabilityChangeNotificationProducer.java
netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NetconfMdsalNotificationMapperModule.java [deleted file]
netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NetconfMdsalNotificationMapperModuleFactory.java [deleted file]
netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NotificationToMdsalWriter.java
netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/SessionNotificationProducer.java
netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/netconf/mdsal/notification/NetconfNotificationOperationServiceFactory.java
netconf/mdsal-netconf-notification/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-notification.xml [new file with mode: 0755]
netconf/mdsal-netconf-notification/src/main/yang/netconf-mdsal-notification.yang [deleted file]
netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/CapabilityChangeNotificationProducerTest.java
netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NotificationToMdsalWriterTest.java
netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/SessionNotificationProducerTest.java
netconf/mdsal-netconf-ssh/pom.xml [new file with mode: 0644]
netconf/mdsal-netconf-ssh/src/main/resources/org/opendaylight/blueprint/netconf-ssh.xml [new file with mode: 0755]
netconf/mdsal-netconf-yang-library/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/yang/library/NetconfMdsalYanglibModule.java [deleted file]
netconf/mdsal-netconf-yang-library/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/yang/library/NetconfMdsalYanglibModuleFactory.java [deleted file]
netconf/mdsal-netconf-yang-library/src/main/java/org/opendaylight/netconf/mdsal/yang/library/SchemaServiceToMdsalWriter.java
netconf/mdsal-netconf-yang-library/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-yang-library.xml [new file with mode: 0755]
netconf/mdsal-netconf-yang-library/src/main/yang/netconf-mdsal-yang-library.yang [deleted file]
netconf/mdsal-netconf-yang-library/src/test/java/org/opendaylight/netconf/mdsal/yang/library/SchemaServiceToMdsalWriterTest.java
netconf/netconf-api/src/main/yang/netconf-northbound.yang
netconf/netconf-artifacts/pom.xml
netconf/netconf-auth/src/main/yang/netconf-auth.yang
netconf/netconf-client/pom.xml
netconf/netconf-client/src/main/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModule.java [new file with mode: 0644]
netconf/netconf-client/src/main/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModuleFactory.java [new file with mode: 0644]
netconf/netconf-client/src/main/resources/org/opendaylight/blueprint/netconf-client.xml [new file with mode: 0755]
netconf/netconf-client/src/main/yang/odl-netconf-cfg.yang [new file with mode: 0644]
netconf/netconf-client/src/main/yang/odl-netconfig-client-cfg.yang [new file with mode: 0644]
netconf/netconf-client/src/test/resources/helloMessage1.xml
netconf/netconf-config-dispatcher/pom.xml
netconf/netconf-config-dispatcher/src/main/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModule.java [deleted file]
netconf/netconf-config-dispatcher/src/main/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModuleFactory.java [deleted file]
netconf/netconf-config-dispatcher/src/main/yang/odl-netconf-cfg.yang
netconf/netconf-config-dispatcher/src/main/yang/odl-netconfig-client-cfg.yang
netconf/netconf-config-dispatcher/src/test/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModuleTest.java [deleted file]
netconf/netconf-config/src/main/resources/initial/01-netconf.xml
netconf/netconf-console/src/main/config/default-config.xml [deleted file]
netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/commands/NetconfCommandUtils.java
netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/commands/NetconfDisconnectDeviceCommand.java
netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/commands/NetconfListDevicesCommand.java
netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/commands/NetconfUpdateDeviceCommand.java
netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfCommandsImpl.java
netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfConsoleProvider.java [deleted file]
netconf/netconf-console/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/netconf/console/provider/impl/rev160323/NetconfConsoleProviderModule.java [deleted file]
netconf/netconf-console/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/netconf/console/provider/impl/rev160323/NetconfConsoleProviderModuleFactory.java [deleted file]
netconf/netconf-console/src/main/resources/OSGI-INF/blueprint/commands.xml [deleted file]
netconf/netconf-console/src/main/resources/org/opendaylight/blueprint/netconf-command.xml [new file with mode: 0755]
netconf/netconf-console/src/main/yang/netconf-console-provider-impl.yang [deleted file]
netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfCommandsImplTest.java
netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfConsoleProviderTest.java [deleted file]
netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfMapperAggregatorModule.java [deleted file]
netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfMapperAggregatorModuleFactory.java [deleted file]
netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerDispatcherModule.java [deleted file]
netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerDispatcherModuleFactory.java [deleted file]
netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerMonitoringModule.java [deleted file]
netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerMonitoringModuleFactory.java [deleted file]
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSessionNegotiatorFactory.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/AggregatedNetconfOperationServiceFactory.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfCapabilityMonitoringService.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfMonitoringServiceImpl.java
netconf/netconf-impl/src/main/yang/netconf-northbound-impl.yang [deleted file]
netconf/netconf-mapping-api/src/main/yang/netconf-northbound-mapper.yang
netconf/netconf-mdsal-config/pom.xml [deleted file]
netconf/netconf-mdsal-config/src/main/resources/initial/08-netconf-mdsal.xml [deleted file]
netconf/netconf-notifications-api/src/main/yang/netconf-northbound-notification.yang
netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/notification/impl/NetconfNotificationManagerModule.java [deleted file]
netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/notification/impl/NetconfNotificationManagerModuleFactory.java [deleted file]
netconf/netconf-notifications-impl/src/main/yang/netconf-northbound-notification-impl.yang [deleted file]
netconf/netconf-ssh/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/ssh/NetconfNorthboundSshModule.java [deleted file]
netconf/netconf-ssh/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/ssh/NetconfNorthboundSshModuleFactory.java [deleted file]
netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/NetconfNorthboundSshServer.java [new file with mode: 0644]
netconf/netconf-ssh/src/main/yang/netconf-northbound-ssh.yang [deleted file]
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfMasterDOMTransaction.java
netconf/netconf-topology/pom.xml
netconf/pom.xml
netconf/sal-netconf-connector/pom.xml

index 9600b0ba5aa50cd7c8c73458da2c8ed50c608af4..d2c3acc43c31806e81011c4eacad7ba9907faebb 100644 (file)
@@ -36,7 +36,6 @@
     <config.netconf.client.configfile>01-netconf.xml</config.netconf.client.configfile>
     <config.netconf.topology.configfile>02-netconf-topology.xml</config.netconf.topology.configfile>
     <config.netconf.connector.configfile>99-netconf-connector.xml</config.netconf.connector.configfile>
-    <config.netconf.console.configfile>100-netconf-console.xml</config.netconf.console.configfile>
   </properties>
 
   <dependencyManagement>
       <type>xml</type>
       <classifier>config</classifier>
     </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-config-dispatcher</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-console</artifactId>
-      <version>${project.version}</version>
-    </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>netconf-console</artifactId>
       <version>${project.version}</version>
-      <classifier>config</classifier>
-      <type>xml</type>
     </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
index 27c883f2211198353299047f1fa5da04474a23d3..c64525e4aeded6add7db3fb81958778dc6d25104 100644 (file)
@@ -39,7 +39,6 @@
         <bundle>mvn:org.opendaylight.controller.model/model-inventory/{{VERSION}}</bundle>
         <bundle>mvn:org.opendaylight.netconf/netconf-topology/{{VERSION}}</bundle>
         <bundle>mvn:org.opendaylight.netconf/sal-netconf-connector/{{VERSION}}</bundle>
-        <bundle>mvn:org.opendaylight.netconf/netconf-config-dispatcher/{{VERSION}}</bundle>
         <configfile finalname='${config.configfile.directory}/${config.netconf.client.configfile}'>mvn:org.opendaylight.netconf/netconf-config/{{VERSION}}/xml/config</configfile>
     </feature>
 
@@ -65,7 +64,6 @@
        <feature version='${project.version}'>odl-netconf-connector-all</feature>
        <feature version='${project.version}'>odl-netconf-topology</feature>
        <bundle>mvn:org.opendaylight.netconf/netconf-console/{{VERSION}}</bundle>
-       <configfile finalname='${config.configfile.directory}/${config.netconf.console.configfile}'>mvn:org.opendaylight.netconf/netconf-console/{{VERSION}}/xml/config</configfile>
     </feature>
 
 </features>
index b413f6b838d807eb4f1cc2fd2eb1e545b8db83e6..6656a4871f1a47c68fa6346687bde63d9d6c4057 100644 (file)
@@ -34,7 +34,6 @@
 
     <config.configfile.directory>etc/opendaylight/karaf</config.configfile.directory>
     <config.netconf.client.configfile>01-netconf.xml</config.netconf.client.configfile>
-    <config.netconf.mdsal.configfile>08-mdsal-netconf.xml</config.netconf.mdsal.configfile>
   </properties>
 
   <dependencyManagement>
       <groupId>${project.groupId}</groupId>
       <artifactId>netconf-impl</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.netconf</groupId>
-      <artifactId>netconf-config-dispatcher</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>config-manager-facade-xml</artifactId>
       <groupId>${project.groupId}</groupId>
       <artifactId>netconf-monitoring</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>mdsal-netconf-ssh</artifactId>
+    </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>mdsal-netconf-monitoring</artifactId>
       <artifactId>mdsal-netconf-yang-library</artifactId>
     </dependency>
     <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-mdsal-config</artifactId>
-      <classifier>config</classifier>
-      <type>xml</type>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>mdsal-netconf-impl</artifactId>
     </dependency>
   </dependencies>
 
index b43653d2a05fd2c75bfdc294fe6b2d32c9dac2cf..175f417dd06e9da0761d7d1560617e0011038416 100644 (file)
@@ -92,7 +92,6 @@
     <feature version='${config.version}'>odl-config-netty</feature>
     <feature version='${project.version}'>odl-netconf-netty-util</feature>
     <bundle>mvn:org.opendaylight.netconf/netconf-client/{{VERSION}}</bundle>
-    <bundle>mvn:org.opendaylight.netconf/netconf-config-dispatcher/{{VERSION}}</bundle>
     <configfile finalname='${config.configfile.directory}/${config.netconf.client.configfile}'>mvn:org.opendaylight.netconf/netconf-config/{{VERSION}}/xml/config</configfile>
   </feature>
 
     <feature version='${project.version}'>odl-netconf-ssh</feature>
     <feature version='${project.version}'>odl-netconf-client</feature>
     <feature version='${controller.mdsal.version}'>odl-mdsal-broker</feature>
+    <bundle>mvn:org.opendaylight.netconf/mdsal-netconf-ssh/{{VERSION}}</bundle>
     <bundle>mvn:org.opendaylight.netconf/mdsal-netconf-notification/{{VERSION}}</bundle>
     <bundle>mvn:org.opendaylight.netconf/mdsal-netconf-connector/{{VERSION}}</bundle>
     <bundle>mvn:org.opendaylight.netconf/mdsal-netconf-monitoring/{{VERSION}}</bundle>
     <bundle>mvn:org.opendaylight.netconf/mdsal-netconf-yang-library/{{VERSION}}</bundle>
-    <configfile finalname='${config.configfile.directory}/${config.netconf.mdsal.configfile}'>mvn:org.opendaylight.netconf/netconf-mdsal-config/{{VERSION}}/xml/config</configfile>
+    <bundle>mvn:org.opendaylight.netconf/mdsal-netconf-impl/{{VERSION}}</bundle>
   </feature>
 
   <feature name='odl-aaa-netconf-plugin' description='OpenDaylight :: AAA :: ODL NETCONF Plugin'
index fe1f21c064e6cdc6a94463302cccb174ad072f7c..67ad6ebc572475dce506bc4aee96bdbf6b00254d 100644 (file)
@@ -88,8 +88,11 @@ public final class CredentialServiceAuthProvider implements AuthProvider, AutoCl
         return true;
     }
 
+    /**
+     * Invoke by blueprint
+     */
     @Override
-    public void close() throws Exception {
+    public void close() {
         listenerTracker.close();
         nullableCredService = null;
     }
diff --git a/netconf/aaa-authn-odl-plugin/src/main/java/org/opendaylight/yang/gen/v1/config/aaa/authn/netconf/plugin/rev150715/AuthProviderModule.java b/netconf/aaa-authn-odl-plugin/src/main/java/org/opendaylight/yang/gen/v1/config/aaa/authn/netconf/plugin/rev150715/AuthProviderModule.java
deleted file mode 100644 (file)
index e264881..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2015 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.yang.gen.v1.config.aaa.authn.netconf.plugin.rev150715;
-
-import com.google.common.base.Preconditions;
-import org.opendaylight.aaa.odl.CredentialServiceAuthProvider;
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.osgi.framework.BundleContext;
-
-public class AuthProviderModule extends org.opendaylight.yang.gen.v1.config.aaa.authn.netconf.plugin.rev150715.AbstractAuthProviderModule {
-
-    private BundleContext bundleContext;
-
-    public AuthProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public AuthProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.config.aaa.authn.netconf.plugin.rev150715.AuthProviderModule oldModule, AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    public AuthProviderModule(final ModuleIdentifier moduleIdentifier, final DependencyResolver dependencyResolver, final AuthProviderModule oldModule, final AutoCloseable oldInstance, final BundleContext bundleContext) {
-        this(moduleIdentifier, dependencyResolver, oldModule, oldInstance);
-        this.bundleContext = bundleContext;
-    }
-
-    public AuthProviderModule(final ModuleIdentifier moduleIdentifier, final DependencyResolver dependencyResolver, final BundleContext bundleContext) {
-        this(moduleIdentifier, dependencyResolver);
-        this.bundleContext = bundleContext;
-    }
-
-    @Override
-    public void customValidation() {
-        Preconditions.checkNotNull(bundleContext, "BundleContext was not properly set up");
-    }
-
-    @Override
-    public AutoCloseable createInstance() {
-       return new CredentialServiceAuthProvider(bundleContext);
-    }
-
-}
diff --git a/netconf/aaa-authn-odl-plugin/src/main/java/org/opendaylight/yang/gen/v1/config/aaa/authn/netconf/plugin/rev150715/AuthProviderModuleFactory.java b/netconf/aaa-authn-odl-plugin/src/main/java/org/opendaylight/yang/gen/v1/config/aaa/authn/netconf/plugin/rev150715/AuthProviderModuleFactory.java
deleted file mode 100644 (file)
index 495ac42..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2015 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
- */
-
-/*
-* Generated file
-*
-* Generated from: yang module name: aaa-authn-netconf-plugin yang module local name: aaa-authn-netconf-plugin
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Wed Jul 15 15:16:51 CEST 2015
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.yang.gen.v1.config.aaa.authn.netconf.plugin.rev150715;
-
-import java.util.Collections;
-import java.util.Set;
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.DependencyResolverFactory;
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.osgi.framework.BundleContext;
-
-public class AuthProviderModuleFactory extends org.opendaylight.yang.gen.v1.config.aaa.authn.netconf.plugin.rev150715.AbstractAuthProviderModuleFactory {
-
-    private static final ModuleIdentifier DEFAULT_INSTANCE_ID = new ModuleIdentifier(NAME, "default-auth-provider");
-
-    @Override
-    public AuthProviderModule instantiateModule(final String instanceName, final DependencyResolver dependencyResolver, final AuthProviderModule oldModule, final AutoCloseable oldInstance, final BundleContext bundleContext) {
-        return new AuthProviderModule(
-                new ModuleIdentifier(NAME, instanceName), dependencyResolver, oldModule, oldInstance, bundleContext);
-    }
-
-    @Override
-    public AuthProviderModule instantiateModule(final String instanceName, final DependencyResolver dependencyResolver, final BundleContext bundleContext) {
-        return new AuthProviderModule(
-                new ModuleIdentifier(NAME, instanceName), dependencyResolver, bundleContext);
-    }
-
-    @Override
-    public Set<AuthProviderModule> getDefaultModules(final DependencyResolverFactory dependencyResolverFactory, final BundleContext bundleContext) {
-        // Config subsystem puts this instance into OSGi service registry automatically
-        final DependencyResolver dependencyResolver = dependencyResolverFactory.createDependencyResolver(DEFAULT_INSTANCE_ID);
-        return Collections.singleton(new AuthProviderModule(DEFAULT_INSTANCE_ID, dependencyResolver, bundleContext));
-    }
-}
diff --git a/netconf/aaa-authn-odl-plugin/src/main/resources/org/opendaylight/blueprint/aaa-authn-netconf.xml b/netconf/aaa-authn-odl-plugin/src/main/resources/org/opendaylight/blueprint/aaa-authn-netconf.xml
new file mode 100644 (file)
index 0000000..6e55371
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016 Inocybe Technologies 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
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+           odl:use-default-for-reference-types="true">
+
+    <bean id="credentialServiceAuthProvider"
+          class="org.opendaylight.aaa.odl.CredentialServiceAuthProvider"
+          destroy-method="close">
+        <argument ref="blueprintBundleContext"/>
+    </bean>
+    <service ref="credentialServiceAuthProvider" interface="org.opendaylight.netconf.auth.AuthProvider"
+             odl:type="netconf-auth-provider"/>
+
+</blueprint>
\ No newline at end of file
diff --git a/netconf/aaa-authn-odl-plugin/src/main/yang/aaa-authn-netconf-plugin.yang b/netconf/aaa-authn-odl-plugin/src/main/yang/aaa-authn-netconf-plugin.yang
deleted file mode 100644 (file)
index ffa6d98..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-module aaa-authn-netconf-plugin {
-
-    yang-version 1;
-    namespace "config:aaa:authn:netconf:plugin";
-    prefix "aaa-authn-store-cfg";
-
-    import config { prefix config; revision-date 2013-04-05; }
-    import netconf-auth { prefix na; revision-date 2015-07-15; }
-
-    revision "2015-07-15" {
-        description
-            "Initial revision.";
-    }
-
-    identity aaa-authn-netconf-plugin {
-            base config:module-type;
-            config:java-name-prefix AuthProvider;
-            config:provided-service na:netconf-auth-provider;
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case aaa-authn-netconf-plugin {
-            when "/config:modules/config:module/config:type = 'aaa-authn-netconf-plugin'";
-            // no config yet
-       }
-    }
-}
diff --git a/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/mapper/NetconfMdsalMapperModule.java b/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/mapper/NetconfMdsalMapperModule.java
deleted file mode 100644 (file)
index 23993cf..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.config.yang.netconf.mdsal.mapper;
-
-import org.opendaylight.netconf.mdsal.connector.MdsalNetconfOperationServiceFactory;
-
-public class NetconfMdsalMapperModule extends org.opendaylight.controller.config.yang.netconf.mdsal.mapper.AbstractNetconfMdsalMapperModule{
-    public NetconfMdsalMapperModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public NetconfMdsalMapperModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.netconf.mdsal.mapper.NetconfMdsalMapperModule oldModule, java.lang.AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    public void customValidation() {
-        // add custom validation form module attributes here.
-    }
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-        final MdsalNetconfOperationServiceFactory mdsalNetconfOperationServiceFactory =
-            new MdsalNetconfOperationServiceFactory(getRootSchemaServiceDependency(), getRootSchemaSourceProviderDependency()) {
-                @Override
-                public void close() throws Exception {
-                    super.close();
-                    getMapperAggregatorDependency().onRemoveNetconfOperationServiceFactory(this);
-                }
-            };
-        getDomBrokerDependency().registerConsumer(mdsalNetconfOperationServiceFactory);
-        getMapperAggregatorDependency().onAddNetconfOperationServiceFactory(mdsalNetconfOperationServiceFactory);
-        return mdsalNetconfOperationServiceFactory;
-    }
-
-}
diff --git a/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/mapper/NetconfMdsalMapperModuleFactory.java b/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/mapper/NetconfMdsalMapperModuleFactory.java
deleted file mode 100644 (file)
index 4eb0563..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2015 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
- */
-
-/*
-* Generated file
-*
-* Generated from: yang module name: netconf-mdsal-mapper yang module local name: netconf-mdsal-mapper
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Wed Jan 14 14:58:42 CET 2015
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.netconf.mdsal.mapper;
-public class NetconfMdsalMapperModuleFactory extends org.opendaylight.controller.config.yang.netconf.mdsal.mapper.AbstractNetconfMdsalMapperModuleFactory {
-
-}
index b450a9d0c8310cc5fd9a738d5b179f8372eaa9ec..ef3bbf03e7c6eb75a03d33ef254efa8440779a71 100644 (file)
@@ -15,19 +15,16 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.nio.charset.StandardCharsets;
-import java.util.Collection;
-import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 import org.opendaylight.controller.config.util.capability.Capability;
 import org.opendaylight.controller.config.util.capability.YangModuleCapability;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
-import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession;
-import org.opendaylight.controller.sal.core.api.Consumer;
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
 import org.opendaylight.netconf.api.monitoring.CapabilityListener;
 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
+import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
 import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
@@ -38,19 +35,30 @@ import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class MdsalNetconfOperationServiceFactory implements NetconfOperationServiceFactory, Consumer, AutoCloseable {
+public class MdsalNetconfOperationServiceFactory implements NetconfOperationServiceFactory, AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(MdsalNetconfOperationServiceFactory.class);
 
-    private ConsumerSession session = null;
-    private DOMDataBroker dataBroker = null;
-    private DOMRpcService rpcService = null;
+    private final DOMDataBroker dataBroker;
+    private final DOMRpcService rpcService;
+
     private final CurrentSchemaContext currentSchemaContext;
     private final SchemaSourceProvider<YangTextSchemaSource> rootSchemaSourceProviderDependency;
+    private final NetconfOperationServiceFactoryListener netconfOperationServiceFactoryListener;
+
+    public MdsalNetconfOperationServiceFactory(final SchemaService schemaService,
+                                               final SchemaSourceProvider<YangTextSchemaSource> rootSchemaSourceProviderDependency,
+                                               final NetconfOperationServiceFactoryListener netconfOperationServiceFactoryListener,
+                                               final DOMDataBroker dataBroker,
+                                               final DOMRpcService rpcService) {
+
+        this.dataBroker = dataBroker;
+        this.rpcService = rpcService;
 
-    public MdsalNetconfOperationServiceFactory(final SchemaService schemaService, final SchemaSourceProvider<YangTextSchemaSource> rootSchemaSourceProviderDependency) {
         this.rootSchemaSourceProviderDependency = rootSchemaSourceProviderDependency;
         this.currentSchemaContext = new CurrentSchemaContext(Preconditions.checkNotNull(schemaService), rootSchemaSourceProviderDependency);
+        this.netconfOperationServiceFactoryListener = netconfOperationServiceFactoryListener;
+        this.netconfOperationServiceFactoryListener.onAddNetconfOperationServiceFactory(this);
     }
 
     @Override
@@ -60,8 +68,15 @@ public class MdsalNetconfOperationServiceFactory implements NetconfOperationServ
     }
 
     @Override
-    public void close() throws Exception {
-        currentSchemaContext.close();
+    public void close() {
+        try {
+            currentSchemaContext.close();
+            if (netconfOperationServiceFactoryListener != null) {
+                netconfOperationServiceFactoryListener.onRemoveNetconfOperationServiceFactory(this);
+            }
+        } catch(Exception e) {
+            LOG.error("Failed to close resources correctly - ignore", e);
+        }
     }
 
     @Override
@@ -130,16 +145,4 @@ public class MdsalNetconfOperationServiceFactory implements NetconfOperationServ
     public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
         return currentSchemaContext.registerCapabilityListener(listener);
     }
-
-    @Override
-    public void onSessionInitiated(ConsumerSession session) {
-        this.session = Preconditions.checkNotNull(session);
-        this.dataBroker = this.session.getService(DOMDataBroker.class);
-        this.rpcService = this.session.getService(DOMRpcService.class);
-    }
-
-    @Override
-    public Collection<ConsumerFunctionality> getConsumerFunctionality() {
-        return Collections.emptySet();
-    }
 }
diff --git a/netconf/mdsal-netconf-connector/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-connector.xml b/netconf/mdsal-netconf-connector/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-connector.xml
new file mode 100644 (file)
index 0000000..63505e7
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016 Inocybe Technologies 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
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+           odl:use-default-for-reference-types="true">
+
+    <reference id="domDataBroker" interface="org.opendaylight.controller.md.sal.dom.api.DOMDataBroker"/>
+    <reference id="domRpcService" interface="org.opendaylight.controller.md.sal.dom.api.DOMRpcService"/>
+    <reference id="schemaService"
+               interface="org.opendaylight.controller.sal.core.api.model.SchemaService"/>
+    <reference id="rootSchemaSourceProviderDependency"
+               interface="org.opendaylight.controller.sal.core.api.model.YangTextSourceProvider"/>
+    <reference id="netconfOperationServiceFactoryListener"
+               interface="org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener"
+               odl:type="mapper-aggregator-registry"/>
+
+    <bean id="mdsalNetconfOperationServiceFactory"
+          class="org.opendaylight.netconf.mdsal.connector.MdsalNetconfOperationServiceFactory"
+          destroy-method="close">
+        <argument ref="schemaService"/>
+        <argument ref="rootSchemaSourceProviderDependency"/>
+        <argument ref="netconfOperationServiceFactoryListener"/>
+        <argument ref="domDataBroker"/>
+        <argument ref="domRpcService"/>
+    </bean>
+    <service ref="mdsalNetconfOperationServiceFactory"
+             interface="org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory"
+             odl:type="mdsal-netconf-connector"/>
+
+</blueprint>
diff --git a/netconf/mdsal-netconf-connector/src/main/yang/netconf-mdsal-mapper.yang b/netconf/mdsal-netconf-connector/src/main/yang/netconf-mdsal-mapper.yang
deleted file mode 100644 (file)
index 633a930..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-module netconf-mdsal-mapper {
-    yang-version 1;
-    namespace "urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:mapper";
-    prefix "nmm";
-
-    import netconf-northbound-mapper { prefix nnm; revision-date 2015-01-14; }
-    import opendaylight-md-sal-dom { prefix md-sal-dom; revision-date 2013-10-28; }
-    import config { prefix config; revision-date 2013-04-05; }
-
-    organization "Cisco Systems, Inc.";
-
-    description
-        "This module contains the base YANG definitions for
-         an MD-SAL mapper implementation";
-
-    revision "2015-01-14" {
-        description
-            "Initial revision.";
-    }
-
-    identity netconf-mdsal-mapper {
-        base config:module-type;
-        config:provided-service nnm:netconf-northbound-mapper;
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case netconf-mdsal-mapper {
-            when "/config:modules/config:module/config:type = 'netconf-mdsal-mapper'";
-
-            container root-schema-service {
-                uses config:service-ref {
-                    refine type {
-                        mandatory false;
-                        config:required-identity md-sal-dom:schema-service;
-                    }
-                }
-            }
-
-            container root-schema-source-provider {
-                uses config:service-ref {
-                    refine type {
-                        mandatory false;
-                        config:required-identity md-sal-dom:yang-text-source-provider;
-                    }
-                }
-            }
-
-            container dom-broker {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity md-sal-dom:dom-broker-osgi-registry;
-                    }
-                }
-            }
-
-            container mapper-aggregator {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity nnm:netconf-mapper-registry;
-                    }
-                }
-            }
-        }
-    }
-
-}
diff --git a/netconf/mdsal-netconf-impl/pom.xml b/netconf/mdsal-netconf-impl/pom.xml
new file mode 100644 (file)
index 0000000..882f939
--- /dev/null
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016 Inocybe Technologies 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
+-->
+<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>
+
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>config-parent</artifactId>
+    <version>0.6.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <groupId>org.opendaylight.netconf</groupId>
+  <artifactId>mdsal-netconf-impl</artifactId>
+  <version>1.2.0-SNAPSHOT</version>
+  <name>${project.artifactId}</name>
+  <packaging>bundle</packaging>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.opendaylight.netconf</groupId>
+        <artifactId>netconf-subsystem</artifactId>
+        <version>${project.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>netconf-impl</artifactId>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+            <Embed-Dependency>netconf-impl</Embed-Dependency>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/netconf/mdsal-netconf-impl/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-impl.xml b/netconf/mdsal-netconf-impl/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-impl.xml
new file mode 100755 (executable)
index 0000000..f75383c
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016 Inocybe Technologies 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
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.3.0"
+           odl:restart-dependents-on-updates="true"
+           odl:use-default-for-reference-types="true">
+
+    <!--This is the MD-SAL netconf server implementation blueprint xml file-->
+
+    <reference id="globalBossGroup" interface="io.netty.channel.EventLoopGroup" odl:type="global-boss-group"/>
+    <reference id="globalWorkerGroup" interface="io.netty.channel.EventLoopGroup" odl:type="global-worker-group"/>
+    <reference id="global-timer" interface="io.netty.util.Timer" odl:type="global-timer"/>
+    <reference id="scheduledThreadPool" interface="org.opendaylight.controller.config.threadpool.ScheduledThreadPool"/>
+
+    <cm:property-placeholder persistent-id="org.opendaylight.netconf.impl" update-strategy="none">
+        <cm:default-properties>
+            <cm:property name="connection-timeout-millis" value="20000"/>
+            <cm:property name="monitoring-update-interval" value="6"/>
+        </cm:default-properties>
+    </cm:property-placeholder>
+
+    <!--NetconfMapperAggregator -->
+
+    <bean id="aggregatedNetconfOperationServiceFactory"
+          class="org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory"
+          destroy-method="close">
+    </bean>
+    <service ref="aggregatedNetconfOperationServiceFactory"
+             interface="org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener"
+             odl:type="mapper-aggregator-registry">
+    </service>
+
+    <!--NetconfServerDispatcher -->
+
+    <bean id="sessionIdProvider"
+          class="org.opendaylight.netconf.impl.SessionIdProvider"/>
+
+    <bean id="aggregatedNetconfOperationServiceFactoryMappers"
+          class="org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory"
+          destroy-method="close">
+        <argument>
+            <list value-type="org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory">
+                <ref component-id="aggregatedNetconfOperationServiceFactory"/>
+            </list>
+        </argument>
+    </bean>
+
+    <bean id="netconfServerSessionNegotiatorFactory"
+          class="org.opendaylight.netconf.impl.NetconfServerSessionNegotiatorFactory">
+        <argument ref="global-timer"/>
+        <argument ref="aggregatedNetconfOperationServiceFactoryMappers"/>
+        <argument ref="sessionIdProvider"/>
+        <argument value="${connection-timeout-millis}"/>
+        <argument ref="netconfMonitoringService"/>
+        <argument><null/></argument><!--Base capabilities-->
+    </bean>
+
+    <bean id="serverChannelInitializer"
+          class="org.opendaylight.netconf.impl.NetconfServerDispatcherImpl.ServerChannelInitializer">
+        <argument ref="netconfServerSessionNegotiatorFactory"/>
+    </bean>
+
+    <bean id="netconfServerDispatcherImpl"
+          class="org.opendaylight.netconf.impl.NetconfServerDispatcherImpl">
+        <argument ref="serverChannelInitializer"/>
+        <argument ref="globalBossGroup"/>
+        <argument ref="globalWorkerGroup"/>
+    </bean>
+    <service ref="netconfServerDispatcherImpl"
+             interface="org.opendaylight.netconf.api.NetconfServerDispatcher"
+             odl:type="netconf-server-dispatcher">
+    </service>
+
+    <!--NetconfServerMonitoring -->
+
+    <bean id="netconfMonitoringService"
+          class="org.opendaylight.netconf.impl.osgi.NetconfMonitoringServiceImpl">
+        <argument ref="aggregatedNetconfOperationServiceFactory"/>
+        <argument ref="scheduledThreadPool"/>
+        <argument value="${monitoring-update-interval}"/>
+    </bean>
+    <service ref="netconfMonitoringService"
+             interface="org.opendaylight.netconf.api.monitoring.NetconfMonitoringService"
+             odl:type="netconf-server-monitoring">
+    </service>
+
+</blueprint>
diff --git a/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MdSalMonitoringMapperFactory.java b/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MdSalMonitoringMapperFactory.java
new file mode 100644 (file)
index 0000000..a80275d
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.yang.netconf.mdsal.monitoring;
+
+import org.opendaylight.controller.config.util.capability.Capability;
+import org.opendaylight.controller.sal.common.util.NoopAutoCloseable;
+import org.opendaylight.netconf.api.monitoring.CapabilityListener;
+import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
+import org.opendaylight.netconf.mapping.api.NetconfOperation;
+import org.opendaylight.netconf.mapping.api.NetconfOperationService;
+import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
+import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
+import org.opendaylight.netconf.monitoring.GetSchema;
+
+import java.util.Collections;
+import java.util.Set;
+
+public class MdSalMonitoringMapperFactory implements NetconfOperationServiceFactory, AutoCloseable {
+
+    private final NetconfOperationService operationService;
+    private final MonitoringToMdsalWriter monitoringToMdsalWriter;
+    private final NetconfOperationServiceFactoryListener netconfOperationServiceFactoryListener;
+
+    private static final Set<Capability> CAPABILITIES = Collections.emptySet();
+
+    public MdSalMonitoringMapperFactory(final NetconfOperationServiceFactoryListener netconfOperationServiceFactoryListener,
+                                        final NetconfMonitoringService netconfMonitoringService,
+                                        final MonitoringToMdsalWriter monitoringToMdsalWriter) {
+
+        this.netconfOperationServiceFactoryListener = netconfOperationServiceFactoryListener;
+        this.monitoringToMdsalWriter = monitoringToMdsalWriter;
+
+        this.operationService = new NetconfOperationService() {
+            @Override
+            public Set<NetconfOperation> getNetconfOperations() {
+                return Collections.singleton(new GetSchema(netconfMonitoringService));
+            }
+
+            @Override
+            public void close() {
+                // NOOP
+            }
+        };
+
+        this.netconfOperationServiceFactoryListener.onAddNetconfOperationServiceFactory(this);
+    }
+
+    @Override
+    public NetconfOperationService createService(final String netconfSessionIdForReporting) {
+        return operationService;
+    }
+
+    @Override
+    public Set<Capability> getCapabilities() {
+        // TODO
+        // No capabilities exposed to prevent clashes with schemas from mdsal-netconf-connector (it exposes all the schemas)
+        // If the schemas exposed by mdsal-netconf-connector are filtered, this class would expose monitoring related models
+        return CAPABILITIES;
+    }
+
+    @Override
+    public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
+        return NoopAutoCloseable.INSTANCE;
+    }
+
+    /**
+     * Invoke using blueprint
+     */
+    @Override
+    public void close() {
+        monitoringToMdsalWriter.close();
+        netconfOperationServiceFactoryListener.onRemoveNetconfOperationServiceFactory(this);
+    }
+
+}
\ No newline at end of file
index 7c434f2813eae2916abd909a6f4d7882c440a6a8..3e487b4db6045c248891122be3a8336c6fe826f9 100644 (file)
@@ -17,8 +17,6 @@ import javax.annotation.Nullable;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
 import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.NetconfState;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Capabilities;
@@ -32,8 +30,8 @@ import org.slf4j.LoggerFactory;
 /**
  * Writes netconf server state changes received from NetconfMonitoringService to netconf-state datastore subtree.
  */
-final class MonitoringToMdsalWriter implements AutoCloseable, NetconfMonitoringService.CapabilitiesListener,
-        NetconfMonitoringService.SessionsListener, BindingAwareProvider {
+public final class MonitoringToMdsalWriter implements AutoCloseable, NetconfMonitoringService.CapabilitiesListener,
+        NetconfMonitoringService.SessionsListener {
 
     private static final Logger LOG = LoggerFactory.getLogger(MonitoringToMdsalWriter.class);
 
@@ -45,12 +43,17 @@ final class MonitoringToMdsalWriter implements AutoCloseable, NetconfMonitoringS
             InstanceIdentifier.create(NetconfState.class).child(Sessions.class);
 
     private final NetconfMonitoringService serverMonitoringDependency;
-    private DataBroker dataBroker;
+    private final DataBroker dataBroker;
 
-    public MonitoringToMdsalWriter(final NetconfMonitoringService serverMonitoringDependency) {
+    public MonitoringToMdsalWriter(final NetconfMonitoringService serverMonitoringDependency,
+                                   final DataBroker dataBroker) {
         this.serverMonitoringDependency = serverMonitoringDependency;
+        this.dataBroker = dataBroker;
     }
 
+    /**
+     * Invoke using blueprint
+     */
     @Override
     public void close() {
         runTransaction((tx) -> tx.delete(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(NetconfState.class)));
@@ -85,9 +88,10 @@ final class MonitoringToMdsalWriter implements AutoCloseable, NetconfMonitoringS
         runTransaction((tx) -> tx.put(LogicalDatastoreType.OPERATIONAL, SCHEMAS_INSTANCE_IDENTIFIER, schemas));
     }
 
-    @Override
-    public void onSessionInitiated(final BindingAwareBroker.ProviderContext providerContext) {
-        dataBroker = providerContext.getSALService(DataBroker.class);
+    /**
+     * Invoke using blueprint
+     */
+    public void start() {
         serverMonitoringDependency.registerCapabilitiesListener(this);
         serverMonitoringDependency.registerSessionsListener(this);
     }
diff --git a/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/NetconfMdsalMonitoringMapperModule.java b/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/NetconfMdsalMonitoringMapperModule.java
deleted file mode 100644 (file)
index d335a28..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.config.yang.netconf.mdsal.monitoring;
-
-import java.util.Collections;
-import java.util.Set;
-import org.opendaylight.controller.config.util.capability.Capability;
-import org.opendaylight.netconf.api.monitoring.CapabilityListener;
-import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
-import org.opendaylight.netconf.mapping.api.NetconfOperation;
-import org.opendaylight.netconf.mapping.api.NetconfOperationService;
-import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
-import org.opendaylight.netconf.monitoring.GetSchema;
-
-public class NetconfMdsalMonitoringMapperModule extends org.opendaylight.controller.config.yang.netconf.mdsal.monitoring.AbstractNetconfMdsalMonitoringMapperModule {
-    public NetconfMdsalMonitoringMapperModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public NetconfMdsalMonitoringMapperModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, final org.opendaylight.controller.config.yang.netconf.mdsal.monitoring.NetconfMdsalMonitoringMapperModule oldModule, final java.lang.AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    public void customValidation() {
-        // add custom validation form module attributes here.
-    }
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-        final NetconfMonitoringService serverMonitoringDependency = getServerMonitoringDependency();
-
-        final MonitoringToMdsalWriter monitoringToMdsalWriter = new MonitoringToMdsalWriter(serverMonitoringDependency);
-        getBindingAwareBrokerDependency().registerProvider(monitoringToMdsalWriter);
-
-        final MdSalMonitoringMapperFactory mdSalMonitoringMapperFactory = new MdSalMonitoringMapperFactory(new MdsalMonitoringMapper(serverMonitoringDependency),
-                this, monitoringToMdsalWriter);
-
-        getAggregatorDependency().onAddNetconfOperationServiceFactory(mdSalMonitoringMapperFactory);
-        return mdSalMonitoringMapperFactory;
-
-    }
-
-    private static class MdSalMonitoringMapperFactory implements NetconfOperationServiceFactory, AutoCloseable {
-
-        private final NetconfOperationService operationService;
-        private final NetconfMdsalMonitoringMapperModule module;
-        private final MonitoringToMdsalWriter monitoringToMdsalWriter;
-
-        private static final Set<Capability> CAPABILITIES = Collections.emptySet();
-        private static final AutoCloseable AUTO_CLOSEABLE = new AutoCloseable() {
-            @Override
-            public void close() throws Exception {
-                // NOOP
-            }
-        };
-
-        public MdSalMonitoringMapperFactory(
-                final NetconfOperationService operationService,
-                final NetconfMdsalMonitoringMapperModule module,
-                final MonitoringToMdsalWriter monitoringToMdsalWriter
-        ) {
-            this.operationService = operationService;
-            this.module = module;
-            this.monitoringToMdsalWriter = monitoringToMdsalWriter;
-        }
-
-        @Override
-        public NetconfOperationService createService(final String netconfSessionIdForReporting) {
-            return operationService;
-        }
-
-        @Override
-        public Set<Capability> getCapabilities() {
-            // TODO
-            // No capabilities exposed to prevent clashes with schemas from mdsal-netconf-connector (it exposes all the schemas)
-            // If the schemas exposed by mdsal-netconf-connector are filtered, this class would expose monitoring related models
-            return CAPABILITIES;
-        }
-
-        @Override
-        public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
-            return AUTO_CLOSEABLE;
-        }
-
-        @Override
-        public void close() {
-            monitoringToMdsalWriter.close();
-            module.getAggregatorDependency().onRemoveNetconfOperationServiceFactory(this);
-        }
-
-    }
-
-
-    private static class MdsalMonitoringMapper implements NetconfOperationService {
-
-        private final NetconfMonitoringService serverMonitoringDependency;
-
-        public MdsalMonitoringMapper(final NetconfMonitoringService serverMonitoringDependency) {
-            this.serverMonitoringDependency = serverMonitoringDependency;
-        }
-
-        @Override
-        public Set<NetconfOperation> getNetconfOperations() {
-            return Collections.<NetconfOperation>singleton(new GetSchema(serverMonitoringDependency));
-        }
-
-        @Override
-        public void close() {
-            // NOOP
-        }
-    }
-}
diff --git a/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/NetconfMdsalMonitoringMapperModuleFactory.java b/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/NetconfMdsalMonitoringMapperModuleFactory.java
deleted file mode 100644 (file)
index 026b415..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2015 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
- */
-
-/*
-* Generated file
-*
-* Generated from: yang module name: netconf-mdsal-monitoring yang module local name: netconf-mdsal-monitoring-mapper
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Wed Feb 18 10:22:17 CET 2015
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.netconf.mdsal.monitoring;
-public class NetconfMdsalMonitoringMapperModuleFactory extends org.opendaylight.controller.config.yang.netconf.mdsal.monitoring.AbstractNetconfMdsalMonitoringMapperModuleFactory {
-
-}
diff --git a/netconf/mdsal-netconf-monitoring/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-monitoring.xml b/netconf/mdsal-netconf-monitoring/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-monitoring.xml
new file mode 100644 (file)
index 0000000..13b2633
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016 Inocybe Technologies 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
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+           odl:use-default-for-reference-types="true">
+
+    <reference id="dataBroker"
+               interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
+               odl:type="default"/>
+    <reference id="netconfMonitoringService"
+               interface="org.opendaylight.netconf.api.monitoring.NetconfMonitoringService"
+               odl:type="netconf-server-monitoring"/>
+    <reference id="netconfOperationServiceFactoryListener"
+               interface="org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener"
+               odl:type="mapper-aggregator-registry"/>
+
+    <bean id="monitoringToMdsalWriter"
+          class="org.opendaylight.controller.config.yang.netconf.mdsal.monitoring.MonitoringToMdsalWriter"
+          init-method="start"
+          destroy-method="close">
+        <argument ref="netconfMonitoringService"/>
+        <argument ref="dataBroker"/>
+    </bean>
+
+    <bean id="mdsalMonitoringMapperFactory"
+          class="org.opendaylight.controller.config.yang.netconf.mdsal.monitoring.MdSalMonitoringMapperFactory"
+          destroy-method="close">
+        <argument ref="netconfOperationServiceFactoryListener"/>
+        <argument ref="netconfMonitoringService"/>
+        <argument ref="monitoringToMdsalWriter"/>
+    </bean>
+
+</blueprint>
diff --git a/netconf/mdsal-netconf-monitoring/src/main/yang/netconf-mdsal-monitoring.yang b/netconf/mdsal-netconf-monitoring/src/main/yang/netconf-mdsal-monitoring.yang
deleted file mode 100644 (file)
index 68a248e..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-module netconf-mdsal-monitoring {
-    yang-version 1;
-    namespace "urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:monitoring";
-    prefix "nmmonitor";
-
-    import netconf-northbound-mapper { prefix nnm; revision-date 2015-01-14; }
-    import opendaylight-md-sal-binding {prefix md-sal-binding; revision-date 2013-10-28;}
-    import netconf-northbound { prefix nn; revision-date 2015-01-14; }
-    import config { prefix config; revision-date 2013-04-05; }
-
-    organization "Cisco Systems, Inc.";
-
-    description
-        "This module contains the base YANG definitions for
-         an MD-SAL monitoring mapper implementation";
-
-    revision "2015-02-18" {
-        description
-            "Initial revision.";
-    }
-
-    identity netconf-mdsal-monitoring-mapper {
-        base config:module-type;
-        config:provided-service nnm:netconf-northbound-mapper;
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case netconf-mdsal-monitoring-mapper {
-            when "/config:modules/config:module/config:type = 'netconf-mdsal-monitoring-mapper'";
-
-            container server-monitoring {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity nn:netconf-server-monitoring;
-                    }
-                }
-            }
-
-            container aggregator {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity nnm:netconf-mapper-registry;
-                    }
-                }
-            }
-
-            container binding-aware-broker {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity md-sal-binding:binding-broker-osgi-registry;
-                    }
-                }
-            }
-        }
-    }
-
-}
index ce52b2508e9e1b68357d630e1010ee714989e857..62551b4896f4e92a0f15086eb1c1d3665a9e2a86 100644 (file)
@@ -27,7 +27,6 @@ import org.mockito.MockitoAnnotations;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.NetconfState;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Capabilities;
@@ -46,8 +45,6 @@ public class MonitoringToMdsalWriterTest {
     @Mock
     private NetconfMonitoringService monitoring;
     @Mock
-    private BindingAwareBroker.ProviderContext context;
-    @Mock
     private DataBroker dataBroker;
     @Mock
     private WriteTransaction writeTransaction;
@@ -61,20 +58,18 @@ public class MonitoringToMdsalWriterTest {
         doReturn(null).when(monitoring).registerCapabilitiesListener(any());
         doReturn(null).when(monitoring).registerSessionsListener(any());
 
-        doReturn(dataBroker).when(context).getSALService(DataBroker.class);
-
         doReturn(writeTransaction).when(dataBroker).newWriteOnlyTransaction();
 
         doNothing().when(writeTransaction).put(eq(LogicalDatastoreType.OPERATIONAL), any(), any());
         doNothing().when(writeTransaction).delete(eq(LogicalDatastoreType.OPERATIONAL), any());
         doReturn(Futures.immediateCheckedFuture(null)).when(writeTransaction).submit();
 
-        writer = new MonitoringToMdsalWriter(monitoring);
+        writer = new MonitoringToMdsalWriter(monitoring, dataBroker);
     }
 
     @Test
     public void testClose() throws Exception {
-        writer.onSessionInitiated(context);
+        writer.start();
         writer.close();
         InOrder inOrder = inOrder(writeTransaction);
         inOrder.verify(writeTransaction).delete(LogicalDatastoreType.OPERATIONAL, INSTANCE_IDENTIFIER);
@@ -84,7 +79,7 @@ public class MonitoringToMdsalWriterTest {
     @Test
     public void testOnCapabilityChanged() throws Exception {
         final InstanceIdentifier<Capabilities> capabilitiesId = InstanceIdentifier.create(NetconfState.class).child(Capabilities.class);
-        writer.onSessionInitiated(context);
+        writer.start();
         final Capabilities capabilities = new CapabilitiesBuilder().build();
         writer.onCapabilitiesChanged(capabilities);
         InOrder inOrder = inOrder(writeTransaction);
@@ -95,7 +90,7 @@ public class MonitoringToMdsalWriterTest {
     @Test
     public void testOnSchemasChanged() throws Exception {
         final InstanceIdentifier<Schemas> schemasId = InstanceIdentifier.create(NetconfState.class).child(Schemas.class);
-        writer.onSessionInitiated(context);
+        writer.start();
         final Schemas schemas = new SchemasBuilder().build();
         writer.onSchemasChanged(schemas);
         InOrder inOrder = inOrder(writeTransaction);
@@ -109,7 +104,7 @@ public class MonitoringToMdsalWriterTest {
                 .setSessionId(1L)
                 .build();
         final InstanceIdentifier<Session> id = InstanceIdentifier.create(NetconfState.class).child(Sessions.class).child(Session.class, session.getKey());
-        writer.onSessionInitiated(context);
+        writer.start();
         writer.onSessionStarted(session);
         InOrder inOrder = inOrder(writeTransaction);
         inOrder.verify(writeTransaction).put(LogicalDatastoreType.OPERATIONAL, id, session);
@@ -122,7 +117,7 @@ public class MonitoringToMdsalWriterTest {
                 .setSessionId(1L)
                 .build();
         final InstanceIdentifier<Session> id = InstanceIdentifier.create(NetconfState.class).child(Sessions.class).child(Session.class, session.getKey());
-        writer.onSessionInitiated(context);
+        writer.start();
         writer.onSessionEnded(session);
         InOrder inOrder = inOrder(writeTransaction);
         inOrder.verify(writeTransaction).delete(LogicalDatastoreType.OPERATIONAL, id);
@@ -142,7 +137,7 @@ public class MonitoringToMdsalWriterTest {
         sessions.add(session2);
         final InstanceIdentifier<Session> id1 = InstanceIdentifier.create(NetconfState.class).child(Sessions.class).child(Session.class, session1.getKey());
         final InstanceIdentifier<Session> id2 = InstanceIdentifier.create(NetconfState.class).child(Sessions.class).child(Session.class, session2.getKey());
-        writer.onSessionInitiated(context);
+        writer.start();
         writer.onSessionsUpdated(sessions);
         InOrder inOrder = inOrder(writeTransaction);
         inOrder.verify(writeTransaction).put(LogicalDatastoreType.OPERATIONAL, id1, session1);
@@ -152,7 +147,7 @@ public class MonitoringToMdsalWriterTest {
 
     @Test
     public void testOnSessionInitiated() throws Exception {
-        writer.onSessionInitiated(context);
+        writer.start();
         verify(monitoring).registerCapabilitiesListener(writer);
     }
 }
\ No newline at end of file
index d229c316a3cf6fa0467483a678ebaef14e8ea2ea..40b561c2a3901c727dec27a2a356ddb332755e7a 100644 (file)
             <artifactId>mockito-configuration</artifactId>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                        <Embed-Dependency>netconf-notifications-impl</Embed-Dependency>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
index 2fd48091e9d1934214f47c88062ff879afb050e3..35f5c805aecbfdf39cfdafb19db7751989439b13 100644 (file)
@@ -15,15 +15,18 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Set;
 import javax.annotation.Nonnull;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.netconf.notifications.BaseNotificationPublisherRegistration;
+import org.opendaylight.netconf.notifications.NetconfNotificationCollector;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.NetconfState;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Capabilities;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfCapabilityChangeBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.changed.by.parms.ChangedByBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.changed.by.parms.changed.by.server.or.user.ServerBuilder;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 
@@ -31,15 +34,19 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
  * Listens on capabilities changes in data store and publishes them to base
  * netconf notification stream listener.
  */
-final class CapabilityChangeNotificationProducer extends OperationalDatastoreListener<Capabilities> {
+public final class CapabilityChangeNotificationProducer extends OperationalDatastoreListener<Capabilities> {
 
     private static final InstanceIdentifier<Capabilities> CAPABILITIES_INSTANCE_IDENTIFIER =
             InstanceIdentifier.create(NetconfState.class).child(Capabilities.class);
+
     private final BaseNotificationPublisherRegistration baseNotificationPublisherRegistration;
+    private final ListenerRegistration capabilityChangeListenerRegistration;
 
-    public CapabilityChangeNotificationProducer(BaseNotificationPublisherRegistration baseNotificationPublisherRegistration) {
+    public CapabilityChangeNotificationProducer(final NetconfNotificationCollector netconfNotificationCollector,
+                                                final DataBroker dataBroker) {
         super(CAPABILITIES_INSTANCE_IDENTIFIER);
-        this.baseNotificationPublisherRegistration = baseNotificationPublisherRegistration;
+        this.baseNotificationPublisherRegistration = netconfNotificationCollector.registerBaseNotificationPublisher();
+        this.capabilityChangeListenerRegistration = registerOnChanges(dataBroker);
     }
 
     @Override
@@ -80,4 +87,16 @@ final class CapabilityChangeNotificationProducer extends OperationalDatastoreLis
         netconfCapabilityChangeBuilder.setModifiedCapability(Collections.<Uri>emptyList());
         baseNotificationPublisherRegistration.onCapabilityChanged(netconfCapabilityChangeBuilder.build());
     }
+
+    /**
+     * Invoke by blueprint
+     */
+    public void close() {
+        if (baseNotificationPublisherRegistration != null) {
+            baseNotificationPublisherRegistration.close();
+        }
+        if (capabilityChangeListenerRegistration != null) {
+            capabilityChangeListenerRegistration.close();
+        }
+    }
 }
diff --git a/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NetconfMdsalNotificationMapperModule.java b/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NetconfMdsalNotificationMapperModule.java
deleted file mode 100644 (file)
index 685e80f..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.config.yang.netconf.mdsal.notification;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.netconf.mdsal.notification.NetconfNotificationOperationServiceFactory;
-import org.opendaylight.netconf.notifications.NetconfNotificationCollector;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-
-public class NetconfMdsalNotificationMapperModule extends org.opendaylight.controller.config.yang.netconf.mdsal.notification.AbstractNetconfMdsalNotificationMapperModule {
-    public NetconfMdsalNotificationMapperModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public NetconfMdsalNotificationMapperModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.netconf.mdsal.notification.NetconfMdsalNotificationMapperModule oldModule, java.lang.AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    public void customValidation() {
-        // add custom validation form module attributes here.
-    }
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-        final NetconfNotificationCollector notificationCollector = getNotificationCollectorDependency();
-
-        final NotificationToMdsalWriter notificationToMdsalWriter = new NotificationToMdsalWriter(notificationCollector);
-        getBindingAwareBrokerDependency().registerProvider(notificationToMdsalWriter);
-        final DataBroker dataBroker = getDataBrokerDependency();
-
-        final OperationalDatastoreListener capabilityNotificationProducer =
-                new CapabilityChangeNotificationProducer(notificationCollector.registerBaseNotificationPublisher());
-        final ListenerRegistration capabilityChangeListenerRegistration = capabilityNotificationProducer.registerOnChanges(dataBroker);
-
-        final OperationalDatastoreListener sessionNotificationProducer =
-                new SessionNotificationProducer(notificationCollector.registerBaseNotificationPublisher());
-        final ListenerRegistration sessionListenerRegistration = sessionNotificationProducer.registerOnChanges(dataBroker);
-
-        final NetconfNotificationOperationServiceFactory netconfNotificationOperationServiceFactory =
-            new NetconfNotificationOperationServiceFactory(getNotificationRegistryDependency()) {
-                @Override
-                public void close() {
-                    super.close();
-                    notificationToMdsalWriter.close();
-                    capabilityChangeListenerRegistration.close();
-                    sessionListenerRegistration.close();
-                    getAggregatorDependency().onRemoveNetconfOperationServiceFactory(this);
-                }
-            };
-
-        getAggregatorDependency().onAddNetconfOperationServiceFactory(netconfNotificationOperationServiceFactory);
-
-        return netconfNotificationOperationServiceFactory;
-    }
-}
diff --git a/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NetconfMdsalNotificationMapperModuleFactory.java b/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NetconfMdsalNotificationMapperModuleFactory.java
deleted file mode 100644 (file)
index c87382c..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2015 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
- */
-
-/*
-* Generated file
-*
-* Generated from: yang module name: netconf-mdsal-notification yang module local name: netconf-mdsal-notification-mapper
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Wed Aug 05 10:21:08 CEST 2015
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.netconf.mdsal.notification;
-
-public class NetconfMdsalNotificationMapperModuleFactory extends org.opendaylight.controller.config.yang.netconf.mdsal.notification.AbstractNetconfMdsalNotificationMapperModuleFactory {
-
-}
index 4a8c09ee24ee1ad9dd77a0e606598664dc0f099f..5ffe2c9ecddf383f51a37d44e4a141d5ceaac899 100644 (file)
@@ -15,8 +15,6 @@ import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
 import org.opendaylight.netconf.notifications.NetconfNotificationCollector;
 import org.opendaylight.netconf.notifications.NotificationRegistration;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.StreamNameType;
@@ -32,16 +30,18 @@ import org.slf4j.LoggerFactory;
  * Listens on changes in netconf notification stream availability and writes
  * changes to the data store.
  */
-final class NotificationToMdsalWriter implements AutoCloseable, NetconfNotificationCollector.NetconfNotificationStreamListener, BindingAwareProvider {
+public final class NotificationToMdsalWriter implements AutoCloseable, NetconfNotificationCollector.NetconfNotificationStreamListener {
 
     private static final Logger LOG = LoggerFactory.getLogger(NotificationToMdsalWriter.class);
 
     private final NetconfNotificationCollector netconfNotificationCollector;
+    private final DataBroker dataBroker;
     private NotificationRegistration notificationRegistration;
-    private DataBroker dataBroker;
 
-    public NotificationToMdsalWriter(NetconfNotificationCollector netconfNotificationCollector) {
+    public NotificationToMdsalWriter(final NetconfNotificationCollector netconfNotificationCollector,
+                                     final DataBroker dataBroker) {
         this.netconfNotificationCollector = netconfNotificationCollector;
+        this.dataBroker = dataBroker;
     }
 
     @Override
@@ -65,9 +65,10 @@ final class NotificationToMdsalWriter implements AutoCloseable, NetconfNotificat
         notificationRegistration.close();
     }
 
-    @Override
-    public void onSessionInitiated(BindingAwareBroker.ProviderContext session) {
-        dataBroker = session.getSALService(DataBroker.class);
+    /**
+     * Invoke by blueprint
+     */
+    public void start() {
         notificationRegistration = netconfNotificationCollector.registerStreamListener(this);
     }
 
index 54f67d39789233959e2b481723788bd2dc9699d3..f8d1b0edb6e7bb82f33f806daa419c1315fbe5f2 100644 (file)
@@ -10,9 +10,11 @@ package org.opendaylight.controller.config.yang.netconf.mdsal.notification;
 import com.google.common.base.Preconditions;
 import java.util.Collection;
 import javax.annotation.Nonnull;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.netconf.notifications.BaseNotificationPublisherRegistration;
+import org.opendaylight.netconf.notifications.NetconfNotificationCollector;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.SessionIdOrZeroType;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.NetconfState;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Sessions;
@@ -21,6 +23,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.not
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionEndBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionStart;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionStartBuilder;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
@@ -31,11 +34,16 @@ public class SessionNotificationProducer extends OperationalDatastoreListener<Se
 
     private static final InstanceIdentifier<Session> SESSION_INSTANCE_IDENTIFIER =
             InstanceIdentifier.create(NetconfState.class).child(Sessions.class).child(Session.class);
+
     private final BaseNotificationPublisherRegistration baseNotificationPublisherRegistration;
+    private final ListenerRegistration sessionListenerRegistration;
 
-    public SessionNotificationProducer(BaseNotificationPublisherRegistration baseNotificationPublisherRegistration) {
+    public SessionNotificationProducer(final NetconfNotificationCollector netconfNotificationCollector,
+                                       final DataBroker dataBroker) {
         super(SESSION_INSTANCE_IDENTIFIER);
-        this.baseNotificationPublisherRegistration = baseNotificationPublisherRegistration;
+
+        this.baseNotificationPublisherRegistration = netconfNotificationCollector.registerBaseNotificationPublisher();
+        this.sessionListenerRegistration = registerOnChanges(dataBroker);
     }
 
     @Override
@@ -82,4 +90,16 @@ public class SessionNotificationProducer extends OperationalDatastoreListener<Se
         baseNotificationPublisherRegistration.onSessionEnded(sessionEnd);
     }
 
+
+    /**
+     * Invoke by blueprint
+     */
+    public void close() {
+        if (baseNotificationPublisherRegistration != null) {
+            baseNotificationPublisherRegistration.close();
+        }
+        if (sessionListenerRegistration != null) {
+            sessionListenerRegistration.close();
+        }
+    }
 }
index 7c82d640d73f51fe66a7db4014c8202daacbe9f7..41ae98e1a2822505f79cc314a11964784bcfa53d 100644 (file)
@@ -11,24 +11,24 @@ package org.opendaylight.netconf.mdsal.notification;
 import java.util.Collections;
 import java.util.Set;
 import org.opendaylight.controller.config.util.capability.Capability;
+import org.opendaylight.controller.sal.common.util.NoopAutoCloseable;
 import org.opendaylight.netconf.api.monitoring.CapabilityListener;
 import org.opendaylight.netconf.mapping.api.NetconfOperationService;
 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
+import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
 import org.opendaylight.netconf.notifications.NetconfNotificationRegistry;
 
 public class NetconfNotificationOperationServiceFactory implements NetconfOperationServiceFactory, AutoCloseable {
 
     private final NetconfNotificationRegistry netconfNotificationRegistry;
+    private final NetconfOperationServiceFactoryListener netconfOperationServiceFactoryListener;
 
-    private static final AutoCloseable AUTO_CLOSEABLE = new AutoCloseable() {
-        @Override
-        public void close() throws Exception {
-            // NOOP
-        }
-    };
-
-    public NetconfNotificationOperationServiceFactory(NetconfNotificationRegistry netconfNotificationRegistry) {
+    public NetconfNotificationOperationServiceFactory(final NetconfNotificationRegistry netconfNotificationRegistry,
+                                                      final NetconfOperationServiceFactoryListener netconfOperationServiceFactoryListener) {
         this.netconfNotificationRegistry = netconfNotificationRegistry;
+        this.netconfOperationServiceFactoryListener = netconfOperationServiceFactoryListener;
+
+        this.netconfOperationServiceFactoryListener.onAddNetconfOperationServiceFactory(this);
     }
 
     @Override
@@ -46,10 +46,11 @@ public class NetconfNotificationOperationServiceFactory implements NetconfOperat
 
     @Override
     public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
-        return AUTO_CLOSEABLE;
+        return NoopAutoCloseable.INSTANCE;
     }
 
     @Override
     public void close() {
+        this.netconfOperationServiceFactoryListener.onRemoveNetconfOperationServiceFactory(this);
     }
 }
diff --git a/netconf/mdsal-netconf-notification/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-notification.xml b/netconf/mdsal-netconf-notification/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-notification.xml
new file mode 100755 (executable)
index 0000000..5550de8
--- /dev/null
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016 Inocybe Technologies 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
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+           odl:restart-dependents-on-updates="true">
+
+    <reference id="dataBroker"
+               interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
+               odl:type="default"/>
+    <reference id="netconfOperationServiceFactoryListener"
+               interface="org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener"
+               odl:type="mapper-aggregator-registry"/>
+
+    <!--This is the MD-SAL netconf server notification blueprint xml file-->
+
+    <bean id="netconfNotificationManager"
+          class="org.opendaylight.netconf.notifications.impl.NetconfNotificationManager"
+          destroy-method="close">
+    </bean>
+    <service ref="netconfNotificationManager"
+             interface="org.opendaylight.netconf.notifications.NetconfNotificationRegistry"
+             odl:type="netconf-notification-manager">
+    </service>
+    <service ref="netconfNotificationManager"
+             interface="org.opendaylight.netconf.notifications.NetconfNotificationCollector"
+             odl:type="netconf-notification-manager">
+    </service>
+
+    <bean id="notificationToMdsalWriter"
+          class="org.opendaylight.controller.config.yang.netconf.mdsal.notification.NotificationToMdsalWriter"
+          init-method="start"
+          destroy-method="close">
+        <argument ref="netconfNotificationManager"/>
+        <argument ref="dataBroker"/>
+    </bean>
+
+    <bean id="capabilityChangeNotificationProducer"
+          class="org.opendaylight.controller.config.yang.netconf.mdsal.notification.CapabilityChangeNotificationProducer"
+          destroy-method="close">
+        <argument ref="netconfNotificationManager"/>
+        <argument ref="dataBroker"/>
+    </bean>
+
+    <bean id="sessionNotificationProducer"
+          class="org.opendaylight.controller.config.yang.netconf.mdsal.notification.SessionNotificationProducer"
+          destroy-method="close">
+        <argument ref="netconfNotificationManager"/>
+        <argument ref="dataBroker"/>
+    </bean>
+
+    <bean id="netconfNotificationOperationServiceFactory"
+          class="org.opendaylight.netconf.mdsal.notification.NetconfNotificationOperationServiceFactory"
+          destroy-method="close">
+        <argument ref="netconfNotificationManager"/>
+        <argument ref="netconfOperationServiceFactoryListener"/>
+    </bean>
+    <service ref="netconfNotificationOperationServiceFactory"
+             interface="org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory"
+             odl:type="mdsal-netconf-notification"/>
+</blueprint>
diff --git a/netconf/mdsal-netconf-notification/src/main/yang/netconf-mdsal-notification.yang b/netconf/mdsal-netconf-notification/src/main/yang/netconf-mdsal-notification.yang
deleted file mode 100644 (file)
index db4e8be..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-module netconf-mdsal-notification {
-     yang-version 1;
-     namespace "urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:notification";
-     prefix "nnotification";
-
-     import netconf-northbound-mapper { prefix nnm; revision-date 2015-01-14; }
-     import opendaylight-md-sal-dom { prefix md-sal-dom; revision-date 2013-10-28; }
-     import opendaylight-md-sal-binding {prefix md-sal-binding; revision-date 2013-10-28;}
-     import netconf-northbound-notification {prefix nnn; revision-date 2015-08-06;}
-     import config { prefix config; revision-date 2013-04-05; }
-
-
-     organization "Cisco Systems, Inc.";
-
-     description
-         "This module contains the base YANG definitions for
-         an SAL notification mapper implementation";
-
-     revision "2015-08-03" {
-         description
-         "Initial revision.";
-     }
-
-     identity netconf-mdsal-notification-mapper {
-         base config:module-type;
-         config:provided-service nnm:netconf-northbound-mapper;
-     }
-
-     augment "/config:modules/config:module/config:configuration" {
-         case netconf-mdsal-notification-mapper {
-             when "/config:modules/config:module/config:type = 'netconf-mdsal-notification-mapper'";
-
-             container aggregator {
-                 uses config:service-ref {
-                     refine type {
-                         mandatory true;
-                         config:required-identity nnm:netconf-mapper-registry;
-                         }
-                 }
-             }
-
-             container binding-aware-broker {
-                 uses config:service-ref {
-                     refine type {
-                         mandatory true;
-                         config:required-identity md-sal-binding:binding-broker-osgi-registry;
-                     }
-                 }
-             }
-
-             container data-broker {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity md-sal-binding:binding-async-data-broker;
-                    }
-                }
-             }
-
-             container notification-collector {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity nnn:netconf-notification-collector;
-                    }
-                }
-             }
-
-            container notification-registry {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity nnn:netconf-notification-registry;
-                    }
-                }
-            }
-        }
-    }
-}
\ No newline at end of file
index e2156413bcd178af85de108ff27ff84682940d60..2f9ae073c1818403f890d72d7762b7f863f756af 100644 (file)
@@ -23,9 +23,13 @@ import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.netconf.notifications.BaseNotificationPublisherRegistration;
+import org.opendaylight.netconf.notifications.NetconfNotificationCollector;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.NetconfState;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Capabilities;
@@ -34,20 +38,35 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.not
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfCapabilityChangeBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.changed.by.parms.ChangedByBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.changed.by.parms.changed.by.server.or.user.ServerBuilder;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 public class CapabilityChangeNotificationProducerTest {
 
+    private CapabilityChangeNotificationProducer capabilityChangeNotificationProducer;
+
     @Mock
     private BaseNotificationPublisherRegistration baseNotificationPublisherRegistration;
-    private CapabilityChangeNotificationProducer capabilityChangeNotificationProducer;
+    @Mock
+    private ListenerRegistration listenerRegistration;
+
+    @Mock
+    private NetconfNotificationCollector netconfNotificationCollector;
+    @Mock
+    private DataBroker dataBroker;
 
     @Before
     public void setUp() throws Exception {
         MockitoAnnotations.initMocks(this);
+
+        doReturn(listenerRegistration).when(dataBroker).registerDataTreeChangeListener(any(DataTreeIdentifier.class), any(DataTreeChangeListener.class));
+
         doNothing().when(baseNotificationPublisherRegistration).onCapabilityChanged(any(NetconfCapabilityChange.class));
-        capabilityChangeNotificationProducer = new CapabilityChangeNotificationProducer(baseNotificationPublisherRegistration);
+
+        doReturn(baseNotificationPublisherRegistration).when(netconfNotificationCollector).registerBaseNotificationPublisher();
+
+        capabilityChangeNotificationProducer = new CapabilityChangeNotificationProducer(netconfNotificationCollector, dataBroker);
     }
 
     @Test
index 6084d92cca0a62952a1b2b9bbc19e06668f015d4..316d56c0d1f18b22010928ba501caadaaf5b4581 100644 (file)
@@ -61,8 +61,8 @@ public class NotificationToMdsalWriterTest {
         doReturn(Futures.immediateCheckedFuture(null)).when(tx).submit();
         doReturn(tx).when(dataBroker).newWriteOnlyTransaction();
 
-        writer = new NotificationToMdsalWriter(notificationCollector);
-        writer.onSessionInitiated(session);
+        writer = new NotificationToMdsalWriter(notificationCollector, dataBroker);
+        writer.start();
     }
 
     @Test
index 8e29ea79717c26da638bf19b9b82305d68f5fba2..cedebb4eeaca0fd97f22d416449b46bf62d80853 100644 (file)
@@ -21,28 +21,49 @@ import org.junit.Test;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.netconf.notifications.BaseNotificationPublisherRegistration;
+import org.opendaylight.netconf.notifications.NetconfNotificationCollector;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.sessions.Session;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.sessions.SessionBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfCapabilityChange;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionEnd;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionStart;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.ZeroBasedCounter32;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
 
 public class SessionNotificationProducerTest {
 
     private SessionNotificationProducer publisher;
+
     @Mock
     private BaseNotificationPublisherRegistration registration;
+    @Mock
+    private ListenerRegistration listenerRegistration;
+
+    @Mock
+    private NetconfNotificationCollector netconfNotificationCollector;
+    @Mock
+    private DataBroker dataBroker;
 
     @Before
     public void setUp() throws Exception {
         MockitoAnnotations.initMocks(this);
-        publisher = new SessionNotificationProducer(registration);
+
+        doReturn(listenerRegistration).when(dataBroker).registerDataTreeChangeListener(any(DataTreeIdentifier.class), any(DataTreeChangeListener.class));
+
+        doNothing().when(registration).onCapabilityChanged(any(NetconfCapabilityChange.class));
         doNothing().when(registration).onSessionStarted(any());
         doNothing().when(registration).onSessionEnded(any());
+
+        doReturn(registration).when(netconfNotificationCollector).registerBaseNotificationPublisher();
+
+        publisher = new SessionNotificationProducer(netconfNotificationCollector, dataBroker);
     }
 
     @Test
diff --git a/netconf/mdsal-netconf-ssh/pom.xml b/netconf/mdsal-netconf-ssh/pom.xml
new file mode 100644 (file)
index 0000000..82c3292
--- /dev/null
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016 Inocybe Technologies 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
+-->
+<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>
+
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>config-parent</artifactId>
+    <version>0.6.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <groupId>org.opendaylight.netconf</groupId>
+  <artifactId>mdsal-netconf-ssh</artifactId>
+  <version>1.2.0-SNAPSHOT</version>
+  <name>${project.artifactId}</name>
+  <packaging>bundle</packaging>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.opendaylight.netconf</groupId>
+        <artifactId>netconf-subsystem</artifactId>
+        <version>${project.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>netconf-ssh</artifactId>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+            <Embed-Dependency>netconf-ssh</Embed-Dependency>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/netconf/mdsal-netconf-ssh/src/main/resources/org/opendaylight/blueprint/netconf-ssh.xml b/netconf/mdsal-netconf-ssh/src/main/resources/org/opendaylight/blueprint/netconf-ssh.xml
new file mode 100755 (executable)
index 0000000..9d5d3ed
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016 Inocybe Technologies 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
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.3.0"
+           odl:restart-dependents-on-updates="true">
+
+    <reference id="netconfServerDispatcher" interface="org.opendaylight.netconf.api.NetconfServerDispatcher"/>
+    <reference id="globalWorkerGroup" interface="io.netty.channel.EventLoopGroup" odl:type="global-worker-group"/>
+    <reference id="executor" interface="io.netty.util.concurrent.EventExecutor" odl:type="global-event-executor"/>
+    <reference id="authProvider" interface="org.opendaylight.netconf.auth.AuthProvider" odl:type="netconf-auth-provider"/>
+
+    <!--    NETCONF server for MD-SAL (listening by default on port 2830)-->
+
+    <cm:property-placeholder persistent-id="org.opendaylight.netconf.ssh" update-strategy="none">
+        <cm:default-properties>
+            <cm:property name="bindingAddress" value="0.0.0.0"/>
+            <cm:property name="portNumber" value="2830"/>
+        </cm:default-properties>
+    </cm:property-placeholder>
+
+    <bean id="netconfMdsalServer"
+          class="org.opendaylight.netconf.ssh.NetconfNorthboundSshServer"
+          destroy-method="close">
+        <argument ref="netconfServerDispatcher"/>
+        <argument ref="globalWorkerGroup"/>
+        <argument ref="executor"/>
+        <argument value="${bindingAddress}"/>
+        <argument value="${portNumber}"/>
+        <argument ref="authProvider"/>
+    </bean>
+
+</blueprint>
diff --git a/netconf/mdsal-netconf-yang-library/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/yang/library/NetconfMdsalYanglibModule.java b/netconf/mdsal-netconf-yang-library/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/yang/library/NetconfMdsalYanglibModule.java
deleted file mode 100644 (file)
index 77492cb..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.config.yang.netconf.mdsal.yang.library;
-
-import org.opendaylight.netconf.mdsal.yang.library.SchemaServiceToMdsalWriter;
-
-public class NetconfMdsalYanglibModule extends org.opendaylight.controller.config.yang.netconf.mdsal.yang.library.AbstractNetconfMdsalYanglibModule {
-    public NetconfMdsalYanglibModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public NetconfMdsalYanglibModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.netconf.mdsal.yang.library.NetconfMdsalYanglibModule oldModule, java.lang.AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    public void customValidation() {
-        // add custom validation form module attributes here.
-    }
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-        // TODO Implement also yang-library-change notfication
-        final SchemaServiceToMdsalWriter schemaServiceToMdsalWriter =
-                new SchemaServiceToMdsalWriter(getRootSchemaServiceDependency());
-
-        getBindingAwareBrokerDependency().registerProvider(schemaServiceToMdsalWriter);
-
-        return schemaServiceToMdsalWriter;
-    }
-
-}
diff --git a/netconf/mdsal-netconf-yang-library/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/yang/library/NetconfMdsalYanglibModuleFactory.java b/netconf/mdsal-netconf-yang-library/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/yang/library/NetconfMdsalYanglibModuleFactory.java
deleted file mode 100644 (file)
index 739485b..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2015 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
- */
-
-/*
-* Generated file
-*
-* Generated from: yang module name: netconf-mdsal-yang-library yang module local name: netconf-mdsal-yanglib
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Sun Jun 19 15:28:13 CEST 2016
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.netconf.mdsal.yang.library;
-public class NetconfMdsalYanglibModuleFactory extends org.opendaylight.controller.config.yang.netconf.mdsal.yang.library.AbstractNetconfMdsalYanglibModuleFactory {
-
-}
index 44dbdc7cf2d06bc438ac4bb17318c66ec829b1ca..2360369e6af354a1a934dfde79f3867a927c0957 100644 (file)
@@ -44,7 +44,7 @@ import org.slf4j.LoggerFactory;
  * Listens for updates on global schema context, transforms context to ietf-yang-library:modules-state and
  * writes this state to operational data store
  */
-public class SchemaServiceToMdsalWriter implements SchemaContextListener, BindingAwareProvider, AutoCloseable {
+public class SchemaServiceToMdsalWriter implements SchemaContextListener, AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(SchemaServiceToMdsalWriter.class);
 
@@ -53,10 +53,12 @@ public class SchemaServiceToMdsalWriter implements SchemaContextListener, Bindin
 
     private final SchemaService schemaService;
     private final AtomicInteger moduleSetId;
-    private DataBroker dataBroker;
+    private final DataBroker dataBroker;
 
-    public SchemaServiceToMdsalWriter(final SchemaService schemaService) {
+    public SchemaServiceToMdsalWriter(final SchemaService schemaService,
+                                      final DataBroker dataBroker) {
         this.schemaService = schemaService;
+        this.dataBroker = dataBroker;
         this.moduleSetId = new AtomicInteger(0);
     }
 
@@ -65,9 +67,10 @@ public class SchemaServiceToMdsalWriter implements SchemaContextListener, Bindin
         // TODO Delete modules-state from operational data store
     }
 
-    @Override
-    public void onSessionInitiated(final BindingAwareBroker.ProviderContext providerContext) {
-        dataBroker = providerContext.getSALService(DataBroker.class);
+    /**
+     * Invoke by blueprint
+     */
+    public void start() {
         schemaService.registerSchemaContextListener(this);
     }
 
diff --git a/netconf/mdsal-netconf-yang-library/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-yang-library.xml b/netconf/mdsal-netconf-yang-library/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-yang-library.xml
new file mode 100755 (executable)
index 0000000..a4a2bf1
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016 Inocybe Technologies 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
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+           odl:use-default-for-reference-types="true">
+
+    <reference id="dataBroker"
+               interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
+               odl:type="default"/>
+    <reference id="schemaService"
+               interface="org.opendaylight.controller.sal.core.api.model.SchemaService" />
+
+    <bean id="schemaServiceToMdsalWriter"
+          class="org.opendaylight.netconf.mdsal.yang.library.SchemaServiceToMdsalWriter"
+          init-method="start"
+          destroy-method="close">
+        <argument ref="schemaService" />
+        <argument ref="dataBroker" />
+    </bean>
+
+</blueprint>
diff --git a/netconf/mdsal-netconf-yang-library/src/main/yang/netconf-mdsal-yang-library.yang b/netconf/mdsal-netconf-yang-library/src/main/yang/netconf-mdsal-yang-library.yang
deleted file mode 100644 (file)
index 407a76d..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-module netconf-mdsal-yang-library {
-    yang-version 1;
-    namespace "urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:yang:library";
-    prefix "nmyanglib";
-
-    import opendaylight-md-sal-dom { prefix md-sal-dom; revision-date 2013-10-28; }
-    import opendaylight-md-sal-binding {prefix md-sal-binding; revision-date 2013-10-28;}
-    import config { prefix config; revision-date 2013-04-05; }
-
-    organization "Cisco Systems, Inc.";
-
-    description
-        "This module contains the base YANG definitions for
-         MDSAL netconf yang module library implementation";
-
-    revision "2016-06-17" {
-        description
-            "Initial revision.";
-    }
-
-    identity netconf-mdsal-yanglib {
-        base config:module-type;
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case netconf-mdsal-yanglib {
-            when "/config:modules/config:module/config:type = 'netconf-mdsal-yanglib'";
-
-            container root-schema-service {
-                uses config:service-ref {
-                    refine type {
-                        mandatory false;
-                        config:required-identity md-sal-dom:schema-service;
-                    }
-                }
-            }
-
-            container binding-aware-broker {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity md-sal-binding:binding-broker-osgi-registry;
-                    }
-                }
-            }
-        }
-    }
-}
\ No newline at end of file
index 0e6e60907add2ef8d5c35595ed0fcc0c61afa73f..d531eb63caa4fa1e16bb7038047bde6099b14125 100644 (file)
@@ -81,12 +81,12 @@ public class SchemaServiceToMdsalWriterTest {
                 return null;
             }
         });
-        schemaServiceToMdsalWriter = new SchemaServiceToMdsalWriter(schemaService);
+        schemaServiceToMdsalWriter = new SchemaServiceToMdsalWriter(schemaService, dataBroker);
     }
 
     @Test
     public void testOnGlobalContextUpdated() {
-        schemaServiceToMdsalWriter.onSessionInitiated(context);
+        schemaServiceToMdsalWriter.start();
 
         schemaServiceToMdsalWriter.onGlobalContextUpdated(getSchema());
         verify(writeTransaction).put(eq(LogicalDatastoreType.OPERATIONAL), eq(MODULES_STATE_INSTANCE_IDENTIFIER), eq(createTestModuleState()));
index 658b2cab2774885709ea0565a1335561b9981a05..121a4d6fc8d916cd0fdc292f891197cd2c9e43c3 100644 (file)
@@ -17,11 +17,15 @@ module netconf-northbound {
     identity netconf-server-dispatcher {
         base "config:service-type";
         config:java-class "org.opendaylight.netconf.api.NetconfServerDispatcher";
+        config:disable-osgi-service-registration;
+        status deprecated;
     }
 
     identity netconf-server-monitoring {
         base "config:service-type";
         config:java-class "org.opendaylight.netconf.api.monitoring.NetconfMonitoringService";
+        config:disable-osgi-service-registration;
+        status deprecated;
     }
 
 }
\ No newline at end of file
index 7102db1cb25db4a9b25fc1c357d57b50a4153631..3ec9cd23250b153919a390e27bfe098942ad5b47 100644 (file)
                 <artifactId>aaa-authn-odl-plugin</artifactId>
                 <version>${project.version}</version>
             </dependency>
-            <dependency>
-                <groupId>${project.groupId}</groupId>
-                <artifactId>netconf-config-dispatcher</artifactId>
-                <version>${project.version}</version>
-            </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
                 <artifactId>config-netconf-connector</artifactId>
                 <type>xml</type>
                 <classifier>config</classifier>
             </dependency>
-            <dependency>
-                <groupId>${project.groupId}</groupId>
-                <artifactId>netconf-mdsal-config</artifactId>
-                <version>${project.version}</version>
-            </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
                 <artifactId>mdsal-netconf-connector</artifactId>
                 <artifactId>mdsal-netconf-yang-library</artifactId>
                 <version>${project.version}</version>
             </dependency>
+            <dependency>
+                <groupId>org.opendaylight.netconf</groupId>
+                <artifactId>mdsal-netconf-impl</artifactId>
+                <version>${project.version}</version>
+            </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
                 <artifactId>netconf-netty-util</artifactId>
                 <classifier>config</classifier>
                 <type>cfg</type>
             </dependency>
-            <dependency>
-                <groupId>${project.groupId}</groupId>
-                <artifactId>netconf-mdsal-config</artifactId>
-                <version>${project.version}</version>
-                <classifier>config</classifier>
-                <type>xml</type>
-            </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
                 <artifactId>sal-netconf-connector</artifactId>
             </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
-                <artifactId>netconf-topology</artifactId>
+                <artifactId>mdsal-netconf-ssh</artifactId>
                 <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
-                <artifactId>netconf-topology-config</artifactId>
+                <artifactId>netconf-topology</artifactId>
                 <version>${project.version}</version>
-                <classifier>config</classifier>
-                <type>xml</type>
             </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
-                <artifactId>yanglib-config</artifactId>
+                <artifactId>netconf-topology-config</artifactId>
                 <version>${project.version}</version>
                 <classifier>config</classifier>
                 <type>xml</type>
index 8f975ced2be7c491a09d42bbe45320ab1abf7a56..97213b5d466ebb229c6c5a8fffd7e9a45fb7bcf1 100644 (file)
@@ -17,6 +17,8 @@ module netconf-auth {
     identity netconf-auth-provider {
         base "config:service-type";
         config:java-class "org.opendaylight.netconf.auth.AuthProvider";
+        config:disable-osgi-service-registration;
+        status deprecated;
     }
 
 }
\ No newline at end of file
index 0683845b4077b19d459321a4b009734cc0091117..dffdfac52ef9c80f35d539c6310ed20cc347e618 100644 (file)
@@ -10,9 +10,9 @@
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
-    <groupId>org.opendaylight.odlparent</groupId>
-    <artifactId>bundle-parent</artifactId>
-    <version>1.8.0-SNAPSHOT</version>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>config-parent</artifactId>
+    <version>0.6.0-SNAPSHOT</version>
     <relativePath/>
   </parent>
 
diff --git a/netconf/netconf-client/src/main/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModule.java b/netconf/netconf-client/src/main/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModule.java
new file mode 100644 (file)
index 0000000..6bde635
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.yang.config.netconf.client.dispatcher;
+
+import com.google.common.reflect.AbstractInvocationHandler;
+import com.google.common.reflect.Reflection;
+import java.lang.reflect.Method;
+import org.opendaylight.controller.config.api.osgi.WaitingServiceTracker;
+import org.opendaylight.netconf.client.NetconfClientDispatcher;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @deprecated Replaced by blueprint wiring
+ */
+@Deprecated
+public final class NetconfClientDispatcherModule extends org.opendaylight.controller.config.yang.config.netconf.client.dispatcher.AbstractNetconfClientDispatcherModule {
+
+    private BundleContext bundleContext;
+
+    public NetconfClientDispatcherModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+        super(identifier, dependencyResolver);
+    }
+
+    public NetconfClientDispatcherModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
+            NetconfClientDispatcherModule oldModule, java.lang.AutoCloseable oldInstance) {
+
+        super(identifier, dependencyResolver, oldModule, oldInstance);
+    }
+
+    @Override
+    protected void customValidation(){
+    }
+
+    @Override
+    public java.lang.AutoCloseable createInstance() {
+        final WaitingServiceTracker<NetconfClientDispatcher> tracker =
+                WaitingServiceTracker.create(NetconfClientDispatcher.class, bundleContext, "(type=netconf-client-dispatcher)");
+        final NetconfClientDispatcher service = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
+
+        return Reflection.newProxy(AutoCloseableNetconfClientDispatcher.class, new AbstractInvocationHandler() {
+            @Override
+            protected Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable {
+                if (method.getName().equals("close")) {
+                    tracker.close();
+                    return null;
+                } else {
+                    return method.invoke(service, args);
+                }
+            }
+        });
+    }
+
+    void setBundleContext(BundleContext bundleContext) {
+        this.bundleContext = bundleContext;
+    }
+
+    private static interface AutoCloseableNetconfClientDispatcher extends NetconfClientDispatcher, AutoCloseable {
+    }
+}
diff --git a/netconf/netconf-client/src/main/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModuleFactory.java b/netconf/netconf-client/src/main/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModuleFactory.java
new file mode 100644 (file)
index 0000000..f361ed2
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.yang.config.netconf.client.dispatcher;
+
+import org.opendaylight.controller.config.api.DependencyResolver;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @deprecated Replaced by blueprint wiring
+ */
+@Deprecated
+public class NetconfClientDispatcherModuleFactory extends AbstractNetconfClientDispatcherModuleFactory {
+    @Override
+    public NetconfClientDispatcherModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
+                                                           NetconfClientDispatcherModule oldModule, AutoCloseable oldInstance, BundleContext bundleContext) {
+        NetconfClientDispatcherModule module = super.instantiateModule(instanceName, dependencyResolver, oldModule,
+                oldInstance, bundleContext);
+        module.setBundleContext(bundleContext);
+        return module;
+    }
+
+    @Override
+    public NetconfClientDispatcherModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
+                                                      BundleContext bundleContext) {
+        NetconfClientDispatcherModule module = super.instantiateModule(instanceName, dependencyResolver, bundleContext);
+        module.setBundleContext(bundleContext);
+        return module;
+    }
+}
diff --git a/netconf/netconf-client/src/main/resources/org/opendaylight/blueprint/netconf-client.xml b/netconf/netconf-client/src/main/resources/org/opendaylight/blueprint/netconf-client.xml
new file mode 100755 (executable)
index 0000000..fb2b56b
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016 Inocybe Technologies 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
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+           odl:use-default-for-reference-types="true">
+
+    <reference id="globalBossGroup" interface="io.netty.channel.EventLoopGroup" odl:type="global-boss-group"/>
+    <reference id="globalWorkerGroup" interface="io.netty.channel.EventLoopGroup" odl:type="global-worker-group"/>
+    <reference id="timer" interface="io.netty.util.Timer" odl:type="global-timer"/>
+
+    <bean id="netconfClientDispatcherImpl"
+          class="org.opendaylight.netconf.client.NetconfClientDispatcherImpl">
+        <argument ref="globalBossGroup"/>
+        <argument ref="globalWorkerGroup"/>
+        <argument ref="timer"/>
+    </bean>
+    <service ref="netconfClientDispatcherImpl"
+             interface="org.opendaylight.netconf.client.NetconfClientDispatcher"
+             odl:type="netconf-client-dispatcher">
+        <service-properties>
+        <entry key="config-module-namespace" value="urn:opendaylight:params:xml:ns:yang:controller:config:netconf"/>
+        <entry key="config-module-name" value="netconf-client-dispatcher"/>
+        <entry key="config-instance-name" value="global-netconf-dispatcher"/>
+        </service-properties>
+    </service>
+
+</blueprint>
diff --git a/netconf/netconf-client/src/main/yang/odl-netconf-cfg.yang b/netconf/netconf-client/src/main/yang/odl-netconf-cfg.yang
new file mode 100644 (file)
index 0000000..21e6242
--- /dev/null
@@ -0,0 +1,35 @@
+// vi: set smarttab et sw=4 tabstop=4:
+module odl-netconf-cfg {
+
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:controller:config:netconf";
+    prefix "cfg-net";
+
+    import config { prefix config; revision-date 2013-04-05; }
+
+    description
+        "This module contains the base YANG definitions for
+        netconf related services.
+
+        Copyright (c)2013 Cisco Systems, Inc. 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";
+
+    revision "2014-04-08" {
+        description
+            "Initial revision.";
+    }
+
+    // We keep this as sal-netconf-connector and netconf-topology need it.
+    // Once they will be moved to blueprint, it will be safe to delete all
+    // together the netconf-config-dispatcher bundle.
+    identity netconf-client-dispatcher {
+        base "config:service-type";
+        config:java-class "org.opendaylight.netconf.client.NetconfClientDispatcher";
+        config:disable-osgi-service-registration;
+        status deprecated;
+    }
+}
\ No newline at end of file
diff --git a/netconf/netconf-client/src/main/yang/odl-netconfig-client-cfg.yang b/netconf/netconf-client/src/main/yang/odl-netconfig-client-cfg.yang
new file mode 100644 (file)
index 0000000..64343a0
--- /dev/null
@@ -0,0 +1,40 @@
+// vi: set smarttab et sw=4 tabstop=4:
+module odl-netconfig-client-cfg {
+
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher";
+    prefix "cfg-net-client";
+
+    import config { prefix config; revision-date 2013-04-05; }
+    import odl-netconf-cfg { prefix cfg-net; revision-date 2014-04-08; }
+    import netty {prefix netty; }
+
+    description
+        "This module contains the base YANG definitions for
+        netconf-client-dispatcher implementation.
+
+        Copyright (c)2013 Cisco Systems, Inc. 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";
+
+    revision "2014-04-08" {
+        description
+            "Initial revision.";
+    }
+
+    identity netconf-client-dispatcher {
+            base config:module-type;
+            config:provided-service cfg-net:netconf-client-dispatcher;
+            config:java-name-prefix NetconfClientDispatcher;
+    }
+
+    augment "/config:modules/config:module/config:configuration" {
+        case netconf-client-dispatcher {
+            when "/config:modules/config:module/config:type = 'netconf-client-dispatcher'";
+        }
+    }
+
+}
\ No newline at end of file
index 9cc3feb8494e30cb3f455119f320de279a87852c..7179c8de25aad4c4efd5afc2b3e15b2a9a7687ce 100644 (file)
@@ -24,7 +24,6 @@
         <capability>urn:ietf:params:xml:ns:yang:ietf-network-topology?module=ietf-network-topology&amp;revision=2015-06-08</capability>
         <capability>urn:ietf:params:xml:ns:yang:ietf-netconf-notifications?module=ietf-netconf-notifications&amp;revision=2012-02-06</capability>
         <capability>urn:TBD:params:xml:ns:yang:ospf-topology?module=ospf-topology&amp;revision=2013-10-21</capability>
-        <capability>config:aaa:authn:netconf:plugin?module=aaa-authn-netconf-plugin&amp;revision=2015-07-15</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:config:netconf:auth?module=netconf-auth&amp;revision=2015-07-15</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:core:spi:operational-dom-store?module=opendaylight-operational-dom-datastore&amp;revision=2014-06-17</capability>
         <capability>urn:ietf:params:xml:ns:yang:ospf-topology?module=ospf-topology&amp;revision=2013-07-12</capability>
index fabef7d7ab7a79e24a22c4bca44e9ec09c067e9e..f9e27324bf006de746b9a271f9fab09cbd6035ef 100644 (file)
@@ -8,12 +8,14 @@
 -->
 <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/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.opendaylight.controller</groupId>
-    <artifactId>config-parent</artifactId>
-    <version>0.6.0-SNAPSHOT</version>
-    <relativePath/>
-  </parent>
+    <parent>
+        <groupId>org.opendaylight.mdsal</groupId>
+        <artifactId>binding-parent</artifactId>
+        <version>0.10.0-SNAPSHOT</version>
+        <relativePath/>
+    </parent>
+
+  <!--TODO Delete this bundle as soon as https://git.opendaylight.org/gerrit/#/c/46621/ is merged.-->
 
   <groupId>org.opendaylight.netconf</groupId>
   <artifactId>netconf-config-dispatcher</artifactId>
diff --git a/netconf/netconf-config-dispatcher/src/main/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModule.java b/netconf/netconf-config-dispatcher/src/main/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModule.java
deleted file mode 100644 (file)
index c48e039..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.config.yang.config.netconf.client.dispatcher;
-
-import org.opendaylight.netconf.client.NetconfClientDispatcherImpl;
-
-/**
-*
-*/
-public final class NetconfClientDispatcherModule extends org.opendaylight.controller.config.yang.config.netconf.client.dispatcher.AbstractNetconfClientDispatcherModule {
-
-    public NetconfClientDispatcherModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public NetconfClientDispatcherModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
-            NetconfClientDispatcherModule oldModule, java.lang.AutoCloseable oldInstance) {
-
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    protected void customValidation(){
-    }
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-        return new NetconfClientDispatcherImpl(getBossThreadGroupDependency(), getWorkerThreadGroupDependency(), getTimerDependency());
-    }
-}
diff --git a/netconf/netconf-config-dispatcher/src/main/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModuleFactory.java b/netconf/netconf-config-dispatcher/src/main/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModuleFactory.java
deleted file mode 100644 (file)
index cfd4ef6..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.config.yang.config.netconf.client.dispatcher;
-
-/**
-*
-*/
-public class NetconfClientDispatcherModuleFactory extends org.opendaylight.controller.config.yang.config.netconf.client.dispatcher.AbstractNetconfClientDispatcherModuleFactory
-{
-
-
-}
index a3c575dc80315880ebf47e0998e7dc12e9211a2c..be1f08c5bcc59620ef5c0dd5e77ea2d77c08ff31 100644 (file)
@@ -1,6 +1,10 @@
 // vi: set smarttab et sw=4 tabstop=4:
 module odl-netconf-cfg {
 
+/**
+* TODO Delete this YANG file as soon as https://git.opendaylight.org/gerrit/#/c/46621/ is merged.
+*/
+
     yang-version 1;
     namespace "urn:opendaylight:params:xml:ns:yang:controller:config:netconf";
     prefix "cfg-net";
@@ -24,7 +28,6 @@ module odl-netconf-cfg {
     }
 
     identity netconf-client-dispatcher {
-
         base "config:service-type";
         config:java-class "org.opendaylight.netconf.client.NetconfClientDispatcher";
     }
index e00bdeb687dc3825d7549a94cf84ddeda886fa33..caa400abb8171a8d1dbcfcb66d7aa629b2f50acf 100644 (file)
@@ -1,6 +1,10 @@
 // vi: set smarttab et sw=4 tabstop=4:
 module odl-netconfig-client-cfg {
 
+/**
+* TODO Delete this YANG file as soon as https://git.opendaylight.org/gerrit/#/c/46621/ is merged.
+*/
+
     yang-version 1;
     namespace "urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher";
     prefix "cfg-net-client";
@@ -34,30 +38,6 @@ module odl-netconfig-client-cfg {
     augment "/config:modules/config:module/config:configuration" {
         case netconf-client-dispatcher {
             when "/config:modules/config:module/config:type = 'netconf-client-dispatcher'";
-
-            container boss-thread-group {
-                uses config:service-ref {
-                    refine type {
-                        config:required-identity netty:netty-threadgroup;
-                    }
-                }
-            }
-
-            container worker-thread-group {
-                uses config:service-ref {
-                    refine type {
-                        config:required-identity netty:netty-threadgroup;
-                    }
-                }
-            }
-
-            container timer {
-                uses config:service-ref {
-                    refine type {
-                        config:required-identity netty:netty-timer;
-                    }
-                }
-            }
         }
     }
 
diff --git a/netconf/netconf-config-dispatcher/src/test/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModuleTest.java b/netconf/netconf-config-dispatcher/src/test/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModuleTest.java
deleted file mode 100644 (file)
index e9adb4c..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.config.yang.config.netconf.client.dispatcher;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.contains;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.InstanceNotFoundException;
-import javax.management.ObjectName;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-import org.opendaylight.controller.config.api.ConflictingVersionException;
-import org.opendaylight.controller.config.api.ValidationException;
-import org.opendaylight.controller.config.api.jmx.CommitStatus;
-import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
-import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;
-import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
-import org.opendaylight.controller.config.yang.netty.threadgroup.NettyThreadgroupModuleFactory;
-import org.opendaylight.controller.config.yang.netty.threadgroup.NettyThreadgroupModuleMXBean;
-import org.opendaylight.controller.config.yang.netty.timer.HashedWheelTimerModuleFactory;
-import org.osgi.framework.Filter;
-import org.osgi.framework.ServiceListener;
-import org.osgi.framework.ServiceReference;
-import io.netty.channel.EventLoopGroup;
-import io.netty.util.Timer;
-
-public class NetconfClientDispatcherModuleTest extends AbstractConfigTest{
-
-    private NetconfClientDispatcherModuleFactory factory;
-    private final String instanceName = "dispatch";
-
-    @Before
-    public void setUp() throws Exception {
-        factory = new NetconfClientDispatcherModuleFactory();
-        super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(mockedContext,factory,
-                new NettyThreadgroupModuleFactory(),
-                new HashedWheelTimerModuleFactory()));
-
-        doAnswer(new Answer<Filter>() {
-            @Override
-            public Filter answer(InvocationOnMock invocation) {
-                String str = invocation.getArgumentAt(0, String.class);
-                Filter mockFilter = mock(Filter.class);
-                doReturn(str).when(mockFilter).toString();
-                return mockFilter;
-            }
-        }).when(mockedContext).createFilter(anyString());
-        doNothing().when(mockedContext).addServiceListener(any(ServiceListener.class), anyString());
-
-        setupMockService(EventLoopGroup.class);
-        setupMockService(Timer.class);
-    }
-
-    private void setupMockService(Class<?> serviceInterface) throws Exception {
-        ServiceReference<?> mockServiceRef = mock(ServiceReference.class);
-        doReturn(new ServiceReference[]{mockServiceRef}).when(mockedContext).
-                getServiceReferences(anyString(), contains(serviceInterface.getName()));
-        doReturn(mock(serviceInterface)).when(mockedContext).getService(mockServiceRef);
-    }
-
-    @Test
-    public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException, ConflictingVersionException {
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
-
-        createInstance(transaction, instanceName, "timer", "thGroup");
-        createInstance(transaction, instanceName + 2, "timer2", "thGroup2");
-        transaction.validateConfig();
-        CommitStatus status = transaction.commit();
-
-        assertBeanCount(2, factory.getImplementationName());
-        assertStatus(status, 2 + 4, 0, 0);
-    }
-
-    @Test
-    public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException, ValidationException {
-
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
-        createInstance(transaction, instanceName, "timer", "thGroup");
-
-        transaction.commit();
-
-        transaction = configRegistryClient.createTransaction();
-        assertBeanCount(1, factory.getImplementationName());
-        CommitStatus status = transaction.commit();
-
-        assertBeanCount(1, factory.getImplementationName());
-        assertStatus(status, 0, 0, 3);
-    }
-
-    @Test
-    public void testReconfigure() throws InstanceAlreadyExistsException, ConflictingVersionException,
-            ValidationException, InstanceNotFoundException {
-
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
-        createInstance(transaction, instanceName, "timer", "thGroup");
-
-        transaction.commit();
-
-        transaction = configRegistryClient.createTransaction();
-        assertBeanCount(1, factory.getImplementationName());
-        NetconfClientDispatcherModuleMXBean mxBean = transaction.newMBeanProxy(
-                transaction.lookupConfigBean(NetconfClientDispatcherModuleFactory.NAME, instanceName),
-                NetconfClientDispatcherModuleMXBean.class);
-        mxBean.setBossThreadGroup(getThreadGroup(transaction, "group2"));
-        CommitStatus status = transaction.commit();
-
-        assertBeanCount(1, factory.getImplementationName());
-        assertStatus(status, 1, 1, 2);
-    }
-
-    private ObjectName createInstance(ConfigTransactionJMXClient transaction, String instanceName, String timerName, String threadGroupName)
-            throws InstanceAlreadyExistsException {
-        ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName);
-        NetconfClientDispatcherModuleMXBean mxBean = transaction.newMBeanProxy(nameCreated, NetconfClientDispatcherModuleMXBean.class);
-        ObjectName thGroup = getThreadGroup(transaction, threadGroupName);
-        mxBean.setBossThreadGroup(thGroup);
-        mxBean.setWorkerThreadGroup(thGroup);
-        mxBean.setTimer(getTimer(transaction, timerName));
-        return nameCreated;
-    }
-
-    private ObjectName getTimer(ConfigTransactionJMXClient transaction, String name) throws InstanceAlreadyExistsException {
-        return transaction.createModule(HashedWheelTimerModuleFactory.NAME, name);
-    }
-
-    private ObjectName getThreadGroup(ConfigTransactionJMXClient transaction, String name) throws InstanceAlreadyExistsException {
-        ObjectName nameCreated = transaction.createModule(NettyThreadgroupModuleFactory.NAME, name);
-        NettyThreadgroupModuleMXBean mxBean = transaction.newMXBeanProxy(nameCreated, NettyThreadgroupModuleMXBean.class);
-        mxBean.setThreadCount(1);
-        return nameCreated;
-    }
-}
index a2e8f4092243fd3a96118a2e905346d1dbad5632..e641ac549c504588b19d735d97717009d6ae1121 100644 (file)
         <module>
           <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">prefix:netconf-client-dispatcher</type>
           <name>global-netconf-dispatcher</name>
-          <boss-thread-group xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
-            <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
-            <name>global-boss-group</name>
-          </boss-thread-group>
-          <worker-thread-group xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
-            <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
-            <name>global-worker-group</name>
-          </worker-thread-group>
-          <timer xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
-            <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-timer</type>
-            <name>global-timer</name>
-          </timer>
         </module>
 
         <!-- Thread factory to be used by all threadpools in netconf-connectors -->
diff --git a/netconf/netconf-console/src/main/config/default-config.xml b/netconf/netconf-console/src/main/config/default-config.xml
deleted file mode 100644 (file)
index 4f27421..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2016 Inocybe Technologies. 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 INTERNAL
--->
-<snapshot>
-  <required-capabilities>
-      <capability>urn:opendaylight:netconf:console:provider:impl?module=netconf-console-provider-impl&amp;revision=2016-03-23</capability>
-      <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&amp;revision=2013-10-28</capability>
-  </required-capabilities>
-
-  <configuration>
-    <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
-      <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-        <module>
-          <type xmlns:prefix="urn:opendaylight:netconf:console:provider:impl">prefix:netconf-console-provider-impl</type>
-          <name>netconf-console-default</name>
-          <broker>
-            <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
-            <name>binding-osgi-broker</name>
-          </broker>
-        </module>
-      </modules>
-    </data>
-  </configuration>
-</snapshot>
\ No newline at end of file
index 40ac48f17c633613afc9a1dd9be39db3ae5d86d0..96715193b5a2928e0dc3ecf8acfe38368ff7d22b 100644 (file)
@@ -8,11 +8,10 @@
 
 package org.opendaylight.netconf.console.commands;
 
+import com.google.common.base.Strings;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import com.google.common.base.Strings;
-
 public class NetconfCommandUtils {
 
     private static final Pattern IP_PATTERN = Pattern.compile(
index b1abf2fa254d7a9f2bac9009245a99f1e0f48211..20f1234ac90dc9af0ebf30353370d5916d695648 100644 (file)
@@ -9,13 +9,12 @@
 package org.opendaylight.netconf.console.commands;
 
 import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Strings;
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
 import org.apache.karaf.shell.console.AbstractAction;
 import org.opendaylight.netconf.console.api.NetconfCommands;
 
-import com.google.common.base.Strings;
-
 @Command(name = "netconf:disconnect-device", scope = "netconf", description = "Disconnect netconf device.")
 public class NetconfDisconnectDeviceCommand extends AbstractAction {
 
index fd52e651e2ff7d9fce9704057ce5306688e1f8fc..7a1ec73f45ec67a99d77a7b04621fe968b98ab7a 100644 (file)
@@ -9,9 +9,7 @@
 package org.opendaylight.netconf.console.commands;
 
 import java.util.Map;
-
 import javax.annotation.Nonnull;
-
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.console.AbstractAction;
 import org.apache.karaf.shell.table.ShellTable;
index 08a8a1e202e366a5db796fe390e3d11e6ffdf06e..df2f6584bf9bbf3aa77fc58689be5d7648a535cc 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.netconf.console.commands;
 import com.google.common.annotations.VisibleForTesting;
 import java.util.HashMap;
 import java.util.Map;
-
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
 import org.apache.karaf.shell.console.AbstractAction;
index 48d21c331d1ad2bfb009479abd6de082bd50cdff..95f0917dc92e9dc432c997c444a41a0f4cb0823c 100644 (file)
@@ -19,7 +19,6 @@ import java.util.Map;
 import java.util.UUID;
 import java.util.stream.Collectors;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.MountPointService;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
@@ -50,17 +49,18 @@ public class NetconfCommandsImpl implements NetconfCommands {
     private static final Logger LOG = LoggerFactory.getLogger(NetconfCommandsImpl.class);
 
     private final DataBroker dataBroker;
-    private final MountPointService mountPointService;
 
-    public NetconfCommandsImpl(final DataBroker db, final MountPointService mountPointService) {
+    public NetconfCommandsImpl(final DataBroker db) {
         LOG.debug("NetconfConsoleProviderImpl initialized");
         this.dataBroker = db;
-        this.mountPointService = mountPointService;
     }
 
     @Override
     public Map<String, Map<String, String>> listDevices() {
         final Topology topology = NetconfConsoleUtils.read(LogicalDatastoreType.OPERATIONAL, NetconfIidFactory.NETCONF_TOPOLOGY_IID, dataBroker);
+        if (topology == null) {
+            return new HashMap<>();
+        }
         final Map<String, Map<String, String>> netconfNodes = new HashMap<>();
         for (final Node node : topology.getNode()) {
             final NetconfNode netconfNode = node.getAugmentation(NetconfNode.class);
diff --git a/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfConsoleProvider.java b/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfConsoleProvider.java
deleted file mode 100644 (file)
index 0f15ef4..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2016 Inocybe Technologies and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.netconf.console.impl;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.MountPointService;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.netconf.console.api.NetconfCommands;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.FrameworkUtil;
-import org.osgi.framework.ServiceRegistration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NetconfConsoleProvider implements BindingAwareProvider, AutoCloseable {
-
-    private static final Logger LOG = LoggerFactory.getLogger(NetconfConsoleProvider.class);
-    private ServiceRegistration<NetconfCommands> netconfConsoleRegistration;
-
-    @Override
-    public void onSessionInitiated(ProviderContext session) {
-        LOG.info("NetconfProvider Session Initiated");
-
-        // Retrieve DataBroker service to interact with md-sal
-        final DataBroker dataBroker =  session.getSALService(DataBroker.class);
-
-        // Retrieve MountPointService to interact with NETCONF remote devices connected to ODL and register it
-        final MountPointService mountService = session.getSALService(MountPointService.class);
-        final BundleContext context = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
-
-        // Initialization of NETCONF Console Provider service implementation
-        initializeNetconfConsoleProvider(dataBroker, context, mountService);
-    }
-
-    private void initializeNetconfConsoleProvider(DataBroker dataBroker, BundleContext context, MountPointService mountService) {
-        // Initialize NetconfConsoleProviderImpl class
-        final NetconfCommandsImpl consoleProvider = new NetconfCommandsImpl(dataBroker, mountService);
-
-        // Register the NetconfConsoleProvider service
-        netconfConsoleRegistration = context.registerService(NetconfCommands.class, consoleProvider, null);
-    }
-
-    @Override
-    public void close() throws Exception {
-        LOG.info("NetconfProvider closed.");
-        netconfConsoleRegistration.unregister();
-    }
-}
diff --git a/netconf/netconf-console/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/netconf/console/provider/impl/rev160323/NetconfConsoleProviderModule.java b/netconf/netconf-console/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/netconf/console/provider/impl/rev160323/NetconfConsoleProviderModule.java
deleted file mode 100644 (file)
index 39f5409..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.console.provider.impl.rev160323;
-
-import org.opendaylight.netconf.console.impl.NetconfConsoleProvider;
-
-public class NetconfConsoleProviderModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.console.provider.impl.rev160323.AbstractNetconfConsoleProviderModule {
-    public NetconfConsoleProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public NetconfConsoleProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.console.provider.impl.rev160323.NetconfConsoleProviderModule oldModule, java.lang.AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    public void customValidation() {
-        // add custom validation form module attributes here.
-    }
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-        final NetconfConsoleProvider provider = new NetconfConsoleProvider();
-        getBrokerDependency().registerProvider(provider);
-        return provider;
-    }
-}
diff --git a/netconf/netconf-console/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/netconf/console/provider/impl/rev160323/NetconfConsoleProviderModuleFactory.java b/netconf/netconf-console/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/netconf/console/provider/impl/rev160323/NetconfConsoleProviderModuleFactory.java
deleted file mode 100644 (file)
index 01c4b5f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
-* Generated file
-*
-* Generated from: yang module name: netconf-console-provider-impl yang module local name: netconf-console-provider-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Wed Mar 23 18:01:12 EDT 2016
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.console.provider.impl.rev160323;
-public class NetconfConsoleProviderModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.console.provider.impl.rev160323.AbstractNetconfConsoleProviderModuleFactory {
-
-}
diff --git a/netconf/netconf-console/src/main/resources/OSGI-INF/blueprint/commands.xml b/netconf/netconf-console/src/main/resources/OSGI-INF/blueprint/commands.xml
deleted file mode 100644 (file)
index 51e07b0..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
-    <reference id="netconfConsoleProvider" availability="mandatory"
-        activation="eager" interface="org.opendaylight.netconf.console.api.NetconfCommands">
-    </reference>
-    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0">
-        <command name="netconf:connect-device">
-            <action class="org.opendaylight.netconf.console.commands.NetconfConnectDeviceCommand">
-                <argument ref="netconfConsoleProvider"/>
-            </action>
-        </command>
-        <command name="netconf:list-devices">
-            <action class="org.opendaylight.netconf.console.commands.NetconfListDevicesCommand">
-                <argument ref="netconfConsoleProvider"/>
-            </action>
-        </command>
-        <command name="netconf:show-device">
-            <action class="org.opendaylight.netconf.console.commands.NetconfShowDeviceCommand">
-                <argument ref="netconfConsoleProvider"/>
-            </action>
-        </command>
-        <command name="netconf:disconnect-device">
-            <action class="org.opendaylight.netconf.console.commands.NetconfDisconnectDeviceCommand">
-                <argument ref="netconfConsoleProvider"/>
-            </action>
-        </command>
-        <command name="netconf:update-device">
-            <action class="org.opendaylight.netconf.console.commands.NetconfUpdateDeviceCommand">
-                <argument ref="netconfConsoleProvider"/>
-            </action>
-        </command>
-    </command-bundle>
-</blueprint>
\ No newline at end of file
diff --git a/netconf/netconf-console/src/main/resources/org/opendaylight/blueprint/netconf-command.xml b/netconf/netconf-console/src/main/resources/org/opendaylight/blueprint/netconf-command.xml
new file mode 100755 (executable)
index 0000000..68d319d
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016 Inocybe Technologies 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
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+           odl:use-default-for-reference-types="true">
+
+    <reference id="dataBroker"
+               interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
+               odl:type="default"/>
+
+    <bean id="netconfCommandsImpl" class="org.opendaylight.netconf.console.impl.NetconfCommandsImpl">
+        <argument ref="dataBroker"/>
+    </bean>
+    <service ref="netconfCommandsImpl" interface="org.opendaylight.netconf.console.api.NetconfCommands" />
+
+    <!--Karaf CLI-->
+
+    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0">
+        <command name="netconf:connect-device">
+            <action class="org.opendaylight.netconf.console.commands.NetconfConnectDeviceCommand">
+                <argument ref="netconfCommandsImpl"/>
+            </action>
+        </command>
+        <command name="netconf:list-devices">
+            <action class="org.opendaylight.netconf.console.commands.NetconfListDevicesCommand">
+                <argument ref="netconfCommandsImpl"/>
+            </action>
+        </command>
+        <command name="netconf:show-device">
+            <action class="org.opendaylight.netconf.console.commands.NetconfShowDeviceCommand">
+                <argument ref="netconfCommandsImpl"/>
+            </action>
+        </command>
+        <command name="netconf:disconnect-device">
+            <action class="org.opendaylight.netconf.console.commands.NetconfDisconnectDeviceCommand">
+                <argument ref="netconfCommandsImpl"/>
+            </action>
+        </command>
+        <command name="netconf:update-device">
+            <action class="org.opendaylight.netconf.console.commands.NetconfUpdateDeviceCommand">
+                <argument ref="netconfCommandsImpl"/>
+            </action>
+        </command>
+    </command-bundle>
+
+</blueprint>
diff --git a/netconf/netconf-console/src/main/yang/netconf-console-provider-impl.yang b/netconf/netconf-console/src/main/yang/netconf-console-provider-impl.yang
deleted file mode 100644 (file)
index bbe7ea6..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-module netconf-console-provider-impl {
-    namespace "urn:opendaylight:netconf:console:provider:impl";
-    prefix "netconf-console-provider-impl";
-
-    import config { prefix config; revision-date 2013-04-05; }
-    import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; }
-
-    revision 2016-03-23 {
-        description "Initial revision";
-    }
-
-    identity netconf-console-provider-impl {
-        base config:module-type;
-        config:java-name-prefix NetconfConsoleProvider;
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case netconf-console-provider-impl {
-            when "/config:modules/config:module/config:type = 'netconf-console-provider-impl'";
-            container broker {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity mdsal:binding-broker-osgi-registry;
-                    }
-                }
-            }
-        }
-    }
-}
\ No newline at end of file
index 6fdf0a6c12a0407518a9fca579de3c8f862c9254..83e21cfcd1b8c7de74a6ee695d6fd371e4996b1e 100644 (file)
@@ -121,8 +121,7 @@ public class NetconfCommandsImplTest {
         bindingToNormalized.onGlobalContextUpdated(schemaContext);
         dataBroker = new BindingDOMDataBrokerAdapter(cDOMDataBroker, bindingToNormalized);
 
-        final MountPointService mountPointService = mock(MountPointService.class);
-        netconfCommands = new NetconfCommandsImpl(dataBroker, mountPointService);
+        netconfCommands = new NetconfCommandsImpl(dataBroker);
     }
 
     @Test
diff --git a/netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfConsoleProviderTest.java b/netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfConsoleProviderTest.java
deleted file mode 100644 (file)
index ef20f81..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.netconf.console.impl;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.BDDMockito;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.MountPointService;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.netconf.console.api.NetconfCommands;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.FrameworkUtil;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(FrameworkUtil.class)
-public class NetconfConsoleProviderTest {
-
-    @Test
-    public void testProvider() throws Exception {
-        final NetconfConsoleProvider netconfConsoleProvider = new NetconfConsoleProvider();
-
-        PowerMockito.mockStatic(FrameworkUtil.class);
-
-        final BindingAwareBroker.ProviderContext session = mock(BindingAwareBroker.ProviderContext.class);
-        final MountPointService mountPointService = mock(MountPointService.class);
-        final BundleContext bundleContext = mock(BundleContext.class);
-        final DataBroker dataBroker = mock(DataBroker.class);
-        final Bundle bundle = mock(Bundle.class);
-
-        doReturn(dataBroker).when(session).getSALService(DataBroker.class);
-        doReturn(mountPointService).when(session).getSALService(MountPointService.class);
-        BDDMockito.given(FrameworkUtil.getBundle(any())).willReturn(bundle);
-        when(bundle.getBundleContext()).thenReturn(bundleContext);
-
-        netconfConsoleProvider.onSessionInitiated(session);
-
-        verify(bundleContext, times(1)).registerService(eq(NetconfCommands.class), any(NetconfCommandsImpl.class), eq(null));
-
-    }
-}
diff --git a/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfMapperAggregatorModule.java b/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfMapperAggregatorModule.java
deleted file mode 100644 (file)
index 4b49941..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.config.yang.config.netconf.northbound.impl;
-
-import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
-
-public class NetconfMapperAggregatorModule extends org.opendaylight.controller.config.yang.config.netconf.northbound.impl.AbstractNetconfMapperAggregatorModule {
-    public NetconfMapperAggregatorModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public NetconfMapperAggregatorModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, final org.opendaylight.controller.config.yang.config.netconf.northbound.impl.NetconfMapperAggregatorModule oldModule, final java.lang.AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    public void customValidation() {}
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-        return new AggregatedNetconfOperationServiceFactory();
-    }
-
-}
diff --git a/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfMapperAggregatorModuleFactory.java b/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfMapperAggregatorModuleFactory.java
deleted file mode 100644 (file)
index 8a8ffb7..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2015 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
- */
-
-/*
-* Generated file
-*
-* Generated from: yang module name: netconf-northbound-impl yang module local name: netconf-mapper-aggregator
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Tue Feb 17 17:24:19 CET 2015
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.config.netconf.northbound.impl;
-public class NetconfMapperAggregatorModuleFactory extends org.opendaylight.controller.config.yang.config.netconf.northbound.impl.AbstractNetconfMapperAggregatorModuleFactory {
-
-}
diff --git a/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerDispatcherModule.java b/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerDispatcherModule.java
deleted file mode 100644 (file)
index 6383b18..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.config.yang.config.netconf.northbound.impl;
-
-import org.opendaylight.controller.config.api.JmxAttributeValidationException;
-import org.opendaylight.netconf.impl.NetconfServerSessionNegotiatorFactoryBuilder;
-import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
-import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
-import org.opendaylight.netconf.impl.NetconfServerDispatcherImpl;
-import org.opendaylight.netconf.impl.NetconfServerSessionNegotiatorFactory;
-import org.opendaylight.netconf.impl.SessionIdProvider;
-import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
-
-public class NetconfServerDispatcherModule extends AbstractNetconfServerDispatcherModule {
-    public NetconfServerDispatcherModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public NetconfServerDispatcherModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, NetconfServerDispatcherModule oldModule, AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    public void customValidation() {
-        JmxAttributeValidationException.checkCondition(getConnectionTimeoutMillis() > 0, "Invalid connection timeout", connectionTimeoutMillisJmxAttribute);
-    }
-
-    @Override
-    public AutoCloseable createInstance() {
-
-        final AggregatedNetconfOperationServiceFactory aggregatedOpProvider = getAggregatedOpProvider();
-        final NetconfMonitoringService monitoringService = getServerMonitorDependency();
-
-        final NetconfServerSessionNegotiatorFactory serverNegotiatorFactory = new NetconfServerSessionNegotiatorFactoryBuilder()
-                .setAggregatedOpService(aggregatedOpProvider)
-                .setTimer(getTimerDependency())
-                .setIdProvider(new SessionIdProvider())
-                .setMonitoringService(monitoringService)
-                .setConnectionTimeoutMillis(getConnectionTimeoutMillis())
-                .build();
-        final NetconfServerDispatcherImpl.ServerChannelInitializer serverChannelInitializer = new NetconfServerDispatcherImpl.ServerChannelInitializer(
-                serverNegotiatorFactory);
-
-        return new NetconfServerDispatcherImpl(serverChannelInitializer, getBossThreadGroupDependency(), getWorkerThreadGroupDependency()) {
-
-            @Override
-            public void close() {
-                // NOOP, close should not be present here, the deprecated method closes injected evet loop groups
-            }
-        };
-
-    }
-
-    private AggregatedNetconfOperationServiceFactory getAggregatedOpProvider() {
-        final AggregatedNetconfOperationServiceFactory netconfOperationProvider = new AggregatedNetconfOperationServiceFactory();
-        for (final NetconfOperationServiceFactory netconfOperationServiceFactory : getMappersDependency()) {
-            netconfOperationProvider.onAddNetconfOperationServiceFactory(netconfOperationServiceFactory);
-        }
-        return netconfOperationProvider;
-    }
-
-
-}
diff --git a/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerDispatcherModuleFactory.java b/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerDispatcherModuleFactory.java
deleted file mode 100644 (file)
index 61c0c71..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2015 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
- */
-
-/*
-* Generated file
-*
-* Generated from: yang module name: netconf-northbound-impl yang module local name: netconf-server-dispatcher-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Thu Feb 12 11:32:29 CET 2015
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.config.netconf.northbound.impl;
-public class NetconfServerDispatcherModuleFactory extends org.opendaylight.controller.config.yang.config.netconf.northbound.impl.AbstractNetconfServerDispatcherModuleFactory {
-
-}
diff --git a/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerMonitoringModule.java b/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerMonitoringModule.java
deleted file mode 100644 (file)
index 02521e8..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.config.yang.config.netconf.northbound.impl;
-
-import com.google.common.base.Optional;
-import org.opendaylight.netconf.impl.osgi.NetconfMonitoringServiceImpl;
-
-public class NetconfServerMonitoringModule extends org.opendaylight.controller.config.yang.config.netconf.northbound.impl.AbstractNetconfServerMonitoringModule {
-    public NetconfServerMonitoringModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public NetconfServerMonitoringModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.netconf.northbound.impl.NetconfServerMonitoringModule oldModule, java.lang.AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    public void customValidation() {
-        // add custom validation form module attributes here.
-    }
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-        return new NetconfMonitoringServiceImpl(getAggregatorDependency(),
-                Optional.fromNullable(getScheduledThreadpoolDependency()),
-                getMonitoringUpdateInterval());
-    }
-
-}
diff --git a/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerMonitoringModuleFactory.java b/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerMonitoringModuleFactory.java
deleted file mode 100644 (file)
index 8b4cb65..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2015 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
- */
-
-/*
-* Generated file
-*
-* Generated from: yang module name: netconf-northbound-impl yang module local name: netconf-server-monitoring-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Tue Feb 17 17:24:19 CET 2015
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.config.netconf.northbound.impl;
-public class NetconfServerMonitoringModuleFactory extends org.opendaylight.controller.config.yang.config.netconf.northbound.impl.AbstractNetconfServerMonitoringModuleFactory {
-
-}
index bd26baa6190e8d3080072df10e66e6c339dbd367..44e2d4e8145e6a0124271da2af1635d6f94e20da 100644 (file)
@@ -52,7 +52,7 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF
     private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSessionNegotiatorFactory.class);
     private final Set<String> baseCapabilities;
 
-    protected NetconfServerSessionNegotiatorFactory(final Timer timer, final NetconfOperationServiceFactory netconfOperationProvider,
+    public NetconfServerSessionNegotiatorFactory(final Timer timer, final NetconfOperationServiceFactory netconfOperationProvider,
                                                  final SessionIdProvider idProvider, final long connectionTimeoutMillis,
                                                  final NetconfMonitoringService monitoringService, final Set<String> baseCapabilities) {
         this.timer = timer;
index d526678fde739cc4e3456ef63fa33f609570fc12..938aec869f9cee8ebf4a355dcf8fa03008c48f66 100644 (file)
@@ -13,8 +13,11 @@ import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.ImmutableSet.Builder;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Multimap;
+import com.google.common.collect.Multimaps;
 import com.google.common.collect.Sets;
+import io.netty.util.internal.ConcurrentSet;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import org.opendaylight.controller.config.util.capability.Capability;
@@ -34,9 +37,16 @@ public class AggregatedNetconfOperationServiceFactory implements NetconfOperatio
 
     private static final Logger LOG = LoggerFactory.getLogger(AggregatedNetconfOperationServiceFactory.class);
 
-    private final Set<NetconfOperationServiceFactory> factories = new HashSet<>();
-    private final Multimap<NetconfOperationServiceFactory, AutoCloseable> registrations = HashMultimap.create();
-    private final Set<CapabilityListener> listeners = Sets.newHashSet();
+    private final Set<NetconfOperationServiceFactory> factories = new ConcurrentSet<>();
+    private final Multimap<NetconfOperationServiceFactory, AutoCloseable> registrations = Multimaps.synchronizedMultimap(HashMultimap.create());
+    private final Set<CapabilityListener> listeners = new ConcurrentSet<>();
+
+    public AggregatedNetconfOperationServiceFactory() {
+    }
+
+    public AggregatedNetconfOperationServiceFactory(final List<NetconfOperationServiceFactory> mappers) {
+        mappers.forEach(this::onAddNetconfOperationServiceFactory);
+    }
 
     @Override
     public synchronized void onAddNetconfOperationServiceFactory(NetconfOperationServiceFactory service) {
@@ -64,7 +74,7 @@ public class AggregatedNetconfOperationServiceFactory implements NetconfOperatio
     }
 
     @Override
-    public synchronized Set<Capability> getCapabilities() {
+    public Set<Capability> getCapabilities() {
         final HashSet<Capability> capabilities = Sets.newHashSet();
         for (final NetconfOperationServiceFactory factory : factories) {
             capabilities.addAll(factory.getCapabilities());
index 59d9a56276e4305aa09c6177abdeec943db0c650..edd3c36bde39ae97b33b5fa1daa8befb6ce97892 100644 (file)
@@ -16,14 +16,15 @@ import com.google.common.collect.ImmutableList.Builder;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
+import io.netty.util.internal.ConcurrentSet;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 import org.opendaylight.controller.config.util.capability.BasicCapability;
 import org.opendaylight.controller.config.util.capability.Capability;
 import org.opendaylight.netconf.api.monitoring.CapabilityListener;
@@ -57,13 +58,13 @@ class NetconfCapabilityMonitoringService implements CapabilityListener, AutoClos
         }
     };
 
-    private final Set<NetconfManagementSession> sessions = new HashSet<>();
+    private final Set<NetconfManagementSession> sessions = new ConcurrentSet<>();
     private final NetconfOperationServiceFactory netconfOperationProvider;
-    private final Map<Uri, Capability> capabilities = new HashMap<>();
-    private final Map<String, Map<String, String>> mappedModulesToRevisionToSchema = Maps.newHashMap();
+    private final Map<Uri, Capability> capabilities = new ConcurrentHashMap<>();
+    private final Map<String, Map<String, String>> mappedModulesToRevisionToSchema = new ConcurrentHashMap<>();
 
 
-    private final Set<NetconfMonitoringService.CapabilitiesListener> listeners = Sets.newHashSet();
+    private final Set<NetconfMonitoringService.CapabilitiesListener> listeners = new ConcurrentSet<>();
     private volatile BaseNotificationPublisherRegistration notificationPublisher;
 
     NetconfCapabilityMonitoringService(final NetconfOperationServiceFactory netconfOperationProvider) {
index 9c8905afffc451e1b809c8f2d5ec7258d8812414..5c4c508f31b6d4e422af4b0954191f80ccd5622d 100644 (file)
@@ -26,6 +26,12 @@ public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, A
         this(opProvider, Optional.absent(), 0);
     }
 
+    public NetconfMonitoringServiceImpl(NetconfOperationServiceFactory opProvider,
+                                        ScheduledThreadPool threadPool,
+                                        long updateInterval) {
+        this(opProvider, Optional.fromNullable(threadPool), updateInterval);
+    }
+
     public NetconfMonitoringServiceImpl(NetconfOperationServiceFactory opProvider,
                                         Optional<ScheduledThreadPool> threadPool,
                                         long updateInterval) {
diff --git a/netconf/netconf-impl/src/main/yang/netconf-northbound-impl.yang b/netconf/netconf-impl/src/main/yang/netconf-northbound-impl.yang
deleted file mode 100644 (file)
index aa6485a..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-// vi: set smarttab et sw=4 tabstop=4:
-module netconf-northbound-impl {
-
-    yang-version 1;
-    namespace "urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound:impl";
-    prefix "cfg-net-s-i";
-
-    import config { prefix config; revision-date 2013-04-05; }
-    import netconf-northbound-mapper { prefix nnm; revision-date 2015-01-14; }
-    import netconf-northbound { prefix nn; revision-date 2015-01-14; }
-    import netty {prefix netty; }
-    import threadpool {prefix th;}
-
-    description
-        "This module contains the base YANG definitions for
-        netconf-server-dispatcher implementation.
-
-        Copyright (c)2013 Cisco Systems, Inc. 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";
-
-    revision "2015-01-12" {
-        description
-            "Initial revision.";
-    }
-
-    identity netconf-server-dispatcher-impl {
-            base config:module-type;
-            config:provided-service nn:netconf-server-dispatcher;
-            config:java-name-prefix NetconfServerDispatcher;
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case netconf-server-dispatcher-impl {
-            when "/config:modules/config:module/config:type = 'netconf-server-dispatcher-impl'";
-
-            leaf connection-timeout-millis {
-                description "Specifies timeout in milliseconds after which connection must be established.";
-                type uint32;
-                default 20000;
-            }
-
-            container boss-thread-group {
-                uses config:service-ref {
-                    refine type {
-                        config:required-identity netty:netty-threadgroup;
-                    }
-                }
-            }
-
-            container worker-thread-group {
-                uses config:service-ref {
-                    refine type {
-                        config:required-identity netty:netty-threadgroup;
-                    }
-                }
-            }
-
-            list mappers {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity nnm:netconf-northbound-mapper;
-                    }
-                }
-            }
-
-            container server-monitor {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity nn:netconf-server-monitoring;
-                    }
-                }
-            }
-
-            container timer {
-                uses config:service-ref {
-                    refine type {
-                        config:required-identity netty:netty-timer;
-                    }
-                }
-            }
-        }
-    }
-
-
-    identity netconf-server-monitoring-impl {
-            base config:module-type;
-            config:provided-service nn:netconf-server-monitoring;
-            config:java-name-prefix NetconfServerMonitoring;
-    }
-
-    // TODO Monitoring could expose the monitoring data over JMX...
-
-    augment "/config:modules/config:module/config:configuration" {
-        case netconf-server-monitoring-impl {
-            when "/config:modules/config:module/config:type = 'netconf-server-monitoring-impl'";
-
-            container aggregator {
-                uses config:service-ref {
-                    refine type {
-                        config:required-identity nnm:netconf-northbound-mapper;
-                    }
-                }
-            }
-            container scheduled-threadpool {
-                uses config:service-ref {
-                    refine type {
-                        mandatory false;
-                        config:required-identity th:scheduled-threadpool;
-                    }
-                }
-                description "Dedicated to update netconf-state/sessions subtree on session change.";
-            }
-            leaf monitoring-update-interval {
-                description "Specifies interval in seconds after which session stats are updated. If zero, stats won't be updated.";
-                type uint32;
-                default 0;
-            }
-
-        }
-    }
-
-    identity netconf-mapper-aggregator {
-        base config:module-type;
-        config:provided-service nnm:netconf-northbound-mapper;
-        config:provided-service nnm:netconf-mapper-registry;
-        config:java-name-prefix NetconfMapperAggregator;
-        description "Aggregated operation provider for netconf servers. Joins all the operations and capabilities of all the mappers it aggregates and exposes them as a single service. The dependency orientation is reversed in order to prevent cyclic dependencies when monitoring service is considered";
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case netconf-mapper-aggregator {
-            when "/config:modules/config:module/config:type = 'netconf-mapper-aggregator'";
-
-        }
-    }
-
-}
\ No newline at end of file
index b4ec7eca3a7c6c494fe66891b1d3365f5f2eebcf..211f1f88b554dd3ceb905b32dc764a4747c0b921 100644 (file)
@@ -17,11 +17,15 @@ module netconf-northbound-mapper {
     identity netconf-northbound-mapper {
         base "config:service-type";
         config:java-class "org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory";
+        config:disable-osgi-service-registration;
+        status deprecated;
     }
 
     identity netconf-mapper-registry {
         base "config:service-type";
         config:java-class "org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener";
+        config:disable-osgi-service-registration;
+        status deprecated;
     }
 
 }
\ No newline at end of file
diff --git a/netconf/netconf-mdsal-config/pom.xml b/netconf/netconf-mdsal-config/pom.xml
deleted file mode 100644 (file)
index 3a45520..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright (c) 2015 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
-  -->
-<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>
-  <parent>
-    <groupId>org.opendaylight.odlparent</groupId>
-    <artifactId>odlparent-lite</artifactId>
-    <version>1.8.0-SNAPSHOT</version>
-    <relativePath/>
-  </parent>
-
-  <groupId>org.opendaylight.netconf</groupId>
-  <artifactId>netconf-mdsal-config</artifactId>
-  <version>1.2.0-SNAPSHOT</version>
-  <description>Configuration files for netconf for mdsal</description>
-  <packaging>jar</packaging>
-
-  <build>
-    <plugins>
-        <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>attach-artifacts</id>
-            <goals>
-              <goal>attach-artifact</goal>
-            </goals>
-            <phase>package</phase>
-            <configuration>
-              <artifacts>
-                <artifact>
-                  <file>${project.build.directory}/classes/initial/08-netconf-mdsal.xml</file>
-                  <type>xml</type>
-                  <classifier>config</classifier>
-                </artifact>
-              </artifacts>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/netconf/netconf-mdsal-config/src/main/resources/initial/08-netconf-mdsal.xml b/netconf/netconf-mdsal-config/src/main/resources/initial/08-netconf-mdsal.xml
deleted file mode 100644 (file)
index 4826035..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright (c) 2015 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
-  -->
-
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-
-<snapshot>
-  <configuration>
-    <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
-      <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-
-          <module>
-              <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:mapper">prefix:netconf-mdsal-mapper</type>
-              <name>netconf-mdsal-mapper</name>
-              <root-schema-service>
-                  <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
-                  <name>yang-schema-service</name>
-              </root-schema-service>
-              <root-schema-source-provider>
-                  <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:yang-text-source-provider</type>
-                  <name>yang-text-source-provider</name>
-              </root-schema-source-provider>
-              <dom-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:mapper">
-                  <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-broker-osgi-registry</type>
-                  <name>dom-broker</name>
-              </dom-broker>
-              <mapper-aggregator xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:mapper">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:north:mapper">prefix:netconf-mapper-registry</type>
-                  <name>mapper-aggregator-registry</name>
-              </mapper-aggregator>
-          </module>
-
-          <module>
-              <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound:impl">prefix:netconf-server-dispatcher-impl</type>
-              <name>netconf-mdsal-server-dispatcher</name>
-              <mappers xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound:impl">
-                  <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:netconf:north:mapper">dom:netconf-northbound-mapper</type>
-                  <name>mapper-aggregator</name>
-              </mappers>
-              <server-monitor xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound:impl">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound">prefix:netconf-server-monitoring</type>
-                  <name>server-monitor</name>
-              </server-monitor>
-              <boss-thread-group xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound:impl">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
-                  <name>global-boss-group</name>
-              </boss-thread-group>
-              <worker-thread-group xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound:impl">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
-                  <name>global-worker-group</name>
-              </worker-thread-group>
-              <timer xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound:impl">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-timer</type>
-                  <name>global-timer</name>
-              </timer>
-          </module>
-
-          <module>
-              <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:monitoring">prefix:netconf-mdsal-monitoring-mapper</type>
-              <name>netconf-mdsal-monitoring-mapper</name>
-              <server-monitoring xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:monitoring">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound">prefix:netconf-server-monitoring</type>
-                  <name>server-monitor</name>
-              </server-monitoring>
-              <binding-aware-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:monitoring">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type>
-                  <name>binding-osgi-broker</name>
-              </binding-aware-broker>
-              <aggregator xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:monitoring">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:north:mapper">prefix:netconf-mapper-registry</type>
-                  <name>mapper-aggregator-registry</name>
-              </aggregator>
-          </module>
-
-          <module>
-              <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound:impl">prefix:netconf-mapper-aggregator</type>
-              <name>mapper-aggregator</name>
-          </module>
-
-          <module>
-              <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound:impl">prefix:netconf-server-monitoring-impl</type>
-              <name>server-monitor</name>
-              <aggregator xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound:impl">
-                  <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:netconf:north:mapper">dom:netconf-northbound-mapper</type>
-                  <name>mapper-aggregator</name>
-              </aggregator>
-              <scheduled-threadpool xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound:impl">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
-                  <name>global-netconf-ssh-scheduled-executor</name>
-              </scheduled-threadpool>
-              <monitoring-update-interval xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound:impl">6</monitoring-update-interval>
-          </module>
-
-          <module>
-              <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:ssh">prefix:netconf-northbound-ssh</type>
-              <name>netconf-mdsal-ssh-server</name>
-
-              <event-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:ssh">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
-                  <name>global-event-executor</name>
-              </event-executor>
-              <worker-thread-group xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:ssh">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
-                  <name>global-worker-group</name>
-              </worker-thread-group>
-              <processing-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:ssh">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
-                  <name>global-netconf-ssh-scheduled-executor</name>
-              </processing-executor>
-              <dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:ssh">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound">prefix:netconf-server-dispatcher</type>
-                  <name>netconf-mdsal-server-dispatcher</name>
-              </dispatcher>
-              <auth-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:ssh">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:auth">prefix:netconf-auth-provider</type>
-                  <name>default-auth-provider</name>
-              </auth-provider>
-          </module>
-
-          <module>
-              <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:notification:impl">prefix:netconf-notification-manager</type>
-              <name>netconf-notification-manager</name>
-          </module>
-
-          <module>
-              <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:notification">prefix:netconf-mdsal-notification-mapper</type>
-              <name>netconf-mdsal-notification-mapper</name>
-              <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:notification">
-                  <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
-                  <name>binding-data-broker</name>
-              </data-broker>
-              <binding-aware-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:notification">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type>
-                  <name>binding-osgi-broker</name>
-              </binding-aware-broker>
-              <aggregator xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:notification">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:north:mapper">prefix:netconf-mapper-registry</type>
-                  <name>mapper-aggregator-registry</name>
-              </aggregator>
-              <notification-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:notification">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:notification">prefix:netconf-notification-registry</type>
-                  <name>netconf-notification-manager</name>
-              </notification-registry>
-              <notification-collector>
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:notification">prefix:netconf-notification-collector</type>
-                  <name>netconf-notification-manager</name>
-              </notification-collector>
-          </module>
-
-          <module>
-              <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:yang:library">prefix:netconf-mdsal-yanglib</type>
-              <name>netconf-mdsal-yanglib</name>
-              <binding-aware-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:yang:library">
-                  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type>
-                  <name>binding-osgi-broker</name>
-              </binding-aware-broker>
-              <root-schema-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:yang:library">
-              <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
-              <name>yang-schema-service</name>
-          </root-schema-service>
-          </module>
-
-
-
-          <!--TCP endpoint for MD-SAL netconf server -->
-          <!--<module>-->
-              <!--<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:tcp">prefix:netconf-northbound-tcp</type>-->
-              <!--<name>netconf-mdsal-tcp-server</name>-->
-              <!--<dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:tcp">-->
-                  <!--<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound">prefix:netconf-server-dispatcher</type>-->
-                  <!--<name>netconf-mdsal-server-dispatcher</name>-->
-              <!--</dispatcher>-->
-          <!--</module>-->
-
-      </modules>
-
-        <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-            <service>
-                <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound">prefix:netconf-server-monitoring</type>
-                <instance>
-                    <name>server-monitor</name>
-                    <provider>/modules/module[type='netconf-server-monitoring-impl'][name='server-monitor']</provider>
-                </instance>
-            </service>
-            <service>
-                <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:north:mapper">prefix:netconf-northbound-mapper</type>
-                <instance>
-                    <name>netconf-mdsal-mapper</name>
-                    <provider>/modules/module[type='netconf-mdsal-mapper'][name='netconf-mdsal-mapper']</provider>
-                </instance>
-            </service>
-            <service>
-                <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:north:mapper">prefix:netconf-northbound-mapper</type>
-                <instance>
-                    <name>mapper-aggregator</name>
-                    <provider>/modules/module[type='netconf-mapper-aggregator'][name='mapper-aggregator']</provider>
-                </instance>
-            </service>
-            <service>
-                <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:north:mapper">prefix:netconf-mapper-registry</type>
-                <instance>
-                    <name>mapper-aggregator-registry</name>
-                    <provider>/modules/module[type='netconf-mapper-aggregator'][name='mapper-aggregator']</provider>
-                </instance>
-            </service>
-            <service>
-                <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound">prefix:netconf-server-dispatcher</type>
-                <instance>
-                    <name>netconf-mdsal-server-dispatcher</name>
-                    <provider>/modules/module[type='netconf-server-dispatcher-impl'][name='netconf-mdsal-server-dispatcher']</provider>
-                </instance>
-            </service>
-            <service>
-                <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:north:mapper">prefix:netconf-northbound-mapper</type>
-                <instance>
-                    <name>netconf-mdsal-notification-mapper</name>
-                    <provider>/modules/module[type='netconf-mdsal-notification-mapper'][name='netconf-mdsal-notification-mapper']</provider>
-                </instance>
-            </service>
-            <service>
-                <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:notification">prefix:netconf-notification-collector</type>
-                <instance>
-                    <name>netconf-notification-manager</name>
-                    <provider>/modules/module[type='netconf-notification-manager'][name='netconf-notification-manager']</provider>
-                </instance>
-            </service>
-            <service>
-                <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:notification">prefix:netconf-notification-registry</type>
-                <instance>
-                    <name>netconf-notification-manager</name>
-                    <provider>/modules/module[type='netconf-notification-manager'][name='netconf-notification-manager']</provider>
-                </instance>
-            </service>
-        </services>
-
-    </data>
-  </configuration>
-  <required-capabilities>
-      <capability>urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:mapper?module=netconf-mdsal-mapper&amp;revision=2015-01-14</capability>
-      <capability>urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:monitoring?module=netconf-mdsal-monitoring&amp;revision=2015-02-18</capability>
-      <capability>urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:ssh?module=netconf-northbound-ssh&amp;revision=2015-01-14</capability>
-      <capability>urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:tcp?module=netconf-northbound-tcp&amp;revision=2015-04-23</capability>
-      <capability>urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound:impl?module=netconf-northbound-impl&amp;revision=2015-01-12</capability>
-      <capability>urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:scheduled?module=threadpool-impl-scheduled&amp;revision=2013-12-01</capability>
-      <capability>urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:notification?module=netconf-mdsal-notification&amp;revision=2015-08-03</capability>
-      <capability>urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:yang:library?module=netconf-mdsal-yang-library&amp;revision=2016-06-17</capability>
-  </required-capabilities>
-</snapshot>
index fe0e09e8a787d6ca27777eec0c3d790dc3034bd3..f821a31dc88d83068de697dd0e276faa565338fe 100644 (file)
@@ -16,10 +16,14 @@ module netconf-northbound-notification {
     identity netconf-notification-collector {
             base "config:service-type";
             config:java-class "org.opendaylight.netconf.notifications.NetconfNotificationCollector";
+            config:disable-osgi-service-registration;
+            status deprecated;
         }
 
     identity netconf-notification-registry {
            base "config:service-type";
            config:java-class "org.opendaylight.netconf.notifications.NetconfNotificationRegistry";
+           config:disable-osgi-service-registration;
+           status deprecated;
     }
 }
\ No newline at end of file
diff --git a/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/notification/impl/NetconfNotificationManagerModule.java b/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/notification/impl/NetconfNotificationManagerModule.java
deleted file mode 100644 (file)
index d9dce4b..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.config.yang.netconf.northbound.notification.impl;
-
-import org.opendaylight.netconf.notifications.impl.NetconfNotificationManager;
-
-public class NetconfNotificationManagerModule extends org.opendaylight.controller.config.yang.netconf.northbound.notification.impl.AbstractNetconfNotificationManagerModule {
-    public NetconfNotificationManagerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public NetconfNotificationManagerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.netconf.northbound.notification.impl.NetconfNotificationManagerModule oldModule, java.lang.AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    public void customValidation() {
-        // add custom validation form module attributes here.
-    }
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-        return new NetconfNotificationManager();
-    }
-
-}
diff --git a/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/notification/impl/NetconfNotificationManagerModuleFactory.java b/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/notification/impl/NetconfNotificationManagerModuleFactory.java
deleted file mode 100644 (file)
index dadf756..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2015 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
- */
-
-/*
-* Generated file
-*
-* Generated from: yang module name: netconf-northbound-notification-impl yang module local name: netconf-notification-manager
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Fri Aug 07 17:09:20 CEST 2015
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.netconf.northbound.notification.impl;
-public class NetconfNotificationManagerModuleFactory extends org.opendaylight.controller.config.yang.netconf.northbound.notification.impl.AbstractNetconfNotificationManagerModuleFactory {
-
-}
diff --git a/netconf/netconf-notifications-impl/src/main/yang/netconf-northbound-notification-impl.yang b/netconf/netconf-notifications-impl/src/main/yang/netconf-northbound-notification-impl.yang
deleted file mode 100644 (file)
index 4b5fb35..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-module netconf-northbound-notification-impl {
-    yang-version 1;
-    namespace "urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:notification:impl";
-    prefix "nnnimpl";
-
-    import config { prefix config; revision-date 2013-04-05; }
-    import netconf-northbound-notification { prefix nnn; revision-date 2015-08-06; }
-
-    description
-        "This module contains the base YANG definitions for
-         netconf northbound notifications implementation";
-
-    revision "2015-08-07"{
-        description "Initial revision.";
-    }
-
-    identity netconf-notification-manager {
-        base config:module-type;
-        config:provided-service nnn:netconf-notification-collector;
-        config:provided-service nnn:netconf-notification-registry;
-        config:java-name-prefix NetconfNotificationManager;
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case netconf-notification-manager {
-            when "/config:modules/config:module/config:type = 'netconf-notification-manager'";
-        }
-    }
-}
\ No newline at end of file
diff --git a/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/ssh/NetconfNorthboundSshModule.java b/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/ssh/NetconfNorthboundSshModule.java
deleted file mode 100644 (file)
index be457f9..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.config.yang.netconf.northbound.ssh;
-
-import io.netty.channel.ChannelFuture;
-import io.netty.channel.local.LocalAddress;
-import io.netty.util.concurrent.GenericFutureListener;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.UnknownHostException;
-import java.util.concurrent.Executors;
-import org.apache.sshd.server.keyprovider.PEMGeneratorHostKeyProvider;
-import org.opendaylight.netconf.api.NetconfServerDispatcher;
-import org.opendaylight.netconf.ssh.SshProxyServer;
-import org.opendaylight.netconf.ssh.SshProxyServerConfigurationBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NetconfNorthboundSshModule extends org.opendaylight.controller.config.yang.netconf.northbound.ssh.AbstractNetconfNorthboundSshModule {
-
-    private static final Logger LOG = LoggerFactory.getLogger(NetconfNorthboundSshModule.class);
-
-    public NetconfNorthboundSshModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public NetconfNorthboundSshModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, final org.opendaylight.controller.config.yang.netconf.northbound.ssh.NetconfNorthboundSshModule oldModule, final java.lang.AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    public void customValidation() {
-        // add custom validation form module attributes here.
-    }
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-        final NetconfServerDispatcher dispatch = getDispatcherDependency();
-
-        final LocalAddress localAddress = new LocalAddress(getPort().toString());
-        final ChannelFuture localServer = dispatch.createLocalServer(localAddress);
-
-        final SshProxyServer sshProxyServer = new SshProxyServer(Executors.newScheduledThreadPool(1), getWorkerThreadGroupDependency(), getEventExecutorDependency());
-
-        final InetSocketAddress bindingAddress = getInetAddress();
-        final SshProxyServerConfigurationBuilder sshProxyServerConfigurationBuilder = new SshProxyServerConfigurationBuilder();
-        sshProxyServerConfigurationBuilder.setBindingAddress(bindingAddress);
-        sshProxyServerConfigurationBuilder.setLocalAddress(localAddress);
-        sshProxyServerConfigurationBuilder.setAuthenticator(getAuthProviderDependency());
-        sshProxyServerConfigurationBuilder.setIdleTimeout(Integer.MAX_VALUE);
-        sshProxyServerConfigurationBuilder.setKeyPairProvider(new PEMGeneratorHostKeyProvider());
-
-        localServer.addListener(new GenericFutureListener<ChannelFuture>() {
-
-            @Override
-            public void operationComplete(final ChannelFuture future) {
-                if(future.isDone() && !future.isCancelled()) {
-                    try {
-                        sshProxyServer.bind(sshProxyServerConfigurationBuilder.createSshProxyServerConfiguration());
-                        LOG.info("Netconf SSH endpoint started successfully at {}", bindingAddress);
-                    } catch (final IOException e) {
-                        throw new RuntimeException("Unable to start SSH netconf server", e);
-                    }
-                } else {
-                    LOG.warn("Unable to start SSH netconf server at {}", bindingAddress, future.cause());
-                    throw new RuntimeException("Unable to start SSH netconf server", future.cause());
-                }
-            }
-        });
-
-        return new NetconfServerCloseable(localServer, sshProxyServer);
-    }
-
-    private InetSocketAddress getInetAddress() {
-        try {
-            final InetAddress inetAd = InetAddress.getByName(getBindingAddress().getIpv4Address() == null ? getBindingAddress().getIpv6Address().getValue() : getBindingAddress().getIpv4Address().getValue());
-            return new InetSocketAddress(inetAd, getPort().getValue());
-        } catch (final UnknownHostException e) {
-            throw new IllegalArgumentException("Unable to bind netconf endpoint to address " + getBindingAddress(), e);
-        }
-    }
-
-    private static final class NetconfServerCloseable implements AutoCloseable {
-        private final ChannelFuture localServer;
-        private final SshProxyServer sshProxyServer;
-
-        public NetconfServerCloseable(final ChannelFuture localServer, final SshProxyServer sshProxyServer) {
-            this.localServer = localServer;
-            this.sshProxyServer = sshProxyServer;
-        }
-
-        @Override
-        public void close() throws Exception {
-            sshProxyServer.close();
-
-            if(localServer.isDone()) {
-                localServer.channel().close();
-            } else {
-                localServer.cancel(true);
-            }
-        }
-    }
-}
diff --git a/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/ssh/NetconfNorthboundSshModuleFactory.java b/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/ssh/NetconfNorthboundSshModuleFactory.java
deleted file mode 100644 (file)
index 88ad64b..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-/*
-* Generated file
-*
-* Generated from: yang module name: netconf-northbound-ssh yang module local name: netconf-northbound-ssh
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Mon Feb 09 14:09:07 CET 2015
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.netconf.northbound.ssh;
-public class NetconfNorthboundSshModuleFactory extends org.opendaylight.controller.config.yang.netconf.northbound.ssh.AbstractNetconfNorthboundSshModuleFactory {
-
-}
diff --git a/netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/NetconfNorthboundSshServer.java b/netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/NetconfNorthboundSshServer.java
new file mode 100644 (file)
index 0000000..fca99e0
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2016 Inocybe Technologies and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.netconf.ssh;
+
+import io.netty.channel.ChannelFuture;
+import io.netty.channel.EventLoopGroup;
+import io.netty.channel.local.LocalAddress;
+import io.netty.util.concurrent.EventExecutor;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.UnknownHostException;
+import java.util.concurrent.Executors;
+import org.apache.sshd.server.keyprovider.PEMGeneratorHostKeyProvider;
+import org.opendaylight.netconf.api.NetconfServerDispatcher;
+import org.opendaylight.netconf.auth.AuthProvider;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class NetconfNorthboundSshServer {
+
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfNorthboundSshServer.class);
+
+    private final ChannelFuture localServer;
+    private final SshProxyServer sshProxyServer;
+
+    public NetconfNorthboundSshServer(final NetconfServerDispatcher netconfServerDispatcher,
+                                      final EventLoopGroup workerGroup,
+                                      final EventExecutor eventExecutor,
+                                      final String bindingAddress,
+                                      final String portNumber,
+                                      final AuthProvider authProvider) {
+
+        final LocalAddress localAddress = new LocalAddress(portNumber);
+
+        localServer = netconfServerDispatcher.createLocalServer(localAddress);
+        sshProxyServer = new SshProxyServer(Executors.newScheduledThreadPool(1), workerGroup, eventExecutor);
+
+        final InetSocketAddress inetAddress = getInetAddress(bindingAddress, portNumber);
+        final SshProxyServerConfigurationBuilder sshProxyServerConfigurationBuilder = new SshProxyServerConfigurationBuilder();
+        sshProxyServerConfigurationBuilder.setBindingAddress(inetAddress);
+        sshProxyServerConfigurationBuilder.setLocalAddress(localAddress);
+        sshProxyServerConfigurationBuilder.setAuthenticator(authProvider);
+        sshProxyServerConfigurationBuilder.setIdleTimeout(Integer.MAX_VALUE);
+        sshProxyServerConfigurationBuilder.setKeyPairProvider(new PEMGeneratorHostKeyProvider());
+
+        localServer.addListener(future -> {
+            if (future.isDone() && !future.isCancelled()) {
+                try {
+                    sshProxyServer.bind(sshProxyServerConfigurationBuilder.createSshProxyServerConfiguration());
+                    LOG.info("Netconf SSH endpoint started successfully at {}", bindingAddress);
+                } catch (final IOException e) {
+                    throw new RuntimeException("Unable to start SSH netconf server", e);
+                }
+            } else {
+                LOG.warn("Unable to start SSH netconf server at {}", bindingAddress, future.cause());
+                throw new RuntimeException("Unable to start SSH netconf server", future.cause());
+            }
+        });
+    }
+
+    private InetSocketAddress getInetAddress(final String bindingAddress, final String portNumber) {
+        try {
+            IpAddress ipAddress= IpAddressBuilder.getDefaultInstance(bindingAddress);
+            final InetAddress inetAd = InetAddress.getByName(ipAddress.getIpv4Address() == null ? ipAddress.getIpv6Address().getValue() : ipAddress.getIpv4Address().getValue());
+            return new InetSocketAddress(inetAd, Integer.valueOf(portNumber));
+        } catch (final UnknownHostException e) {
+            throw new IllegalArgumentException("Unable to bind netconf endpoint to address " + bindingAddress, e);
+        }
+    }
+
+    public void close() {
+        sshProxyServer.close();
+
+        if (localServer.isDone()) {
+            localServer.channel().close();
+        } else {
+            localServer.cancel(true);
+        }
+    }
+}
diff --git a/netconf/netconf-ssh/src/main/yang/netconf-northbound-ssh.yang b/netconf/netconf-ssh/src/main/yang/netconf-northbound-ssh.yang
deleted file mode 100644 (file)
index 0f4da44..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-module netconf-northbound-ssh {
-    yang-version 1;
-    namespace "urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:ssh";
-    prefix "nni";
-
-    import netconf-northbound-mapper { prefix nnm; revision-date 2015-01-14; }
-    import netconf-northbound { prefix nn; revision-date 2015-01-14; }
-    import config { prefix config; revision-date 2013-04-05; }
-    import threadpool {prefix th;}
-    import netty {prefix netty;}
-    import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
-    import netconf-auth { prefix na; revision-date 2015-07-15; }
-
-    organization "Cisco Systems, Inc.";
-
-    description
-        "This module contains the base YANG definitions for
-         a default implementation of netconf northbound server";
-
-    revision "2015-01-14" {
-        description
-            "Initial revision.";
-    }
-
-    identity netconf-northbound-ssh {
-        base config:module-type;
-        config:java-name-prefix NetconfNorthboundSsh;
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case netconf-northbound-ssh {
-            when "/config:modules/config:module/config:type = 'netconf-northbound-ssh'";
-
-            leaf port {
-                type inet:port-number;
-                default 2830;
-            }
-
-            leaf binding-address {
-                type inet:ip-address;
-                default "0.0.0.0";
-            }
-
-            container processing-executor {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity th:scheduled-threadpool;
-                    }
-                }
-
-                description "Required by the mina-ssh library used in SSH endpoint";
-            }
-
-            container event-executor {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity netty:netty-event-executor;
-                    }
-                }
-            }
-
-            container worker-thread-group {
-                uses config:service-ref {
-                    refine type {
-                        config:required-identity netty:netty-threadgroup;
-                    }
-                }
-            }
-
-            container dispatcher {
-                uses config:service-ref {
-                    refine type {
-                        config:required-identity nn:netconf-server-dispatcher;
-                    }
-                }
-            }
-
-            container auth-provider {
-                uses config:service-ref {
-                    refine type {
-                        config:required-identity na:netconf-auth-provider;
-                    }
-                }
-            }
-
-        }
-    }
-
-}
index 33680f2dfc2701212e17ae068b54a82f04528d74..356b3bf705d7decb20887922211cf679ae059145 100644 (file)
@@ -152,18 +152,18 @@ public class NetconfMasterDOMTransaction implements NetconfDOMTransaction {
         LOG.trace("{}: Submit[{}} via NETCONF", id, writeTx.getIdentifier());
 
         final CheckedFuture<Void, TransactionCommitFailedException> submitFuture = writeTx.submit();
+        writeTx = null;
+
         final DefaultPromise<Void> promise = new DefaultPromise<>();
         Futures.addCallback(submitFuture, new FutureCallback<Void>() {
             @Override
             public void onSuccess(final Void result) {
                 promise.success(result);
-                writeTx = null;
             }
 
             @Override
             public void onFailure(@Nonnull final Throwable throwable) {
                 promise.failure(throwable);
-                writeTx = null;
             }
         });
         return promise.future();
index f0839ae945f914aabd912ff2b405decab5aec4f9..5ffd6d8d37aa1c1df9ad5bd54bc24cd0cf3537e5 100644 (file)
             <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>mdsal-binding-generator-impl</artifactId>
         </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>netconf-config-dispatcher</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>sal-core-api</artifactId>
index 925488cc637dd78e57a7df7336610a538a216089..56887d08f41418af8e9fcefbd7bda2980d5fd49d 100644 (file)
     <module>netconf-config</module>
     <module>netconf-impl</module>
     <module>config-netconf-connector</module>
+    <module>mdsal-netconf-ssh</module>
     <module>mdsal-netconf-connector</module>
     <module>mdsal-netconf-monitoring</module>
     <module>mdsal-netconf-notification</module>
     <module>mdsal-netconf-yang-library</module>
+    <module>mdsal-netconf-impl</module>
     <module>netconf-util</module>
     <module>netconf-netty-util</module>
     <module>netconf-mapping-api</module>
     <module>netconf-client</module>
+    <!--TODO Delete netconf-config-dispatcher bundle as soon as https://git.opendaylight.org/gerrit/#/c/46621/ is merged.-->
     <module>netconf-config-dispatcher</module>
     <module>netconf-ssh</module>
     <module>netconf-tcp</module>
     <module>netconf-monitoring</module>
     <module>netconf-connector-config</module>
-    <module>netconf-mdsal-config</module>
     <module>netconf-auth</module>
     <module>aaa-authn-odl-plugin</module>
     <module>netconf-notifications-impl</module>
index 9adcf03eb64f716cc55dd7b152132a5d7b9c3b2a..6129d4050ff8b3a96fa21f91d37ede0bf2fb3650 100644 (file)
   </dependencyManagement>
 
   <dependencies>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-config-dispatcher</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-common-util</artifactId>