Merge "Bug 225 - added support for depth RESTCONF parameter in URI"
authorTony Tkacik <ttkacik@cisco.com>
Wed, 18 Jun 2014 12:34:14 +0000 (12:34 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 18 Jun 2014 12:34:14 +0000 (12:34 +0000)
102 files changed:
features/base/pom.xml
features/base/src/main/resources/features.xml
features/controller/pom.xml [new file with mode: 0644]
features/controller/src/main/resources/features.xml [new file with mode: 0644]
opendaylight/commons/opendaylight/pom.xml
opendaylight/connectionmanager/implementation/src/main/java/org/opendaylight/controller/connectionmanager/internal/ConnectionManager.java
opendaylight/containermanager/api/src/main/java/org/opendaylight/controller/containermanager/IContainerManagerShell.java [new file with mode: 0644]
opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/Activator.java
opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/ContainerManager.java
opendaylight/containermanager/shell/pom.xml [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainer.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainerEntry.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainerFlow.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetAuthorizedGroups.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetAuthorizedResources.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetResourcesForGroup.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetRoles.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserLevel.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserResources.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/CreateContainer.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Pfc.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psc.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psd.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psm.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psp.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainer.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainerEntry.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainerFlow.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/SaveConfig.java [new file with mode: 0644]
opendaylight/containermanager/shell/src/main/resources/OSGI-INF/blueprint/blueprint.xml [new file with mode: 0644]
opendaylight/containermanager/shell/src/test/java/org/opendaylight/controller/containermanager/shell/ContainerManagerShellTest.java [new file with mode: 0644]
opendaylight/distribution/opendaylight-karaf/pom.xml
opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/custom.properties
opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/startup.properties
opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/system.properties [new file with mode: 0644]
opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-action-types.yang
opendaylight/md-sal/pom.xml
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncConfigurationCommitCohort.java [new file with mode: 0644]
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncConfigurationCommitCoordinator.java [new file with mode: 0644]
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncConfigurationCommitHandler.java [new file with mode: 0644]
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataValidationFailedException.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/pom.xml
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStore.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DOMStoreProxy.java with 76% similarity]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ListenerRegistrationProxy.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionChainProxy.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedDataStoreProviderModule.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedDataStoreProviderModuleFactory.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/yang/distributed-datastore-provider.yang [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/AbstractDOMForwardedTransactionFactory.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMDataBrokerTransactionChainImpl.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMDataCommitErrorListener.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMDataCommitExecutor.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMDataCommitImplementation.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMForwardedReadOnlyTransaction.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMForwardedReadWriteTransaction.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMForwardedWriteTransaction.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/TransactionCommitFailedExceptionMapper.java
opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/BlockingTransactionChainListener.java
opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMTransactionChainTest.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/get/Get.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/getconfig/GetConfig.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionListener.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/SubtreeFilter.java [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/SubtreeFilterTest.java [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/getConfig_reply_unfiltered.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/logback-test.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringOperationService.java
opendaylight/netconf/netconf-ssh/src/test/java/org/opendaylight/controller/netconf/netty/SSHTest.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/mapping/AbstractNetconfOperation.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlElement.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlNetconfConstants.java
opendaylight/sal/connection/implementation/src/main/java/org/opendaylight/controller/sal/connection/implementation/internal/ConnectionService.java
pom.xml

index d12432c6b4f8dd8e7d194d524eb1f88713a7805b..922b2d6bdfbd7652df204f2e70597a11fc0a76ac 100644 (file)
@@ -8,7 +8,7 @@
     <relativePath>../../opendaylight/commons/opendaylight</relativePath>
   </parent>
   <artifactId>base-features</artifactId>
-  <packaging>kar</packaging>
+  <packaging>pom</packaging>
   <name>${project.artifactId}</name>
   <description>Base Features POM</description>
   <properties>
       </resource>
     </resources>
     <plugins>
-      <plugin>
-        <groupId>org.apache.karaf.tooling</groupId>
-        <artifactId>karaf-maven-plugin</artifactId>
-        <version>${karaf.version}</version>
-        <extensions>true</extensions>
-        <executions>
-          <execution>
-            <id>features-create-kar</id>
-            <goals>
-              <goal>features-create-kar</goal>
-            </goals>
-            <configuration>
-              <featuresFile>${project.build.directory}/classes/${features.file}</featuresFile>
-            </configuration>
-          </execution>
-        </executions>
-        <!-- There is no useful configuration for the kar mojo. The features-generate-descriptor mojo configuration may be useful -->
-      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-resources-plugin</artifactId>
index 23051f5a9ab88ba7a7f82dc75b9ad2abfbf0355c..5677ab66d0bf971e43541583ce6b5955a57906e0 100644 (file)
       <bundle start="true" start-level="35">mvn:orbit/org.apache.juli.extras/7.0.32.v201211081135</bundle>
       <bundle start="true" start-level="35">mvn:orbit/org.apache.tomcat.api/7.0.32.v201211081135</bundle>
       <bundle start="true" start-level="35">mvn:orbit/org.apache.tomcat.util/7.0.32.v201211201952</bundle>
-      <bundle start="true" start-level="35">wrap:mvn:virgomirror/org.eclipse.jdt.core.compiler.batch/3.8.0.I20120518-2145</bundle>
    </feature>
    <feature name="base-spring" description="Opendaylight Spring Support" version="${spring.version}">
       <bundle>mvn:org.ow2.asm/asm-all/${asm.version}</bundle>
diff --git a/features/controller/pom.xml b/features/controller/pom.xml
new file mode 100644 (file)
index 0000000..ddaf773
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>commons.opendaylight</artifactId>
+    <version>1.4.2-SNAPSHOT</version>
+    <relativePath>../../opendaylight/commons/opendaylight</relativePath>
+  </parent>
+  <artifactId>controller-features</artifactId>
+  <packaging>pom</packaging>
+  <name>${project.artifactId}</name>
+  <description>Features POM</description>
+  <properties>
+    <features.file>features.xml</features.file>
+  </properties>
+  <build>
+    <resources>
+      <resource>
+        <filtering>true</filtering>
+        <directory>src/main/resources</directory>
+      </resource>
+    </resources>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>filter</id>
+            <goals>
+              <goal>resources</goal>
+            </goals>
+            <phase>generate-resources</phase>
+          </execution>
+        </executions>
+      </plugin>
+      <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/${features.file}</file>
+                  <type>xml</type>
+                  <classifier>features</classifier>
+                </artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/features/controller/src/main/resources/features.xml b/features/controller/src/main/resources/features.xml
new file mode 100644 (file)
index 0000000..1ae210a
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<features name="controller-${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">
+
+   <feature name="odl-hosttracker" description="Controller Service: Host Tracker">
+      <feature>odl-clustering</feature>
+      <feature>odl-managers</feature>
+      <feature>odl-sal</feature>
+      <bundle>mvn:org.opendaylight.controller/hosttracker/${hosttracker.api.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/hosttracker.implementation/${hosttracker.implementation.version}</bundle>
+   </feature>
+   <feature name="odl-sal" description="Service Abstraction Layer"
+      version="${sal.version}">
+      <feature>base-felix-dm</feature>
+      <bundle start="true" start-level="35">mvn:org.apache.commons/commons-lang3/${commons.lang.version}</bundle>
+      <bundle>mvn:org.osgi/org.osgi.compendium/${osgi.compendium.version}</bundle>
+      <bundle>mvn:org.apache.felix/org.apache.felix.dependencymanager/${felix.dependencymanager.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/sal/${sal.version}</bundle>
+      <!-- The SAL Implementation doesn't follow API versioning, should be revisited in the bundle -->
+      <bundle>mvn:org.opendaylight.controller/sal.implementation/${sal.implementation.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/sal.networkconfiguration/${sal.networkconfiguration.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/sal.networkconfiguration.implementation/${sal.networkconfiguration.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/sal.connection/${sal.connection.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/sal.connection.implementation/${sal.connection.version}</bundle>
+   </feature>
+   <feature name="odl-clustering" description="Controller Service: Clustering">
+      <feature>transaction</feature>
+      <feature>base-felix-dm</feature>
+      <feature>base-eclipselink-persistence</feature>
+      <feature>odl-sal</feature>
+      <bundle>mvn:org.opendaylight.controller/clustering.services/${clustering.services.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/clustering.services-implementation/${clustering.services_implementation.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/clustering.stub/${clustering.stub.version}</bundle>
+   </feature>
+   <feature name="odl-legacy-configuration">
+      <feature>odl-sal</feature>
+      <bundle>mvn:org.opendaylight.controller/configuration/${configuration.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/configuration.implementation/${configuration.implementation.version}</bundle>
+   </feature>
+   <feature name="odl-configuration" description="Controller Service: Configuration">
+      <!-- org.opendaylight.controller.config.yangjmxgenerator is missing -->
+      <bundle>mvn:org.opendaylight.controller/config-api/${config.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/config-manager/${config.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/config-netconf-connector/${netconf.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/config-persister-api/${config.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/config-persister-directory-xml-adapter/${config.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/config-persister-file-xml-adapter/${config.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/config-persister-impl/${netconf.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/yang-jmx-generator/${yang-jmx-generator.version}</bundle>
+   </feature>
+   <feature name="odl-managers" description="Big boss">
+      <feature>odl-legacy-configuration</feature>
+      <feature>base-spring-security</feature>
+      <feature>base-felix-dm</feature>
+      <feature>odl-clustering</feature>
+      <bundle>mvn:org.opendaylight.controller.thirdparty/net.sf.jung2/2.0.1</bundle>
+      <bundle>mvn:org.opendaylight.controller/appauth/${appauth.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/hosttracker/${hosttracker.api.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/hosttracker.implementation/${hosttracker.implementation.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/switchmanager/${switchmanager.api.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/switchmanager.implementation/${switchmanager.implementation.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/statisticsmanager/${statisticsmanager.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/statisticsmanager.implementation/${statisticsmanager.implementation.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/forwardingrulesmanager/${forwardingrulesmanager.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/forwardingrulesmanager.implementation/${forwardingrulesmanager.implementation.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/usermanager/${usermanager.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/usermanager.implementation/${usermanager.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/containermanager/${containermanager.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/containermanager.implementation/${containermanager.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/topologymanager/${topologymanager.version}</bundle>
+      <bundle>mvn:org.opendaylight.controller/forwarding.staticrouting</bundle>
+      <bundle>mvn:org.opendaylight.controller/routing.dijkstra_implementation</bundle>
+      <bundle>mvn:org.opendaylight.controller/connectionmanager</bundle>
+      <bundle>mvn:org.opendaylight.controller/connectionmanager.implementation</bundle>
+   </feature>
+</features>
index c3c8168bd77abcf00d84baeabad33576984c54e5..92e4ee0b481a7bd58c1ef0143fa4a97a0095a8e9 100644 (file)
   </prerequisites>
 
   <properties>
+    <akka.version>2.3.2</akka.version>
     <aopalliance.version>1.0.0</aopalliance.version>
     <appauth.version>0.4.2-SNAPSHOT</appauth.version>
+    <archetype-app-northbound>0.0.1-SNAPSHOT</archetype-app-northbound>
     <aries.util.version>1.1.0</aries.util.version>
     <!-- Controller Modules Versions -->
     <arphandler.version>0.5.2-SNAPSHOT</arphandler.version>
+    <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.4.0</bundle.plugin.version>
+    <bundlescanner.api.version>0.4.2-SNAPSHOT</bundlescanner.api.version>
+    <bundlescanner.implementation.version>0.4.2-SNAPSHOT</bundlescanner.implementation.version>
     <bundlescanner.version>0.4.2-SNAPSHOT</bundlescanner.version>
     <checkstyle.version>2.10</checkstyle.version>
     <clustering.services.version>0.5.1-SNAPSHOT</clustering.services.version>
     <clustering.stub.version>0.4.2-SNAPSHOT</clustering.stub.version>
     <clustering.test.version>0.4.2-SNAPSHOT</clustering.test.version>
     <commmons.northbound.version>0.4.2-SNAPSHOT</commmons.northbound.version>
+    <commons.checkstyle.version>0.0.3-SNAPSHOT</commons.checkstyle.version>
     <!-- Third Party Versions -->
     <commons.codec.version>1.7</commons.codec.version>
     <commons.fileupload.version>1.2.2</commons.fileupload.version>
     <commons.httpclient.version>0.1.2-SNAPSHOT</commons.httpclient.version>
     <commons.io.version>2.4</commons.io.version>
     <commons.lang.version>3.1</commons.lang.version>
+    <commons.logback_settings.version>0.0.2-SNAPSHOT</commons.logback_settings.version>
     <commons.net.version>3.0.1</commons.net.version>
+    <commons.opendaylight.commons.httpclient>0.1.2-SNAPSHOT</commons.opendaylight.commons.httpclient>
+    <commons.opendaylight.concepts.version>0.5.2-SNAPSHOT</commons.opendaylight.concepts.version>
+    <commons.opendaylight.version>1.4.2-SNAPSHOT</commons.opendaylight.version>
+    <commons.parent.version>1.0.2-SNAPSHOT</commons.parent.version>
     <compiler.version>2.3.2</compiler.version>
     <concepts.version>0.5.2-SNAPSHOT</concepts.version>
     <config.version>0.2.5-SNAPSHOT</config.version>
     <connectionmanager.version>0.1.2-SNAPSHOT</connectionmanager.version>
     <containermanager.it.version>0.5.2-SNAPSHOT</containermanager.it.version>
     <containermanager.northbound.version>0.4.2-SNAPSHOT</containermanager.northbound.version>
+    <containermanager.shell.version>0.5.2-SNAPSHOT</containermanager.shell.version>
     <containermanager.version>0.5.2-SNAPSHOT</containermanager.version>
     <controllermanager.northbound.version>0.0.2-SNAPSHOT</controllermanager.northbound.version>
     <corsfilter.version>7.0.42</corsfilter.version>
     <ctrie.version>0.2.0</ctrie.version>
     <devices.web.version>0.4.2-SNAPSHOT</devices.web.version>
+    <dummy-console.version>1.1.0-SNAPSHOT</dummy-console.version>
     <eclipse.persistence.version>2.5.0</eclipse.persistence.version>
     <!-- enforcer version -->
     <enforcer.version>1.3.1</enforcer.version>
@@ -79,6 +92,8 @@
     <hosttracker.implementation.version>0.5.2-SNAPSHOT</hosttracker.implementation.version>
     <hosttracker.northbound.version>0.4.2-SNAPSHOT</hosttracker.northbound.version>
     <hosttracker_new.api.version>0.4.2-SNAPSHOT</hosttracker_new.api.version>
+    <hosttracker_new.implementation.version>0.4.2-SNAPSHOT</hosttracker_new.implementation.version>
+    <httpservice-bridge.northbound.version>0.0.2-SNAPSHOT</httpservice-bridge.northbound.version>
     <ietf-inet-types.version>2010.09.24.4-SNAPSHOT</ietf-inet-types.version>
     <ietf-restconf.version>2013.10.19.1-SNAPSHOT</ietf-restconf.version>
     <ietf-topology.version>2013.10.21.2-SNAPSHOT</ietf-topology.version>
     <jersey2.version>2.8</jersey2.version>
     <jettison.version>1.3.3</jettison.version>
     <jmxGeneratorPath>src/main/yang-gen-config</jmxGeneratorPath>
+    <jolokia-bridge.version>0.0.2-SNAPSHOT</jolokia-bridge.version>
     <jolokia.version>1.1.4</jolokia.version>
     <jsr305.api.version>2.0.1</jsr305.api.version>
     <jsr311.api.version>1.1.1</jsr311.api.version>
     <jsr311.v2.api.version>2.0</jsr311.v2.api.version>
     <junit.version>4.8.1</junit.version>
     <karaf.branding.version>1.0.0-SNAPSHOT</karaf.branding.version>
+    <karaf.shell.version>3.0.0</karaf.shell.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>
     <networkconfig.neutron.version>0.4.2-SNAPSHOT</networkconfig.neutron.version>
     <!-- ODL repository / plugin repository -->
     <nexusproxy>http://nexus.opendaylight.org/content</nexusproxy>
+    <northbound.commons.version>0.4.2-SNAPSHOT</northbound.commons.version>
+    <northbound.hosttracker.version>1.4.2-SNAPSHOT</northbound.hosttracker.version>
+    <northbound.jolokia.version>1.4.2-SNAPSHOT</northbound.jolokia.version>
     <opendaylight-l2-types.version>2013.08.27.4-SNAPSHOT</opendaylight-l2-types.version>
     <org.json.version>20080701</org.json.version>
     <osgi-brandfragment.web.version>0.0.2-SNAPSHOT</osgi-brandfragment.web.version>
     <samples.loadbalancer.northbound.version>0.4.2-SNAPSHOT</samples.loadbalancer.northbound.version>
     <samples.simpleforwarding.version>0.4.2-SNAPSHOT</samples.simpleforwarding.version>
     <sanitytest.version>0.4.2-SNAPSHOT</sanitytest.version>
+    <scala.version>2.11</scala.version>
     <security.version>0.4.2-SNAPSHOT</security.version>
     <sitedeploy>dav:http://nexus.opendaylight.org/content/sites/site</sitedeploy>
     <siteplugin>3.2</siteplugin>
     <xtend.dstdir>src/main/xtend-gen</xtend.dstdir>
     <xtend.version>2.4.3</xtend.version>
     <yang-ext.version>2013.09.07.4-SNAPSHOT</yang-ext.version>
+    <yang-jmx-generator.version>1.0.0-SNAPSHOT</yang-jmx-generator.version>
     <yangtools.version>0.6.2-SNAPSHOT</yangtools.version>
   </properties>
 
         <artifactId>jersey-core</artifactId>
         <version>${jersey.version}</version>
       </dependency>
+
       <dependency>
         <groupId>com.sun.jersey</groupId>
         <artifactId>jersey-server</artifactId>
         <version>${jersey.version}</version>
       </dependency>
+
+      <dependency>
+        <groupId>com.typesafe.akka</groupId>
+        <artifactId>akka-actor_${scala.version}</artifactId>
+        <version>${akka.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>com.typesafe.akka</groupId>
+        <artifactId>akka-cluster_${scala.version}</artifactId>
+        <version>${akka.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>com.typesafe.akka</groupId>
+        <artifactId>akka-persistence-experimental_${scala.version}</artifactId>
+        <version>${akka.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>com.typesafe.akka</groupId>
+        <artifactId>akka-remote_${scala.version}</artifactId>
+        <version>${akka.version}</version>
+      </dependency>
       <dependency>
         <groupId>commons-codec</groupId>
         <artifactId>commons-codec</artifactId>
         <artifactId>containermanager.northbound</artifactId>
         <version>${containermanager.northbound.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>containermanager.shell</artifactId>
+        <version>${containermanager.shell.version}</version>
+      </dependency>
       <dependency>
         <groupId>org.opendaylight.controller</groupId>
         <artifactId>controllermanager.northbound</artifactId>
         <artifactId>chameleon-mbeans</artifactId>
         <version>1.0.0</version>
       </dependency>
+      <dependency>
+        <groupId>org.scala-lang</groupId>
+        <artifactId>scala-library</artifactId>
+        <version>${scala.version}.1</version>
+      </dependency>
       <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>jcl-over-slf4j</artifactId>
           <includeTestSourceDirectory>true</includeTestSourceDirectory>
           <sourceDirectory>${project.basedir}</sourceDirectory>
           <includes>**\/*.java,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat</includes>
-          <excludes>**\/target\/,**\/bin\/,**\/target-ide\/,**\/${jmxGeneratorPath}\/,**\/${salGeneratorPath}\/</excludes>
+          <excludes>**\/target\/,**\/bin\/,**\/target-ide\/,**\/${jmxGeneratorPath}\/,**\/${salGeneratorPath}\/,**\/xtend-gen\/</excludes>
         </configuration>
         <dependencies>
           <dependency>
index ebc56928a23856a158b4247d98c2720af9f98ac6..d76c094851123394a2c967a0b9aa4aaf020be90d 100644 (file)
@@ -261,7 +261,7 @@ public class ConnectionManager implements IConnectionManager,
             Map<ConnectionConstants, String> params) {
         if (connectionService == null)
             return null;
-        Node node = connectionService.connect(connectionIdentifier, params);
+        Node node = connectionService.connect(type, connectionIdentifier, params);
         AbstractScheme scheme = schemes.get(activeScheme);
         if (scheme != null && node != null)
             scheme.addNode(node);
diff --git a/opendaylight/containermanager/api/src/main/java/org/opendaylight/controller/containermanager/IContainerManagerShell.java b/opendaylight/containermanager/api/src/main/java/org/opendaylight/controller/containermanager/IContainerManagerShell.java
new file mode 100644 (file)
index 0000000..2024b18
--- /dev/null
@@ -0,0 +1,25 @@
+package org.opendaylight.controller.containermanager;
+
+import java.util.List;
+
+public interface IContainerManagerShell {
+    public List<String> psc();
+    public List<String> pfc();
+    public List<String> psd();
+    public List<String> psp();
+    public List<String> psm();
+    public List<String> addContainer(String arg1, String arg2);
+    public List<String> createContainer(String arg1, String arg2);
+    public List<String> removeContainerShell(String arg1);
+    public List<String> addContainerEntry(String arg1, String arg2, String arg3);
+    public List<String> removeContainerEntry(String arg1, String arg2, String arg3);
+    public List<String> addContainerFlow(String arg1, String arg2, String arg3);
+    public List<String> removeContainerFlow(String arg1, String arg2);
+    public List<String> containermgrGetRoles();
+    public List<String> containermgrGetAuthorizedGroups(String arg1);
+    public List<String> containermgrGetAuthorizedResources(String arg1);
+    public List<String> containermgrGetResourcesForGroup(String arg1);
+    public List<String> containermgrGetUserLevel(String arg1);
+    public List<String> containermgrGetUserResources(String arg1);
+    public List<String> saveConfig();
+}
\ No newline at end of file
index 616a0f24f33c5f856885981284b98ea1f9c4ec83..61c8ab6c6eb112a48141bb76753b8bec0c1fc78c 100644 (file)
 package org.opendaylight.controller.containermanager.internal;
 
 import org.eclipse.osgi.framework.console.CommandProvider;
+
 import java.util.Dictionary;
 import java.util.HashSet;
 import java.util.Set;
 import java.util.Hashtable;
+
 import org.opendaylight.controller.containermanager.IContainerManager;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
 import org.apache.felix.dm.Component;
 import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
 import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
@@ -124,7 +127,8 @@ public class Activator extends ComponentActivatorAbstractBase {
                             CommandProvider.class.getName(),
                             IContainerInternal.class.getName(),
                             IContainerAuthorization.class.getName(),
-                            ICacheUpdateAware.class.getName()}, props);
+                            ICacheUpdateAware.class.getName(),
+                            IContainerManagerShell.class.getName()}, props);
 
             c.add(createServiceDependency()
                     .setService(IClusterGlobalServices.class)
index 0fee183b67b8c1be06725b310c4111fbf3f9f8a8..98378e81354742327e912199a44619febbaa5905 100644 (file)
@@ -44,6 +44,7 @@ import org.opendaylight.controller.containermanager.ContainerFlowChangeEvent;
 import org.opendaylight.controller.containermanager.ContainerFlowConfig;
 import org.opendaylight.controller.containermanager.IContainerAuthorization;
 import org.opendaylight.controller.containermanager.IContainerManager;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
 import org.opendaylight.controller.containermanager.NodeConnectorsChangeEvent;
 import org.opendaylight.controller.sal.authorization.AppRoleLevel;
 import org.opendaylight.controller.sal.authorization.Privilege;
@@ -71,7 +72,7 @@ import org.slf4j.LoggerFactory;
 
 public class ContainerManager extends Authorization<String> implements IContainerManager, IObjectReader,
         CommandProvider, ICacheUpdateAware<String, Object>, IContainerInternal, IContainerAuthorization,
-        IConfigurationAware {
+        IConfigurationAware, IContainerManagerShell {
     private static final Logger logger = LoggerFactory.getLogger(ContainerManager.class);
     private static String CONTAINERS_FILE_NAME = "containers.conf";
     private static final String allContainersGroup = "allContainers";
@@ -1619,4 +1620,286 @@ public class ContainerManager extends Authorization<String> implements IContaine
     public boolean inContainerMode() {
         return this.containerConfigs.size() > 0;
     }
+
+    public List<String> psc() {
+        List<String> result = new ArrayList<String>();
+        for (Map.Entry<String, ContainerConfig> entry : containerConfigs.entrySet()) {
+            ContainerConfig sc = entry.getValue();
+            result.add(String.format("%s: %s", sc.getContainerName(), sc.toString()));
+        }
+        result.add("Total number of containers: " + containerConfigs.entrySet().size());
+        return result;
+    }
+
+    public List<String> pfc() {
+        List<String> result = new ArrayList<String>();
+        for (Map.Entry<String, ContainerConfig> entry : containerConfigs.entrySet()) {
+            ContainerConfig sc = entry.getValue();
+            result.add(String.format("%s: %s", sc.getContainerName(), sc.getContainerFlowConfigs()));
+        }
+        return result;
+    }
+
+    public List<String> psd() {
+        List<String> result = new ArrayList<String>();
+        for (String containerName : containerData.keySet()) {
+            ContainerData sd = containerData.get(containerName);
+            for (Node sid : sd.getSwPorts().keySet()) {
+                Set<NodeConnector> s = sd.getSwPorts().get(sid);
+                result.add("\t" + sid + " : " + s);
+            }
+
+            for (ContainerFlow s : sd.getContainerFlowSpecs()) {
+                result.add("\t" + s.toString());
+            }
+        }
+        return result;
+    }
+
+    public List<String> psp() {
+        List<String> result = new ArrayList<String>();
+        for (NodeConnector sp : nodeConnectorToContainers.keySet()) {
+            result.add(nodeConnectorToContainers.get(sp).toString());
+        }
+        return result;
+    }
+
+    public List<String> psm() {
+        List<String> result = new ArrayList<String>();
+        for (Node sp : nodeToContainers.keySet()) {
+            result.add(nodeToContainers.get(sp).toString());
+        }
+        return result;
+    }
+
+    public List<String> addContainer(String arg1, String arg2) {
+        List<String> result = new ArrayList<String>();
+        String containerName = arg1;
+        if (containerName == null) {
+            result.add("Container Name not specified");
+            return result;
+        }
+        String staticVlan = arg2;
+        ContainerConfig containerConfig = new ContainerConfig(containerName, staticVlan, null, null);
+        result.add((this.addRemoveContainer(containerConfig, false)).toString());
+        return result;
+    }
+
+    public List<String> createContainer(String arg1, String arg2) {
+        List<String> result = new ArrayList<String>();
+        String containerName = arg1;
+        if (containerName == null) {
+            result.add("Container Name not specified");
+            return result;
+        }
+        String staticVlan = arg2;
+        if (staticVlan == null) {
+            result.add("Static Vlan not specified");
+            return result;
+        }
+        List<String> ports = new ArrayList<String>();
+        for (long l = 1L; l < 10L; l++) {
+            ports.add(NodeConnectorCreator.createOFNodeConnector((short) 1, NodeCreator.createOFNode(l)).toString());
+        }
+        List<ContainerFlowConfig> cFlowList = new ArrayList<ContainerFlowConfig>();
+        cFlowList.add(this.createSampleContainerFlowConfig("tcp", true));
+        ContainerConfig containerConfig = new ContainerConfig(containerName, staticVlan, ports, cFlowList);
+        result.add((this.addRemoveContainer(containerConfig, false)).toString());
+        return result;
+    }
+
+    public List<String> removeContainerShell(String arg1) {
+        List<String> result = new ArrayList<String>();
+        String containerName = arg1;
+        if (containerName == null) {
+            result.add("Container Name not specified");
+            return result;
+        }
+        ContainerConfig containerConfig = new ContainerConfig(containerName, "", null, null);
+        result.add((this.addRemoveContainer(containerConfig, true)).toString());
+        return result;
+    }
+
+    public List<String> addContainerEntry(String arg1, String arg2, String arg3) {
+        List<String> result = new ArrayList<String>();
+        String containerName = arg1;
+        if (containerName == null) {
+            result.add("Container Name not specified");
+            return result;
+        }
+        String nodeId = arg2;
+        if (nodeId == null) {
+            result.add("Node Id not specified");
+            return result;
+        }
+        String portId = arg3;
+        if (portId == null) {
+            result.add("Port not specified");
+            return result;
+        }
+        Node node = NodeCreator.createOFNode(Long.valueOf(nodeId));
+        Short port = Short.valueOf(portId);
+        NodeConnector nc = NodeConnectorCreator.createOFNodeConnector(port, node);
+        List<String> portList = new ArrayList<String>(1);
+        portList.add(nc.toString());
+        result.add((this.addRemoveContainerEntries(containerName, portList, false)).toString());
+        return result;
+    }
+
+    public List<String> removeContainerEntry(String arg1, String arg2, String arg3) {
+        List<String> result = new ArrayList<String>();
+        String containerName = arg1;
+        if (containerName == null) {
+            result.add("Container Name not specified");
+            return result;
+        }
+        String nodeId = arg2;
+        if (nodeId == null) {
+            result.add("Node Id not specified");
+            return result;
+        }
+        String portId = arg3;
+        if (portId == null) {
+            result.add("Port not specified");
+            return result;
+        }
+        Node node = NodeCreator.createOFNode(Long.valueOf(nodeId));
+        Short port = Short.valueOf(portId);
+        NodeConnector nc = NodeConnectorCreator.createOFNodeConnector(port, node);
+        List<String> portList = new ArrayList<String>(1);
+        portList.add(nc.toString());
+        result.add((this.addRemoveContainerEntries(containerName, portList, true)).toString());
+        return result;
+    }
+    public List<String> addContainerFlow(String arg1, String arg2, String arg3) {
+        List<String> result = new ArrayList<String>();
+        String containerName = arg1;
+        if (containerName == null) {
+            result.add("Container Name not specified");
+            return result;
+        }
+        String cflowName = arg2;
+        if (cflowName == null) {
+            result.add("cflowName not specified");
+            return result;
+        }
+        String unidirectional = arg3;
+        boolean boolUnidirectional = Boolean.parseBoolean(unidirectional);
+        List<ContainerFlowConfig> list = new ArrayList<ContainerFlowConfig>();
+        list.add(createSampleContainerFlowConfig(cflowName, boolUnidirectional));
+        result.add((this.addRemoveContainerFlow(containerName, list, false)).toString());
+        return result;
+    }
+
+    public List<String> removeContainerFlow(String arg1, String arg2) {
+        List<String> result = new ArrayList<String>();
+        String containerName = arg1;
+        if (containerName == null) {
+            result.add("Container Name not specified");
+            return result;
+        }
+        String cflowName = arg2;
+        if (cflowName == null) {
+            result.add("cflowName not specified");
+            return result;
+        }
+        Set<String> set = new HashSet<String>(1);
+        set.add(cflowName);
+        result.add((this.removeContainerFlows(containerName, set)).toString());
+        return result;
+    }
+
+    public List<String> containermgrGetRoles() {
+        List<String> result = new ArrayList<String>();
+        result.add("Configured roles for Container Mgr:");
+        List<String> list = this.getRoles();
+        for (String role : list) {
+            result.add(role + "\t" + roles.get(role));
+        }
+        return result;
+    }
+
+    public List<String> containermgrGetAuthorizedGroups(String arg1) {
+        List<String> result = new ArrayList<String>();
+        String roleName = arg1;
+        if (roleName == null || roleName.trim().isEmpty()) {
+            result.add("Invalid argument");
+            result.add("mmGetAuthorizedGroups <role_name>");
+            return result;
+        }
+        result.add("Resource Groups associated to role " + roleName + ":");
+        List<ResourceGroup> list = this.getAuthorizedGroups(roleName);
+        for (ResourceGroup group : list) {
+            result.add(group.toString());
+        }
+        return result;
+    }
+    public List<String> containermgrGetAuthorizedResources(String arg1) {
+        List<String> result = new ArrayList<String>();
+        String roleName = arg1;
+        if (roleName == null || roleName.trim().isEmpty()) {
+            result.add("Invalid argument");
+            result.add("mmGetAuthorizedResources <role_name>");
+            return result;
+        }
+        result.add("Resource associated to role " + roleName + ":");
+        List<Resource> list = this.getAuthorizedResources(roleName);
+        for (Resource resource : list) {
+            result.add(resource.toString());
+        }
+        return result;
+    }
+    public List<String> containermgrGetResourcesForGroup(String arg1) {
+        List<String> result = new ArrayList<String>();
+        String groupName = arg1;
+        if (groupName == null || groupName.trim().isEmpty()) {
+            result.add("Invalid argument");
+            result.add("containermgrResourcesForGroup <group_name>");
+            return result;
+        }
+        result.add("Group " + groupName + " contains the following resources:");
+        List<Object> resources = this.getResources(groupName);
+        for (Object resource : resources) {
+            result.add(resource.toString());
+        }
+        return result;
+    }
+    public List<String> containermgrGetUserLevel(String arg1) {
+        List<String> result = new ArrayList<String>();
+        String userName = arg1;
+        if (userName == null || userName.trim().isEmpty()) {
+            result.add("Invalid argument");
+            result.add("containermgrGetUserLevel <user_name>");
+            return result;
+        }
+        result.add("User " + userName + " has level: " + this.getUserLevel(userName));
+        return result;
+    }
+    public List<String> containermgrGetUserResources(String arg1) {
+        List<String> result = new ArrayList<String>();
+        String userName = arg1;
+        if (userName == null || userName.trim().isEmpty()) {
+            result.add("Invalid argument");
+            result.add("containermgrGetUserResources <user_name>");
+            return result;
+        }
+        result.add("User " + userName + " owns the following resources: ");
+        Set<Resource> resources = this.getAllResourcesforUser(userName);
+        for (Resource resource : resources) {
+            result.add(resource.toString());
+        }
+        return result;
+    }
+    public List<String> saveConfig() {
+        List<String> result = new ArrayList<String>();
+        Status status = new Status(StatusCode.NOSERVICE, "Configuration service not reachable");
+
+        IConfigurationService configService = (IConfigurationService) ServiceHelper.getGlobalInstance(
+                IConfigurationService.class, this);
+        if (configService != null) {
+            status = configService.saveConfigurations();
+        }
+        result.add(status.toString());
+        return result;
+    }
 }
diff --git a/opendaylight/containermanager/shell/pom.xml b/opendaylight/containermanager/shell/pom.xml
new file mode 100644 (file)
index 0000000..1eedd4b
--- /dev/null
@@ -0,0 +1,52 @@
+<?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>
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>commons.opendaylight</artifactId>
+    <version>1.4.2-SNAPSHOT</version>
+    <relativePath>../../commons/opendaylight</relativePath>
+  </parent>
+  <artifactId>containermanager.shell</artifactId>
+  <version>${containermanager.shell.version}</version>
+  <packaging>bundle</packaging>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.karaf.shell</groupId>
+      <artifactId>org.apache.karaf.shell.console</artifactId>
+      <version>${karaf.shell.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-all</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>containermanager</artifactId>
+      <version>${containermanager.version}</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>${bundle.plugin.version}</version>
+        <configuration>
+          <instructions>
+            <Import-Package>org.apache.felix.service.command,
+              org.apache.karaf.shell.commands,
+              org.apache.karaf.shell.console,
+              *</Import-Package>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainer.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainer.java
new file mode 100644 (file)
index 0000000..e87682e
--- /dev/null
@@ -0,0 +1,29 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "addcontainer", description="Add Container")
+public class AddContainer extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Argument(index=0, name="containerName", description="container name", required=true, multiValued=false)
+    String containerName = null;
+
+    @Argument(index=1, name="staticVlan", description="staticVlan", required=true, multiValued=false)
+    String staticVlan = null;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.addContainer(containerName, staticVlan)) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainerEntry.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainerEntry.java
new file mode 100644 (file)
index 0000000..b7ee4bd
--- /dev/null
@@ -0,0 +1,32 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "AddContainerEntry", description="add container entry")
+public class AddContainerEntry extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Argument(index=0, name="containerName", description="container name", required=true, multiValued=false)
+    String containerName = null;
+
+    @Argument(index=1, name="nodeId", description="node ID", required=true, multiValued=false)
+    String nodeId = null;
+
+    @Argument(index=2, name="portId", description="portId", required=true, multiValued=false)
+    String portId = null;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.addContainerEntry(containerName, nodeId, portId)) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainerFlow.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainerFlow.java
new file mode 100644 (file)
index 0000000..03ed94d
--- /dev/null
@@ -0,0 +1,32 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "addContainerFlow", description="adds container flow")
+public class AddContainerFlow extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Argument(index=0, name="containerName", description="container name", required=true, multiValued=false)
+    String containerName = null;
+
+    @Argument(index=1, name="cflowName", description="c Flow name", required=true, multiValued=false)
+    String cflowName = null;
+
+    @Argument(index=2, name="unidirectional", description="unidirectional", required=true, multiValued=false)
+    String unidirectional = null;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.addContainerFlow(containerName, cflowName, unidirectional)) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetAuthorizedGroups.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetAuthorizedGroups.java
new file mode 100644 (file)
index 0000000..f78b856
--- /dev/null
@@ -0,0 +1,26 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "containermgrGetAuthorizedGroups", description="Get authorized groups")
+public class ContainermgrGetAuthorizedGroups extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Argument(index=0, name="roleName", description="role name", required=true, multiValued=false)
+    String roleName = null;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.containermgrGetAuthorizedGroups(roleName)) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetAuthorizedResources.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetAuthorizedResources.java
new file mode 100644 (file)
index 0000000..1ac50fa
--- /dev/null
@@ -0,0 +1,26 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "containermgrGetAuthorizedResources", description="Get authorized resources")
+public class ContainermgrGetAuthorizedResources extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Argument(index=0, name="roleName", description="role name", required=true, multiValued=false)
+    String roleName = null;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.containermgrGetAuthorizedResources(roleName)) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetResourcesForGroup.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetResourcesForGroup.java
new file mode 100644 (file)
index 0000000..bbccb65
--- /dev/null
@@ -0,0 +1,26 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "containermgrGetResourcesForGroup", description="Get resources for group")
+public class ContainermgrGetResourcesForGroup extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Argument(index=0, name="groupName", description="group name", required=true, multiValued=false)
+    String groupName = null;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.containermgrGetResourcesForGroup(groupName)) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetRoles.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetRoles.java
new file mode 100644 (file)
index 0000000..38fdb27
--- /dev/null
@@ -0,0 +1,22 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "containermgrGetRoles", description="Get container mgr roles")
+public class ContainermgrGetRoles extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.containermgrGetRoles()) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserLevel.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserLevel.java
new file mode 100644 (file)
index 0000000..9ee607a
--- /dev/null
@@ -0,0 +1,26 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "containermgrGetUserLevel", description="Get user level")
+public class ContainermgrGetUserLevel extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Argument(index=0, name="userName", description="user name", required=true, multiValued=false)
+    String userName = null;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.containermgrGetUserLevel(userName)) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserResources.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserResources.java
new file mode 100644 (file)
index 0000000..6a281bd
--- /dev/null
@@ -0,0 +1,26 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "containermgrGetUserResources", description="Get user resources")
+public class ContainermgrGetUserResources extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Argument(index=0, name="userName", description="user name", required=true, multiValued=false)
+    String userName = null;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.containermgrGetUserResources(userName)) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/CreateContainer.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/CreateContainer.java
new file mode 100644 (file)
index 0000000..ef51563
--- /dev/null
@@ -0,0 +1,29 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "createcontainer", description="create container")
+public class CreateContainer extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Argument(index=0, name="containerName", description="container name", required=true, multiValued=false)
+    String containerName = null;
+
+    @Argument(index=1, name="staticVlan", description="staticVlan", required=true, multiValued=false)
+    String staticVlan = null;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.createContainer(containerName, staticVlan)) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Pfc.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Pfc.java
new file mode 100644 (file)
index 0000000..62b4c9a
--- /dev/null
@@ -0,0 +1,22 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "pfc", description="Display pfc")
+public class Pfc extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.pfc()) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psc.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psc.java
new file mode 100644 (file)
index 0000000..83e6496
--- /dev/null
@@ -0,0 +1,22 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "psc", description="Display ")
+public class Psc extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.psc()) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psd.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psd.java
new file mode 100644 (file)
index 0000000..ff8a024
--- /dev/null
@@ -0,0 +1,22 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "psd", description="Display psd")
+public class Psd extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.psd()) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psm.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psm.java
new file mode 100644 (file)
index 0000000..a7c3549
--- /dev/null
@@ -0,0 +1,22 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "psm", description="Display psm")
+public class Psm extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.psm()) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psp.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psp.java
new file mode 100644 (file)
index 0000000..d221c83
--- /dev/null
@@ -0,0 +1,22 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "psp", description="Display psp")
+public class Psp extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.psp()) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainer.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainer.java
new file mode 100644 (file)
index 0000000..997ef67
--- /dev/null
@@ -0,0 +1,26 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "removecontainer", description="remove container")
+public class RemoveContainer extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Argument(index=0, name="containerName", description="container name", required=true, multiValued=false)
+    String containerName = null;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.removeContainerShell(containerName)) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainerEntry.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainerEntry.java
new file mode 100644 (file)
index 0000000..9413842
--- /dev/null
@@ -0,0 +1,32 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "removeContainerEntry", description="remove container entry")
+public class RemoveContainerEntry extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Argument(index=0, name="containerName", description="container name", required=true, multiValued=false)
+    String containerName = null;
+
+    @Argument(index=1, name="nodeId", description="node ID", required=true, multiValued=false)
+    String nodeId = null;
+
+    @Argument(index=2, name="portId", description="portId", required=true, multiValued=false)
+    String portId = null;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.removeContainerEntry(containerName, nodeId, portId)) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainerFlow.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainerFlow.java
new file mode 100644 (file)
index 0000000..94cbb19
--- /dev/null
@@ -0,0 +1,29 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "removeContainerFlow", description="removes container flow")
+public class RemoveContainerFlow extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Argument(index=0, name="containerName", description="container name", required=true, multiValued=false)
+    String containerName = null;
+
+    @Argument(index=1, name="cflowName", description="c Flow name", required=true, multiValued=false)
+    String cflowName = null;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.removeContainerFlow(containerName, cflowName)) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/SaveConfig.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/SaveConfig.java
new file mode 100644 (file)
index 0000000..b96f769
--- /dev/null
@@ -0,0 +1,22 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "saveConfig", description="Save config")
+public class SaveConfig extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.saveConfig()) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/containermanager/shell/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/opendaylight/containermanager/shell/src/main/resources/OSGI-INF/blueprint/blueprint.xml
new file mode 100644 (file)
index 0000000..e7e01f8
--- /dev/null
@@ -0,0 +1,123 @@
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+    <reference id="containerManagerRef" interface="org.opendaylight.controller.containermanager.IContainerManagerShell"/>
+    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.AddContainer">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.AddContainerEntry">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.AddContainerFlow">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.ContainermgrGetAuthorizedGroups">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.ContainermgrGetAuthorizedResources">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.ContainermgrGetResourcesForGroup">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.ContainermgrGetRoles">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.ContainermgrGetUserLevel">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.ContainermgrGetUserResources">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.CreateContainer">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.Pfc">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.Psc">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.Psd">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.Psm">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.Psp">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.RemoveContainer">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.RemoveContainerEntry">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.RemoveContainerFlow">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+        <command>
+        <action class="org.opendaylight.controller.containermanager.shell.SaveConfig">
+            <property name="containerManager" ref="containerManagerRef"/>
+            </action>
+        </command>
+
+    </command-bundle>
+
+
+</blueprint>
diff --git a/opendaylight/containermanager/shell/src/test/java/org/opendaylight/controller/containermanager/shell/ContainerManagerShellTest.java b/opendaylight/containermanager/shell/src/test/java/org/opendaylight/controller/containermanager/shell/ContainerManagerShellTest.java
new file mode 100644 (file)
index 0000000..f11d1da
--- /dev/null
@@ -0,0 +1,368 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.lang.reflect.Field;
+
+import org.junit.Assert;
+import org.junit.Test;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+
+public class ContainerManagerShellTest {
+    private IContainerManagerShell containerManager;
+
+    @Test
+    public void testAddContainer() throws Exception {
+        String containerName = "test", staticVlan = "1234";
+        AddContainer addConTest = new AddContainer();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        List<String> result2 = new ArrayList<String>(Arrays.asList("Container Name not specified"));
+        when(containerManager.addContainer(containerName, staticVlan)).thenReturn(result);
+        when(containerManager.addContainer(null, null)).thenReturn(result2);
+
+        Field cNField = addConTest.getClass().getDeclaredField("containerName");
+        cNField.setAccessible(true);
+        Field sVField = addConTest.getClass().getDeclaredField("staticVlan");
+        sVField.setAccessible(true);
+
+        cNField.set(addConTest, "test");
+        sVField.set(addConTest, "1234");
+
+        addConTest.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        addConTest.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+        baos.reset();
+
+        cNField.set(addConTest, null);
+        sVField.set(addConTest, null);
+        addConTest.doExecute();
+        Assert.assertEquals("Container Name not specified\n", baos.toString());
+    }
+
+    @Test
+    public void testAddContainerEntry() throws Exception {
+        String containerName = "test", nodeId = "1234", portId = "5678";
+        AddContainerEntry addConEntTest = new AddContainerEntry();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.addContainerEntry(containerName, nodeId, portId)).thenReturn(result);
+
+        Field cNField = addConEntTest.getClass().getDeclaredField("containerName");
+        cNField.setAccessible(true);
+        Field nIField = addConEntTest.getClass().getDeclaredField("nodeId");
+        nIField.setAccessible(true);
+        Field pIField = addConEntTest.getClass().getDeclaredField("portId");
+        pIField.setAccessible(true);
+
+        cNField.set(addConEntTest, "test");
+        nIField.set(addConEntTest, "1234");
+        pIField.set(addConEntTest, "5678");
+
+        addConEntTest.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        addConEntTest.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testAddContainerFlow() throws Exception {
+        String containerName = "test", cflowName = "1234", unidirectional = "5678";
+        AddContainerFlow addConFlowTest = new AddContainerFlow();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.addContainerFlow(containerName, cflowName, unidirectional)).thenReturn(result);
+
+        Field cNField = addConFlowTest.getClass().getDeclaredField("containerName");
+        cNField.setAccessible(true);
+        Field cfField = addConFlowTest.getClass().getDeclaredField("cflowName");
+        cfField.setAccessible(true);
+        Field unField = addConFlowTest.getClass().getDeclaredField("unidirectional");
+        unField.setAccessible(true);
+
+        cNField.set(addConFlowTest, "test");
+        cfField.set(addConFlowTest, "1234");
+        unField.set(addConFlowTest, "5678");
+
+        addConFlowTest.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        addConFlowTest.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testContainermgrGetAuthorizedGroups() throws Exception {
+        String roleName = "test";
+        ContainermgrGetAuthorizedGroups contmgrGTest = new ContainermgrGetAuthorizedGroups();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.containermgrGetAuthorizedGroups(roleName)).thenReturn(result);
+
+        Field rNField = contmgrGTest.getClass().getDeclaredField("roleName");
+        rNField.setAccessible(true);
+
+        rNField.set(contmgrGTest, "test");
+
+        contmgrGTest.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        contmgrGTest.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testContainermgrGetAuthorizedResources() throws Exception {
+        String roleName = "test";
+        ContainermgrGetAuthorizedResources contmgrRTest = new ContainermgrGetAuthorizedResources();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.containermgrGetAuthorizedResources(roleName)).thenReturn(result);
+
+        Field rNField = contmgrRTest.getClass().getDeclaredField("roleName");
+        rNField.setAccessible(true);
+
+        rNField.set(contmgrRTest, "test");
+
+        contmgrRTest.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        contmgrRTest.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testContainermgrGetResourcesForGroup() throws Exception {
+        String groupName = "test";
+        ContainermgrGetResourcesForGroup contmgrRTest = new ContainermgrGetResourcesForGroup();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.containermgrGetResourcesForGroup(groupName)).thenReturn(result);
+
+        Field gNField = contmgrRTest.getClass().getDeclaredField("groupName");
+        gNField.setAccessible(true);
+
+        gNField.set(contmgrRTest, groupName);
+
+        contmgrRTest.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        contmgrRTest.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testContainermgrGetRoles() throws Exception {
+        ContainermgrGetRoles contmgrRTest = new ContainermgrGetRoles();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.containermgrGetRoles()).thenReturn(result);
+
+        contmgrRTest.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        contmgrRTest.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testContainermgrGetUserLevel() throws Exception {
+        String userName = "test";
+        ContainermgrGetUserLevel contmgrUTest = new ContainermgrGetUserLevel();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.containermgrGetUserLevel(userName)).thenReturn(result);
+
+        Field gNField = contmgrUTest.getClass().getDeclaredField("userName");
+        gNField.setAccessible(true);
+
+        gNField.set(contmgrUTest, userName);
+
+        contmgrUTest.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        contmgrUTest.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testContainermgrGetUserResources() throws Exception {
+        String userName = "test";
+        ContainermgrGetUserResources contmgrUTest = new ContainermgrGetUserResources();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.containermgrGetUserResources(userName)).thenReturn(result);
+
+        Field gNField = contmgrUTest.getClass().getDeclaredField("userName");
+        gNField.setAccessible(true);
+
+        gNField.set(contmgrUTest, userName);
+
+        contmgrUTest.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        contmgrUTest.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testPfc() throws Exception {
+        Pfc pfc = new Pfc();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.pfc()).thenReturn(result);
+
+        pfc.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        pfc.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testPsc() throws Exception {
+        Psc psc = new Psc();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.psc()).thenReturn(result);
+
+        psc.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        psc.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testPsd() throws Exception {
+        Psd psd = new Psd();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.psd()).thenReturn(result);
+
+        psd.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        psd.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testPsm() throws Exception {
+        Psm psm = new Psm();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.psm()).thenReturn(result);
+
+        psm.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        psm.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testPsp() throws Exception {
+        Psp psp = new Psp();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.psp()).thenReturn(result);
+
+        psp.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        psp.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testRemoveContainer() throws Exception {
+        String containerName = "test";
+        RemoveContainer remConTest = new RemoveContainer();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.removeContainerShell(containerName)).thenReturn(result);
+
+        Field cNField = remConTest.getClass().getDeclaredField("containerName");
+        cNField.setAccessible(true);
+        cNField.set(remConTest, "test");
+
+        remConTest.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        remConTest.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testRemoveContainerEntry() throws Exception {
+        String containerName = "test", nodeId = "1234", portId = "5678";
+        RemoveContainerEntry remConEntTest = new RemoveContainerEntry();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.removeContainerEntry(containerName, nodeId, portId)).thenReturn(result);
+
+        Field cNField = remConEntTest.getClass().getDeclaredField("containerName");
+        cNField.setAccessible(true);
+        Field nIField = remConEntTest.getClass().getDeclaredField("nodeId");
+        nIField.setAccessible(true);
+        Field pIField = remConEntTest.getClass().getDeclaredField("portId");
+        pIField.setAccessible(true);
+
+        cNField.set(remConEntTest, "test");
+        nIField.set(remConEntTest, "1234");
+        pIField.set(remConEntTest, "5678");
+
+        remConEntTest.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        remConEntTest.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testRemoveContainerFlow() throws Exception {
+        String containerName = "test", cflowName = "1234";
+        RemoveContainerFlow remConFlowTest = new RemoveContainerFlow();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.removeContainerFlow(containerName, cflowName)).thenReturn(result);
+
+        Field cNField = remConFlowTest.getClass().getDeclaredField("containerName");
+        cNField.setAccessible(true);
+        Field cfField = remConFlowTest.getClass().getDeclaredField("cflowName");
+        cfField.setAccessible(true);
+
+        cNField.set(remConFlowTest, "test");
+        cfField.set(remConFlowTest, "1234");
+
+        remConFlowTest.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        remConFlowTest.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+
+    @Test
+    public void testSaveConfig() throws Exception {
+        SaveConfig saveConfig = new SaveConfig();
+        containerManager = mock(IContainerManagerShell.class);
+        List<String> result = new ArrayList<String>(Arrays.asList("status"));
+        when(containerManager.saveConfig()).thenReturn(result);
+
+        saveConfig.setContainerManager(containerManager);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        System.setOut(new PrintStream(baos));
+        saveConfig.doExecute();
+        Assert.assertEquals("status\n", baos.toString());
+    }
+}
\ No newline at end of file
index 67c30454f86cc7b640c871b2e89955dda452262e..6a6a12d1de2499cb1956f02f456b158fd79f470e 100644 (file)
       <type>xml</type>
       <scope>runtime</scope>
     </dependency>
+    <!-- scope is compile so all features (there is only one) are installed
+            into startup.properties and the feature repo itself is not installed -->
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>base-features</artifactId>
       <version>${project.version}</version>
-      <type>kar</type>
+      <type>pom</type>
       <scope>runtime</scope>
     </dependency>
     <dependency>
index 6c1ca421c257ab81807c20f4a939d556cb5338c6..502e1a261c713b1ea030ec014e663dcb82f4b51b 100644 (file)
@@ -1,17 +1,11 @@
 # Extra packages to import from the boot class loader
 org.osgi.framework.system.packages.extra=org.apache.karaf.branding,sun.reflect,sun.reflect.misc,sun.misc,sun.nio.ch
 
-# https://bugs.eclipse.org/bugs/show_bug.cgi?id=325578
-# Extend the framework to avoid the resources to be presented with
-# a URL of type bundleresource: but to be presented as file:
-osgi.hook.configurators.include=org.eclipse.virgo.kernel.equinox.extensions.hooks.ExtensionsHookConfigurator
 
 # Embedded Tomcat configuration File
 org.eclipse.gemini.web.tomcat.config.path=configuration/tomcat-server.xml
 org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true
 
-# Use Equinox as default OSGi Framework Implementation
-karaf.framework=equinox
 
 # Netconf startup configuration
 netconf.tcp.address=127.0.0.1
index ca8c83c380aea4f1c51c801a3e846a82e364fbeb..288fe629f806ff74a3c241a3d27e95a39e86fcf5 100644 (file)
@@ -7,7 +7,7 @@ mvn\:org.ops4j.pax.swissbox/pax-swissbox-bnd/1.7.0 = 5
 mvn\:org.ops4j.pax.url/pax-url-maven-commons/1.6.0 = 5
 mvn\:org.ops4j.pax.url/pax-url-aether/1.6.0 = 5
 mvn\:org.ops4j.pax.url/pax-url-wrap/1.6.0 = 5
-mvn\:javax.annotation/javax.annotation-api/1.2 = 5
+#mvn\:javax.annotation/javax.annotation-api/1.2 = 5
 mvn\:org.ops4j.pax.logging/pax-logging-api/1.7.2 = 8
 mvn\:org.ops4j.pax.logging/pax-logging-service/1.7.2 = 8
 mvn\:org.apache.karaf.service/org.apache.karaf.service.guard/3.0.1 = 10
diff --git a/opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/system.properties b/opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/system.properties
new file mode 100644 (file)
index 0000000..a312d66
--- /dev/null
@@ -0,0 +1,109 @@
+#
+# The properties defined in this file will be made available through system
+# properties at the very beginning of the Karaf's boot process.
+#
+
+# Use Equinox as default OSGi Framework Implementation
+karaf.framework=equinox
+
+# https://bugs.eclipse.org/bugs/show_bug.cgi?id=325578
+# Extend the framework to avoid the resources to be presented with
+# a URL of type bundleresource: but to be presented as file:
+osgi.hook.configurators.include=org.eclipse.virgo.kernel.equinox.extensions.hooks.ExtensionsHookConfigurator
+
+
+# Log level when the pax-logging service is not available
+# This level will only be used while the pax-logging service bundle
+# is not fully available.
+# To change log levels, please refer to the org.ops4j.pax.logging.cfg file
+# instead.
+org.ops4j.pax.logging.DefaultServiceLog.level = ERROR
+
+#
+# Name of this Karaf instance.
+#
+karaf.name = root
+
+#
+# Default repository where bundles will be loaded from before using
+# other Maven repositories.  For the full Maven configuration, see
+# the org.ops4j.pax.url.mvn.cfg file.
+#
+karaf.default.repository = system
+
+#
+# Location of a shell script that will be run when starting a shell
+# session.  This script can be used to create aliases and define
+# additional commands.
+#
+karaf.shell.init.script = ${karaf.etc}/shell.init.script
+
+#
+# Sets the maximum size of the shell command history. If not set,
+# defaults to 500 entries. Setting to 0 will disable history.
+#
+# karaf.shell.history.maxSize = 0
+
+#
+# Deletes the entire karaf.data directory at every start
+#
+karaf.clean.all = false
+
+#
+# Deletes the karaf.data/cache directory at every start
+#
+karaf.clean.cache = false
+
+#
+# Roles to use when logging into a local Karaf console.
+#
+# The syntax is the following:
+#   [classname:]principal
+# where classname is the class name of the principal object
+# (defaults to org.apache.karaf.jaas.modules.RolePrincipal)
+# and principal is the name of the principal of that class
+# (defaults to instance).
+#
+karaf.local.roles = admin,manager,viewer
+
+#
+# Set this empty property to avoid errors when validating xml documents.
+#
+xml.catalog.files =
+
+#
+# Suppress the bell in the console when hitting backspace too many times
+# for example
+#
+jline.nobell = true
+
+#
+# ServiceMix specs options
+#
+org.apache.servicemix.specs.debug = false
+org.apache.servicemix.specs.timeout = 0
+
+#
+# Settings for the OSGi 4.3 Weaving
+# By default, we will not weave any classes. Change this setting to include classes
+# that you application needs to have woven.
+#
+org.apache.aries.proxy.weaving.enabled = none
+# Classes not to weave - Aries default + Xerces which is known to have issues.
+org.apache.aries.proxy.weaving.disabled = org.objectweb.asm.*,org.slf4j.*,org.apache.log4j.*,javax.*,org.apache.xerces.*
+
+#
+# By default, only Karaf shell commands are secured, but additional services can be
+# secured by expanding this filter
+#
+karaf.secured.services = (&(osgi.command.scope=*)(osgi.command.function=*))
+
+#
+# Security properties
+#
+# To enable OSGi security, uncomment the properties below,
+# install the framework-security feature and restart.
+#
+#java.security.policy=${karaf.etc}/all.policy
+#org.osgi.framework.security=osgi
+#org.osgi.framework.trust.repositories=${karaf.etc}/trustStore.ks
index 3cc490f01774ae710aa94c93f4b8223099b989f2..fdc8d02e176d52201ea7022a559de2eada25512b 100644 (file)
@@ -30,6 +30,10 @@ module opendaylight-action-types {
         }
     }  
     
+    container action-types {   
+       uses action-list;
+    }
+    
     grouping action-list {
         list action {
             key "order";
index 9222734360a0b1cb81b58caafe36381728056048..8d4901d31b118659980148a20f79c0826b71a171 100644 (file)
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
       </plugin>
-      <plugin>
-        <!-- FIXME: BUG-272: remove this configuration override -->
-        <!-- replaced with new configuration -->
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-checkstyle-plugin</artifactId>
-        <version>2.12</version>
-        <configuration>
-          <failsOnError>false</failsOnError>
-          <failOnViolation>false</failOnViolation>
-          <configLocation>checkstyle-logging.xml</configLocation>
-          <consoleOutput>true</consoleOutput>
-          <includeTestSourceDirectory>true</includeTestSourceDirectory>
-          <sourceDirectory>${project.basedir}</sourceDirectory>
-          <includes>**\/*.java,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat,**\/*.yang</includes>
-          <excludes>**\/target\/,**\/bin\/,**\/target-ide\/,**\/${jmxGeneratorPath}\/,**\/${salGeneratorPath}\/</excludes>
-        </configuration>
-        <dependencies>
-          <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>checkstyle-logging</artifactId>
-            <version>${yangtools.version}</version>
-          </dependency>
-        </dependencies>
-        <executions>
-          <execution>
-            <goals>
-              <goal>check</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>
diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncConfigurationCommitCohort.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncConfigurationCommitCohort.java
new file mode 100644 (file)
index 0000000..9fb350b
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * 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.md.sal.common.api.data;
+
+import org.opendaylight.yangtools.concepts.Path;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ *
+ * Three phase Commit Cohort for subtree, which is
+ * uniquely associated with user submitted transcation.
+ *
+ * @param <P>
+ *            Type of path (subtree identifier), which represents location in
+ *            tree
+ * @param <D>
+ *            Type of data (payload), which represents data payload
+ */
+public interface AsyncConfigurationCommitCohort<P extends Path<P>, D> {
+
+    /**
+     * Initiates a pre-commit of associated request
+     *
+     * Implementation MUST NOT do any blocking calls during this callback, all
+     * pre-commit preparation SHOULD happen asynchronously and MUST result in
+     * completing returned future object.
+     *
+     * @param rebasedTransaction
+     *            Read-only view of transaction as if happened on top of actual
+     *            data store
+     * @return Future which is completed once pre-commit phase for this request
+     *         is finished.
+     */
+    ListenableFuture<Void> preCommit(AsyncReadTransaction<P, D> rebasedTransaction);
+
+    /**
+     *
+     * Initiates a commit phase of associated request
+     *
+     * Implementation MUST NOT do any blocking calls during this callback, all
+     * commit finalization SHOULD happen asynchronously and MUST result in
+     * completing returned future object.
+     *
+     * @return Future which is completed once commit phase for associated
+     *         request is finished.
+     */
+    ListenableFuture<Void> commit();
+
+    /**
+     *
+     * Initiates abort phase of associated request
+     *
+     * Implementation MUST NOT do any blocking calls during this callback, all
+     * commit finalization SHOULD happen asynchronously and MUST result in
+     * completing returned future object.
+     *
+     * @return Future which is completed once commit phase for associated
+     *         request is finished.
+     */
+    ListenableFuture<Void> abort();
+
+}
diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncConfigurationCommitCoordinator.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncConfigurationCommitCoordinator.java
new file mode 100644 (file)
index 0000000..6d669ab
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * 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.md.sal.common.api.data;
+
+import org.opendaylight.yangtools.concepts.ObjectRegistration;
+import org.opendaylight.yangtools.concepts.Path;
+
+/**
+ * Three Phase Commit Coordinator with support of user-supplied commit cohorts
+ * which participates in three-phase commit protocols
+ *
+ * @param <P>
+ *            Type of path (subtree identifier), which represents location in
+ *            tree
+ * @param <D>
+ *            Type of data (payload), which represents data payload
+ */
+public interface AsyncConfigurationCommitCoordinator<P extends Path<P>, D> {
+
+    /**
+     * Register configuration commit handler for particular subtree
+     *
+     * Configuration commit handler is invoked for all write transactions
+     * which modifies <code>subtree</code>
+     *
+     * @param subtree Subtree which configuration commit handler is interested it
+     * @param commitHandler Instance of user-provided commit handler
+     * @return Registration object representing this registration. Invoking {@link ObjectRegistration#close()}
+     *   will unregister configuration commit handler.
+     */
+    <C extends AsyncConfigurationCommitCohort<P, D>> ObjectRegistration<C> registerConfigurationCommitHandler(
+            P subtree, C commitHandler);
+}
diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncConfigurationCommitHandler.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncConfigurationCommitHandler.java
new file mode 100644 (file)
index 0000000..6025e13
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * 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.md.sal.common.api.data;
+
+import org.opendaylight.yangtools.concepts.Path;
+
+import com.google.common.util.concurrent.CheckedFuture;
+
+/**
+ * User-supplied participant in three-phase commit of transaction for configuration data tree
+ *
+ * Client-supplied implementation of commit handler for subtree, which
+ * is responsible for processing CAN-COMMIT phase of three-phase commit protocol
+ * and return CommitCohort, which provides access to additional transitions
+ * such as PRE-COMMIT, COMMIT and ABORT.
+ *
+ * @param <P>
+ *            Type of path (subtree identifier), which represents location in
+ *            tree
+ * @param <D>
+ *            Type of data (payload), which represents data payload
+ */
+public interface AsyncConfigurationCommitHandler<P extends Path<P>, D> {
+
+    /**
+     *
+     * Requests a can commit phase
+     *
+     * Implementations SHOULD NOT do any blocking operation during
+     * processing this callback.
+     *
+     * <b>Implementation Notes</b>
+     * <ul>
+     * <li>Implementation are REQUIRED to use <code>request</code> object for any data related access</li>
+     * <li>Implementations SHOULD NOT use any other state stored outside configuration subtree for validation</li>
+     * <li>Validation should happen asynchronously, outside callback call by updating returned {@link CheckedFuture}
+     *     object.</li>
+     * <li>If validation (CAN_COMMIT) phase:
+     * <ul>
+     * <li><b>is successful</b> - invocation of {@link CheckedFuture#checkedGet()} on returned future MUST
+     *     return {@link AsyncConfigurationCommitCohort} associated with request.</li>
+     * <li><b>is unsuccessful</b> - invocation of {@link CheckedFuture#checkedGet()} must throw instance of {@link DataValidationFailedException}
+     * with human readable explanaition of error condition.
+     * </li>
+     * </ul>
+     * </li>
+     * @param request
+     *            Commit Request submitted by client, which contains
+     *            information about modifications and read-only view as
+     *            if transaction happened.
+     * @return CheckedFuture which contains client-supplied implementation of {@link AsyncConfigurationCommitCohort}
+     *         associated with submitted request, if can commit phase is
+     *         successful, if can commit was unsuccessful, future must fail with
+     *         {@link TransactionCommitFailedException} exception.
+     */
+    CheckedFuture<AsyncConfigurationCommitCohort<P, D>, DataValidationFailedException> canCommit(
+            ConfigurationCommitRequest<P, D> request);
+
+    /**
+     *
+     * Commit Request as was submitted by client code
+     *
+     * Commit Request contains list view of created / updated / removed
+     * path and read-only view of proposed client transaction,
+     * which may be used to retrieve modified or referenced data.
+     *
+     *
+     * @param <P>
+     *            Type of path (subtree identifier), which represents location
+     *            in tree
+     * @param <D>
+     *            Type of data (payload), which represents data payload
+     */
+    static interface ConfigurationCommitRequest<P extends Path<P>, D> {
+
+        /**
+         *
+         * Read-only transaction which provides access only to configuration
+         * data tree as if submitted transaction successfully happened and
+         * no other concurrent modifications happened between allocation
+         * of client transactions and write of client transactions.
+         *
+         * Implementations of Commit Handlers are REQUIRED to use this
+         * read-only view to access any data from configuration data tree,
+         * in order to capture them as preconditions for this transaction.
+         *
+         * @return Read-only transaction which provides access only to configuration
+         * data tree as if submitted transaction successfully happened
+         */
+        AsyncReadTransaction<P, D> getReadOnlyView();
+
+        /**
+         *
+         * Returns iteration of paths, to data which was introduced by this transaction.
+         *
+         * @return Iteration of paths, which was introduced by this transaction.
+         */
+        Iterable<P> getCreatedPaths();
+        /**
+         *
+         * Returns iteration of paths, to data which was updated by this transaction.
+         *
+         * @return Iteration of paths, which was updated by this transaction.
+         */
+        Iterable<P> getUpdatedPaths();
+
+        /**
+         *
+         * Returns iteration of paths, to data which was removed by this transaction.
+         *
+         * @return Iteration of paths, which was removed by this transaction.
+         */
+        Iterable<P> getRemovedPaths();
+    }
+
+}
diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataValidationFailedException.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataValidationFailedException.java
new file mode 100644 (file)
index 0000000..c59c12e
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * 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.md.sal.common.api.data;
+
+import org.opendaylight.yangtools.concepts.Path;
+
+import com.google.common.base.Preconditions;
+
+/**
+ *
+ * Failure of asynchronous transaction commit caused by invalid data.
+ *
+ * This exception is raised and returned when transaction commit
+ * failed, because other data submitted via transactions
+ *
+ *  Clients usually are not able recover from this error condition by
+ *  retrieving same transaction, since data introduced by this transaction
+ *  are invalid.
+ *
+ */
+public class DataValidationFailedException extends TransactionCommitFailedException {
+
+    private static final long serialVersionUID = 1L;
+
+    private Path<?> path;
+
+    private Class<? extends Path<?>> pathType;
+
+    public <P extends Path<P>> DataValidationFailedException(final Class<P> pathType,final P path, final String message, final Throwable cause) {
+        super(message, cause);
+        this.pathType = Preconditions.checkNotNull(pathType, "path type must not be null");
+        this.path = Preconditions.checkNotNull(path,"path must not be null.");
+    }
+
+    public  <P extends Path<P>> DataValidationFailedException(final Class<P> pathType,final P path,final String message) {
+        this(pathType,path,message,null);
+    }
+
+    public final Path<?> getPath() {
+        return path;
+    }
+
+    public final Class<? extends Path<?>> getPathType() {
+        return pathType;
+    }
+
+}
index a2b4c89c89513037862fed4ac11f2ad04e91592f..e7fcd83328f86c425e7a95092da1b3cc5f36bc47 100644 (file)
       <artifactId>guava</artifactId>
     </dependency>
 
+    <dependency>
+      <groupId>com.typesafe.akka</groupId>
+      <artifactId>akka-actor_${scala.version}</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>com.typesafe.akka</groupId>
+      <artifactId>akka-cluster_${scala.version}</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>com.typesafe.akka</groupId>
+      <artifactId>akka-persistence-experimental_${scala.version}</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>com.typesafe.akka</groupId>
+      <artifactId>akka-remote_${scala.version}</artifactId>
+    </dependency>
+
+    <!-- SAL Dependencies -->
+
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>config-api</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal-binding-api</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal-binding-config</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal-common-api</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal-common-util</artifactId>
+    </dependency>
+
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-core-spi</artifactId>
     </dependency>
 
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>concepts</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-binding</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-common</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-data-api</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.core</artifactId>
+    </dependency>
+
+    <!-- AKKA Dependencies -->
+    <dependency>
+      <groupId>org.scala-lang</groupId>
+      <artifactId>scala-library</artifactId>
+    </dependency>
+
+    <!-- Test Dependencies -->
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.opendaylight.yangtools</groupId>
+        <artifactId>yang-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>config</id>
+            <goals>
+              <goal>generate-sources</goal>
+            </goals>
+            <configuration>
+              <codeGenerators>
+                <generator>
+                  <codeGeneratorClass>org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator</codeGeneratorClass>
+                  <outputBaseDir>${jmxGeneratorPath}</outputBaseDir>
+                  <additionalConfiguration>
+                    <namespaceToPackage1>urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang</namespaceToPackage1>
+                  </additionalConfiguration>
+                </generator>
+                <generator>
+                  <codeGeneratorClass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
+                  <outputBaseDir>${salGeneratorPath}</outputBaseDir>
+                </generator>
+              </codeGenerators>
+              <inspectDependencies>true</inspectDependencies>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
   <scm>
@@ -11,30 +11,33 @@ import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
-public class DOMStoreProxy implements DOMStore {
+/**
+ *
+ */
+public class DistributedDataStore implements DOMStore {
 
     @Override
     public <L extends AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>> ListenerRegistration<L> registerChangeListener(InstanceIdentifier path, L listener, AsyncDataBroker.DataChangeScope scope) {
-        throw new UnsupportedOperationException("registerChangeListener");
+        return new ListenerRegistrationProxy();
     }
 
     @Override
     public DOMStoreTransactionChain createTransactionChain() {
-        throw new UnsupportedOperationException("createTransactionChain");
+        return new TransactionChainProxy();
     }
 
     @Override
     public DOMStoreReadTransaction newReadOnlyTransaction() {
-        throw new UnsupportedOperationException("newReadOnlyTransaction");
+        return new TransactionProxy();
     }
 
     @Override
     public DOMStoreWriteTransaction newWriteOnlyTransaction() {
-        throw new UnsupportedOperationException("newWriteOnlyTransaction");
+        return new TransactionProxy();
     }
 
     @Override
     public DOMStoreReadWriteTransaction newReadWriteTransaction() {
-        throw new UnsupportedOperationException("newReadWriteTransaction");
+        return new TransactionProxy();
     }
 }
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ListenerRegistrationProxy.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ListenerRegistrationProxy.java
new file mode 100644 (file)
index 0000000..19e7f19
--- /dev/null
@@ -0,0 +1,21 @@
+package org.opendaylight.controller.cluster.datastore;
+
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+
+/**
+ * ListenerRegistrationProxy acts as a proxy for a ListenerRegistration that was done on a remote shard
+ *
+ * Registering a DataChangeListener on the Data Store creates a new instance of the ListenerRegistrationProxy
+ * The ListenerRegistrationProxy talks to a remote ListenerRegistration actor.
+ */
+public class ListenerRegistrationProxy implements ListenerRegistration {
+    @Override
+    public Object getInstance() {
+        throw new UnsupportedOperationException("getInstance");
+    }
+
+    @Override
+    public void close() {
+        throw new UnsupportedOperationException("close");
+    }
+}
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionChainProxy.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionChainProxy.java
new file mode 100644 (file)
index 0000000..20a74e3
--- /dev/null
@@ -0,0 +1,31 @@
+package org.opendaylight.controller.cluster.datastore;
+
+import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
+import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
+import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
+import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
+
+/**
+ * TransactionChainProxy acts as a proxy for a DOMStoreTransactionChain created on a remote shard
+ */
+public class TransactionChainProxy implements DOMStoreTransactionChain{
+    @Override
+    public DOMStoreReadTransaction newReadOnlyTransaction() {
+        throw new UnsupportedOperationException("newReadOnlyTransaction");
+    }
+
+    @Override
+    public DOMStoreReadWriteTransaction newReadWriteTransaction() {
+        throw new UnsupportedOperationException("newReadWriteTransaction");
+    }
+
+    @Override
+    public DOMStoreWriteTransaction newWriteOnlyTransaction() {
+        throw new UnsupportedOperationException("newWriteOnlyTransaction");
+    }
+
+    @Override
+    public void close() {
+        throw new UnsupportedOperationException("close");
+    }
+}
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java
new file mode 100644 (file)
index 0000000..c9a6304
--- /dev/null
@@ -0,0 +1,56 @@
+package org.opendaylight.controller.cluster.datastore;
+
+import com.google.common.base.Optional;
+import com.google.common.util.concurrent.ListenableFuture;
+import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
+import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+
+/**
+ * TransactionProxy acts as a proxy for one or more transactions that were created on a remote shard
+ *
+ * Creating a transaction on the consumer side will create one instance of a transaction proxy. If during
+ * the transaction reads and writes are done on data that belongs to different shards then a separate transaction will
+ * be created on each of those shards by the TransactionProxy
+ *
+ * The TransactionProxy does not make any guarantees about atomicity or order in which the transactions on the various
+ * shards will be executed.
+ *
+ */
+public class TransactionProxy implements DOMStoreReadWriteTransaction {
+    @Override
+    public ListenableFuture<Optional<NormalizedNode<?, ?>>> read(InstanceIdentifier path) {
+        throw new UnsupportedOperationException("read");
+    }
+
+    @Override
+    public void write(InstanceIdentifier path, NormalizedNode<?, ?> data) {
+        throw new UnsupportedOperationException("write");
+    }
+
+    @Override
+    public void merge(InstanceIdentifier path, NormalizedNode<?, ?> data) {
+        throw new UnsupportedOperationException("merge");
+    }
+
+    @Override
+    public void delete(InstanceIdentifier path) {
+        throw new UnsupportedOperationException("delete");
+    }
+
+    @Override
+    public DOMStoreThreePhaseCommitCohort ready() {
+        throw new UnsupportedOperationException("ready");
+    }
+
+    @Override
+    public Object getIdentifier() {
+        throw new UnsupportedOperationException("getIdentifier");
+    }
+
+    @Override
+    public void close() {
+        throw new UnsupportedOperationException("close");
+    }
+}
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedDataStoreProviderModule.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedDataStoreProviderModule.java
new file mode 100644 (file)
index 0000000..241bcb0
--- /dev/null
@@ -0,0 +1,34 @@
+package org.opendaylight.controller.config.yang.config.distributed_datastore_provider;
+
+import org.opendaylight.controller.cluster.datastore.DistributedDataStore;
+
+public class DistributedDataStoreProviderModule extends org.opendaylight.controller.config.yang.config.distributed_datastore_provider.AbstractDistributedDataStoreProviderModule {
+    public DistributedDataStoreProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+        super(identifier, dependencyResolver);
+    }
+
+    public DistributedDataStoreProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.distributed_datastore_provider.DistributedDataStoreProviderModule 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() {
+        new DistributedDataStore();
+
+        final class AutoCloseableDistributedDataStore implements AutoCloseable {
+
+            @Override
+            public void close() throws Exception {
+
+            }
+        }
+
+        return new AutoCloseableDistributedDataStore();
+    }
+
+}
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedDataStoreProviderModuleFactory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedDataStoreProviderModuleFactory.java
new file mode 100644 (file)
index 0000000..53ef84e
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+* Generated file
+*
+* Generated from: yang module name: distributed-datastore-provider yang module local name: distributed-datastore-provider
+* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+* Generated at: Thu Jun 12 15:23:43 PDT 2014
+*
+* Do not modify this file unless it is present under src/main directory
+*/
+package org.opendaylight.controller.config.yang.config.distributed_datastore_provider;
+public class DistributedDataStoreProviderModuleFactory extends org.opendaylight.controller.config.yang.config.distributed_datastore_provider.AbstractDistributedDataStoreProviderModuleFactory {
+
+}
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/yang/distributed-datastore-provider.yang b/opendaylight/md-sal/sal-distributed-datastore/src/main/yang/distributed-datastore-provider.yang
new file mode 100644 (file)
index 0000000..0471bc8
--- /dev/null
@@ -0,0 +1,34 @@
+// vi: set smarttab et sw=4 tabstop=4:
+module distributed-datastore-provider {
+
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:controller:config:distributed-datastore-provider";
+    prefix "distributed-datastore-provider";
+
+    import config { prefix config; revision-date 2013-04-05; }
+    import rpc-context { prefix rpcx; revision-date 2013-06-17; }
+
+    description
+        "This module contains the base YANG definitions for
+        the distributed datastore provider implementation";
+
+    revision "2014-06-12" {
+        description
+            "Initial revision.";
+    }
+
+    // This is the definition of the service implementation as a module identity.
+    identity distributed-datastore-provider {
+            base config:module-type;
+
+            // Specifies the prefix for generated java classes.
+            config:java-name-prefix DistributedDataStoreProvider;
+    }
+
+    // Augments the 'configuration' choice node under modules/module.
+    augment "/config:modules/config:module/config:configuration" {
+        case distributed-datastore-provider {
+            when "/config:modules/config:module/config:type = 'distributed-datastore-provider'";
+        }
+    }
+}
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreTest.java
new file mode 100644 (file)
index 0000000..6544f33
--- /dev/null
@@ -0,0 +1,65 @@
+package org.opendaylight.controller.cluster.datastore;
+
+import junit.framework.Assert;
+import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
+import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
+import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
+import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
+import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
+import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
+import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+
+public class DistributedDataStoreTest {
+
+    private DistributedDataStore distributedDataStore;
+
+    @org.junit.Before
+    public void setUp() throws Exception {
+        distributedDataStore = new DistributedDataStore();
+    }
+
+    @org.junit.After
+    public void tearDown() throws Exception {
+
+    }
+
+    @org.junit.Test
+    public void testRegisterChangeListener() throws Exception {
+        ListenerRegistration registration =
+                distributedDataStore.registerChangeListener(InstanceIdentifier.builder().build(), new AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>() {
+            @Override
+            public void onDataChanged(AsyncDataChangeEvent<InstanceIdentifier, NormalizedNode<?, ?>> change) {
+                throw new UnsupportedOperationException("onDataChanged");
+            }
+        }, AsyncDataBroker.DataChangeScope.BASE);
+
+        Assert.assertNotNull(registration);
+    }
+
+    @org.junit.Test
+    public void testCreateTransactionChain() throws Exception {
+        final DOMStoreTransactionChain transactionChain = distributedDataStore.createTransactionChain();
+        Assert.assertNotNull(transactionChain);
+    }
+
+    @org.junit.Test
+    public void testNewReadOnlyTransaction() throws Exception {
+        final DOMStoreReadTransaction transaction = distributedDataStore.newReadOnlyTransaction();
+        Assert.assertNotNull(transaction);
+    }
+
+    @org.junit.Test
+    public void testNewWriteOnlyTransaction() throws Exception {
+        final DOMStoreWriteTransaction transaction = distributedDataStore.newWriteOnlyTransaction();
+        Assert.assertNotNull(transaction);
+    }
+
+    @org.junit.Test
+    public void testNewReadWriteTransaction() throws Exception {
+        final DOMStoreReadWriteTransaction transaction = distributedDataStore.newReadWriteTransaction();
+        Assert.assertNotNull(transaction);
+    }
+}
index 7b5ea11dbb8518de97065f700203c226af032323..2203087c997ce536485f5359b03ee85c56c1c568 100644 (file)
@@ -20,8 +20,6 @@ import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionFactory;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -68,7 +66,7 @@ public abstract class AbstractDOMForwardedTransactionFactory<T extends DOMStoreT
      *
      * Subtransaction for reading is selected by supplied
      * {@link LogicalDatastoreType} as parameter for
-     * {@link DOMDataReadTransaction#read(LogicalDatastoreType, InstanceIdentifier)}
+     * {@link DOMDataReadTransaction#read(LogicalDatastoreType,org.opendaylight.yangtools.yang.data.api.InstanceIdentifier)}
      * .
      *
      * Id of returned transaction is retrieved via
@@ -99,19 +97,19 @@ public abstract class AbstractDOMForwardedTransactionFactory<T extends DOMStoreT
      *
      * <ul>
      * <li>
-     * {@link DOMDataWriteTransaction#put(LogicalDatastoreType, InstanceIdentifier, NormalizedNode)}
+     * {@link DOMDataWriteTransaction#put(LogicalDatastoreType, org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
      * - backing subtransaction is selected by {@link LogicalDatastoreType},
-     * {@link DOMStoreWriteTransaction#write(InstanceIdentifier, NormalizedNode)}
+     * {@link DOMStoreWriteTransaction#write(org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
      * is invoked on selected subtransaction.
      * <li>
-     * {@link DOMDataWriteTransaction#merge(LogicalDatastoreType, InstanceIdentifier, NormalizedNode)}
+     * {@link DOMDataWriteTransaction#merge(LogicalDatastoreType, org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
      * - backing subtransaction is selected by {@link LogicalDatastoreType},
-     * {@link DOMStoreWriteTransaction#merge(InstanceIdentifier, NormalizedNode)}
+     * {@link DOMStoreWriteTransaction#merge(org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
      * is invoked on selected subtransaction.
      * <li>
-     * {@link DOMDataWriteTransaction#delete(LogicalDatastoreType, InstanceIdentifier)
+     * {@link DOMDataWriteTransaction#delete(LogicalDatastoreType, org.opendaylight.yangtools.yang.data.api.InstanceIdentifier)
      * - backing subtransaction is selected by {@link LogicalDatastoreType},
-     * {@link DOMStoreWriteTransaction#delete(InstanceIdentifier)} is invoked on
+     * {@link DOMStoreWriteTransaction#delete(org.opendaylight.yangtools.yang.data.api.InstanceIdentifier)} is invoked on
      * selected subtransaction.
      * <li> {@link DOMDataWriteTransaction#commit()} - results in invoking
      * {@link DOMStoreWriteTransaction#ready()}, gathering all resulting cohorts
@@ -147,24 +145,24 @@ public abstract class AbstractDOMForwardedTransactionFactory<T extends DOMStoreT
      *
      * <ul>
      * <li>
-     * {@link DOMDataWriteTransaction#read(LogicalDatastoreType, InstanceIdentifier)}
+     * {@link DOMDataWriteTransaction#read(LogicalDatastoreType, org.opendaylight.yangtools.yang.data.api.InstanceIdentifier)}
      * - backing subtransaction is selected by {@link LogicalDatastoreType},
-     * {@link DOMStoreWriteTransaction#read(InstanceIdentifier)} is invoked on
+     * {@link DOMStoreWriteTransaction#read(org.opendaylight.yangtools.yang.data.api.InstanceIdentifier)} is invoked on
      * selected subtransaction.
      * <li>
-     * {@link DOMDataWriteTransaction#put(LogicalDatastoreType, InstanceIdentifier, NormalizedNode)}
+     * {@link DOMDataWriteTransaction#put(LogicalDatastoreType, org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
      * - backing subtransaction is selected by {@link LogicalDatastoreType},
-     * {@link DOMStoreWriteTransaction#write(InstanceIdentifier, NormalizedNode)}
+     * {@link DOMStoreWriteTransaction#write(org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
      * is invoked on selected subtransaction.
      * <li>
-     * {@link DOMDataWriteTransaction#merge(LogicalDatastoreType, InstanceIdentifier, NormalizedNode)}
+     * {@link DOMDataWriteTransaction#merge(LogicalDatastoreType, org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
      * - backing subtransaction is selected by {@link LogicalDatastoreType},
-     * {@link DOMStoreWriteTransaction#merge(InstanceIdentifier, NormalizedNode)}
+     * {@link DOMStoreWriteTransaction#merge(org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
      * is invoked on selected subtransaction.
      * <li>
-     * {@link DOMDataWriteTransaction#delete(LogicalDatastoreType, InstanceIdentifier)
+     * {@link DOMDataWriteTransaction#delete(LogicalDatastoreType, org.opendaylight.yangtools.yang.data.api.InstanceIdentifier)
      * - backing subtransaction is selected by {@link LogicalDatastoreType},
-     * {@link DOMStoreWriteTransaction#delete(InstanceIdentifier)} is invoked on
+     * {@link DOMStoreWriteTransaction#delete(org.opendaylight.yangtools.yang.data.api.InstanceIdentifier)} is invoked on
      * selected subtransaction.
      * <li> {@link DOMDataWriteTransaction#commit()} - results in invoking
      * {@link DOMStoreWriteTransaction#ready()}, gathering all resulting cohorts
index bcefc25ae86c5ec32fce666d8b099c44ac186d62..b9f096aafc251400b01ee6b7319395cc8ec739fd 100644 (file)
@@ -12,7 +12,6 @@ import javax.annotation.concurrent.GuardedBy;
 
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
@@ -28,9 +27,9 @@ import com.google.common.collect.ImmutableMap;
 import com.google.common.util.concurrent.ListenableFuture;
 
 /**
- * NormalizedNode implementation of {@link TransactionChain} which is backed
+ * NormalizedNode implementation of {@link org.opendaylight.controller.md.sal.common.api.data.TransactionChain} which is backed
  * by several {@link DOMStoreTransactionChain} differentiated by provided
- * {@link LogicalDatastoreType} type.
+ * {@link org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType} type.
  *
  */
 public class DOMDataBrokerTransactionChainImpl extends AbstractDOMForwardedTransactionFactory<DOMStoreTransactionChain>
index 3a4b54eb2dc3f5a2654f0227dc0f4d2d1b6a906e..80bc6696f0cb3f976c00477781a90054b707c5e8 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.md.sal.dom.broker.impl;
 
 import java.util.EventListener;
 
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 
 /**
@@ -21,7 +20,7 @@ import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
  * failure is visible to client code.
  *
  * This is internal API for MD-SAL implementations, for consumer facing error
- * listeners see {@link TransactionChainListener}.
+ * listeners see {@link org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener}.
  *
  */
 interface DOMDataCommitErrorListener extends EventListener {
index f233912ea457a1c7780b15f9b870f98176e865ea..2050d148a8a9638bd562b81d1b2f2a5374f8f4c9 100644 (file)
@@ -18,21 +18,21 @@ import com.google.common.util.concurrent.ListenableFuture;
 /**
  * Executor of Three Phase Commit coordination for
  * {@link DOMDataWriteTransaction} transactions.
- * 
+ *
  * Implementations are responsible for executing implementation of three-phase
  * commit protocol on supplied {@link DOMStoreThreePhaseCommitCohort}s.
- * 
- * 
+ *
+ *
  */
 interface DOMDataCommitExecutor {
 
     /**
      * Submits supplied transaction to be executed in context of provided
      * cohorts.
-     * 
+     *
      * Transaction is used only as a context, cohorts should be associated with
      * this transaction.
-     * 
+     *
      * @param tx
      *            Transaction to be used as context for reporting
      * @param cohort
@@ -43,7 +43,7 @@ interface DOMDataCommitExecutor {
      * @return ListenableFuture which contains RpcResult with
      *         {@link TransactionStatus#COMMITED} if commit coordination on
      *         cohorts finished successfully.
-     * 
+     *
      */
     ListenableFuture<RpcResult<TransactionStatus>> submit(DOMDataWriteTransaction tx,
             Iterable<DOMStoreThreePhaseCommitCohort> cohort, Optional<DOMDataCommitErrorListener> listener);
index ca2d711032882ba8130360563f5d81d7d77684a5..4906b6e84df9c9b84516c9e958d146f15d9766af 100644 (file)
@@ -15,28 +15,29 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import com.google.common.util.concurrent.ListenableFuture;
 
 /**
- * 
+ *
  * Implementation prototype of commit method for
  * {@link DOMForwardedWriteTransaction}.
- * 
+ *
  */
 public interface DOMDataCommitImplementation {
 
     /**
      * User-supplied implementation of {@link DOMDataWriteTransaction#commit()}
      * for transaction.
-     * 
+     *
      * Callback invoked when {@link DOMDataWriteTransaction#commit()} is invoked
      * on transaction created by this factory.
-     * 
+     *
      * @param transaction
      *            Transaction on which {@link DOMDataWriteTransaction#commit()}
      *            was invoked.
      * @param cohorts
      *            Iteration of cohorts for subtransactions associated with
      *            commited transaction.
-     * 
+     *
      */
     ListenableFuture<RpcResult<TransactionStatus>> commit(final DOMDataWriteTransaction transaction,
             final Iterable<DOMStoreThreePhaseCommitCohort> cohorts);
 }
+
index be55911199bbe1748a243d12a074a56d7646ba84..d2543f02bc548be0430584d926a0ed372c6ccf55 100644 (file)
@@ -18,7 +18,7 @@ import com.google.common.collect.ImmutableMap;
 import com.google.common.util.concurrent.ListenableFuture;
 
 /**
- * 
+ *
  * Read Only Transaction, which is composed of several
  * {@link DOMStoreReadTransaction} transactions. Subtransaction is selected by
  * {@link LogicalDatastoreType} type parameter in
@@ -39,4 +39,4 @@ class DOMForwardedReadOnlyTransaction extends
         return getSubtransaction(store).read(path);
     }
 
-}
\ No newline at end of file
+}
index 956e169333a8d3001276340718db271d84d432e9..f5b96e27f5724be29a7bf844b508cbe6d51117cb 100644 (file)
@@ -8,9 +8,7 @@
 
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
@@ -19,11 +17,11 @@ import com.google.common.collect.ImmutableMap;
 import com.google.common.util.concurrent.ListenableFuture;
 
 /**
- * 
+ *
  * Read-Write Transaction, which is composed of several
- * {@link DOMStoreReadTransaction} transactions. Subtransaction is selected by
+ * {@link DOMStoreReadWriteTransaction} transactions. Subtransaction is selected by
  * {@link LogicalDatastoreType} type parameter in:
- * 
+ *
  * <ul>
  * <li>{@link #read(LogicalDatastoreType, InstanceIdentifier)}
  * <li>{@link #put(LogicalDatastoreType, InstanceIdentifier, NormalizedNode)}
@@ -32,10 +30,11 @@ import com.google.common.util.concurrent.ListenableFuture;
  * </ul>
  * {@link #commit()} will result in invocation of
  * {@link DOMDataCommitImplementation#commit(org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction, Iterable)}
- * invocation with all {@link DOMStoreThreePhaseCommitCohort} for underlying
+ * invocation with all {@link org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort} for underlying
  * transactions.
- * 
+ *
  */
+
 class DOMForwardedReadWriteTransaction extends DOMForwardedWriteTransaction<DOMStoreReadWriteTransaction> implements
         DOMDataReadWriteTransaction {
 
index 199438fc8799ba00f64d456478db0fead308984d..eeb345e9ce663e7340300f779ab789805be86a7f 100644 (file)
@@ -14,7 +14,6 @@ import javax.annotation.concurrent.GuardedBy;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -27,12 +26,12 @@ import com.google.common.collect.ImmutableMap;
 import com.google.common.util.concurrent.ListenableFuture;
 
 /**
- * /**
- * 
+ *
+ *
  * Read-Write Transaction, which is composed of several
- * {@link DOMStoreReadTransaction} transactions. Subtransaction is selected by
+ * {@link DOMStoreWriteTransaction} transactions. Subtransaction is selected by
  * {@link LogicalDatastoreType} type parameter in:
- * 
+ *
  * <ul>
  * <li>{@link #put(LogicalDatastoreType, InstanceIdentifier, NormalizedNode)}
  * <li>{@link #delete(LogicalDatastoreType, InstanceIdentifier)}
@@ -41,9 +40,9 @@ import com.google.common.util.concurrent.ListenableFuture;
  * <p>
  * {@link #commit()} will result in invocation of
  * {@link DOMDataCommitImplementation#commit(org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction, Iterable)}
- * invocation with all {@link DOMStoreThreePhaseCommitCohort} for underlying
+ * invocation with all {@link org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort} for underlying
  * transactions.
- * 
+ *
  * @param <T>
  *            Subtype of {@link DOMStoreWriteTransaction} which is used as
  *            subtransaction.
index 87bd6c8c6083a089894cca88a8ddac0e323197bc..258b06892963c1d311e01bdef1a69c6d884d9ed5 100644 (file)
@@ -13,14 +13,13 @@ import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFaile
 
 import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
-import com.google.common.util.concurrent.Futures;
 
 /**
  *
  * Utility exception mapper which translates {@link Exception}
  * to {@link TransactionCommitFailedException}.
  *
- * This mapper is intended to be used with {@link Futures#makeChecked(com.google.common.util.concurrent.ListenableFuture, Function)}
+ * This mapper is intended to be used with {@link com.google.common.util.concurrent.Futures#makeChecked(com.google.common.util.concurrent.ListenableFuture, Function)}
  * <ul>
  * <li>if exception is {@link TransactionCommitFailedException} or one of its subclasses returns original exception.
  * <li>if exception is {@link ExecutionException} and cause is  {@link TransactionCommitFailedException} return cause
@@ -28,6 +27,7 @@ import com.google.common.util.concurrent.Futures;
  * </ul>
  *
  */
+
 final class TransactionCommitFailedExceptionMapper implements
         Function<Exception, TransactionCommitFailedException> {
 
index f9c301c1805b6a2a78574836d7a799487d9cf659..5b531fed6175878733c03eb33460b78a753af59d 100644 (file)
@@ -15,11 +15,11 @@ import com.google.common.util.concurrent.SettableFuture;
 
 /**
  * Simple implementation of {@link TransactionChainListener} for testing.
- * 
+ *
  * This transaction chain listener does not contain any logic, only update
  * futures ({@link #getFailFuture()} and {@link #getSuccessFuture()} when
  * transaction chain event is retrieved.
- * 
+ *
  */
 class BlockingTransactionChainListener implements TransactionChainListener {
 
@@ -27,13 +27,13 @@ class BlockingTransactionChainListener implements TransactionChainListener {
     private final SettableFuture<Void> successFuture = SettableFuture.create();
 
     @Override
-    public void onTransactionChainFailed(TransactionChain<?, ?> chain, AsyncTransaction<?, ?> transaction,
-            Throwable cause) {
+    public void onTransactionChainFailed(final TransactionChain<?, ?> chain, final AsyncTransaction<?, ?> transaction,
+            final Throwable cause) {
         failFuture.set(cause);
     }
 
     @Override
-    public void onTransactionChainSuccessful(TransactionChain<?, ?> chain) {
+    public void onTransactionChainSuccessful(final TransactionChain<?, ?> chain) {
         successFuture.set(null);
     }
 
index b360cb1694eab7224980ed6ed078f39a51942e1e..2a955e5f4215e6dccc0c397ca9c0850ccb159aa3 100644 (file)
@@ -71,8 +71,8 @@ public class DOMTransactionChainTest {
 
         /**
          * We alocate new read-write transaction and write /test
-         * 
-         * 
+         *
+         *
          */
         DOMDataReadWriteTransaction firstTx = allocateAndWrite(txChain);
 
@@ -88,19 +88,19 @@ public class DOMTransactionChainTest {
         DOMDataReadTransaction secondReadTx = txChain.newReadOnlyTransaction();
 
         /**
-         * 
+         *
          * We test if we are able to read data from tx, read should not fail
          * since we are using chained transaction.
-         * 
-         * 
+         *
+         *
          */
         assertTestContainerExists(secondReadTx);
 
         /**
-         * 
+         *
          * We alocate next transaction, which is still based on first one, but
          * is read-write.
-         * 
+         *
          */
         DOMDataReadWriteTransaction thirdDeleteTx = allocateAndDelete(txChain);
 
@@ -111,7 +111,7 @@ public class DOMTransactionChainTest {
 
         /**
          * We commit first transaction
-         * 
+         *
          */
         assertCommitSuccessful(firstWriteTxFuture);
 
@@ -124,7 +124,7 @@ public class DOMTransactionChainTest {
         assertTestContainerExists(storeReadTx);
         /**
          * We commit third transaction
-         * 
+         *
          */
         assertCommitSuccessful(thirdDeleteTxFuture);
 
@@ -144,8 +144,8 @@ public class DOMTransactionChainTest {
 
         /**
          * We alocate new read-write transaction and write /test
-         * 
-         * 
+         *
+         *
          */
         allocateAndWrite(txChain);
 
@@ -155,21 +155,21 @@ public class DOMTransactionChainTest {
          * IllegalStateException.
          */
         try {
-            DOMDataReadTransaction secondReadTx = txChain.newReadOnlyTransaction();
+            txChain.newReadOnlyTransaction();
             fail("Allocation of secondReadTx should fail with IllegalStateException");
         } catch (Exception e) {
             assertTrue(e instanceof IllegalStateException);
         }
     }
 
-    private static DOMDataReadWriteTransaction allocateAndDelete(DOMTransactionChain txChain)
+    private static DOMDataReadWriteTransaction allocateAndDelete(final DOMTransactionChain txChain)
             throws InterruptedException, ExecutionException {
         DOMDataReadWriteTransaction tx = txChain.newReadWriteTransaction();
 
         /**
          * We test existence of /test in third transaction container should
          * still be visible from first one (which is still uncommmited).
-         * 
+         *
          */
         assertTestContainerExists(tx);
 
@@ -180,28 +180,28 @@ public class DOMTransactionChainTest {
         return tx;
     }
 
-    private static DOMDataReadWriteTransaction allocateAndWrite(DOMTransactionChain txChain)
+    private static DOMDataReadWriteTransaction allocateAndWrite(final DOMTransactionChain txChain)
             throws InterruptedException, ExecutionException {
         DOMDataReadWriteTransaction tx = txChain.newReadWriteTransaction();
         assertTestContainerWrite(tx);
         return tx;
     }
 
-    private static void assertCommitSuccessful(ListenableFuture<RpcResult<TransactionStatus>> future)
+    private static void assertCommitSuccessful(final ListenableFuture<RpcResult<TransactionStatus>> future)
             throws InterruptedException, ExecutionException {
         RpcResult<TransactionStatus> rpcResult = future.get();
         assertTrue(rpcResult.isSuccessful());
         assertEquals(TransactionStatus.COMMITED, rpcResult.getResult());
     }
 
-    private static void assertTestContainerExists(DOMDataReadTransaction readTx) throws InterruptedException,
+    private static void assertTestContainerExists(final DOMDataReadTransaction readTx) throws InterruptedException,
             ExecutionException {
         ListenableFuture<Optional<NormalizedNode<?, ?>>> readFuture = readTx.read(OPERATIONAL, TestModel.TEST_PATH);
         Optional<NormalizedNode<?, ?>> readedData = readFuture.get();
         assertTrue(readedData.isPresent());
     }
 
-    private static void assertTestContainerWrite(DOMDataReadWriteTransaction tx) throws InterruptedException,
+    private static void assertTestContainerWrite(final DOMDataReadWriteTransaction tx) throws InterruptedException,
             ExecutionException {
         tx.put(OPERATIONAL, TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
         assertTestContainerExists(tx);
index 48b4bbc2a825e6fd00a3d31575ffac69c0b22630..867ad603623b7998612dab84c906323d7aea8942 100644 (file)
@@ -103,10 +103,7 @@ public class Get extends AbstractConfigNetconfOperation {
         xml.checkName(XmlNetconfConstants.GET);
         xml.checkNamespace(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
 
-        // Filter option - unsupported
-        if (xml.getChildElements(XmlNetconfConstants.FILTER).size() != 0){
-            throw new UnsupportedOperationException("Unsupported option " + XmlNetconfConstants.FILTER + " for " + XmlNetconfConstants.GET);
-        }
+        // Filter option: ignore for now, TODO only load modules specified by the filter
     }
 
     @Override
index 03e0176e32892b034b413443d3edf35cca7afb3c..bc059d345c647d2ea3316efea1887be1eee39a56 100644 (file)
@@ -9,6 +9,8 @@
 package org.opendaylight.controller.netconf.confignetconfconnector.operations.getconfig;
 
 import com.google.common.base.Optional;
+import java.util.Set;
+import javax.management.ObjectName;
 import org.opendaylight.controller.config.util.ConfigRegistryClient;
 import org.opendaylight.controller.config.util.ConfigTransactionClient;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
@@ -30,9 +32,6 @@ import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import javax.management.ObjectName;
-import java.util.Set;
-
 public class GetConfig extends AbstractConfigNetconfOperation {
 
     public static final String GET_CONFIG = "get-config";
@@ -65,11 +64,7 @@ public class GetConfig extends AbstractConfigNetconfOperation {
         logger.debug("Setting source datastore to '{}'", sourceParsed);
         Datastore sourceDatastore = Datastore.valueOf(sourceParsed);
 
-        // Filter option - unsupported
-        if (xml.getChildElements(XmlNetconfConstants.FILTER).size() != 0){
-            throw new UnsupportedOperationException("Unsupported option " + XmlNetconfConstants.FILTER + " for "
-                    + GET_CONFIG);
-        }
+        // Filter option: ignore for now, TODO only load modules specified by the filter
 
         return sourceDatastore;
 
index 75be1f8fe01647beeabbcb1101bd5265c7813578..54ad18a1dec7a61b2159a5b854d70084bbab0018 100644 (file)
@@ -13,10 +13,10 @@ import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
-import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
 import org.opendaylight.controller.netconf.api.NetconfSessionListener;
 import org.opendaylight.controller.netconf.api.NetconfTerminationReason;
 import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultCloseSession;
+import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
 import org.opendaylight.controller.netconf.impl.osgi.SessionMonitoringService;
 import org.opendaylight.controller.netconf.util.messages.SendErrorExceptionUtil;
 import org.opendaylight.controller.netconf.util.xml.XmlElement;
@@ -98,7 +98,7 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
             session.onIncommingRpcFail();
             throw new IllegalStateException("Unable to process incoming message " + netconfMessage, e);
         } catch (NetconfDocumentedException e) {
-            logger.trace("Error occured while processing mesage {}",e);
+            logger.trace("Error occurred while processing message",e);
             session.onOutgoingRpcError();
             session.onIncommingRpcFail();
             SendErrorExceptionUtil.sendErrorMessage(session, e, netconfMessage);
@@ -111,6 +111,8 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
         logger.info("Session {} closed successfully", session.getSessionId());
     }
 
+
+
     private NetconfMessage processDocument(final NetconfMessage netconfMessage, NetconfServerSession session)
             throws NetconfDocumentedException {
 
@@ -123,6 +125,8 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
 
             Document rpcReply = operationRouter.onNetconfMessage(incomingDocument, session);
 
+            rpcReply = SubtreeFilter.applySubtreeFilter(incomingDocument, rpcReply);
+
             session.onIncommingRpcSuccess();
 
             responseDocument.appendChild(responseDocument.importNode(rpcReply.getDocumentElement(), true));
diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/SubtreeFilter.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/SubtreeFilter.java
new file mode 100644 (file)
index 0000000..bfc7df5
--- /dev/null
@@ -0,0 +1,169 @@
+/*
+ * 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.netconf.impl;
+
+import com.google.common.base.Optional;
+import java.io.IOException;
+import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
+import org.opendaylight.controller.netconf.util.mapping.AbstractNetconfOperation.OperationNameAndNamespace;
+import org.opendaylight.controller.netconf.util.xml.XmlElement;
+import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants;
+import org.opendaylight.controller.netconf.util.xml.XmlUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+/**
+ * See <a href="http://tools.ietf.org/html/rfc6241#section-6">rfc6241</a> for details.
+ */
+public class SubtreeFilter {
+    private static final Logger logger = LoggerFactory.getLogger(SubtreeFilter.class);
+
+    static Document applySubtreeFilter(Document requestDocument, Document rpcReply) throws NetconfDocumentedException {
+        // FIXME: rpcReply document must be reread otherwise some nodes do not inherit namespaces. (services/service)
+        try {
+            rpcReply = XmlUtil.readXmlToDocument(XmlUtil.toString(rpcReply, true));
+        } catch (SAXException | IOException e) {
+            logger.error("Cannot transform document", e);
+            throw new NetconfDocumentedException("Cannot transform document");
+        }
+
+        OperationNameAndNamespace operationNameAndNamespace = new OperationNameAndNamespace(requestDocument);
+        if (XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0.equals(operationNameAndNamespace.getNamespace()) &&
+                XmlNetconfConstants.GET.equals(operationNameAndNamespace.getOperationName()) ||
+                XmlNetconfConstants.GET_CONFIG.equals(operationNameAndNamespace.getOperationName())) {
+            // process subtree filtering here, in case registered netconf operations do
+            // not implement filtering.
+            Optional<XmlElement> maybeFilter = operationNameAndNamespace.getOperationElement().getOnlyChildElementOptionally(
+                    XmlNetconfConstants.FILTER, XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
+            if (maybeFilter.isPresent() && (
+                    "subtree".equals(maybeFilter.get().getAttribute("type"))||
+                            "subtree".equals(maybeFilter.get().getAttribute("type", XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0))
+            )) {
+
+
+                // do
+                return filtered(maybeFilter.get(), rpcReply);
+            }
+        }
+        return rpcReply; // return identical document
+    }
+
+    private static Document filtered(XmlElement filter, Document originalReplyDocument) throws NetconfDocumentedException {
+        Document result = XmlUtil.newDocument();
+        // even if filter is empty, copy /rpc/data
+        Element rpcReply = originalReplyDocument.getDocumentElement();
+        Node rpcReplyDst = result.importNode(rpcReply, false);
+        result.appendChild(rpcReplyDst);
+        XmlElement dataSrc = XmlElement.fromDomElement(rpcReply).getOnlyChildElement("data", XmlNetconfConstants.RFC4741_TARGET_NAMESPACE);
+        Element dataDst = (Element) result.importNode(dataSrc.getDomElement(), false);
+        rpcReplyDst.appendChild(dataDst);
+        addSubtree(filter, dataSrc, XmlElement.fromDomElement(dataDst));
+
+        return result;
+    }
+
+    private static void addSubtree(XmlElement filter, XmlElement src, XmlElement dst) {
+        for (XmlElement srcChild : src.getChildElements()) {
+            for (XmlElement filterChild : filter.getChildElements()) {
+                addSubtree2(filterChild, srcChild, dst);
+            }
+        }
+    }
+
+    private static MatchingResult addSubtree2(XmlElement filter, XmlElement src, XmlElement dstParent) {
+        Document document = dstParent.getDomElement().getOwnerDocument();
+        MatchingResult matches = matches(src, filter);
+        if (matches != MatchingResult.NO_MATCH && matches != MatchingResult.CONTENT_MISMATCH) {
+            // copy srcChild to dst
+            boolean filterHasChildren = filter.getChildElements().isEmpty() == false;
+            // copy to depth if this is leaf of filter tree
+            Element copied = (Element) document.importNode(src.getDomElement(), filterHasChildren == false);
+            boolean shouldAppend = filterHasChildren == false;
+            if (filterHasChildren) { // this implies TAG_MATCH
+                // do the same recursively
+                int numberOfTextMatchingChildren = 0;
+                for (XmlElement srcChild : src.getChildElements()) {
+                    for (XmlElement filterChild : filter.getChildElements()) {
+                        MatchingResult childMatch = addSubtree2(filterChild, srcChild, XmlElement.fromDomElement(copied));
+                        if (childMatch == MatchingResult.CONTENT_MISMATCH) {
+                            return MatchingResult.NO_MATCH;
+                        }
+                        if (childMatch == MatchingResult.CONTENT_MATCH) {
+                            numberOfTextMatchingChildren++;
+                        }
+                        shouldAppend |= childMatch != MatchingResult.NO_MATCH;
+                    }
+                }
+                // if only text matching child filters are specified..
+                if (numberOfTextMatchingChildren == filter.getChildElements().size()) {
+                    // force all children to be added (to depth). This is done by copying parent node to depth.
+                    // implies shouldAppend == true
+                    copied = (Element) document.importNode(src.getDomElement(), true);
+                }
+            }
+            if (shouldAppend) {
+                dstParent.getDomElement().appendChild(copied);
+            }
+        }
+        return matches;
+    }
+
+    /**
+     * Shallow compare src node to filter: tag name and namespace must match.
+     * If filter node has no children and has text content, it also must match.
+     */
+    private static MatchingResult matches(XmlElement src, XmlElement filter) {
+        boolean tagMatch = src.getName().equals(filter.getName()) &&
+                src.getNamespaceOptionally().equals(filter.getNamespaceOptionally());
+        MatchingResult result = null;
+        if (tagMatch) {
+            // match text content
+            Optional<String> maybeText = filter.getOnlyTextContentOptionally();
+            if (maybeText.isPresent()) {
+                if (maybeText.equals(src.getOnlyTextContentOptionally())) {
+                    result = MatchingResult.CONTENT_MATCH;
+                } else {
+                    result = MatchingResult.CONTENT_MISMATCH;
+                }
+            }
+            // match attributes, combination of content and tag is not supported
+            if (result == null) {
+                for (Attr attr : filter.getAttributes().values()) {
+                    // ignore namespace declarations
+                    if (XmlUtil.XMLNS_URI.equals(attr.getNamespaceURI()) == false ) {
+                        // find attr with matching localName(),  namespaceURI(),  == value() in src
+                        String found = src.getAttribute(attr.getLocalName(), attr.getNamespaceURI());
+                        if (attr.getValue().equals(found) && result != MatchingResult.NO_MATCH) {
+                            result = MatchingResult.TAG_MATCH;
+                        } else {
+                            result = MatchingResult.NO_MATCH;
+                        }
+                    }
+                }
+            }
+            if (result == null) {
+                result = MatchingResult.TAG_MATCH;
+            }
+        }
+        if (result == null) {
+            result = MatchingResult.NO_MATCH;
+        }
+        logger.debug("Matching {} to {} resulted in {}", src, filter, tagMatch);
+        return result;
+    }
+
+    enum MatchingResult {
+        NO_MATCH, TAG_MATCH, CONTENT_MATCH, CONTENT_MISMATCH
+    }
+}
diff --git a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/SubtreeFilterTest.java b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/SubtreeFilterTest.java
new file mode 100644 (file)
index 0000000..b118343
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * 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.netconf.impl;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.XMLUnit;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+import org.opendaylight.controller.netconf.util.xml.XmlUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+@RunWith(value = Parameterized.class)
+public class SubtreeFilterTest {
+    private static final Logger logger = LoggerFactory.getLogger(SubtreeFilterTest.class);
+
+    private final int directoryIndex;
+
+    @Parameters
+    public static Collection<Object[]> data() {
+        List<Object[]> result = new ArrayList<>();
+        for (int i = 0; i <= 8; i++) {
+            result.add(new Object[]{i});
+        }
+        return result;
+    }
+
+    public SubtreeFilterTest(int directoryIndex) {
+        this.directoryIndex = directoryIndex;
+    }
+
+    @Before
+    public void setUp(){
+        XMLUnit.setIgnoreWhitespace(true);
+    }
+
+    @Test
+    public void test() throws Exception {
+        Document requestDocument = getDocument("request.xml");
+        Document preFilterDocument = getDocument("pre-filter.xml");
+        Document postFilterDocument = getDocument("post-filter.xml");
+        Document actualPostFilterDocument = SubtreeFilter.applySubtreeFilter(requestDocument, preFilterDocument);
+        logger.info("Actual document: {}", XmlUtil.toString(actualPostFilterDocument));
+        Diff diff = XMLUnit.compareXML(postFilterDocument, actualPostFilterDocument);
+        assertTrue(diff.toString(), diff.similar());
+
+    }
+
+    public Document getDocument(String fileName) throws SAXException, IOException {
+        return XmlUtil.readXmlToDocument(getClass().getResourceAsStream("/subtree/" + directoryIndex + "/" +
+                fileName));
+    }
+}
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/getConfig_reply_unfiltered.xml b/opendaylight/netconf/netconf-impl/src/test/resources/getConfig_reply_unfiltered.xml
new file mode 100644 (file)
index 0000000..3c2765a
--- /dev/null
@@ -0,0 +1,439 @@
+<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-2">
+  <data>
+    <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+          prefix:toaster-provider-impl
+        </type>
+        <name>toaster-provider-impl</name>
+        <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+            prefix:binding-notification-service
+          </type>
+          <name>binding-notification-broker</name>
+        </notification-service>
+        <rpc-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+            prefix:binding-rpc-registry
+          </type>
+          <name>binding-rpc-broker</name>
+        </rpc-registry>
+        <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+            prefix:binding-data-broker
+          </type>
+          <name>binding-data-broker</name>
+        </data-broker>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          prefix:sal-netconf-connector
+        </type>
+        <name>controller-config</name>
+        <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1830</port>
+        <connection-timeout-millis xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          20000
+        </connection-timeout-millis>
+        <between-attempts-timeout-millis
+                xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">2000
+        </between-attempts-timeout-millis>
+        <sleep-factor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1.5</sleep-factor>
+        <password xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</password>
+        <dom-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">
+            prefix:dom-broker-osgi-registry
+          </type>
+          <name>dom-broker</name>
+        </dom-registry>
+        <client-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">
+            prefix:netconf-client-dispatcher
+          </type>
+          <name>global-netconf-dispatcher</name>
+        </client-dispatcher>
+        <username xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</username>
+        <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">127.0.0.1</address>
+        <processing-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+          <name>global-netconf-processing-executor</name>
+        </processing-executor>
+        <tcp-only xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">false</tcp-only>
+        <binding-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <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-registry>
+        <max-connection-attempts xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">0
+        </max-connection-attempts>
+        <event-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+          <name>global-event-executor</name>
+        </event-executor>
+      </module>
+      <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>
+        <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>
+        <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>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:logback:config">prefix:logback</type>
+        <name>singleton</name>
+        <console-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <threshold-filter>ERROR</threshold-filter>
+          <name>STDOUT</name>
+          <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</encoder-pattern>
+        </console-appenders>
+        <file-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <append>true</append>
+          <file-name>logs/audit.log</file-name>
+          <name>audit-file</name>
+          <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} %msg %n</encoder-pattern>
+        </file-appenders>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>WARN</level>
+          <logger-name>org.opendaylight.controller.logging.bridge</logger-name>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>INFO</level>
+          <logger-name>audit</logger-name>
+          <appenders>audit-file</appenders>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>ERROR</level>
+          <logger-name>ROOT</logger-name>
+          <appenders>STDOUT</appenders>
+          <appenders>opendaylight.log</appenders>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>INFO</level>
+          <logger-name>org.opendaylight</logger-name>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>INFO</level>
+          <logger-name>org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort</logger-name>
+          <appenders>opendaylight.log</appenders>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>TRACE</level>
+          <logger-name>org.opendaylight.controller.netconf</logger-name>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>WARN</level>
+          <logger-name>io.netty</logger-name>
+        </loggers>
+        <rolling-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <append>true</append>
+          <max-file-size>10MB</max-file-size>
+          <file-name>logs/opendaylight.log</file-name>
+          <name>opendaylight.log</name>
+          <file-name-pattern>logs/opendaylight.%d.log.zip</file-name-pattern>
+          <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{35} - %msg%n</encoder-pattern>
+          <clean-history-on-start>false</clean-history-on-start>
+          <max-history>1</max-history>
+          <rolling-policy-type>TimeBasedRollingPolicy</rolling-policy-type>
+        </rolling-appenders>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:shutdown:impl">prefix:shutdown</type>
+        <name>shutdown</name>
+        <secret xmlns="urn:opendaylight:params:xml:ns:yang:controller:shutdown:impl"/>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:timer">
+          prefix:netty-hashed-wheel-timer
+        </type>
+        <name>global-timer</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:threadgroup">
+          prefix:netty-threadgroup-fixed
+        </type>
+        <name>global-boss-group</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:threadgroup">
+          prefix:netty-threadgroup-fixed
+        </type>
+        <name>global-worker-group</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+          prefix:schema-service-singleton
+        </type>
+        <name>yang-schema-service</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:dom-broker-impl
+        </type>
+        <name>inmemory-dom-broker</name>
+        <async-data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-async-data-broker
+          </type>
+          <name>inmemory-data-broker</name>
+        </async-data-broker>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+          prefix:dom-inmemory-data-broker
+        </type>
+        <name>inmemory-data-broker</name>
+        <schema-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:schema-service</type>
+          <name>yang-schema-service</name>
+        </schema-service>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">
+          prefix:threadpool-flexible
+        </type>
+        <name>global-netconf-processing-executor</name>
+        <threadFactory xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadfactory</type>
+          <name>global-netconf-processing-executor-threadfactory</name>
+        </threadFactory>
+        <minThreadCount xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">1
+        </minThreadCount>
+        <max-thread-count xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">4
+        </max-thread-count>
+        <keepAliveMillis xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">600000
+        </keepAliveMillis>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:eventexecutor">
+          prefix:netty-global-event-executor
+        </type>
+        <name>singleton</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          prefix:binding-broker-impl
+        </type>
+        <name>binding-broker-impl</name>
+        <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+            prefix:binding-notification-service
+          </type>
+          <name>binding-notification-broker</name>
+        </notification-service>
+        <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+            prefix:binding-data-broker
+          </type>
+          <name>binding-data-broker</name>
+        </data-broker>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          prefix:runtime-generated-mapping
+        </type>
+        <name>runtime-mapping-singleton</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          prefix:binding-notification-broker
+        </type>
+        <name>binding-notification-broker</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          prefix:binding-data-compatible-broker
+        </type>
+        <name>inmemory-binding-data-broker</name>
+        <dom-async-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">
+            prefix:dom-broker-osgi-registry
+          </type>
+          <name>dom-broker</name>
+        </dom-async-broker>
+        <binding-mapping-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+            prefix:binding-dom-mapping-service
+          </type>
+          <name>runtime-mapping-singleton</name>
+        </binding-mapping-service>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl">
+          prefix:threadfactory-naming
+        </type>
+        <name>global-netconf-processing-executor-threadfactory</name>
+        <name-prefix xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl">
+          remote-connector-processing-executor
+        </name-prefix>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+          prefix:kitchen-service-impl
+        </type>
+        <name>kitchen-service-impl</name>
+        <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+            prefix:binding-notification-service
+          </type>
+          <name>binding-notification-broker</name>
+        </notification-service>
+        <rpc-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+            prefix:binding-rpc-registry
+          </type>
+          <name>binding-rpc-broker</name>
+        </rpc-registry>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">
+          prefix:remote-zeromq-rpc-server
+        </type>
+        <name>remoter</name>
+        <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">5666</port>
+        <dom-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">
+            prefix:dom-broker-osgi-registry
+          </type>
+          <name>dom-broker</name>
+        </dom-broker>
+      </module>
+    </modules>
+    <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:schema-service</type>
+        <instance>
+          <name>yang-schema-service</name>
+          <provider>/modules/module[type='schema-service-singleton'][name='yang-schema-service']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry
+        </type>
+        <instance>
+          <name>dom-broker</name>
+          <provider>/modules/module[type='dom-broker-impl'][name='inmemory-dom-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-async-data-broker
+        </type>
+        <instance>
+          <name>inmemory-data-broker</name>
+          <provider>/modules/module[type='dom-inmemory-data-broker'][name='inmemory-data-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+        <instance>
+          <name>global-netconf-processing-executor</name>
+          <provider>/modules/module[type='threadpool-flexible'][name='global-netconf-processing-executor']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadfactory</type>
+        <instance>
+          <name>global-netconf-processing-executor-threadfactory</name>
+          <provider>
+            /modules/module[type='threadfactory-naming'][name='global-netconf-processing-executor-threadfactory']
+          </provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          prefix:binding-dom-mapping-service
+        </type>
+        <instance>
+          <name>runtime-mapping-singleton</name>
+          <provider>/modules/module[type='runtime-generated-mapping'][name='runtime-mapping-singleton']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-timer</type>
+        <instance>
+          <name>global-timer</name>
+          <provider>/modules/module[type='netty-hashed-wheel-timer'][name='global-timer']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+        <instance>
+          <name>global-boss-group</name>
+          <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-boss-group']</provider>
+        </instance>
+        <instance>
+          <name>global-worker-group</name>
+          <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-worker-group']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+        <instance>
+          <name>global-event-executor</name>
+          <provider>/modules/module[type='netty-global-event-executor'][name='singleton']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-rpc-registry
+        </type>
+        <instance>
+          <name>binding-rpc-broker</name>
+          <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+          prefix:binding-notification-service
+        </type>
+        <instance>
+          <name>binding-notification-broker</name>
+          <provider>/modules/module[type='binding-notification-broker'][name='binding-notification-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+          prefix:binding-broker-osgi-registry
+        </type>
+        <instance>
+          <name>binding-osgi-broker</name>
+          <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-data-broker
+        </type>
+        <instance>
+          <name>binding-data-broker</name>
+          <provider>/modules/module[type='binding-data-compatible-broker'][name='inmemory-binding-data-broker']
+          </provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+          prefix:kitchen-service
+        </type>
+        <instance>
+          <name>kitchen-service</name>
+          <provider>/modules/module[type='kitchen-service-impl'][name='kitchen-service-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">
+          prefix:netconf-client-dispatcher
+        </type>
+        <instance>
+          <name>global-netconf-dispatcher</name>
+          <provider>/modules/module[type='netconf-client-dispatcher'][name='global-netconf-dispatcher']</provider>
+        </instance>
+      </service>
+    </services>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/logback-test.xml b/opendaylight/netconf/netconf-impl/src/test/resources/logback-test.xml
new file mode 100644 (file)
index 0000000..74714a0
--- /dev/null
@@ -0,0 +1,13 @@
+<configuration scan="true">
+
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</pattern>
+    </encoder>
+  </appender>
+
+  <root level="error">
+    <appender-ref ref="STDOUT" />
+  </root>
+  <logger name="org.opendaylight.controller.netconf" level="TRACE"/>
+</configuration>
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/post-filter.xml
new file mode 100644 (file)
index 0000000..4abe6a3
--- /dev/null
@@ -0,0 +1,48 @@
+<!--
+  ~ 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
+  -->
+
+<rpc-reply message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/pre-filter.xml
new file mode 100644 (file)
index 0000000..031409b
--- /dev/null
@@ -0,0 +1,40 @@
+<rpc-reply message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/request.xml
new file mode 100644 (file)
index 0000000..8d49a7f
--- /dev/null
@@ -0,0 +1,5 @@
+<rpc message-id="0"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get>
+  </get>
+</rpc>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/post-filter.xml
new file mode 100644 (file)
index 0000000..1ad3f20
--- /dev/null
@@ -0,0 +1,5 @@
+<rpc-reply message-id="1"
+           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+  </data>
+</rpc-reply>
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/pre-filter.xml
new file mode 100644 (file)
index 0000000..8fd61e1
--- /dev/null
@@ -0,0 +1,40 @@
+<rpc-reply message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/request.xml
new file mode 100644 (file)
index 0000000..2579aa6
--- /dev/null
@@ -0,0 +1,7 @@
+<rpc message-id="1"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get>
+    <filter type="subtree">
+    </filter>
+  </get>
+</rpc>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/post-filter.xml
new file mode 100644 (file)
index 0000000..e974b59
--- /dev/null
@@ -0,0 +1,35 @@
+<rpc-reply message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/pre-filter.xml
new file mode 100644 (file)
index 0000000..a399e57
--- /dev/null
@@ -0,0 +1,48 @@
+<!--
+  ~ 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
+  -->
+
+<rpc-reply message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/request.xml
new file mode 100644 (file)
index 0000000..7b549b9
--- /dev/null
@@ -0,0 +1,13 @@
+<rpc message-id="2"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get-config>
+    <source>
+      <running/>
+    </source>
+    <filter type="subtree">
+      <top xmlns="http://example.com/schema/1.2/config">
+        <users/>
+      </top>
+    </filter>
+  </get-config>
+</rpc>
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/post-filter.xml
new file mode 100644 (file)
index 0000000..e379d49
--- /dev/null
@@ -0,0 +1,26 @@
+<!--
+  ~ 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
+  -->
+
+<rpc-reply message-id="3"
+           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+        </user>
+        <user>
+          <name>fred</name>
+        </user>
+        <user>
+          <name>barney</name>
+        </user>
+      </users>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/pre-filter.xml
new file mode 100644 (file)
index 0000000..42f451b
--- /dev/null
@@ -0,0 +1,48 @@
+<!--
+  ~ 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
+  -->
+
+<rpc-reply message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/request.xml
new file mode 100644 (file)
index 0000000..771f136
--- /dev/null
@@ -0,0 +1,25 @@
+<!--
+  ~ 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
+  -->
+
+<rpc message-id="3"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get-config>
+    <source>
+      <running/>
+    </source>
+    <filter type="subtree">
+      <top xmlns="http://example.com/schema/1.2/config">
+        <users>
+          <user>
+            <name/>
+          </user>
+        </users>
+      </top>
+    </filter>
+  </get-config>
+</rpc>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/post-filter.xml
new file mode 100644 (file)
index 0000000..c701ba0
--- /dev/null
@@ -0,0 +1,18 @@
+<rpc-reply message-id="4"
+           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+      </users>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/pre-filter.xml
new file mode 100644 (file)
index 0000000..f2f2cbb
--- /dev/null
@@ -0,0 +1,48 @@
+<!--
+  ~ 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
+  -->
+
+<rpc-reply message-id="4" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/request.xml
new file mode 100644 (file)
index 0000000..04c8149
--- /dev/null
@@ -0,0 +1,17 @@
+<rpc message-id="4"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get-config>
+    <source>
+      <running/>
+    </source>
+    <filter type="subtree">
+      <top xmlns="http://example.com/schema/1.2/config">
+        <users>
+          <user>
+            <name>fred</name>
+          </user>
+        </users>
+      </top>
+    </filter>
+  </get-config>
+</rpc>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/post-filter.xml
new file mode 100644 (file)
index 0000000..d6ffd00
--- /dev/null
@@ -0,0 +1,14 @@
+<rpc-reply message-id="5"
+           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+        </user>
+      </users>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/pre-filter.xml
new file mode 100644 (file)
index 0000000..7e3f721
--- /dev/null
@@ -0,0 +1,40 @@
+<rpc-reply message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/request.xml
new file mode 100644 (file)
index 0000000..3581988
--- /dev/null
@@ -0,0 +1,19 @@
+<rpc message-id="5"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get-config>
+    <source>
+      <running/>
+    </source>
+    <filter type="subtree">
+      <top xmlns="http://example.com/schema/1.2/config">
+        <users>
+          <user>
+            <name>fred</name>
+            <type/>
+            <full-name/>
+          </user>
+        </users>
+      </top>
+    </filter>
+  </get-config>
+</rpc>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/post-filter.xml
new file mode 100644 (file)
index 0000000..05eb019
--- /dev/null
@@ -0,0 +1,22 @@
+<rpc-reply message-id="6"
+           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <company-info>
+            <id>2</id>
+          </company-info>
+        </user>
+      </users>
+    </top>
+  </data>
+</rpc-reply>
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/pre-filter.xml
new file mode 100644 (file)
index 0000000..71dd628
--- /dev/null
@@ -0,0 +1,48 @@
+<!--
+  ~ 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
+  -->
+
+<rpc-reply message-id="6" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/request.xml
new file mode 100644 (file)
index 0000000..c4a410d
--- /dev/null
@@ -0,0 +1,32 @@
+<rpc message-id="6"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get-config>
+    <source>
+      <running/>
+    </source>
+    <filter type="subtree">
+      <top xmlns="http://example.com/schema/1.2/config">
+        <users>
+          <user>
+            <name>root</name>
+            <company-info/>
+          </user>
+          <user>
+            <name>fred</name>
+            <company-info>
+              <id/>
+            </company-info>
+          </user>
+          <user>
+            <name>barney</name>
+            <type>superuser</type>
+            <company-info>
+              <dept/>
+            </company-info>
+          </user>
+        </users>
+      </top>
+    </filter>
+  </get-config>
+</rpc>
+
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/post-filter.xml
new file mode 100644 (file)
index 0000000..676ba22
--- /dev/null
@@ -0,0 +1,13 @@
+<rpc-reply message-id="7"
+           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <t:top xmlns:t="http://example.com/schema/1.2/stats">
+      <t:interfaces>
+        <t:interface t:ifName="eth0">
+          <t:ifInOctets>45621</t:ifInOctets>
+          <t:ifOutOctets>774344</t:ifOutOctets>
+        </t:interface>
+      </t:interfaces>
+    </t:top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/pre-filter.xml
new file mode 100644 (file)
index 0000000..ef88283
--- /dev/null
@@ -0,0 +1,52 @@
+<rpc-reply message-id="7" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+    <prefix:top xmlns:prefix="http://example.com/schema/1.2/stats">
+      <prefix:interfaces>
+        <prefix:interface prefix:ifName="eth0">
+          <prefix:ifInOctets>45621</prefix:ifInOctets>
+          <prefix:ifOutOctets>774344</prefix:ifOutOctets>
+        </prefix:interface>
+        <prefix:interface prefix:ifName="eth1">
+          <prefix:ifInOctets>1</prefix:ifInOctets>
+          <prefix:ifOutOctets>1</prefix:ifOutOctets>
+        </prefix:interface>
+      </prefix:interfaces>
+    </prefix:top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/request.xml
new file mode 100644 (file)
index 0000000..4bbbaba
--- /dev/null
@@ -0,0 +1,12 @@
+<rpc message-id="7"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get>
+    <filter type="subtree">
+      <t:top xmlns:t="http://example.com/schema/1.2/stats">
+        <t:interfaces>
+          <t:interface t:ifName="eth0"/>
+        </t:interfaces>
+      </t:top>
+    </filter>
+  </get>
+</rpc>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/post-filter.xml
new file mode 100644 (file)
index 0000000..3498b02
--- /dev/null
@@ -0,0 +1,115 @@
+<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-6">
+  <data>
+    <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:schema-service</type>
+        <instance>
+          <name>yang-schema-service</name>
+          <provider>/modules/module[type='schema-service-singleton'][name='yang-schema-service']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+        <instance>
+          <name>dom-broker</name>
+          <provider>/modules/module[type='dom-broker-impl'][name='inmemory-dom-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-async-data-broker</type>
+        <instance>
+          <name>inmemory-data-broker</name>
+          <provider>/modules/module[type='dom-inmemory-data-broker'][name='inmemory-data-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+        <instance>
+          <name>global-netconf-processing-executor</name>
+          <provider>/modules/module[type='threadpool-flexible'][name='global-netconf-processing-executor']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadfactory</type>
+        <instance>
+          <name>global-netconf-processing-executor-threadfactory</name>
+          <provider>/modules/module[type='threadfactory-naming'][name='global-netconf-processing-executor-threadfactory']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-dom-mapping-service</type>
+        <instance>
+          <name>runtime-mapping-singleton</name>
+          <provider>/modules/module[type='runtime-generated-mapping'][name='runtime-mapping-singleton']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-timer</type>
+        <instance>
+          <name>global-timer</name>
+          <provider>/modules/module[type='netty-hashed-wheel-timer'][name='global-timer']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+        <instance>
+          <name>global-boss-group</name>
+          <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-boss-group']</provider>
+        </instance>
+        <instance>
+          <name>global-worker-group</name>
+          <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-worker-group']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+        <instance>
+          <name>global-event-executor</name>
+          <provider>/modules/module[type='netty-global-event-executor'][name='singleton']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-rpc-registry</type>
+        <instance>
+          <name>binding-rpc-broker</name>
+          <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-notification-service</type>
+        <instance>
+          <name>binding-notification-broker</name>
+          <provider>/modules/module[type='binding-notification-broker'][name='binding-notification-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type>
+        <instance>
+          <name>binding-osgi-broker</name>
+          <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-data-broker</type>
+        <instance>
+          <name>binding-data-broker</name>
+          <provider>/modules/module[type='binding-data-compatible-broker'][name='inmemory-binding-data-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">prefix:kitchen-service</type>
+        <instance>
+          <name>kitchen-service</name>
+          <provider>/modules/module[type='kitchen-service-impl'][name='kitchen-service-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">prefix:netconf-client-dispatcher</type>
+        <instance>
+          <name>global-netconf-dispatcher</name>
+          <provider>/modules/module[type='netconf-client-dispatcher'][name='global-netconf-dispatcher']</provider>
+        </instance>
+      </service>
+    </services>
+  </data>
+</rpc-reply>
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/pre-filter.xml
new file mode 100644 (file)
index 0000000..8a57b4c
--- /dev/null
@@ -0,0 +1,350 @@
+<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-6">
+  <data>
+    <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">prefix:toaster-provider-impl</type>
+        <name>toaster-provider-impl</name>
+        <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-notification-service</type>
+          <name>binding-notification-broker</name>
+        </notification-service>
+        <rpc-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-rpc-registry</type>
+          <name>binding-rpc-broker</name>
+        </rpc-registry>
+        <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-data-broker</type>
+          <name>binding-data-broker</name>
+        </data-broker>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">prefix:sal-netconf-connector</type>
+        <name>controller-config</name>
+        <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1830</port>
+        <connection-timeout-millis xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">20000</connection-timeout-millis>
+        <between-attempts-timeout-millis xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">2000</between-attempts-timeout-millis>
+        <sleep-factor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1.5</sleep-factor>
+        <password xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</password>
+        <dom-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+          <name>dom-broker</name>
+        </dom-registry>
+        <client-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">prefix:netconf-client-dispatcher</type>
+          <name>global-netconf-dispatcher</name>
+        </client-dispatcher>
+        <username xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</username>
+        <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">127.0.0.1</address>
+        <processing-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+          <name>global-netconf-processing-executor</name>
+        </processing-executor>
+        <tcp-only xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">false</tcp-only>
+        <binding-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <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-registry>
+        <max-connection-attempts xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">0</max-connection-attempts>
+        <event-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+          <name>global-event-executor</name>
+        </event-executor>
+      </module>
+      <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>
+        <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>
+        <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>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:logback:config">prefix:logback</type>
+        <name>singleton</name>
+        <console-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <threshold-filter>ERROR</threshold-filter>
+          <name>STDOUT</name>
+          <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</encoder-pattern>
+        </console-appenders>
+        <file-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <append>true</append>
+          <file-name>logs/audit.log</file-name>
+          <name>audit-file</name>
+          <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} %msg %n</encoder-pattern>
+        </file-appenders>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>WARN</level>
+          <logger-name>org.opendaylight.controller.logging.bridge</logger-name>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>INFO</level>
+          <logger-name>audit</logger-name>
+          <appenders>audit-file</appenders>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>ERROR</level>
+          <logger-name>ROOT</logger-name>
+          <appenders>STDOUT</appenders>
+          <appenders>opendaylight.log</appenders>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>INFO</level>
+          <logger-name>org.opendaylight</logger-name>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>INFO</level>
+          <logger-name>org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort</logger-name>
+          <appenders>opendaylight.log</appenders>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>TRACE</level>
+          <logger-name>org.opendaylight.controller.netconf</logger-name>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>WARN</level>
+          <logger-name>io.netty</logger-name>
+        </loggers>
+        <rolling-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <append>true</append>
+          <max-file-size>10MB</max-file-size>
+          <file-name>logs/opendaylight.log</file-name>
+          <name>opendaylight.log</name>
+          <file-name-pattern>logs/opendaylight.%d.log.zip</file-name-pattern>
+          <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{35} - %msg%n</encoder-pattern>
+          <clean-history-on-start>false</clean-history-on-start>
+          <max-history>1</max-history>
+          <rolling-policy-type>TimeBasedRollingPolicy</rolling-policy-type>
+        </rolling-appenders>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:shutdown:impl">prefix:shutdown</type>
+        <name>shutdown</name>
+        <secret xmlns="urn:opendaylight:params:xml:ns:yang:controller:shutdown:impl"/>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:timer">prefix:netty-hashed-wheel-timer</type>
+        <name>global-timer</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:threadgroup">prefix:netty-threadgroup-fixed</type>
+        <name>global-boss-group</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:threadgroup">prefix:netty-threadgroup-fixed</type>
+        <name>global-worker-group</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:schema-service-singleton</type>
+        <name>yang-schema-service</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:dom-broker-impl</type>
+        <name>inmemory-dom-broker</name>
+        <async-data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-async-data-broker</type>
+          <name>inmemory-data-broker</name>
+        </async-data-broker>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:dom-inmemory-data-broker</type>
+        <name>inmemory-data-broker</name>
+        <schema-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:schema-service</type>
+          <name>yang-schema-service</name>
+        </schema-service>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">prefix:threadpool-flexible</type>
+        <name>global-netconf-processing-executor</name>
+        <threadFactory xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadfactory</type>
+          <name>global-netconf-processing-executor-threadfactory</name>
+        </threadFactory>
+        <minThreadCount xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">1</minThreadCount>
+        <max-thread-count xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">4</max-thread-count>
+        <keepAliveMillis xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">600000</keepAliveMillis>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:eventexecutor">prefix:netty-global-event-executor</type>
+        <name>singleton</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-broker-impl</type>
+        <name>binding-broker-impl</name>
+        <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-notification-service</type>
+          <name>binding-notification-broker</name>
+        </notification-service>
+        <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-data-broker</type>
+          <name>binding-data-broker</name>
+        </data-broker>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:runtime-generated-mapping</type>
+        <name>runtime-mapping-singleton</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-notification-broker</type>
+        <name>binding-notification-broker</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-data-compatible-broker</type>
+        <name>inmemory-binding-data-broker</name>
+        <dom-async-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+          <name>dom-broker</name>
+        </dom-async-broker>
+        <binding-mapping-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-dom-mapping-service</type>
+          <name>runtime-mapping-singleton</name>
+        </binding-mapping-service>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl">prefix:threadfactory-naming</type>
+        <name>global-netconf-processing-executor-threadfactory</name>
+        <name-prefix xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl">remote-connector-processing-executor</name-prefix>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">prefix:kitchen-service-impl</type>
+        <name>kitchen-service-impl</name>
+        <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-notification-service</type>
+          <name>binding-notification-broker</name>
+        </notification-service>
+        <rpc-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-rpc-registry</type>
+          <name>binding-rpc-broker</name>
+        </rpc-registry>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">prefix:remote-zeromq-rpc-server</type>
+        <name>remoter</name>
+        <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">5666</port>
+        <dom-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+          <name>dom-broker</name>
+        </dom-broker>
+      </module>
+    </modules>
+    <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:schema-service</type>
+        <instance>
+          <name>yang-schema-service</name>
+          <provider>/modules/module[type='schema-service-singleton'][name='yang-schema-service']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+        <instance>
+          <name>dom-broker</name>
+          <provider>/modules/module[type='dom-broker-impl'][name='inmemory-dom-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-async-data-broker</type>
+        <instance>
+          <name>inmemory-data-broker</name>
+          <provider>/modules/module[type='dom-inmemory-data-broker'][name='inmemory-data-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+        <instance>
+          <name>global-netconf-processing-executor</name>
+          <provider>/modules/module[type='threadpool-flexible'][name='global-netconf-processing-executor']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadfactory</type>
+        <instance>
+          <name>global-netconf-processing-executor-threadfactory</name>
+          <provider>/modules/module[type='threadfactory-naming'][name='global-netconf-processing-executor-threadfactory']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-dom-mapping-service</type>
+        <instance>
+          <name>runtime-mapping-singleton</name>
+          <provider>/modules/module[type='runtime-generated-mapping'][name='runtime-mapping-singleton']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-timer</type>
+        <instance>
+          <name>global-timer</name>
+          <provider>/modules/module[type='netty-hashed-wheel-timer'][name='global-timer']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+        <instance>
+          <name>global-boss-group</name>
+          <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-boss-group']</provider>
+        </instance>
+        <instance>
+          <name>global-worker-group</name>
+          <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-worker-group']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+        <instance>
+          <name>global-event-executor</name>
+          <provider>/modules/module[type='netty-global-event-executor'][name='singleton']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-rpc-registry</type>
+        <instance>
+          <name>binding-rpc-broker</name>
+          <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-notification-service</type>
+        <instance>
+          <name>binding-notification-broker</name>
+          <provider>/modules/module[type='binding-notification-broker'][name='binding-notification-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type>
+        <instance>
+          <name>binding-osgi-broker</name>
+          <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-data-broker</type>
+        <instance>
+          <name>binding-data-broker</name>
+          <provider>/modules/module[type='binding-data-compatible-broker'][name='inmemory-binding-data-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">prefix:kitchen-service</type>
+        <instance>
+          <name>kitchen-service</name>
+          <provider>/modules/module[type='kitchen-service-impl'][name='kitchen-service-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">prefix:netconf-client-dispatcher</type>
+        <instance>
+          <name>global-netconf-dispatcher</name>
+          <provider>/modules/module[type='netconf-client-dispatcher'][name='global-netconf-dispatcher']</provider>
+        </instance>
+      </service>
+    </services>
+  </data>
+</rpc-reply>
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/request.xml
new file mode 100644 (file)
index 0000000..4d71ba4
--- /dev/null
@@ -0,0 +1,12 @@
+<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-10">
+  <get-config>
+    <filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
+      <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+        <service/>
+      </services>
+    </filter>
+    <source>
+      <running/>
+    </source>
+  </get-config>
+</rpc>
index 731aad6d1a4d7103ca12fc99541482b81a82757b..e9e92d9202297c626d57e02bcd173beed9ebdc13 100644 (file)
@@ -20,7 +20,7 @@ import org.opendaylight.controller.netconf.monitoring.MonitoringConstants;
 
 public class NetconfMonitoringOperationService implements NetconfOperationService {
 
-    public static final Set<Capability> CAPABILITIES = Sets.<Capability>newHashSet(new Capability() {
+    private static final Set<Capability> CAPABILITIES = Sets.<Capability>newHashSet(new Capability() {
 
         @Override
         public String getCapabilityUri() {
index 4e32e82e89251089b8425fe3a990ab46fb22cace..2bda51b495c3505741ff9c697712cb3f98a2b1ee 100644 (file)
@@ -30,7 +30,7 @@ public class SSHTest {
         AuthProvider authProvider = mock(AuthProvider.class);
         doReturn(PEMGenerator.generate().toCharArray()).when(authProvider).getPEMAsCharArray();
         doReturn(true).when(authProvider).authenticated(anyString(), anyString());
-        NetconfSSHServer thread = NetconfSSHServer.start(1831, NetconfConfigUtil.getNetconfLocalAddress(), authProvider, new NioEventLoopGroup());
+        NetconfSSHServer thread = NetconfSSHServer.start(10831, NetconfConfigUtil.getNetconfLocalAddress(), authProvider, new NioEventLoopGroup());
         Thread.sleep(2000);
         logger.info("Closing socket");
         thread.close();
index 65ca1b7c4b5118b00653aa5daf9d0416342532ef..8837c74ff5ad80911deb7c804d48383c52d4a51c 100644 (file)
@@ -47,12 +47,12 @@ public abstract class AbstractNetconfOperation implements NetconfOperation {
 
     public static final class OperationNameAndNamespace {
         private final String operationName, namespace;
+        private final XmlElement operationElement;
 
         public OperationNameAndNamespace(Document message) throws NetconfDocumentedException {
             XmlElement requestElement = null;
             requestElement = getRequestElementWithCheck(message);
-
-            XmlElement operationElement = requestElement.getOnlyChildElement();
+            operationElement = requestElement.getOnlyChildElement();
             operationName = operationElement.getName();
             namespace = operationElement.getNamespace();
         }
@@ -64,6 +64,10 @@ public abstract class AbstractNetconfOperation implements NetconfOperation {
         public String getNamespace() {
             return namespace;
         }
+
+        public XmlElement getOperationElement() {
+            return operationElement;
+        }
     }
 
     protected static XmlElement getRequestElementWithCheck(Document message) throws NetconfDocumentedException {
index ac200a0aa668c1a406e044e11205ac90c20fc478..8780925eb185b97493cfc7557620f2846604ecd4 100644 (file)
@@ -338,6 +338,17 @@ public final class XmlElement {
         );
     }
 
+    public Optional<String> getOnlyTextContentOptionally() {
+        // only return text content if this node has exactly one Text child node
+        if (element.getChildNodes().getLength() == 1) {
+            Node item = element.getChildNodes().item(0);
+            if (item instanceof Text) {
+                return Optional.of(((Text) item).getWholeText());
+            }
+        }
+        return Optional.absent();
+    }
+
     public String getNamespaceAttribute() throws MissingNameSpaceException {
         String attribute = element.getAttribute(XmlUtil.XMLNS_ATTRIBUTE_KEY);
         if (attribute == null || attribute.equals("")){
index 708f17cadbc2a16dd639b53b386dd84e212d3d54..fa72284b98c5139be4dacbdc0552ded84c0ebc52 100644 (file)
@@ -56,4 +56,5 @@ public final class XmlNetconfConstants {
     // TODO where to store namespace of config ?
     public static final String URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG = "urn:opendaylight:params:xml:ns:yang:controller:config";
     public static final String GET = "get";
+    public static final String GET_CONFIG = "get-config";
 }
index b2cb414303fa2a826f9b9a3ebfc0ab7f7365da88..7bd15ff7f45c2aa56bfde10a4878ac55371fc533 100644 (file)
@@ -111,7 +111,9 @@ public class ConnectionService implements IPluginOutConnectionService, IConnecti
     @Override
     public Node connect (String type, String connectionIdentifier, Map<ConnectionConstants, String> params) {
         IPluginInConnectionService s = pluginService.get(type);
-        if (s != null) return s.connect(connectionIdentifier, params);
+        if (s != null) {
+            return s.connect(connectionIdentifier, params);
+        }
         return null;
     }
 
@@ -121,7 +123,9 @@ public class ConnectionService implements IPluginOutConnectionService, IConnecti
             for (String pluginType : this.pluginService.keySet()) {
                 IPluginInConnectionService s = pluginService.get(pluginType);
                 Node node = s.connect(connectionIdentifier, params);
-                if (node != null) return node;
+                if (node != null) {
+                    return node;
+                }
             }
         }
         return null;
diff --git a/pom.xml b/pom.xml
index 8ad038763c8f2909ff95974b888c281adbcf44ae..a26533819c45e8a8a89d696eef00093551db1b49 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -32,6 +32,7 @@
     <module>opendaylight/hosttracker_new/implementation</module>
     <module>opendaylight/containermanager/api</module>
     <module>opendaylight/containermanager/implementation</module>
+    <module>opendaylight/containermanager/shell</module>
     <module>opendaylight/appauth</module>
     <module>opendaylight/switchmanager/api</module>
     <module>opendaylight/switchmanager/implementation</module>
 
     <!-- Karaf Distribution -->
     <module>features/base</module>
+    <module>features/controller</module>
     <module>opendaylight/dummy-console</module>
     <module>opendaylight/karaf-branding</module>
     <module>opendaylight/distribution/opendaylight-karaf</module>