Merge "Fix a race PingPongTransactionChain"
authorTony Tkacik <ttkacik@cisco.com>
Thu, 15 Jan 2015 10:12:10 +0000 (10:12 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 15 Jan 2015 10:12:10 +0000 (10:12 +0000)
46 files changed:
opendaylight/archetypes/opendaylight-startup/pom.xml [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/META-INF/maven/archetype-metadata.xml [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/.gitignore [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-api/.gitignore [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-api/pom.xml [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-api/src/main/yang/__artifactId__.yang [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-artifacts/pom.xml [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-features/pom.xml [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-features/src/main/features/features.xml [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/pom.xml [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/src/main/config/default-config.xml [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/src/main/java/__packageInPathFormat__/__classPrefix__Provider.java [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/__artifactId__/impl/rev141210/__classPrefix__ImplModule.java [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/__artifactId__/impl/rev141210/__classPrefix__ImplModuleFactory.java [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/src/main/yang/__artifactId__-impl.yang [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-karaf/pom.xml [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/pom.xml [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/test/resources/projects/basic/archetype.properties [new file with mode: 0644]
opendaylight/archetypes/opendaylight-startup/src/test/resources/projects/basic/goal.txt [new file with mode: 0644]
opendaylight/archetypes/pom.xml
opendaylight/commons/opendaylight/pom.xml
opendaylight/config/config-parent/pom.xml
opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/NetconfTestImplModuleStub.txt
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/SalCompatibilityProvider.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/AbstractBindingAwareProvider.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/BindingAwareBroker.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/BindingAwareProvider.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataRefresher.java [deleted file]
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/RuntimeDataProvider.java [deleted file]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RootBindingAwareBroker.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/BindingIndependentConnector.java
opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/AbstractTestProvider.java
opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/NotificationTest.java
opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/BindingContextUtils.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/yang/gen/v1/http/netconfcentral/org/ns/xsql/rev140626/XSQLModule.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/sal/NetconfDeviceSalProvider.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/BrokerFacade.java
opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/SalRemoteServiceBroker.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImpl.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfMonitoringServiceImpl.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfMonitoringServiceImplTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITMonitoringTest.java
opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/Capability.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringOperationService.java
opendaylight/netconf/netconf-monitoring/src/test/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringOperationServiceTest.java
opendaylight/netconf/netconf-testtool/src/main/java/org/opendaylight/controller/netconf/test/tool/ModuleBuilderCapability.java

diff --git a/opendaylight/archetypes/opendaylight-startup/pom.xml b/opendaylight/archetypes/opendaylight-startup/pom.xml
new file mode 100644 (file)
index 0000000..abdb487
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+
+  <groupId>org.opendaylight.controller</groupId>
+  <artifactId>opendaylight-startup-archetype</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  <packaging>maven-archetype</packaging>
+
+  <name>${project.artifactId}</name>
+
+  <build>
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.archetype</groupId>
+        <artifactId>archetype-packaging</artifactId>
+        <version>2.2</version>
+      </extension>
+    </extensions>
+
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-archetype-plugin</artifactId>
+          <version>2.2</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <failsOnError>false</failsOnError>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/META-INF/maven/archetype-metadata.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/META-INF/maven/archetype-metadata.xml
new file mode 100644 (file)
index 0000000..7057a86
--- /dev/null
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="example-aggregator"
+    xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <requiredProperties>
+    <requiredProperty key="classPrefix" >
+        <defaultValue>
+            ${artifactId.substring(0,1).toUpperCase()}${artifactId.substring(1)}
+        </defaultValue>
+    </requiredProperty>
+    <requiredProperty key="copyright" />
+  </requiredProperties>
+  <fileSets>
+
+    <!-- aggregator -->
+    <fileSet encoding="UTF-8">
+      <directory></directory>
+      <includes>
+        <include>.gitignore</include>
+      </includes>
+    </fileSet>
+    <fileSet filtered="true" encoding="UTF-8">
+      <directory></directory>
+      <includes>
+        <include>pom.xml</include>
+      </includes>
+    </fileSet>
+
+    <!-- karaf distro -->
+    <fileSet filtered="true" encoding="UTF-8">
+        <directory>__artifactId__-karaf</directory>
+        <includes>
+            <include>pom.xml</include>
+        </includes>
+    </fileSet>
+
+    <!-- features -->
+
+    <fileSet filtered="true" encoding="UTF-8">
+        <directory>__artifactId__-features</directory>
+        <includes>
+            <include>pom.xml</include>
+        </includes>
+    </fileSet>
+    <fileSet filtered="true" encoding="UTF-8">
+        <directory>__artifactId__-features/src/main/features</directory>
+        <includes>
+            <include>**/*.xml</include>
+          </includes>
+    </fileSet>
+
+    <!-- impl -->
+
+    <fileSet filtered="true" encoding="UTF-8">
+        <directory>__artifactId__-impl</directory>
+        <includes>
+            <include>pom.xml</include>
+        </includes>
+    </fileSet>
+    <fileSet filtered="true" encoding="UTF-8">
+        <directory>__artifactId__-impl/src/main/java</directory>
+        <includes>
+            <include>**/*.java</include>
+         </includes>
+    </fileSet>
+    <fileSet filtered="true" encoding="UTF-8">
+        <directory>__artifactId__-impl/src/main/config</directory>
+        <includes>
+            <include>**/*.xml</include>
+         </includes>
+    </fileSet>
+    <fileSet filtered="true" encoding="UTF-8">
+       <directory>__artifactId__-impl/src/main/yang</directory>
+       <includes>
+         <include>**/*.yang</include>
+       </includes>
+     </fileSet>
+
+     <!-- api -->
+
+     <fileSet filtered="true" encoding="UTF-8">
+       <directory>__artifactId__-api</directory>
+       <includes>
+         <include>pom.xml</include>
+       </includes>
+     </fileSet>
+     <fileSet filtered="true" encoding="UTF-8">
+       <directory>__artifactId__-api/src/main/yang</directory>
+       <includes>
+         <include>**/*.yang</include>
+       </includes>
+     </fileSet>
+
+     <!-- artifacts -->
+     <fileSet filtered="true" encoding="UTF-8">
+       <directory>__artifactId__-artifacts</directory>
+       <includes>
+         <include>pom.xml</include>
+       </includes>
+     </fileSet>
+  </fileSets>
+</archetype-descriptor>
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/.gitignore b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/.gitignore
new file mode 100644 (file)
index 0000000..4496250
--- /dev/null
@@ -0,0 +1,18 @@
+*.class
+**/target
+bin/
+dist
+**/logs
+*~
+target
+target-ide
+.classpath
+.project
+.settings
+.idea
+xtend-gen
+yang-gen-config
+yang-gen-sal
+classes
+.DS_STORE
+.metadata
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-api/.gitignore b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-api/.gitignore
new file mode 100644 (file)
index 0000000..b83d222
--- /dev/null
@@ -0,0 +1 @@
+/target/
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-api/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-api/pom.xml
new file mode 100644 (file)
index 0000000..bdcec2e
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+${copyright} 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">
+  <parent>
+    <groupId>org.opendaylight.yangtools</groupId>
+    <artifactId>binding-parent</artifactId>
+    <version>0.7.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>${groupId}</groupId>
+  <artifactId>${artifactId}-api</artifactId>
+  <version>${version}</version>
+  <packaging>bundle</packaging>
+
+</project>
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-api/src/main/yang/__artifactId__.yang b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-api/src/main/yang/__artifactId__.yang
new file mode 100644 (file)
index 0000000..14bc435
--- /dev/null
@@ -0,0 +1,9 @@
+module ${artifactId} {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:example";
+    prefix "${artifactId}";
+
+    revision "2015-01-05" {
+        description "Initial revision of ${artifactId} model";
+    }
+}
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-artifacts/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-artifacts/pom.xml
new file mode 100644 (file)
index 0000000..2d634d0
--- /dev/null
@@ -0,0 +1,42 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+${copyright} 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>
+  <groupId>${groupId}</groupId>
+  <artifactId>${artifactId}-artifacts</artifactId>
+  <version>${version}</version>
+  <packaging>pom</packaging>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>${symbol_dollar}{project.groupId}</groupId>
+        <artifactId>${artifactId}-api</artifactId>
+        <version>${symbol_dollar}{project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>${symbol_dollar}{project.groupId}</groupId>
+        <artifactId>${artifactId}-impl</artifactId>
+        <version>${symbol_dollar}{project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>${symbol_dollar}{project.groupId}</groupId>
+        <artifactId>${artifactId}-features</artifactId>
+        <version>${symbol_dollar}{project.version}</version>
+        <classifier>features</classifier>
+        <type>xml</type>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+</project>
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-features/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-features/pom.xml
new file mode 100644 (file)
index 0000000..880e2dc
--- /dev/null
@@ -0,0 +1,53 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+${copyright} 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 INTERNAL
+-->
+<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">
+  <parent>
+    <groupId>org.opendaylight.odlparent</groupId>
+    <artifactId>features-parent</artifactId>
+    <version>1.5.0-SNAPSHOT</version>
+  </parent>
+  <groupId>${groupId}</groupId>
+  <artifactId>${artifactId}-features</artifactId>
+  <version>${version}</version>
+  <name>${project.artifactId}</name>
+  <modelVersion>4.0.0</modelVersion>
+  <prerequisites>
+    <maven>3.1.1</maven>
+  </prerequisites>
+  <properties>
+    <mdsal.version>1.2.0-SNAPSHOT</mdsal.version>
+    <yangtools.version>0.7.0-SNAPSHOT</yangtools.version>
+  </properties>
+  <dependencyManagement>
+    <dependencies>
+      <!-- project specific dependencies -->
+      <dependency>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>mdsal-artifacts</artifactId>
+        <version>${mdsal.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <dependencies>
+    <dependency>
+      <groupId>${symbol_dollar}{groupId}</groupId>
+      <artifactId>${artifactId}-impl</artifactId>
+      <version>${symbol_dollar}{project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>${symbol_dollar}{groupId}</groupId>
+      <artifactId>${artifactId}-api</artifactId>
+      <version>${symbol_dollar}{project.version}</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-features/src/main/features/features.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-features/src/main/features/features.xml
new file mode 100644 (file)
index 0000000..d0b5eb6
--- /dev/null
@@ -0,0 +1,39 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+Necessary TODO: Put your copyright statement here
+
+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
+-->
+<features name="odl-${artifactId}-${symbol_dollar}{project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+  <repository>mvn:org.opendaylight.yangtools/features-yangtools/${symbol_dollar}{yangtools.version}/xml/features</repository>
+  <repository>mvn:org.opendaylight.controller/features-mdsal/${symbol_dollar}{mdsal.version}/xml/features</repository>
+  <repository>mvn:org.opendaylight.controller/features-restconf/${symbol_dollar}{mdsal.version}/xml/features</repository>
+  <feature name='odl-${artifactId}-api' version='${symbol_dollar}{project.version}' description='OpenDaylight :: ${artifactId} :: api '>
+    <feature version='${symbol_dollar}{yangtools.version}'>odl-yangtools-models</feature>
+    <bundle>mvn:${groupId}/${artifactId}-api/${symbol_dollar}{project.version}</bundle>
+  </feature>
+  <feature name='odl-${artifactId}-impl' version='${symbol_dollar}{project.version}' description='OpenDaylight :: ${artifactId} :: impl '>
+    <feature version='${symbol_dollar}{mdsal.version}'>odl-mdsal-broker</feature>
+    <feature version='${symbol_dollar}{project.version}'>odl-${artifactId}-api</feature>
+    <bundle>mvn:${groupId}/${artifactId}-impl/${symbol_dollar}{project.version}</bundle>
+    <configfile finalname="${artifactId}-impl-default-config.xml">mvn:${groupId}/${artifactId}-impl/${symbol_dollar}{project.version}/xml/config</configfile>
+  </feature>
+  <feature name='odl-${artifactId}-impl-rest' version='${symbol_dollar}{project.version}' description='OpenDaylight :: ${artifactId} :: impl :: REST '>
+    <feature version="${symbol_dollar}{project.version}">odl-${artifactId}-impl</feature>
+    <feature version="${symbol_dollar}{mdsal.version}">odl-restconf</feature>
+  </feature>
+  <feature name='odl-${artifactId}-impl-ui' version='${symbol_dollar}{project.version}' description='OpenDaylight :: ${artifactId} :: impl :: UI'>
+    <feature version="${symbol_dollar}{project.version}">odl-${artifactId}-impl-rest</feature>
+    <feature version="${symbol_dollar}{mdsal.version}">odl-mdsal-apidocs</feature>
+    <feature version="${symbol_dollar}{mdsal.version}">odl-mdsal-xsql</feature>
+  </feature>
+
+</features>
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/pom.xml
new file mode 100644 (file)
index 0000000..56903d0
--- /dev/null
@@ -0,0 +1,34 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: --><!--
+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
+-->
+<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">
+
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>config-parent</artifactId>
+    <version>0.3.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>${groupId}</groupId>
+  <artifactId>${artifactId}-impl</artifactId>
+  <version>${version}</version>
+  <packaging>bundle</packaging>
+  <dependencies>
+    <dependency>
+      <groupId>${symbol_dollar}{groupId}</groupId>
+      <artifactId>${artifactId}-api</artifactId>
+      <version>${symbol_dollar}{project.version}</version>
+    </dependency>
+  </dependencies>
+
+</project>
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/src/main/config/default-config.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/src/main/config/default-config.xml
new file mode 100644 (file)
index 0000000..db4efb8
--- /dev/null
@@ -0,0 +1,31 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+${copyright} 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
+-->
+<snapshot>
+  <required-capabilities>
+  </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:params:xml:ns:yang:${artifactId}:impl">prefix:${artifactId}-impl</type>
+          <name>${artifactId}-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>
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/src/main/java/__packageInPathFormat__/__classPrefix__Provider.java b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/src/main/java/__packageInPathFormat__/__classPrefix__Provider.java
new file mode 100644 (file)
index 0000000..070fb4d
--- /dev/null
@@ -0,0 +1,32 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * ${copyright} 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 ${package};
+
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ${classPrefix}Provider implements BindingAwareProvider, AutoCloseable {
+
+    private static final Logger LOG = LoggerFactory.getLogger(${classPrefix}Provider.class);
+
+    @Override
+    public void onSessionInitiated(ProviderContext session) {
+        LOG.info("${classPrefix}Provider Session Initiated");
+    }
+
+    @Override
+    public void close() throws Exception {
+        LOG.info("${classPrefix}Provider Closed");
+    }
+
+}
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/__artifactId__/impl/rev141210/__classPrefix__ImplModule.java b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/__artifactId__/impl/rev141210/__classPrefix__ImplModule.java
new file mode 100644 (file)
index 0000000..558b018
--- /dev/null
@@ -0,0 +1,36 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * ${copyright} 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.urn.opendaylight.params.xml.ns.yang.${artifactId}.impl.rev141210;
+
+import ${package}.${classPrefix}Provider;
+
+public class ${classPrefix}ImplModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.${artifactId}.impl.rev141210.Abstract${classPrefix}ImplModule {
+    public ${classPrefix}ImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+        super(identifier, dependencyResolver);
+    }
+
+    public ${classPrefix}ImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.${artifactId}.impl.rev141210.${classPrefix}ImplModule 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() {
+        ${classPrefix}Provider provider = new ${classPrefix}Provider();
+        getBrokerDependency().registerProvider(provider);
+        return provider;
+    }
+
+}
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/__artifactId__/impl/rev141210/__classPrefix__ImplModuleFactory.java b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/__artifactId__/impl/rev141210/__classPrefix__ImplModuleFactory.java
new file mode 100644 (file)
index 0000000..a531fe0
--- /dev/null
@@ -0,0 +1,23 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * ${copyright} 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: ${artifactId} yang module local name: ${artifactId}
+* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+* Generated at: Fri Jan 02 13:49:24 CST 2015
+*
+* Do not modify this file unless it is present under src/main directory
+*/
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.${artifactId}.impl.rev141210;
+public class ${classPrefix}ImplModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.${artifactId}.impl.rev141210.Abstract${classPrefix}ImplModuleFactory {
+
+}
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/src/main/yang/__artifactId__-impl.yang b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-impl/src/main/yang/__artifactId__-impl.yang
new file mode 100644 (file)
index 0000000..7b00b84
--- /dev/null
@@ -0,0 +1,35 @@
+module ${artifactId}-impl {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:${artifactId}:impl";
+    prefix "${artifactId}-impl";
+
+    import config { prefix config; revision-date 2013-04-05; }
+    import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;}
+
+    description
+        "Service definition for ${artifactId} project";
+
+    revision "2014-12-10" {
+        description
+            "Initial revision";
+    }
+
+    identity ${artifactId}-impl {
+        base config:module-type;
+        config:java-name-prefix ${classPrefix}Impl;
+    }
+
+    augment "/config:modules/config:module/config:configuration" {
+        case ${artifactId}-impl {
+            when "/config:modules/config:module/config:type = '${artifactId}-impl'";
+            container broker {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity md-sal-binding:binding-broker-osgi-registry;
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-karaf/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/__artifactId__-karaf/pom.xml
new file mode 100644 (file)
index 0000000..80fe081
--- /dev/null
@@ -0,0 +1,57 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- TODO: Put your copyright here:
+<your copyright> 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 INTERNAL
+-->
+<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">
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>karaf-parent</artifactId>
+    <version>1.5.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>${groupId}</groupId>
+  <artifactId>${artifactId}</artifactId>
+  <version>${version}</version>
+  <name>${project.artifactId}</name>
+  <prerequisites>
+    <maven>3.1.1</maven>
+  </prerequisites>
+  <properties>
+    <karaf.localFeature>odl-${artifactId}-impl-ui</karaf.localFeature>
+  </properties>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>${symbol_dollar}{project.groupId}</groupId>
+        <artifactId>${artifactId}-artifacts</artifactId>
+        <version>${symbol_dollar}{project.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <dependencies>
+    <dependency>
+      <!-- scope is compile so all features (there is only one) are installed
+      into startup.properties and the feature repo itself is not installed -->
+      <groupId>org.apache.karaf.features</groupId>
+      <artifactId>framework</artifactId>
+      <type>kar</type>
+    </dependency>
+
+    <dependency>
+      <groupId>${symbol_dollar}{project.groupId}</groupId>
+      <artifactId>${artifactId}-features</artifactId>
+      <classifier>features</classifier>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/pom.xml
new file mode 100644 (file)
index 0000000..cbc021f
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- TODO: Put your copyright here:
+<your copyright> 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 INTERNAL
+-->
+<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">
+  <groupId>${groupId}</groupId>
+  <artifactId>${artifactId}-aggregator</artifactId>
+  <version>${version}</version>
+  <name>${project.artifactId}</name>
+  <packaging>pom</packaging>
+  <modelVersion>4.0.0</modelVersion>
+  <prerequisites>
+    <maven>3.1.1</maven>
+  </prerequisites>
+  <modules>
+    <module>${artifactId}-api</module>
+    <module>${artifactId}-impl</module>
+    <module>${artifactId}-karaf</module>
+    <module>${artifactId}-features</module>
+    <module>${artifactId}-artifacts</module>
+  </modules>
+</project>
diff --git a/opendaylight/archetypes/opendaylight-startup/src/test/resources/projects/basic/archetype.properties b/opendaylight/archetypes/opendaylight-startup/src/test/resources/projects/basic/archetype.properties
new file mode 100644 (file)
index 0000000..a7d692b
--- /dev/null
@@ -0,0 +1,7 @@
+#Mon Jan 12 13:10:37 CST 2015
+package=it.pkg
+version=0.1-SNAPSHOT
+groupId=archetype.it
+artifactId=basic
+classPrefix=Basic
+copyright=Copyright (c) 2013 Cisco Systems, Inc.
diff --git a/opendaylight/archetypes/opendaylight-startup/src/test/resources/projects/basic/goal.txt b/opendaylight/archetypes/opendaylight-startup/src/test/resources/projects/basic/goal.txt
new file mode 100644 (file)
index 0000000..e69de29
index 33c2548..d8ac923 100644 (file)
@@ -42,5 +42,6 @@
     <module>opendaylight-configfile-archetype</module>
     <module>opendaylight-karaf-distro-archetype</module>
     <module>opendaylight-karaf-features</module>
+    <module>opendaylight-startup</module>
   </modules>
 </project>
index 84c04e0..4d95b72 100644 (file)
           <includeTestSourceDirectory>true</includeTestSourceDirectory>
           <sourceDirectory>${project.basedir}</sourceDirectory>
           <includes>**\/*.java,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat</includes>
-          <excludes>**\/target\/,**\/bin\/,**\/target-ide\/,**\/${jmxGeneratorPath}\/,**\/${salGeneratorPath}\/,**\/protobuff\/</excludes>
+          <excludes>**\/target\/,**\/bin\/,**\/target-ide\/,**\/${jmxGeneratorPath}\/,**\/${salGeneratorPath}\/,**\/protobuff\/,**\/src\/main\/resources\/archetype-resources\/**\/*.java</excludes>
         </configuration>
         <dependencies>
           <dependency>
index 0b2b634..10c1824 100644 (file)
@@ -102,6 +102,12 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
                   <include>**</include>
                 </includes>
               </fileset>
+              <fileset>
+                <directory>${salGeneratorPath}</directory>
+                <includes>
+                  <include>**</include>
+                </includes>
+              </fileset>
             </filesets>
           </configuration>
         </plugin>
index f8f2b37..75e63f1 100644 (file)
@@ -7,11 +7,7 @@
  */
 package org.opendaylight.controller.sal.compatibility;
 
-import java.util.Collection;
-import java.util.Collections;
-
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
 import org.opendaylight.controller.sal.binding.api.NotificationService;
@@ -26,7 +22,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.FlowTopologyDiscoveryService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsService;
-import org.opendaylight.yangtools.yang.binding.RpcService;
 
 import com.google.common.base.Preconditions;
 
@@ -37,21 +32,6 @@ class SalCompatibilityProvider implements BindingAwareProvider {
         this.activator = Preconditions.checkNotNull(cmpAct);
     }
 
-    @Override
-    public Collection<? extends ProviderFunctionality> getFunctionality() {
-        return Collections.emptyList();
-    }
-
-    @Override
-    public Collection<? extends RpcService> getImplementations() {
-        return Collections.emptyList();
-    }
-
-    @Override
-    public void onSessionInitialized(final ConsumerContext session) {
-        // No-op
-    }
-
     @Override
     public void onSessionInitiated(final ProviderContext session) {
         final NotificationService subscribe = session.getSALService(NotificationService.class);
index d32fa36..0b9c604 100644 (file)
@@ -7,12 +7,7 @@
  */
 package org.opendaylight.controller.sal.binding.api;
 
-import java.util.Collection;
-import java.util.Collections;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.osgi.framework.BundleContext;
 
 @Deprecated
@@ -21,52 +16,5 @@ public abstract class AbstractBindingAwareProvider extends AbstractBrokerAwareAc
     @Override
     protected final void onBrokerAvailable(BindingAwareBroker broker, BundleContext context) {
         ProviderContext ctx = broker.registerProvider(this, context);
-        registerRpcImplementations(ctx);
-        registerFunctionality(ctx);
-    }
-
-    private void registerFunctionality(ProviderContext ctx) {
-        Collection<? extends ProviderFunctionality> functionality = this.getFunctionality();
-        if (functionality == null || functionality.isEmpty()) {
-            return;
-        }
-        for (ProviderFunctionality providerFunctionality : functionality) {
-            ctx.registerFunctionality(providerFunctionality);
-        }
-
-    }
-
-    private void registerRpcImplementations(ProviderContext ctx) {
-        Collection<? extends RpcService> rpcs = this.getImplementations();
-        if (rpcs == null || rpcs.isEmpty()) {
-            return;
-        }
-        for (RpcService rpcService : rpcs) {
-            // ctx.addRpcImplementation(type, implementation);
-        }
-
-    }
-
-    @Override
-    public Collection<? extends ProviderFunctionality> getFunctionality() {
-        return Collections.emptySet();
-    }
-
-    @Override
-    public Collection<? extends RpcService> getImplementations() {
-        return Collections.emptySet();
-    }
-
-    /**
-     * Initialization of consumer context.
-     *
-     * {@link ProviderContext} is replacement of {@link ConsumerContext}
-     * so this method is not needed in case of Provider.
-     *
-     */
-    @Deprecated
-    @Override
-    public final void onSessionInitialized(ConsumerContext session) {
-        // NOOP
     }
 }
index 5e24560..ab62c80 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.sal.binding.api;
 
 import org.opendaylight.controller.md.sal.common.api.routing.RoutedRegistration;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -52,6 +51,12 @@ import org.osgi.framework.BundleContext;
  * and {@link ProviderContext}
  */
 public interface BindingAwareBroker {
+    /*
+     * @deprecated Use registerConsumer(BindingAwareConsumer cons) instead (BundleContext is no longer used)
+     */
+    @Deprecated
+    ConsumerContext registerConsumer(BindingAwareConsumer consumer, BundleContext ctx);
+
     /**
      * Registers the {@link BindingAwareConsumer}, which will use the SAL layer.
      *
@@ -73,7 +78,13 @@ public interface BindingAwareBroker {
      * @throws IllegalStateException
      *             If the consumer is already registered.
      */
-    ConsumerContext registerConsumer(BindingAwareConsumer consumer, BundleContext ctx);
+    ConsumerContext registerConsumer(BindingAwareConsumer consumer);
+
+    /*
+     * @deprecated Use registerProvider(BindingAwareProvider prov) instead (BundleContext is no longer used)
+     */
+    @Deprecated
+    ProviderContext registerProvider(BindingAwareProvider provider, BundleContext ctx);
 
     /**
      * Registers the {@link BindingAwareProvider}, which will use the SAL layer.
@@ -103,7 +114,7 @@ public interface BindingAwareBroker {
      * @throws IllegalStateException
      *             If the consumer is already registered.
      */
-    ProviderContext registerProvider(BindingAwareProvider provider, BundleContext ctx);
+    ProviderContext registerProvider(BindingAwareProvider provider);
 
     /**
      * {@link BindingAwareConsumer} specific access to the SAL functionality.
@@ -149,11 +160,6 @@ public interface BindingAwareBroker {
      */
     public interface ProviderContext extends ConsumerContext, RpcProviderRegistry {
 
-        @Deprecated
-        void registerFunctionality(ProviderFunctionality functionality);
-
-        @Deprecated
-        void unregisterFunctionality(ProviderFunctionality functionality);
     }
 
     /**
index cb26cad..35583c0 100644 (file)
@@ -7,11 +7,7 @@
  */
 package org.opendaylight.controller.sal.binding.api;
 
-import java.util.Collection;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.yangtools.yang.binding.RpcService;
 
 /**
  *
@@ -107,55 +103,6 @@ import org.opendaylight.yangtools.yang.binding.RpcService;
  */
 public interface BindingAwareProvider {
 
-    /**
-     * @deprecated
-     *
-     * This interface was originally intended to solve problems of how to get Implementations
-     * of functionality from a provider, but that is no longer necessary because the Provider
-     * Registers RPCs in onSessionInitiated.
-     *
-     * Recommend:
-     * {code
-     * public Collection<? extends RpcService> getImplementations() {
-     *   return Collections.emptySet();
-     * }
-     * }
-     */
-    @Deprecated
-    Collection<? extends RpcService> getImplementations();
-
-    /**
-     * @deprecated
-     *
-     * This interface was originally intended to solve problems of how to get Functionality
-     *  a provider could provide, but that is no longer necessary because the Provider
-     * Registers RPCs in onSessionInitiated.
-     *
-     * Recommend:
-     * {code
-     * public Collection<? extends ProviderFunctionality> getFunctionality() {
-     *   return Collections.emptySet();
-     * }
-     * }
-     *
-     */
-    @Deprecated
-    Collection<? extends ProviderFunctionality> getFunctionality();
-
-    /**
-     * Functionality provided by the {@link BindingAwareProvider}
-     *
-     * <p>
-     * Marker interface used to mark the interfaces describing specific
-     * functionality which could be exposed by providers to other components.
-     *
-     *
-     *
-     */
-    @Deprecated
-    public interface ProviderFunctionality {
-
-    }
     /**
      * Callback signaling initialization of the consumer session to the SAL.
      *
@@ -168,22 +115,4 @@ public interface BindingAwareProvider {
      * @param session Unique session between consumer and SAL.
      */
     void onSessionInitiated(ProviderContext session);
-
-    /*
-     * @deprecated
-     *
-     * A provider was at one point considered an extension of a consumer, thus this
-     * call.  It is deprecated and the @see org.opendaylight.controller.sal.binding.api.BindingAwareConsumer#onSessionInitiated
-     * used, or you should simply use {@link #onSessionInitiated(ProviderContext)}
-     *
-     * Recommend:
-     * {code
-     * public final void onSessionInitialized(ConsumerContext session) {
-     *   // NOOP - as method is deprecated
-     * }
-     * }
-     */
-    @Deprecated
-    void onSessionInitialized(ConsumerContext session);
-
 }
diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataRefresher.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataRefresher.java
deleted file mode 100644 (file)
index c0c8f4f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.api.data;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-
-/**
- * Trigger for refreshing of the data exposed by the {@link Provider}
- *
- *
- * @deprecated Unused, not supported. Replaced by org.opendaylight.controller.sal.core.spi.data.DOMStore.
- */
-@Deprecated
-public interface DataRefresher extends BindingAwareProvider.ProviderFunctionality {
-
-    /**
-     * Fired when some component explicitly requested the data refresh.
-     *
-     * The provider which exposed the {@link DataRefresher} should republish its
-     * provided data by editing the data in all affected data stores.
-     */
-    void refreshData();
-}
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/RuntimeDataProvider.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/RuntimeDataProvider.java
deleted file mode 100644 (file)
index 273f20f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.api.data;
-
-import org.opendaylight.controller.md.sal.common.api.data.DataReader;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-/**
- * Utility interface which does type capture for BindingAware DataReader.
- *
- *
- * @deprecated Removed, replaced by org.opendaylight.controller.sal.core.spi.data.DOMStore.
- *
- */
-@Deprecated
-public interface RuntimeDataProvider extends ProviderFunctionality,DataReader<InstanceIdentifier<? extends DataObject>, DataObject> {
-
-
-
-}
index d810149..ddfb1cd 100644 (file)
@@ -135,13 +135,25 @@ public class RootBindingAwareBroker implements //
     }
 
     @Override
-    public ConsumerContext registerConsumer(final BindingAwareConsumer consumer, final BundleContext ctx) {
+    public ConsumerContext registerConsumer(BindingAwareConsumer consumer,
+            BundleContext ctx) {
+        return registerConsumer(consumer);
+    }
+
+    @Override
+    public ProviderContext registerProvider(BindingAwareProvider provider,
+            BundleContext ctx) {
+        return registerProvider(provider);
+    }
+
+    @Override
+    public ConsumerContext registerConsumer(final BindingAwareConsumer consumer) {
         checkState(supportedConsumerServices != null, "Broker is not initialized.");
         return BindingContextUtils.createConsumerContextAndInitialize(consumer, supportedConsumerServices);
     }
 
     @Override
-    public ProviderContext registerProvider(final BindingAwareProvider provider, final BundleContext ctx) {
+    public ProviderContext registerProvider(final BindingAwareProvider provider) {
         checkState(supportedProviderServices != null, "Broker is not initialized.");
         return BindingContextUtils.createProviderContextAndInitialize(provider, supportedProviderServices);
     }
index d00d8b7..f63ce10 100644 (file)
@@ -12,15 +12,15 @@ import static com.google.common.base.Preconditions.checkState;
 
 import java.util.Collection;
 import java.util.Collections;
-
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+
 import org.opendaylight.controller.md.sal.binding.impl.AbstractForwardedDataBroker;
+import org.opendaylight.controller.md.sal.common.api.data.DataReader;
 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangePublisher;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.controller.sal.binding.api.data.RuntimeDataProvider;
 import org.opendaylight.controller.sal.binding.impl.DataBrokerImpl;
 import org.opendaylight.controller.sal.binding.impl.MountPointManagerImpl.BindingMountPointImpl;
 import org.opendaylight.controller.sal.binding.impl.RpcProviderRegistryImpl;
@@ -41,7 +41,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class BindingIndependentConnector implements //
-        RuntimeDataProvider, //
+        DataReader<InstanceIdentifier<? extends DataObject>, DataObject>, //
         Provider, //
         AutoCloseable {
 
index da47b17..6871a0a 100644 (file)
@@ -7,29 +7,9 @@
  */
 package org.opendaylight.controller.test.sal.binding.it;
 
-import java.util.Collection;
-import java.util.Collections;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.yangtools.yang.binding.RpcService;
 
 public abstract class AbstractTestProvider implements BindingAwareProvider {
 
-    @Override
-    public Collection<? extends RpcService> getImplementations() {
-        return Collections.emptySet();
-    }
-
-    @Override
-    public Collection<? extends ProviderFunctionality> getFunctionality() {
-        return Collections.emptySet();
-    }
-
-    @Override
-    public void onSessionInitialized(ConsumerContext session) {
-        // Noop
-
-    }
 
 }
index 9ec5bcf..8f8e475 100644 (file)
@@ -12,7 +12,6 @@ import static org.junit.Assert.assertNotNull;
 
 import java.math.BigInteger;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.List;
 
 import org.junit.Before;
@@ -35,7 +34,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.Swit
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.NotificationListener;
-import org.opendaylight.yangtools.yang.binding.RpcService;
 
 @Ignore
 public class NotificationTest extends AbstractTest {
@@ -115,25 +113,6 @@ public class NotificationTest extends AbstractTest {
                 listener2Reg = session.getSALService(NotificationProviderService.class).registerNotificationListener(
                         listener2);
             }
-
-            @Override
-            public void onSessionInitialized(ConsumerContext session) {
-                // TODO Auto-generated method stub
-
-            }
-
-            @Override
-            public Collection<? extends RpcService> getImplementations() {
-                // TODO Auto-generated method stub
-                return null;
-            }
-
-            @Override
-            public Collection<? extends ProviderFunctionality> getFunctionality() {
-                // TODO Auto-generated method stub
-                return null;
-            }
-
         };
 
         // registerConsumer method calls onSessionInitialized method above
index dc22891..26aa27e 100644 (file)
@@ -16,7 +16,6 @@ import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcR
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
 import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality;
 import org.opendaylight.controller.sal.binding.api.BindingAwareService;
 import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
@@ -132,17 +131,5 @@ public class BindingContextUtils {
                 throws IllegalStateException {
             return getSALService(RpcProviderRegistry.class).addRpcImplementation(type, implementation);
         }
-
-        @Deprecated
-        @Override
-        public void registerFunctionality(ProviderFunctionality functionality) {
-            // NOOP
-        }
-
-        @Deprecated
-        @Override
-        public void unregisterFunctionality(ProviderFunctionality functionality) {
-            // NOOP
-        }
     }
 }
index 59cdc76..c8a5a85 100644 (file)
@@ -23,7 +23,7 @@ public class XSQLModule extends org.opendaylight.yang.gen.v1.http.netconfcentral
         getSchemaServiceDependency().registerSchemaContextListener(xsqlAdapter);
         xsqlAdapter.setDataBroker(getAsyncDataBrokerDependency());
         XSQLProvider p = new XSQLProvider();
-        p.buildXSQL(getDataBrokerDependency());
+        //p.buildXSQL(getDataBrokerDependency());
         return p;
     }
 
index cf9174d..171f2f4 100644 (file)
@@ -23,7 +23,6 @@ import org.opendaylight.controller.sal.core.api.Provider;
 import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry;
 import org.opendaylight.controller.sal.core.api.notify.NotificationPublishService;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
-import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.slf4j.Logger;
@@ -70,16 +69,6 @@ final class NetconfDeviceSalProvider implements AutoCloseable, Provider, Binding
         return Collections.emptySet();
     }
 
-    @Override
-    public Collection<? extends RpcService> getImplementations() {
-        return Collections.emptySet();
-    }
-
-    @Override
-    public Collection<? extends BindingAwareProvider.ProviderFunctionality> getFunctionality() {
-        return Collections.emptySet();
-    }
-
     @Override
     public void onSessionInitiated(final BindingAwareBroker.ProviderContext session) {
         logger.debug("{}: Session with sal established {}", id, session);
@@ -88,9 +77,6 @@ final class NetconfDeviceSalProvider implements AutoCloseable, Provider, Binding
         datastoreAdapter = new NetconfDeviceDatastoreAdapter(id, dataBroker);
     }
 
-    @Override
-    public void onSessionInitialized(final BindingAwareBroker.ConsumerContext session) {}
-
     public void close() throws Exception {
         mountInstance.close();
         datastoreAdapter.close();
index 95fb9a4..7cd20ee 100644 (file)
@@ -205,6 +205,7 @@ public class BrokerFacade {
             if (optionalDatastoreData.isPresent() && payload.equals(optionalDatastoreData.get())) {
                 String errMsg = "Post Configuration via Restconf was not executed because data already exists";
                 LOG.trace(errMsg + ":{}", path);
+                rWTransaction.cancel();
                 throw new RestconfDocumentedException("Data already exists for path: " + path, ErrorType.PROTOCOL,
                         ErrorTag.DATA_EXISTS);
             }
@@ -250,6 +251,7 @@ public class BrokerFacade {
             try {
                 currentOp = currentOp.getChild(currentArg);
             } catch (DataNormalizationException e) {
+                rwTx.cancel();
                 throw new IllegalArgumentException(
                         String.format("Invalid child encountered in path %s", normalizedPath), e);
             }
@@ -264,6 +266,7 @@ public class BrokerFacade {
                 exists = future.checkedGet();
             } catch (ReadFailedException e) {
                 LOG.error("Failed to read pre-existing data from store {} path {}", store, currentPath, e);
+                rwTx.cancel();
                 throw new IllegalStateException("Failed to read pre-existing data", e);
             }
 
index 74b2320..0553b2f 100644 (file)
@@ -51,7 +51,7 @@ public class SalRemoteServiceBroker implements BindingAwareBroker,AutoCloseable
                 .put(RpcConsumerRegistry.class,servicesFactory.getRpcConsumerRegistry() ).build();
     }
 
-    public ProviderContext registerProvider(BindingAwareProvider provider, BundleContext ctx) {
+    public ProviderContext registerProvider(BindingAwareProvider provider) {
         throw new UnsupportedOperationException();
     }
     @Override
@@ -59,9 +59,21 @@ public class SalRemoteServiceBroker implements BindingAwareBroker,AutoCloseable
         //TODO decide if serviceFactory should close clientContext or it has to be closed by consumer
     }
     @Override
-    public ConsumerContext registerConsumer(BindingAwareConsumer consumer, BundleContext ctx) {
+    public ConsumerContext registerConsumer(BindingAwareConsumer consumer) {
         checkState(supportedConsumerServices != null, "Broker is not initialized.");
         return BindingContextUtils.createConsumerContextAndInitialize(consumer, supportedConsumerServices);
     }
 
+    @Override
+    public ConsumerContext registerConsumer(BindingAwareConsumer consumer,
+            BundleContext ctx) {
+        return registerConsumer(consumer);
+    }
+
+    @Override
+    public ProviderContext registerProvider(BindingAwareProvider provider,
+            BundleContext ctx) {
+        return registerProvider(provider);
+    }
+
 }
index 7008879..902be44 100644 (file)
@@ -12,8 +12,9 @@ import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Sets;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import org.opendaylight.controller.config.api.LookupRegistry;
@@ -36,8 +37,8 @@ public class NetconfOperationServiceImpl implements NetconfOperationService {
     private final Set<Capability> capabilities;
     private final TransactionProvider transactionProvider;
 
-    public NetconfOperationServiceImpl(YangStoreService yangStoreService, ConfigRegistryJMXClient jmxClient,
-            String netconfSessionIdForReporting) throws YangStoreException {
+    public NetconfOperationServiceImpl(final YangStoreService yangStoreService, final ConfigRegistryJMXClient jmxClient,
+            final String netconfSessionIdForReporting) throws YangStoreException {
 
         yangStoreSnapshot = yangStoreService.getYangStoreSnapshot();
         checkConsistencyBetweenYangStoreAndConfig(jmxClient, yangStoreSnapshot);
@@ -50,7 +51,7 @@ public class NetconfOperationServiceImpl implements NetconfOperationService {
 
 
     @VisibleForTesting
-    static void checkConsistencyBetweenYangStoreAndConfig(LookupRegistry jmxClient, YangStoreSnapshot yangStoreSnapshot) {
+    static void checkConsistencyBetweenYangStoreAndConfig(final LookupRegistry jmxClient, final YangStoreSnapshot yangStoreSnapshot) {
         Set<String> missingModulesFromConfig = Sets.newHashSet();
 
         Set<String> modulesSeenByConfig = jmxClient.getAvailableModuleFactoryQNames();
@@ -89,7 +90,7 @@ public class NetconfOperationServiceImpl implements NetconfOperationService {
         return operationProvider.getOperations();
     }
 
-    private static Set<Capability> setupCapabilities(YangStoreSnapshot yangStoreSnapshot) {
+    private static Set<Capability> setupCapabilities(final YangStoreSnapshot yangStoreSnapshot) {
         Set<Capability> capabilities = new HashSet<>();
         // [RFC6241] 8.3.  Candidate Configuration Capability
         capabilities.add(new BasicCapability("urn:ietf:params:netconf:capability:candidate:1.0"));
@@ -110,7 +111,7 @@ public class NetconfOperationServiceImpl implements NetconfOperationService {
 
         private final String capability;
 
-        private BasicCapability(String capability) {
+        private BasicCapability(final String capability) {
             this.capability = capability;
         }
 
@@ -140,8 +141,8 @@ public class NetconfOperationServiceImpl implements NetconfOperationService {
         }
 
         @Override
-        public Optional<List<String>> getLocation() {
-            return Optional.absent();
+        public Collection<String> getLocation() {
+            return Collections.emptyList();
         }
 
         @Override
@@ -157,7 +158,7 @@ public class NetconfOperationServiceImpl implements NetconfOperationService {
         private final String moduleName;
         private final String moduleNamespace;
 
-        public YangStoreCapability(Module module, String moduleContent) {
+        public YangStoreCapability(final Module module, final String moduleContent) {
             super(toCapabilityURI(module));
             this.content = moduleContent;
             this.moduleName = module.getName();
@@ -170,7 +171,7 @@ public class NetconfOperationServiceImpl implements NetconfOperationService {
             return Optional.of(content);
         }
 
-        private static String toCapabilityURI(Module module) {
+        private static String toCapabilityURI(final Module module) {
             return String.valueOf(module.getNamespace()) + "?module="
                     + module.getName() + "&revision=" + Util.writeDate(module.getRevision());
         }
index 3f44ff4..efbe3ad 100644 (file)
@@ -10,10 +10,12 @@ package org.opendaylight.controller.netconf.impl.osgi;
 import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Collections2;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableList.Builder;
 import io.netty.util.internal.ConcurrentSet;
-import java.util.Collections;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import javax.annotation.Nonnull;
@@ -37,25 +39,32 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, SessionMonitoringService {
-
+    private static final Schema.Location NETCONF_LOCATION = new Schema.Location(Schema.Location.Enumeration.NETCONF);
+    private static final List<Schema.Location> NETCONF_LOCATIONS = ImmutableList.of(NETCONF_LOCATION);
     private static final Logger LOG = LoggerFactory.getLogger(NetconfMonitoringServiceImpl.class);
+    private static final Function<NetconfManagementSession, Session> SESSION_FUNCTION = new Function<NetconfManagementSession, Session>() {
+        @Override
+        public Session apply(@Nonnull final NetconfManagementSession input) {
+            return input.toManagementSession();
+        }
+    };
 
     private final Set<NetconfManagementSession> sessions = new ConcurrentSet<>();
     private final NetconfOperationProvider netconfOperationProvider;
 
-    public NetconfMonitoringServiceImpl(NetconfOperationProvider netconfOperationProvider) {
+    public NetconfMonitoringServiceImpl(final NetconfOperationProvider netconfOperationProvider) {
         this.netconfOperationProvider = netconfOperationProvider;
     }
 
     @Override
-    public void onSessionUp(NetconfManagementSession session) {
+    public void onSessionUp(final NetconfManagementSession session) {
         LOG.debug("Session {} up", session);
         Preconditions.checkState(!sessions.contains(session), "Session %s was already added", session);
         sessions.add(session);
     }
 
     @Override
-    public void onSessionDown(NetconfManagementSession session) {
+    public void onSessionDown(final NetconfManagementSession session) {
         LOG.debug("Session {} down", session);
         Preconditions.checkState(sessions.contains(session), "Session %s not present", session);
         sessions.remove(session);
@@ -63,7 +72,7 @@ public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, S
 
     @Override
     public Sessions getSessions() {
-        return new SessionsBuilder().setSession(transformSessions(sessions)).build();
+        return new SessionsBuilder().setSession(ImmutableList.copyOf(Collections2.transform(sessions, SESSION_FUNCTION))).build();
     }
 
     @Override
@@ -78,65 +87,55 @@ public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, S
         }
     }
 
-    private Schemas transformSchemas(Set<NetconfOperationService> services) {
-        Set<Capability> caps = Sets.newHashSet();
-
-        List<Schema> schemas = Lists.newArrayList();
-
-
+    private static Schemas transformSchemas(final Set<NetconfOperationService> services) {
+        // FIXME: Capability implementations do not have hashcode/equals!
+        final Set<Capability> caps = new HashSet<>();
         for (NetconfOperationService netconfOperationService : services) {
             // TODO check for duplicates ? move capability merging to snapshot
             // Split capabilities from operations first and delete this duplicate code
             caps.addAll(netconfOperationService.getCapabilities());
         }
 
+        final List<Schema> schemas = new ArrayList<>(caps.size());
         for (Capability cap : caps) {
-            SchemaBuilder builder = new SchemaBuilder();
-
-            if (cap.getCapabilitySchema().isPresent() == false) {
-                continue;
-            }
+            if (cap.getCapabilitySchema().isPresent()) {
+                SchemaBuilder builder = new SchemaBuilder();
+                Preconditions.checkState(cap.getModuleNamespace().isPresent());
+                builder.setNamespace(new Uri(cap.getModuleNamespace().get()));
 
-            Preconditions.checkState(cap.getModuleNamespace().isPresent());
-            builder.setNamespace(new Uri(cap.getModuleNamespace().get()));
+                Preconditions.checkState(cap.getRevision().isPresent());
+                String version = cap.getRevision().get();
+                builder.setVersion(version);
 
-            Preconditions.checkState(cap.getRevision().isPresent());
-            String version = cap.getRevision().get();
-            builder.setVersion(version);
+                Preconditions.checkState(cap.getModuleName().isPresent());
+                String identifier = cap.getModuleName().get();
+                builder.setIdentifier(identifier);
 
-            Preconditions.checkState(cap.getModuleName().isPresent());
-            String identifier = cap.getModuleName().get();
-            builder.setIdentifier(identifier);
+                builder.setFormat(Yang.class);
 
-            builder.setFormat(Yang.class);
+                builder.setLocation(transformLocations(cap.getLocation()));
 
-            builder.setLocation(transformLocations(cap.getLocation().or(Collections.<String>emptyList())));
+                builder.setKey(new SchemaKey(Yang.class, identifier, version));
 
-            builder.setKey(new SchemaKey(Yang.class, identifier, version));
-
-            schemas.add(builder.build());
+                schemas.add(builder.build());
+            }
         }
 
         return new SchemasBuilder().setSchema(schemas).build();
     }
 
-    private List<Schema.Location> transformLocations(List<String> locations) {
-        List<Schema.Location> monitoringLocations = Lists.newArrayList();
-        monitoringLocations.add(new Schema.Location(Schema.Location.Enumeration.NETCONF));
+    private static List<Schema.Location> transformLocations(final Collection<String> locations) {
+        if (locations.isEmpty()) {
+            return NETCONF_LOCATIONS;
+        }
+
+        final Builder<Schema.Location> b = ImmutableList.builder();
+        b.add(NETCONF_LOCATION);
 
         for (String location : locations) {
-            monitoringLocations.add(new Schema.Location(new Uri(location)));
+            b.add(new Schema.Location(new Uri(location)));
         }
 
-        return monitoringLocations;
-    }
-
-    private List<Session> transformSessions(Set<NetconfManagementSession> sessions) {
-        return Lists.newArrayList(Collections2.transform(sessions, new Function<NetconfManagementSession, Session>() {
-            @Override
-            public Session apply(@Nonnull NetconfManagementSession input) {
-                return input.toManagementSession();
-            }
-        }));
+        return b.build();
     }
 }
index 0d296c5..93caa09 100644 (file)
@@ -90,7 +90,7 @@ public class NetconfMonitoringServiceImplTest {
         Optional<String> optRev = Optional.of("rev");
         doReturn(optRev).when(cap).getRevision();
         doReturn(Optional.of("modName")).when(cap).getModuleName();
-        doReturn(Optional.of(Lists.newArrayList("loc"))).when(cap).getLocation();
+        doReturn(Lists.newArrayList("loc")).when(cap).getLocation();
         doNothing().when(snapshot).close();
 
         assertNotNull(service.getSchemas());
index 463b5f0..ea94fd3 100644 (file)
@@ -199,8 +199,8 @@ public class NetconfITMonitoringTest extends AbstractNetconfConfigTest {
         }
 
         @Override
-        public Optional<List<String>> getLocation() {
-            return Optional.absent();
+        public List<String> getLocation() {
+            return Collections.emptyList();
         }
     }
 }
index f55a90e..408756b 100644 (file)
@@ -9,7 +9,7 @@
 package org.opendaylight.controller.netconf.mapping.api;
 
 import com.google.common.base.Optional;
-import java.util.List;
+import java.util.Collection;
 
 /**
  * Contains capability URI announced by server hello message and optionally its
@@ -27,5 +27,5 @@ public interface Capability {
 
     public Optional<String> getCapabilitySchema();
 
-    public Optional<List<String>> getLocation();
+    public Collection<String> getLocation();
 }
index e9e92d9..a17e139 100644 (file)
@@ -9,7 +9,8 @@ package org.opendaylight.controller.netconf.monitoring.osgi;
 
 import com.google.common.base.Optional;
 import com.google.common.collect.Sets;
-import java.util.List;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.Set;
 import org.opendaylight.controller.netconf.api.monitoring.NetconfMonitoringService;
 import org.opendaylight.controller.netconf.mapping.api.Capability;
@@ -48,14 +49,14 @@ public class NetconfMonitoringOperationService implements NetconfOperationServic
         }
 
         @Override
-        public Optional<List<String>> getLocation() {
-            return Optional.absent();
+        public Collection<String> getLocation() {
+            return Collections.emptyList();
         }
     });
 
     private final NetconfMonitoringService monitor;
 
-    public NetconfMonitoringOperationService(NetconfMonitoringService monitor) {
+    public NetconfMonitoringOperationService(final NetconfMonitoringService monitor) {
         this.monitor = monitor;
     }
 
index 74e6747..7873183 100644 (file)
@@ -12,6 +12,7 @@ import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.mock;
 
 import com.google.common.base.Optional;
+import java.util.Collections;
 import org.junit.Test;
 import org.opendaylight.controller.netconf.api.monitoring.NetconfMonitoringService;
 import org.opendaylight.controller.netconf.monitoring.MonitoringConstants;
@@ -24,8 +25,8 @@ public class NetconfMonitoringOperationServiceTest {
 
         assertEquals(1, service.getNetconfOperations().size());
 
-        assertEquals(Optional.absent(), service.getCapabilities().iterator().next().getCapabilitySchema());
-        assertEquals(Optional.absent(), service.getCapabilities().iterator().next().getLocation());
+        assertEquals(Optional.<String>absent(), service.getCapabilities().iterator().next().getCapabilitySchema());
+        assertEquals(Collections.<String>emptyList(), service.getCapabilities().iterator().next().getLocation());
         assertEquals(Optional.of(MonitoringConstants.MODULE_REVISION), service.getCapabilities().iterator().next().getRevision());
         assertEquals(Optional.of(MonitoringConstants.MODULE_NAME), service.getCapabilities().iterator().next().getModuleName());
         assertEquals(Optional.of(MonitoringConstants.NAMESPACE), service.getCapabilities().iterator().next().getModuleNamespace());
index 1a68f55..68f8796 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.controller.netconf.test.tool;
 
 import com.google.common.base.Optional;
+import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 import org.opendaylight.controller.netconf.confignetconfconnector.util.Util;
@@ -58,7 +59,7 @@ final class ModuleBuilderCapability implements Capability {
     }
 
     @Override
-    public Optional<List<String>> getLocation() {
-        return Optional.absent();
+    public List<String> getLocation() {
+        return Collections.emptyList();
     }
 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.