Merge changes I05e784af,Ie975a2ec
authorTony Tkacik <ttkacik@cisco.com>
Tue, 6 May 2014 06:49:43 +0000 (06:49 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 6 May 2014 06:49:43 +0000 (06:49 +0000)
* changes:
  BUG-693 Config module for netconf client dispatcher.
  BUG-938 Fix negotiation error when using exi

1  2 
opendaylight/commons/opendaylight/pom.xml
opendaylight/config/pom.xml
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDevice.java

index fe70eeb4e455139f0fb1548d881149269e0ac67a,8588a6050a1e42ccae486ad9e664978efe5b2069..545c01060a1757c7c4f4df2279d688861b4922d0
@@@ -19,7 -19,6 +19,7 @@@
      <appauth.version>0.4.2-SNAPSHOT</appauth.version>
      <!-- Controller Modules Versions -->
      <arphandler.version>0.5.2-SNAPSHOT</arphandler.version>
 +    <asm.version>4.1</asm.version>
      <!-- Plugin Versions -->
      <bouncycastle.version>1.50</bouncycastle.version>
      <bundle.plugin.version>2.3.7</bundle.plugin.version>
@@@ -58,7 -57,6 +58,7 @@@
      <!-- OpenEXI third party lib for netconf-->
      <exi.nagasena.version>0000.0002.0038.0-SNAPSHOT</exi.nagasena.version>
      <failsafe.version>2.15</failsafe.version>
 +    <feature.transaction.version>1.0.1</feature.transaction.version>
      <felix.dependencymanager.shell.version>3.0.1</felix.dependencymanager.shell.version>
      <felix.dependencymanager.version>3.1.0</felix.dependencymanager.version>
      <felix.fileinstall.version>3.1.6</felix.fileinstall.version>
@@@ -94,7 -92,6 +94,7 @@@
      <jsr305.api.version>2.0.1</jsr305.api.version>
      <jsr311.api.version>1.1.1</jsr311.api.version>
      <junit.version>4.8.1</junit.version>
 +    <karaf.version>3.0.1</karaf.version>
      <logback.version>1.0.9</logback.version>
      <logging.bridge.version>0.4.2-SNAPSHOT</logging.bridge.version>
      <maven.compile.plugin.version>2.5.1</maven.compile.plugin.version>
      <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
      <sonar.language>java</sonar.language>
      <sonar.skippedModules>org.openflow.openflowj,net.sf.jung2</sonar.skippedModules>
 +    <spifly.version>1.0.0</spifly.version>
      <spring-osgi.version>1.2.1</spring-osgi.version>
 +    <spring-security-karaf.version>3.1.4.RELEASE</spring-security-karaf.version>
      <spring-security.version>3.1.3.RELEASE</spring-security.version>
      <spring.version>3.1.3.RELEASE</spring.version>
      <statistics.northbound.version>0.4.2-SNAPSHOT</statistics.northbound.version>
          <artifactId>netconf-client</artifactId>
          <version>${netconf.version}</version>
        </dependency>
+       <!--Netconf config-->
+       <dependency>
+         <groupId>org.opendaylight.controller</groupId>
+         <artifactId>netconf-config-dispatcher</artifactId>
+         <version>${netconf.version}</version>
+       </dependency>
        <dependency>
          <groupId>org.opendaylight.controller</groupId>
          <artifactId>netconf-impl</artifactId>
                <phase>generate-sources</phase>
                <configuration>
                  <sources>
 +                  <source>src/main/yang</source>
                    <source>${jmxGeneratorPath}</source>
                    <source>${salGeneratorPath}</source>
                    <source>${xtend.dstdir}</source>
                      </goals>
                    </pluginExecutionFilter>
                    <action>
 -                    <ignore></ignore>
 +                    <execute></execute>
                    </action>
                  </pluginExecution>
                  <pluginExecution>
index 7c244f57fcf6d2b9141807e2478b197a138121fd,8bf9a0f3cdc70a4ecf9248044eaf742a68b99d6e..20b1b411a4e93ee712f1a4e67844c57ceab630c8
@@@ -38,6 -38,7 +38,7 @@@
      <module>yang-test-plugin</module>
      <module>shutdown-api</module>
      <module>shutdown-impl</module>
+     <module>netconf-config-dispatcher</module>
      <module>config-module-archetype</module>
    </modules>
  
            <artifactId>gmaven-plugin</artifactId>
            <version>1.0</version>
          </plugin>
 -        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
 -        <plugin>
 -          <groupId>org.eclipse.m2e</groupId>
 -          <artifactId>lifecycle-mapping</artifactId>
 -          <version>1.0.0</version>
 -          <configuration>
 -            <lifecycleMappingMetadata>
 -              <pluginExecutions>
 -                <pluginExecution>
 -                  <pluginExecutionFilter>
 -                    <groupId>org.opendaylight.yangtools</groupId>
 -                    <artifactId>yang-maven-plugin</artifactId>
 -                    <versionRange>[0.5.7-SNAPSHOT,)</versionRange>
 -                    <goals>
 -                      <goal>generate-sources</goal>
 -                    </goals>
 -                  </pluginExecutionFilter>
 -                  <action>
 -                    <ignore></ignore>
 -                  </action>
 -                </pluginExecution>
 -              </pluginExecutions>
 -            </lifecycleMappingMetadata>
 -          </configuration>
 -        </plugin>
          <plugin>
            <groupId>org.opendaylight.yangtools</groupId>
            <artifactId>yang-maven-plugin</artifactId>
index 2ed941851bb71852f06d8d1c0aa7d921e44937bb,e3f8649cd1e2bb22851a95b526872d88d770ad04..1209e88f5241a56b19b0140f3beb60be4120c8bd
@@@ -21,6 -21,7 +21,7 @@@ import static org.opendaylight.controll
  import static org.opendaylight.controller.sal.connect.netconf.NetconfMapping.toRpcMessage;
  import static org.opendaylight.controller.sal.connect.netconf.NetconfMapping.wrap;
  
+ import com.google.common.base.Preconditions;
  import java.io.InputStream;
  import java.net.InetSocketAddress;
  import java.net.URI;
@@@ -38,6 -39,7 +39,7 @@@ import org.opendaylight.controller.md.s
  import org.opendaylight.controller.md.sal.common.api.data.DataModification;
  import org.opendaylight.controller.md.sal.common.api.data.DataReader;
  import org.opendaylight.controller.netconf.client.NetconfClientDispatcher;
+ import org.opendaylight.controller.netconf.client.conf.NetconfClientConfiguration;
  import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
  import org.opendaylight.controller.sal.core.api.Broker.RpcRegistration;
  import org.opendaylight.controller.sal.core.api.Provider;
@@@ -121,6 -123,7 +123,7 @@@ public class NetconfDevice implements P
  
      private boolean rollbackSupported;
  
+     private NetconfClientConfiguration clientConfig;
  
      public NetconfDevice(String name) {
          this.name = name;
          checkState(schemaSourceProvider != null, "Schema Source Provider must be set.");
          checkState(eventExecutor != null, "Event executor must be set.");
  
-         listener = new NetconfDeviceListener(this);
+         Preconditions.checkArgument(clientConfig.getSessionListener() instanceof NetconfDeviceListener);
+         listener = (NetconfDeviceListener) clientConfig.getSessionListener();
  
          logger.info("Starting NETCONF Client {} for address {}", name, socketAddress);
  
-         dispatcher.createClient(socketAddress, listener, reconnectStrategy);
+         dispatcher.createClient(clientConfig);
      }
  
      Optional<SchemaContext> getSchemaContext() {
  
          logger.debug("Client capabilities {}", capabilities);
          for (QName capability : capabilities) {
 -            it.addLeaf(NETCONF_INVENTORY_INITIAL_CAPABILITY, capability);
 +            it.addLeaf(NETCONF_INVENTORY_INITIAL_CAPABILITY, capability.toString());
          }
  
          logger.debug("Update device state transaction " + transaction.getIdentifier()
      public void setDispatcher(final NetconfClientDispatcher dispatcher) {
          this.dispatcher = dispatcher;
      }
+     public void setClientConfig(final NetconfClientConfiguration clientConfig) {
+         this.clientConfig = clientConfig;
+     }
  }
  
  class NetconfDeviceSchemaContextProvider {