Merge "BUG-704 Remove pax from netconf identity-ref test."
authorTony Tkacik <ttkacik@cisco.com>
Mon, 12 May 2014 16:35:07 +0000 (16:35 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 12 May 2014 16:35:07 +0000 (16:35 +0000)
138 files changed:
opendaylight/appauth/pom.xml
opendaylight/arphandler/pom.xml
opendaylight/clustering/services/pom.xml
opendaylight/clustering/services/src/main/java/org/opendaylight/controller/clustering/services/CacheConfigException.java
opendaylight/clustering/services/src/main/java/org/opendaylight/controller/clustering/services/CacheExistException.java
opendaylight/clustering/services/src/main/java/org/opendaylight/controller/clustering/services/CacheListenerAddException.java
opendaylight/clustering/services/src/main/java/org/opendaylight/controller/clustering/services/ListenRoleChangeAddException.java
opendaylight/clustering/services_implementation/pom.xml
opendaylight/clustering/stub/pom.xml
opendaylight/clustering/test/pom.xml
opendaylight/clustering/test/src/main/java/org/opendaylight/controller/clustering/test/internal/ComplexClass.java
opendaylight/clustering/test/src/main/java/org/opendaylight/controller/clustering/test/internal/ComplexClass1.java
opendaylight/clustering/test/src/main/java/org/opendaylight/controller/clustering/test/internal/ComplexContainer.java
opendaylight/clustering/test/src/main/java/org/opendaylight/controller/clustering/test/internal/StringContainer.java
opendaylight/commons/concepts/pom.xml
opendaylight/commons/httpclient/pom.xml
opendaylight/commons/opendaylight/pom.xml
opendaylight/config/pom.xml
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/ConcreteModuleGeneratedObjectFactory.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtil.java
opendaylight/config/yang-jmx-generator-plugin/src/main/resources/copyright.txt [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtilTest.java
opendaylight/configuration/api/pom.xml
opendaylight/configuration/implementation/pom.xml
opendaylight/connectionmanager/api/pom.xml
opendaylight/connectionmanager/implementation/pom.xml
opendaylight/containermanager/api/pom.xml
opendaylight/containermanager/implementation/pom.xml
opendaylight/containermanager/it.implementation/pom.xml
opendaylight/distribution/opendaylight/pom.xml
opendaylight/distribution/sanitytest/pom.xml
opendaylight/dummy-console/pom.xml
opendaylight/forwarding/staticrouting/pom.xml
opendaylight/forwardingrulesmanager/api/pom.xml
opendaylight/forwardingrulesmanager/implementation/pom.xml
opendaylight/hosttracker/api/pom.xml
opendaylight/hosttracker/implementation/pom.xml
opendaylight/hosttracker_new/api/pom.xml
opendaylight/hosttracker_new/implementation/pom.xml
opendaylight/logging/bridge/pom.xml
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeMapping.java
opendaylight/md-sal/pom.xml
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/AbstractForwardedDataBroker.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingToNormalizedNodeCodec.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/SingletonHolder.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/MultipleAugmentationPuts.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/md/sal/binding/data/ConcurrentImplicitCreateTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/md/sal/binding/data/ListProcessingAndOrderingTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/md/sal/binding/data/WildcardedDataChangeListenerTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DOMCodecBug03Test.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/FlagsSerializationTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/PutAugmentationTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/WriteParentReadChildTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/ChangeOriginatedInDomBrokerTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/CrossBrokerMountPointTest.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/routing/RoutedRegistration.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/ChangeListenerNotifyTask.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DOMImmutableDataChangeEvent.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DataAndMetadataSnapshot.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DataChangeListenerRegistration.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DataPreconditionFailedException.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/ModificationApplyOperation.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/OperationWithModification.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/SchemaAwareApplyOperation.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/SchemaAwareApplyOperationRoot.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/StoreUtils.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/StoreMetadataNode.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/StoreNodeCompositeBuilder.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/TreeNodeUtils.java
opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DataNormalizerTest.java
opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDataStoreTest.java
opendaylight/md-sal/sal-netconf-connector/pom.xml
opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/RemoteRpcProvider.java
opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/dto/Message.java
opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/dto/RouteIdentifierImpl.java
opendaylight/md-sal/sal-remoterpc-connector/implementation/src/test/java/org/opendaylight/controller/sal/connector/remoterpc/ClientRequestHandlerTest.java
opendaylight/md-sal/samples/toaster-it/pom.xml
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/AbstractStatsTracker.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/GroupDescStatsTracker.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/GroupStatsTracker.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/MeterConfigStatsTracker.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/MeterStatsTracker.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/QueueStatsTracker.java
opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/exception/NetconfConfigHandlingException.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/exception/NoTransactionFoundException.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/exception/OperationNotPermittedException.java
opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPusher.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/exception/MissingNameSpaceException.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/exception/UnexpectedElementException.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/exception/UnexpectedNamespaceException.java
opendaylight/networkconfiguration/neutron/implementation/pom.xml
opendaylight/networkconfiguration/neutron/pom.xml
opendaylight/northbound/bundlescanner/api/pom.xml
opendaylight/northbound/bundlescanner/implementation/pom.xml
opendaylight/northbound/commons/pom.xml
opendaylight/northbound/connectionmanager/pom.xml
opendaylight/northbound/containermanager/pom.xml
opendaylight/northbound/controllermanager/pom.xml
opendaylight/northbound/flowprogrammer/pom.xml
opendaylight/northbound/hosttracker/pom.xml
opendaylight/northbound/httpservice-bridge/pom.xml
opendaylight/northbound/jolokia/pom.xml
opendaylight/northbound/networkconfiguration/bridgedomain/pom.xml
opendaylight/northbound/networkconfiguration/neutron/pom.xml
opendaylight/northbound/staticrouting/pom.xml
opendaylight/northbound/statistics/pom.xml
opendaylight/northbound/subnets/pom.xml
opendaylight/northbound/switchmanager/pom.xml
opendaylight/northbound/topology/pom.xml
opendaylight/northbound/usermanager/pom.xml
opendaylight/protocol_plugins/openflow/pom.xml
opendaylight/protocol_plugins/stub/pom.xml
opendaylight/routing/dijkstra_implementation/pom.xml
opendaylight/sal/api/pom.xml
opendaylight/sal/connection/api/pom.xml
opendaylight/sal/connection/implementation/pom.xml
opendaylight/sal/implementation/pom.xml
opendaylight/sal/networkconfiguration/api/pom.xml
opendaylight/sal/networkconfiguration/implementation/pom.xml
opendaylight/samples/loadbalancer/pom.xml
opendaylight/samples/northbound/loadbalancer/pom.xml
opendaylight/samples/simpleforwarding/pom.xml
opendaylight/security/pom.xml
opendaylight/statisticsmanager/api/pom.xml
opendaylight/statisticsmanager/implementation/pom.xml
opendaylight/switchmanager/api/pom.xml
opendaylight/switchmanager/implementation/pom.xml
opendaylight/topologymanager/implementation/pom.xml
opendaylight/usermanager/api/pom.xml
opendaylight/usermanager/implementation/pom.xml
opendaylight/web/devices/pom.xml
opendaylight/web/flows/pom.xml
opendaylight/web/osgi-brandfragment/pom.xml
opendaylight/web/root/pom.xml
opendaylight/web/topology/pom.xml
opendaylight/web/troubleshoot/pom.xml

index f07c855..e74e3cb 100644 (file)
@@ -35,7 +35,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
@@ -48,7 +47,6 @@
                             org.apache.felix.dm,</Import-Package>
             <Export-Package>org.opendaylight.controller.appauth,
                             org.opendaylight.controller.appauth.authorization</Export-Package>
-            <Bundle-Activator></Bundle-Activator>
           </instructions>
         </configuration>
       </plugin>
index 8d62c1d..064d04c 100644 (file)
@@ -50,7 +50,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 3806421..3ff6bac 100644 (file)
@@ -24,7 +24,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 32c3d08..e030142 100644 (file)
@@ -24,6 +24,7 @@ package org.opendaylight.controller.clustering.services;
  * passed and so on.
  */
 public class CacheConfigException extends Exception {
+    private static final long serialVersionUID = 1L;
 
     /**
      * Instantiates a new cache config exception.
index 583de7c..70165cc 100644 (file)
@@ -23,6 +23,7 @@ package org.opendaylight.controller.clustering.services;
  * allocated already exists
  */
 public class CacheExistException extends Exception {
+    private static final long serialVersionUID = 1L;
 
     /**
      * Instantiates a new cache exist exception.
index 34ba41c..996e0a0 100644 (file)
@@ -21,6 +21,7 @@ package org.opendaylight.controller.clustering.services;
  * Listener being added fails for any reason
  */
 public class CacheListenerAddException extends Exception {
+    private static final long serialVersionUID = 1L;
 
     /**
      * Instantiates a new cache listener add exception.
index 523a134..dd2585b 100644 (file)
@@ -20,7 +20,9 @@ package org.opendaylight.controller.clustering.services;
  * @deprecated for internal use
  * The Class ListenRoleChangeAddException.
  */
+@Deprecated
 public class ListenRoleChangeAddException extends Exception {
+    private static final long serialVersionUID = 1L;
 
     /**
      * Instantiates a new listen role change add exception.
index 4acfae0..8d3f53b 100644 (file)
@@ -63,7 +63,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
@@ -75,9 +74,8 @@
               !org.hornetq.*,
               !org.jboss.*,
               javax.transaction,
-              *,
               org.opendaylight.controller.clustering.services,
-              org.opendaylight.controller.sal.core</Import-Package>
+              org.opendaylight.controller.sal.core,*</Import-Package>
             <Bundle-Activator>org.opendaylight.controller.clustering.services_implementation.internal.Activator</Bundle-Activator>
             <!-- Add in the DynamicImport-Package ONLY the packages that -->
             <!-- contains types that MUST be unmarshalled by the -->
index 7a0c137..6a0b308 100644 (file)
@@ -31,7 +31,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 02a231b..9021c94 100644 (file)
@@ -60,7 +60,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 076ec05..51f8128 100644 (file)
@@ -12,6 +12,7 @@ package org.opendaylight.controller.clustering.test.internal;
 import java.io.Serializable;
 
 public class ComplexClass implements IComplex, Serializable {
+    private static final long serialVersionUID = 1L;
     private String identity;
 
     public ComplexClass(String i) {
index fda2ff1..876fb65 100644 (file)
@@ -12,6 +12,7 @@ package org.opendaylight.controller.clustering.test.internal;
 import java.io.Serializable;
 
 public class ComplexClass1 implements IComplex, Serializable {
+    private static final long serialVersionUID = 1L;
     private String identity;
 
     public ComplexClass1(String i) {
index adc062d..d07c192 100644 (file)
@@ -12,9 +12,10 @@ package org.opendaylight.controller.clustering.test.internal;
 import java.io.Serializable;
 
 public class ComplexContainer implements Serializable {
-    private IComplex f;
-    private IComplex f1;
-    private Integer state;
+    private static final long serialVersionUID = 1L;
+    private final IComplex f;
+    private final IComplex f1;
+    private final Integer state;
 
     public ComplexContainer(String i, Integer s) {
         this.state = s;
index 39ef1b0..7cdb032 100644 (file)
@@ -12,6 +12,7 @@ package org.opendaylight.controller.clustering.test.internal;
 import java.io.Serializable;
 
 public class StringContainer implements Serializable {
+    private static final long serialVersionUID = 1L;
     private String mystring;
 
     public StringContainer() {
index de263cb..01dd61a 100644 (file)
@@ -23,7 +23,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index f068fde..07d3cdd 100644 (file)
@@ -38,7 +38,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 4c545d9..aaab66d 100644 (file)
@@ -22,7 +22,7 @@
     <asm.version>4.1</asm.version>
     <!-- Plugin Versions -->
     <bouncycastle.version>1.50</bouncycastle.version>
-    <bundle.plugin.version>2.3.7</bundle.plugin.version>
+    <bundle.plugin.version>2.4.0</bundle.plugin.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>
             <configFile>enunciate.xml</configFile>
           </configuration>
           <dependencies>
-            <dependency>
-              <groupId>org.opendaylight.controller</groupId>
-              <artifactId>commons.logback_settings</artifactId>
-              <version>0.0.2-SNAPSHOT</version>
-            </dependency>
             <dependency>
               <groupId>org.codehaus.enunciate</groupId>
               <artifactId>enunciate-swagger</artifactId>
               <version>${enunciate.version}</version>
             </dependency>
+            <dependency>
+              <groupId>org.opendaylight.controller</groupId>
+              <artifactId>commons.logback_settings</artifactId>
+              <version>0.0.2-SNAPSHOT</version>
+            </dependency>
           </dependencies>
           <executions>
             <execution>
index 9e0aef3..6139401 100644 (file)
       <plugin>
         <groupId>org.jacoco</groupId>
         <artifactId>jacoco-maven-plugin</artifactId>
-        <version>${jacoco.version}</version>
         <executions>
           <execution>
             <goals>
index fbc507d..051b1a7 100644 (file)
@@ -1,7 +1,7 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory;
 
-import com.google.common.base.Joiner;
-import com.google.common.base.Optional;
+import java.util.LinkedHashMap;
+
 import org.opendaylight.controller.config.api.DependencyResolver;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
@@ -11,7 +11,8 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.Generated
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.JavaFileInputBuilder;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.TypeName;
 
-import java.util.LinkedHashMap;
+import com.google.common.base.Joiner;
+import com.google.common.base.Optional;
 
 public class ConcreteModuleGeneratedObjectFactory {
 
@@ -46,12 +47,10 @@ public class ConcreteModuleGeneratedObjectFactory {
     }
 
     private static String getNewCtor(FullyQualifiedName fqn) {
-        LinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>(){
-            {
-                put(ModuleIdentifier.class.getCanonicalName(), "identifier");
-                put(DependencyResolver.class.getCanonicalName(), "dependencyResolver");
-            }
-        };
+        LinkedHashMap<String, String> parameters = new LinkedHashMap<>();
+        parameters.put(ModuleIdentifier.class.getCanonicalName(), "identifier");
+        parameters.put(DependencyResolver.class.getCanonicalName(), "dependencyResolver");
+
         StringBuilder stringBuilder = getCtor(fqn, parameters);
         return stringBuilder.toString();
     }
@@ -72,14 +71,11 @@ public class ConcreteModuleGeneratedObjectFactory {
     }
 
     private static String getCopyCtor(final FullyQualifiedName fqn) {
-        LinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>(){
-            {
-                put(ModuleIdentifier.class.getCanonicalName(), "identifier");
-                put(DependencyResolver.class.getCanonicalName(), "dependencyResolver");
-                put(fqn.toString(), "oldModule");
-                put(AutoCloseable.class.getCanonicalName(), "oldInstance");
-            }
-        };
+        LinkedHashMap<String, String> parameters = new LinkedHashMap<>();
+        parameters.put(ModuleIdentifier.class.getCanonicalName(), "identifier");
+        parameters.put(DependencyResolver.class.getCanonicalName(), "dependencyResolver");
+        parameters.put(fqn.toString(), "oldModule");
+        parameters.put(AutoCloseable.class.getCanonicalName(), "oldInstance");
         StringBuilder stringBuilder = getCtor(fqn, parameters);
         return stringBuilder.toString();
     }
index 265aea1..bcc55a2 100644 (file)
@@ -4,14 +4,11 @@ import com.google.common.base.Joiner;
 import com.google.common.base.Optional;
 import com.google.common.base.Splitter;
 import com.google.common.base.Strings;
-import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-import java.io.InputStream;
 import java.util.List;
 import java.util.regex.Pattern;
 
@@ -61,13 +58,18 @@ public class StringUtil {
 
 
     public static Optional<String> loadCopyright() {
-        try (InputStream in = StringUtil.class.getResourceAsStream("/copyright.txt")) {
-            if (in != null) {
-                return Optional.of(IOUtils.toString(in));
+        /*
+         * FIXME: BUG-980: this is a nice feature, but the copyright needs to come
+         *        from the project being processed, not this one.
+            try (InputStream in = StringUtil.class.getResourceAsStream("/copyright.txt")) {
+                if (in != null) {
+                    return Optional.of(IOUtils.toString(in));
+                }
+            } catch (IOException e) {
+                logger.warn("Cannot load copyright.txt", e);
             }
-        } catch (IOException e) {
-            logger.warn("Cannot load copyright.txt", e);
-        }
+
+        */
         return Optional.absent();
     }
 
diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/copyright.txt b/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/copyright.txt
deleted file mode 100644 (file)
index 4a0c355..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
-
-This program and the accompanying materials are made available under the
-terms of the Eclipse Public License v1.0 which accompanies this distribution,
-and is available at http://www.eclipse.org/legal/epl-v10.html
index b0217a4..1ad0207 100644 (file)
@@ -1,5 +1,6 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.util;
 
+import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName;
 
@@ -24,6 +25,7 @@ public class StringUtilTest {
     }
 
     @Test
+    @Ignore
     public void testCopyright() throws IOException {
         assertTrue(StringUtil.loadCopyright().isPresent());
     }
index 992e4b0..ef27bfd 100644 (file)
@@ -23,7 +23,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index b6d2229..a4a7ba6 100644 (file)
@@ -35,7 +35,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index b3a427a..c4ced04 100644 (file)
@@ -27,7 +27,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 5adcc89..8be119d 100644 (file)
@@ -39,7 +39,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 5bfeded..a19e271 100644 (file)
@@ -27,7 +27,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index b7b9e0a..3ead8be 100644 (file)
@@ -43,7 +43,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 2727f77..a3f140d 100644 (file)
@@ -35,7 +35,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 221866f..72ce89d 100644 (file)
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
           <artifactId>binding-generator-impl</artifactId>
-          <version>${yangtools.version}</version>
         </dependency>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
           <artifactId>binding-generator-spi</artifactId>
-          <version>${yangtools.version}</version>
         </dependency>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
           <artifactId>binding-generator-util</artifactId>
-          <version>${yangtools.version}</version>
         </dependency>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
           <artifactId>binding-type-provider</artifactId>
-          <version>${yangtools.version}</version>
         </dependency>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
           <artifactId>yang-parser-api</artifactId>
-          <version>${yangtools.version}</version>
         </dependency>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
           <artifactId>yang-parser-impl</artifactId>
-          <version>${yangtools.version}</version>
         </dependency>
         <!-- yang model dependencies -->
         <dependency>
index 893776c..793e835 100644 (file)
@@ -23,7 +23,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 68921ab..6d90eb3 100644 (file)
@@ -22,7 +22,6 @@
           <instructions>
             <Import-Package>*</Import-Package>
             <Export-Package>org.eclipse.osgi.framework.console</Export-Package>
-            <Bundle-Activator></Bundle-Activator>
           </instructions>
         </configuration>
       </plugin>
index 6a73a21..37c0a3a 100644 (file)
@@ -39,7 +39,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 82f5f9b..b6e1dd6 100644 (file)
@@ -35,7 +35,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index a5a15f6..f87bed8 100644 (file)
@@ -55,7 +55,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index d8f31ca..b48d7ab 100644 (file)
@@ -26,7 +26,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 9da62bd..cb09322 100644 (file)
@@ -58,7 +58,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 1dec4e5..240976b 100644 (file)
@@ -38,7 +38,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index aaaf3ab..036dd5d 100644 (file)
@@ -62,7 +62,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 26fd11c..82bc6cd 100644 (file)
@@ -43,7 +43,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index d434444..c4c1ee9 100644 (file)
@@ -178,7 +178,7 @@ public final class NodeMapping {
         nodeConnectorId = new NodeConnectorId(Arguments.<String>checkInstanceOf(nodeConnector.getID(), String.class));
     }
     final NodeConnectorKey connectorKey = new NodeConnectorKey(nodeConnectorId);
-    final InstanceIdentifier<NodeConnector> path = InstanceIdentifier.builder(nodePath).child(NODECONNECTOR_CLASS, connectorKey).toInstance();
+    final InstanceIdentifier<NodeConnector> path = nodePath.child(NODECONNECTOR_CLASS, connectorKey);
     return new NodeConnectorRef(path);
   }
 
index edc9bf0..a13d2bb 100644 (file)
       <plugin>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yang-maven-plugin</artifactId>
-        <version>${yangtools.version}</version>
         <dependencies>
           <dependency>
             <groupId>org.opendaylight.controller</groupId>
index fa48416..2a866a9 100644 (file)
@@ -96,8 +96,12 @@ public abstract class AbstractForwardedDataBroker implements Delegator<DOMDataBr
         for (Map.Entry<org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, ? extends NormalizedNode<?, ?>> entry : normalized
                 .entrySet()) {
             try {
-                Entry<InstanceIdentifier<? extends DataObject>, DataObject> binding = getCodec().toBinding(entry);
-                newMap.put(binding.getKey(), binding.getValue());
+                Optional<Entry<InstanceIdentifier<? extends DataObject>, DataObject>> potential = getCodec().toBinding(
+                        entry);
+                if (potential.isPresent()) {
+                    Entry<InstanceIdentifier<? extends DataObject>, DataObject> binding = potential.get();
+                    newMap.put(binding.getKey(), binding.getValue());
+                }
             } catch (DeserializationException e) {
                 LOG.warn("Failed to transform {}, omitting it", entry, e);
             }
@@ -110,8 +114,11 @@ public abstract class AbstractForwardedDataBroker implements Delegator<DOMDataBr
         Set<InstanceIdentifier<?>> hashSet = new HashSet<>();
         for (org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalizedPath : normalized) {
             try {
-                InstanceIdentifier<? extends DataObject> binding = getCodec().toBinding(normalizedPath);
-                hashSet.add(binding);
+                Optional<InstanceIdentifier<? extends DataObject>> potential = getCodec().toBinding(normalizedPath);
+                if (potential.isPresent()) {
+                    InstanceIdentifier<? extends DataObject> binding = potential.get();
+                    hashSet.add(binding);
+                }
             } catch (DeserializationException e) {
                 LOG.warn("Failed to transform {}, omitting it", normalizedPath, e);
             }
@@ -120,7 +127,7 @@ public abstract class AbstractForwardedDataBroker implements Delegator<DOMDataBr
     }
 
     protected Optional<DataObject> toBindingData(final InstanceIdentifier<?> path, final NormalizedNode<?, ?> data) {
-        if(path.isWildcarded()) {
+        if (path.isWildcarded()) {
             return Optional.absent();
         }
 
@@ -207,7 +214,11 @@ public abstract class AbstractForwardedDataBroker implements Delegator<DOMDataBr
         @Override
         public DataObject getOriginalSubtree() {
             if (originalDataCache == null) {
-                originalDataCache = toBindingData(path, domEvent.getOriginalSubtree());
+                if(domEvent.getOriginalSubtree() != null) {
+                    originalDataCache = toBindingData(path, domEvent.getOriginalSubtree());
+                } else {
+                    originalDataCache = Optional.absent();
+                }
             }
             return originalDataCache.orNull();
         }
@@ -215,20 +226,23 @@ public abstract class AbstractForwardedDataBroker implements Delegator<DOMDataBr
         @Override
         public DataObject getUpdatedSubtree() {
             if (updatedDataCache == null) {
-                updatedDataCache = toBindingData(path, domEvent.getUpdatedSubtree());
+                if(domEvent.getUpdatedSubtree() != null) {
+                    updatedDataCache = toBindingData(path, domEvent.getUpdatedSubtree());
+                } else {
+                    updatedDataCache = Optional.absent();
+                }
             }
-
             return updatedDataCache.orNull();
         }
 
         @Override
         public String toString() {
             return Objects.toStringHelper(TranslatedDataChangeEvent.class) //
-                .add("created", getCreatedData()) //
-                .add("updated", getUpdatedData()) //
-                .add("removed", getRemovedPaths()) //
-                .add("dom", domEvent) //
-                .toString();
+                    .add("created", getCreatedData()) //
+                    .add("updated", getUpdatedData()) //
+                    .add("removed", getRemovedPaths()) //
+                    .add("dom", domEvent) //
+                    .toString();
         }
     }
 
index 6329637..53615ad 100644 (file)
@@ -16,6 +16,7 @@ import java.util.Map.Entry;
 import java.util.concurrent.Callable;
 
 import org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizationException;
+import org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizationOperation;
 import org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizer;
 import org.opendaylight.yangtools.concepts.util.ClassLoaderUtils;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
@@ -42,6 +43,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 
@@ -60,7 +62,8 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
     public org.opendaylight.yangtools.yang.data.api.InstanceIdentifier toNormalized(
             final InstanceIdentifier<? extends DataObject> binding) {
 
-        // Used instance-identifier codec do not support serialization of last path
+        // Used instance-identifier codec do not support serialization of last
+        // path
         // argument if it is Augmentation (behaviour expected by old datastore)
         // in this case, we explicitly check if last argument is augmentation
         // to process it separately
@@ -103,13 +106,24 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
 
     }
 
-    public InstanceIdentifier<? extends DataObject> toBinding(
+    /**
+     *
+     * Returns a Binding-Aware instance identifier from normalized
+     * instance-identifier if it is possible to create representation.
+     *
+     * Returns Optional.absent for cases where target is mixin node except
+     * augmentation.
+     *
+     */
+    public Optional<InstanceIdentifier<? extends DataObject>> toBinding(
             final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized)
             throws DeserializationException {
 
         PathArgument lastArgument = Iterables.getLast(normalized.getPath());
-        // Used instance-identifier codec do not support serialization of last path
-        // argument if it is AugmentationIdentifier (behaviour expected by old datastore)
+        // Used instance-identifier codec do not support serialization of last
+        // path
+        // argument if it is AugmentationIdentifier (behaviour expected by old
+        // datastore)
         // in this case, we explicitly check if last argument is augmentation
         // to process it separately
         if (lastArgument instanceof AugmentationIdentifier) {
@@ -118,46 +132,71 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
         return toBindingImpl(normalized);
     }
 
-    private InstanceIdentifier<? extends DataObject> toBindingAugmented(
-            final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized) throws DeserializationException {
-        InstanceIdentifier<? extends DataObject> potential = toBindingImpl(normalized);
+    private Optional<InstanceIdentifier<? extends DataObject>> toBindingAugmented(
+            final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized)
+            throws DeserializationException {
+        Optional<InstanceIdentifier<? extends DataObject>> potential = toBindingImpl(normalized);
         // Shorthand check, if codec already supports deserialization
         // of AugmentationIdentifier we will return
-        if(isAugmentationIdentifier(potential)) {
+        if (potential.isPresent() && isAugmentationIdentifier(potential.get())) {
             return potential;
         }
 
         AugmentationIdentifier lastArgument = (AugmentationIdentifier) Iterables.getLast(normalized.getPath());
 
-        // Here we employ small trick - Binding-aware Codec injects an pointer to augmentation class
-        // if child is referenced - so we will reference child and then shorten path.
+        // Here we employ small trick - Binding-aware Codec injects an pointer
+        // to augmentation class
+        // if child is referenced - so we will reference child and then shorten
+        // path.
         for (QName child : lastArgument.getPossibleChildNames()) {
             org.opendaylight.yangtools.yang.data.api.InstanceIdentifier childPath = new org.opendaylight.yangtools.yang.data.api.InstanceIdentifier(
-                    ImmutableList.<PathArgument> builder()
-                    .addAll(normalized.getPath()).add(new NodeIdentifier(child)).build());
+                    ImmutableList.<PathArgument> builder().addAll(normalized.getPath()).add(new NodeIdentifier(child))
+                            .build());
             try {
-
-                InstanceIdentifier<? extends DataObject> potentialPath = shortenToLastAugment(toBindingImpl(childPath));
-                return potentialPath;
+                if (!isChoiceOrCasePath(childPath)) {
+                    InstanceIdentifier<? extends DataObject> potentialPath = shortenToLastAugment(toBindingImpl(
+                            childPath).get());
+                    return Optional.<InstanceIdentifier<? extends DataObject>> of(potentialPath);
+                }
             } catch (Exception e) {
-                LOG.trace("Unable to deserialize aug. child path for {}",childPath,e);
+                LOG.trace("Unable to deserialize aug. child path for {}", childPath, e);
             }
         }
         return toBindingImpl(normalized);
     }
 
-    private InstanceIdentifier<? extends DataObject> toBindingImpl(
+    private Optional<InstanceIdentifier<? extends DataObject>> toBindingImpl(
             final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized)
             throws DeserializationException {
         org.opendaylight.yangtools.yang.data.api.InstanceIdentifier legacyPath;
+
         try {
+            if (isChoiceOrCasePath(normalized)) {
+                return Optional.absent();
+            }
             legacyPath = legacyToNormalized.toLegacy(normalized);
         } catch (DataNormalizationException e) {
             throw new IllegalStateException("Could not denormalize path.", e);
         }
         LOG.trace("InstanceIdentifier Path Deserialization: Legacy representation {}, Normalized representation: {}",
                 legacyPath, normalized);
-        return bindingToLegacy.fromDataDom(legacyPath);
+        return Optional.<InstanceIdentifier<? extends DataObject>> of(bindingToLegacy.fromDataDom(legacyPath));
+    }
+
+    private boolean isChoiceOrCasePath(final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized)
+            throws DataNormalizationException {
+        DataNormalizationOperation<?> op = findNormalizationOperation(normalized);
+        return op.isMixin() && op.getIdentifier() instanceof NodeIdentifier;
+    }
+
+    private DataNormalizationOperation<?> findNormalizationOperation(
+            final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized)
+            throws DataNormalizationException {
+        DataNormalizationOperation<?> current = legacyToNormalized.getRootOperation();
+        for (PathArgument arg : normalized.getPath()) {
+            current = current.getChild(arg);
+        }
+        return current;
     }
 
     private static final Entry<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<? extends DataObject>, DataObject> toEntry(
@@ -170,7 +209,7 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
     public DataObject toBinding(final InstanceIdentifier<?> path, final NormalizedNode<?, ?> normalizedNode)
             throws DeserializationException {
         CompositeNode legacy = null;
-        if(isAugmentationIdentifier(path) && normalizedNode instanceof AugmentationNode) {
+        if (isAugmentationIdentifier(path) && normalizedNode instanceof AugmentationNode) {
             QName augIdentifier = BindingReflections.findQName(path.getTargetType());
             ContainerNode virtualNode = Builders.containerBuilder() //
                     .withNodeIdentifier(new NodeIdentifier(augIdentifier)) //
@@ -188,12 +227,20 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
         return legacyToNormalized;
     }
 
-    public Entry<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<? extends DataObject>, DataObject> toBinding(
+    public Optional<Entry<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<? extends DataObject>, DataObject>> toBinding(
             final Entry<org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, ? extends NormalizedNode<?, ?>> normalized)
             throws DeserializationException {
-        InstanceIdentifier<? extends DataObject> bindingPath = toBinding(normalized.getKey());
-        DataObject bindingData = toBinding(bindingPath, normalized.getValue());
-        return toEntry(bindingPath, bindingData);
+        Optional<InstanceIdentifier<? extends DataObject>> potentialPath = toBinding(normalized.getKey());
+        if (potentialPath.isPresent()) {
+            InstanceIdentifier<? extends DataObject> bindingPath = potentialPath.get();
+            DataObject bindingData = toBinding(bindingPath, normalized.getValue());
+            if (bindingData == null) {
+                LOG.warn("Failed to deserialize {} to Binding format. Binding path is: {}", normalized, bindingPath);
+            }
+            return Optional.of(toEntry(bindingPath, bindingData));
+        } else {
+            return Optional.absent();
+        }
     }
 
     @Override
@@ -206,14 +253,17 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
         org.opendaylight.yangtools.yang.data.api.InstanceIdentifier processed = toNormalizedImpl(augPath);
         // If used instance identifier codec added supports for deserialization
         // of last AugmentationIdentifier we will just reuse it
-        if(isAugmentationIdentifier(processed)) {
+        if (isAugmentationIdentifier(processed)) {
             return processed;
         }
-        // Here we employ small trick - DataNormalizer injecst augmentation identifier if child is
-        // also part of the path (since using a child we can safely identify augmentation)
+        // Here we employ small trick - DataNormalizer injecst augmentation
+        // identifier if child is
+        // also part of the path (since using a child we can safely identify
+        // augmentation)
         // so, we scan augmentation for children add it to path
         // and use original algorithm, then shorten it to last augmentation
-        for (@SuppressWarnings("rawtypes") Class augChild : getAugmentationChildren(augPath.getTargetType())) {
+        for (@SuppressWarnings("rawtypes")
+        Class augChild : getAugmentationChildren(augPath.getTargetType())) {
             @SuppressWarnings("unchecked")
             InstanceIdentifier<?> childPath = augPath.child(augChild);
             org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized = toNormalizedImpl(childPath);
@@ -225,8 +275,6 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
         return processed;
     }
 
-
-
     private org.opendaylight.yangtools.yang.data.api.InstanceIdentifier shortenToLastAugmentation(
             final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized) {
         int position = 0;
@@ -248,7 +296,7 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
             final InstanceIdentifier<? extends DataObject> binding) {
         int position = 0;
         int foundPosition = -1;
-        for(org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument arg : binding.getPathArguments()) {
+        for (org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument arg : binding.getPathArguments()) {
             position++;
             if (isAugmentation(arg.getType())) {
                 foundPosition = position;
@@ -257,8 +305,6 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
         return InstanceIdentifier.create(Iterables.limit(binding.getPathArguments(), foundPosition));
     }
 
-
-
     private org.opendaylight.yangtools.yang.data.api.InstanceIdentifier toNormalizedImpl(
             final InstanceIdentifier<? extends DataObject> binding) {
         final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier legacyPath = bindingToLegacy
@@ -326,13 +372,12 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
         return InstanceIdentifier.create(wildArgs);
     }
 
-
     private static boolean isAugmentation(final Class<? extends DataObject> type) {
         return Augmentation.class.isAssignableFrom(type);
     }
 
-    private static boolean isAugmentationIdentifier(final InstanceIdentifier<?> path) {
-        return Augmentation.class.isAssignableFrom(path.getTargetType());
+    private static boolean isAugmentationIdentifier(final InstanceIdentifier<?> potential) {
+        return Augmentation.class.isAssignableFrom(potential.getTargetType());
     }
 
     private boolean isAugmentationIdentifier(final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier processed) {
index cf754cc..8276446 100644 (file)
@@ -7,9 +7,6 @@
  */
 package org.opendaylight.controller.sal.binding.codegen.impl;
 
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
-import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -18,13 +15,19 @@ import java.util.concurrent.RejectedExecutionHandler;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
+
 import javassist.ClassPool;
+
 import org.apache.commons.lang3.StringUtils;
 import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeGenerator;
 import org.opendaylight.controller.sal.binding.spi.NotificationInvokerFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+
 public class SingletonHolder {
     private static final Logger logger = LoggerFactory.getLogger(SingletonHolder.class);
 
@@ -69,6 +72,8 @@ public class SingletonHolder {
             // occurs in RejectedExecutionHandler.
             // This impl saturates threadpool first, then queue. When both are full caller will get blocked.
             BlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(queueSize) {
+                private static final long serialVersionUID = 1L;
+
                 @Override
                 public boolean offer(Runnable r) {
                     // ThreadPoolExecutor will spawn a new thread after core size is reached only if the queue.offer returns false.
index b147e03..6b2568a 100644 (file)
@@ -61,9 +61,8 @@ public class MultipleAugmentationPuts extends AbstractDataServiceTest implements
     private static final InstanceIdentifier<Nodes> NODES_INSTANCE_ID_BA = InstanceIdentifier.builder(Nodes.class) //
             .toInstance();
 
-    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = InstanceIdentifier
-            .builder(NODES_INSTANCE_ID_BA) //
-            .child(Node.class, NODE_KEY).toInstance();
+    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA =
+            NODES_INSTANCE_ID_BA.child(Node.class, NODE_KEY);
 
     private static final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier NODE_INSTANCE_ID_BI = //
     org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.builder() //
@@ -74,7 +73,7 @@ public class MultipleAugmentationPuts extends AbstractDataServiceTest implements
 
     /**
      * Test for Bug 148
-     * 
+     *
      * @throws Exception
      */
     @Test
@@ -111,12 +110,12 @@ public class MultipleAugmentationPuts extends AbstractDataServiceTest implements
 //        Node meterStatsNodeWithDuration = createTestNode(NodeMeterStatistics.class, nodeMeterStatistics(5, true));
 //        commitNodeAndVerifyTransaction(meterStatsNodeWithDuration);
 //
-//        
+//
 //        Node nodeWithUpdatedList = (Node) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
 //        AugmentationVerifier.from(nodeWithUpdatedList) //
 //                .assertHasAugmentation(FlowCapableNode.class) //
 //                .assertHasAugmentation(NodeMeterStatistics.class);
-//        
+//
 //        List<MeterStats> meterStats = nodeWithUpdatedList.getAugmentation(NodeMeterStatistics.class).getMeterStatistics().getMeterStats();
 //        assertNotNull(meterStats);
 //        assertFalse(meterStats.isEmpty());
index 61a73d6..c5dbdce 100644 (file)
@@ -30,10 +30,8 @@ public class ConcurrentImplicitCreateTest extends AbstractDataServiceTest {
     private static final NodeKey NODE_FOO_KEY = new NodeKey(new NodeId("foo"));
     private static final NodeKey NODE_BAR_KEY = new NodeKey(new NodeId("foo"));
     private static InstanceIdentifier<Nodes> NODES_PATH = InstanceIdentifier.builder(Nodes.class).build();
-    private static InstanceIdentifier<Node> NODE_FOO_PATH = InstanceIdentifier.builder(NODES_PATH)
-            .child(Node.class, NODE_FOO_KEY).build();
-    private static InstanceIdentifier<Node> NODE_BAR_PATH = InstanceIdentifier.builder(NODES_PATH)
-            .child(Node.class, NODE_FOO_KEY).build();
+    private static InstanceIdentifier<Node> NODE_FOO_PATH = NODES_PATH.child(Node.class, NODE_FOO_KEY);
+    private static InstanceIdentifier<Node> NODE_BAR_PATH = NODES_PATH.child(Node.class, NODE_FOO_KEY);
 
     @Test
     public void testConcurrentCreate() throws InterruptedException, ExecutionException {
index 0925e9b..800c1b4 100644 (file)
@@ -75,13 +75,13 @@ public class ListProcessingAndOrderingTest extends AbstractDataServiceTest {
     private static final UnorderedListKey UNORDERED_FOO_KEY = new UnorderedListKey("foo");
     private static final UnorderedListKey UNORDERED_BAR_KEY = new UnorderedListKey("bar");
 
-    private static final InstanceIdentifier<UnorderedList> UNORDERED_FOO_PATH = InstanceIdentifier.builder(UNORDERED_CONTAINER_PATH).child(UnorderedList.class,UNORDERED_FOO_KEY).build();
-    private static final InstanceIdentifier<UnorderedList> UNORDERED_BAR_PATH = InstanceIdentifier.builder(UNORDERED_CONTAINER_PATH).child(UnorderedList.class,UNORDERED_BAR_KEY).build();
+    private static final InstanceIdentifier<UnorderedList> UNORDERED_FOO_PATH = UNORDERED_CONTAINER_PATH.child(UnorderedList.class,UNORDERED_FOO_KEY);
+    private static final InstanceIdentifier<UnorderedList> UNORDERED_BAR_PATH = UNORDERED_CONTAINER_PATH.child(UnorderedList.class,UNORDERED_BAR_KEY);
 
     private static final OrderedListKey ORDERED_FOO_KEY = new OrderedListKey("foo");
     private static final OrderedListKey ORDERED_BAR_KEY = new OrderedListKey("bar");
-    private static final InstanceIdentifier<OrderedList> ORDERED_FOO_PATH = InstanceIdentifier.builder(ORDERED_CONTAINER_PATH).child(OrderedList.class,ORDERED_FOO_KEY).build();
-    private static final InstanceIdentifier<OrderedList> ORDERED_BAR_PATH = InstanceIdentifier.builder(ORDERED_CONTAINER_PATH).child(OrderedList.class,ORDERED_BAR_KEY).build();
+    private static final InstanceIdentifier<OrderedList> ORDERED_FOO_PATH = ORDERED_CONTAINER_PATH.child(OrderedList.class,ORDERED_FOO_KEY);
+    private static final InstanceIdentifier<OrderedList> ORDERED_BAR_PATH = ORDERED_CONTAINER_PATH.child(OrderedList.class,ORDERED_BAR_KEY);
 
 
     @Test
index 450ca1c..6b4cc57 100644 (file)
@@ -78,14 +78,12 @@ public class WildcardedDataChangeListenerTest extends AbstractDataServiceTest {
 
     private static final FlowKey FLOW_KEY = new FlowKey(new FlowId("test"));
 
-    private static final InstanceIdentifier<Flow> NODE_0_FLOW_PATH = InstanceIdentifier.builder(NODE_0_TABLE_PATH)
-            .child(Flow.class, FLOW_KEY).build();
+    private static final InstanceIdentifier<Flow> NODE_0_FLOW_PATH = NODE_0_TABLE_PATH.child(Flow.class, FLOW_KEY);
 
-    private static final InstanceIdentifier<Flow> NODE_1_FLOW_PATH = InstanceIdentifier.builder(NODE_1_TABLE_PATH)
-            .child(Flow.class, FLOW_KEY).build();
+    private static final InstanceIdentifier<Flow> NODE_1_FLOW_PATH = NODE_1_TABLE_PATH.child(Flow.class, FLOW_KEY);
 
-    private static final InstanceIdentifier<TableFeatures> NODE_0_TABLE_FEATURES_PATH = InstanceIdentifier
-            .builder(NODE_0_TABLE_PATH).child(TableFeatures.class, TABLE_FEATURES_KEY).build();
+    private static final InstanceIdentifier<TableFeatures> NODE_0_TABLE_FEATURES_PATH =
+            NODE_0_TABLE_PATH.child(TableFeatures.class, TABLE_FEATURES_KEY);
 
     private static final TableFeatures TABLE_FEATURES = new TableFeaturesBuilder()//
             .setKey(TABLE_FEATURES_KEY) //
index e893713..ccbd52f 100644 (file)
@@ -60,13 +60,11 @@ public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataCh
             .toInstance();
 
 
-    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = InstanceIdentifier//
-            .builder(NODES_INSTANCE_ID_BA) //
-            .child(Node.class, NODE_KEY).toInstance();
+    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = NODES_INSTANCE_ID_BA.child(Node.class, NODE_KEY);
 
 
-    private static final InstanceIdentifier<SupportedActions> SUPPORTED_ACTIONS_INSTANCE_ID_BA = InstanceIdentifier//
-            .builder(NODES_INSTANCE_ID_BA) //
+    private static final InstanceIdentifier<SupportedActions> SUPPORTED_ACTIONS_INSTANCE_ID_BA = //
+            NODES_INSTANCE_ID_BA.builder() //
             .child(Node.class, NODE_KEY) //
             .augmentation(FlowCapableNode.class) //
             .child(SupportedActions.class)
@@ -163,7 +161,7 @@ public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataCh
 
         NodeConnectorId ncId = new NodeConnectorId("openflow:1:bar");
         NodeConnectorKey nodeKey = new NodeConnectorKey(ncId );
-        InstanceIdentifier<NodeConnector> ncInstanceId = InstanceIdentifier.builder(NODE_INSTANCE_ID_BA).child(NodeConnector.class, nodeKey).toInstance();
+        InstanceIdentifier<NodeConnector> ncInstanceId = NODE_INSTANCE_ID_BA.child(NodeConnector.class, nodeKey);
         NodeConnectorBuilder ncBuilder = new NodeConnectorBuilder();
         ncBuilder.setId(ncId);
         ncBuilder.setKey(nodeKey);
index 023bd79..30c7af7 100644 (file)
@@ -7,7 +7,15 @@
  */
 package org.opendaylight.controller.sal.binding.test.bugfix;
 
-import com.google.common.collect.ImmutableSet;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
@@ -44,14 +52,7 @@ import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import com.google.common.collect.ImmutableSet;
 
 public class FlagsSerializationTest extends AbstractDataServiceTest {
 
@@ -65,7 +66,7 @@ public class FlagsSerializationTest extends AbstractDataServiceTest {
     private static final NodeKey NODE_KEY = new NodeKey(new NodeId(NODE_ID));
     private static final FlowKey FLOW_KEY = new FlowKey(new FlowId(FLOW_ID));
     private static final TableKey TABLE_KEY = new TableKey(TABLE_ID);
-    
+
     private static final Map<QName, Object> NODE_KEY_BI = Collections.<QName, Object> singletonMap(NODE_ID_QNAME,
             NODE_ID);
 
@@ -83,12 +84,12 @@ public class FlagsSerializationTest extends AbstractDataServiceTest {
 
 //    private static final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier FLOW_INSTANCE_ID_BI = //
 //    org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.builder() //
-//            
+//
 //            .node(Flows.QNAME) //
 //            .nodeWithKey(Flow.QNAME, FLOW_KEY_BI) //
 //            .toInstance();
     private static final InstanceIdentifier<? extends DataObject> FLOW_INSTANCE_ID_BA = //
-    InstanceIdentifier.builder(NODE_INSTANCE_ID_BA) //
+            NODE_INSTANCE_ID_BA.builder() //
             .augmentation(FlowCapableNode.class)
             .child(Table.class,TABLE_KEY)
             .child(Flow.class, FLOW_KEY) //
@@ -101,34 +102,34 @@ public class FlagsSerializationTest extends AbstractDataServiceTest {
         FlowModFlags checkOverlapFlags = new FlowModFlags(true,false,false,false,false);
         ImmutableSet<String> domCheckOverlapFlags = ImmutableSet.<String>of("CHECK_OVERLAP");
         testFlags(checkOverlapFlags,domCheckOverlapFlags);
-        
-        
-        
+
+
+
         FlowModFlags allFalseFlags = new FlowModFlags(false,false,false,false,false);
         ImmutableSet<String> domAllFalseFlags = ImmutableSet.<String>of();
         testFlags(allFalseFlags,domAllFalseFlags);
-        
+
         FlowModFlags allTrueFlags = new FlowModFlags(true,true,true,true,true);
         ImmutableSet<String> domAllTrueFlags = ImmutableSet.<String>of("CHECK_OVERLAP","NO_BYT_COUNTS", "NO_PKT_COUNTS", "RESET_COUNTS", "SEND_FLOW_REM");
         testFlags(allTrueFlags,domAllTrueFlags);
-        
+
         FlowModFlags nullFlags = null;
         ImmutableSet<String> domNullFlags = null;
         testFlags(null,null);
-        
-        
+
+
 
     }
 
     private void testFlags(FlowModFlags flagsToTest, ImmutableSet<String> domFlags) throws Exception {
         Flow flow = createFlow(flagsToTest);
         assertNotNull(flow);
-        
+
         CompositeNode domFlow = biDataService.readConfigurationData(mappingService.toDataDom(FLOW_INSTANCE_ID_BA));
-        
+
         assertNotNull(domFlow);
         org.opendaylight.yangtools.yang.data.api.Node<?> readedFlags = domFlow.getFirstSimpleByName(FLOW_FLAGS_QNAME);
-        
+
         if(domFlags != null) {
             assertNotNull(readedFlags);
             assertEquals(domFlags,readedFlags.getValue());
@@ -136,12 +137,12 @@ public class FlagsSerializationTest extends AbstractDataServiceTest {
             assertNull(readedFlags);
         }
         assertEquals(flagsToTest, flow.getFlags());
-        
+
         DataModificationTransaction transaction = baDataService.beginTransaction();
         transaction.removeConfigurationData(FLOW_INSTANCE_ID_BA);
         RpcResult<TransactionStatus> result = transaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
-           
+
     }
 
     private Flow createFlow(FlowModFlags flagsToTest) throws Exception {
@@ -158,12 +159,12 @@ public class FlagsSerializationTest extends AbstractDataServiceTest {
 
         flow.setKey(FLOW_KEY);
         flow.setMatch(match.build());
-        
+
         flow.setFlags(flagsToTest);
-        
+
         InstructionsBuilder instructions = new InstructionsBuilder();
         InstructionBuilder instruction = new InstructionBuilder();
-        
+
         instruction.setOrder(10);
         ApplyActionsBuilder applyActions = new ApplyActionsBuilder();
         List<Action> actionList = new ArrayList<>();
index 027a8ee..7f16320 100644 (file)
@@ -58,18 +58,18 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
     private static final InstanceIdentifier<Nodes> NODES_INSTANCE_ID_BA = InstanceIdentifier.builder(Nodes.class) //
             .toInstance();
 
-    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = InstanceIdentifier//
-            .builder(NODES_INSTANCE_ID_BA) //
+    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = //
+            NODES_INSTANCE_ID_BA.builder() //
             .child(Node.class, NODE_KEY).toInstance();
 
-    private static final InstanceIdentifier<SupportedActions> SUPPORTED_ACTIONS_INSTANCE_ID_BA = InstanceIdentifier//
-            .builder(NODES_INSTANCE_ID_BA) //
+    private static final InstanceIdentifier<SupportedActions> SUPPORTED_ACTIONS_INSTANCE_ID_BA = //
+            NODES_INSTANCE_ID_BA.builder() //
             .child(Node.class, NODE_KEY) //
             .augmentation(FlowCapableNode.class) //
             .child(SupportedActions.class).toInstance();
 
-    private static final InstanceIdentifier<FlowCapableNode> ALL_FLOW_CAPABLE_NODES = InstanceIdentifier //
-            .builder(NODES_INSTANCE_ID_BA) //
+    private static final InstanceIdentifier<FlowCapableNode> ALL_FLOW_CAPABLE_NODES = //
+            NODES_INSTANCE_ID_BA.builder() //
             .child(Node.class) //
             .augmentation(FlowCapableNode.class) //
             .build();
@@ -88,8 +88,8 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
             .nodeWithKey(Node.QNAME, NODE_KEY_BI) //
             .node(SUPPORTED_ACTIONS_QNAME) //
             .toInstance();
-    private static final InstanceIdentifier<FlowCapableNode> FLOW_AUGMENTATION_PATH = InstanceIdentifier //
-            .builder(NODE_INSTANCE_ID_BA) //
+    private static final InstanceIdentifier<FlowCapableNode> FLOW_AUGMENTATION_PATH =
+            NODE_INSTANCE_ID_BA.builder() //
             .augmentation(FlowCapableNode.class) //
             .build();
 
@@ -126,8 +126,8 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
         fnub.setDescription("Description Foo");
         fnub.setSoftware("JUnit emulated");
         FlowCapableNode fnu = fnub.build();
-        InstanceIdentifier<FlowCapableNode> augmentIdentifier = InstanceIdentifier.builder(NODE_INSTANCE_ID_BA)
-                .augmentation(FlowCapableNode.class).toInstance();
+        InstanceIdentifier<FlowCapableNode> augmentIdentifier = NODE_INSTANCE_ID_BA
+                .augmentation(FlowCapableNode.class);
         DataModificationTransaction augmentedTransaction = baDataService.beginTransaction();
         augmentedTransaction.putOperationalData(augmentIdentifier, fnu);
 
@@ -183,8 +183,8 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
         lastReceivedChangeEvent = SettableFuture.create();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
 
-        FlowCapableNode readedAugmentation = (FlowCapableNode) baDataService.readOperationalData(InstanceIdentifier
-                .builder(NODE_INSTANCE_ID_BA).augmentation(FlowCapableNode.class).toInstance());
+        FlowCapableNode readedAugmentation = (FlowCapableNode) baDataService.readOperationalData(
+                NODE_INSTANCE_ID_BA.augmentation(FlowCapableNode.class));
         assertNotNull(readedAugmentation);
 
         assertEquals(fnu.getHardware(), readedAugmentation.getHardware());
@@ -198,10 +198,10 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
 
     private void testPutNodeConnectorWithAugmentation() throws Exception {
         NodeConnectorKey ncKey = new NodeConnectorKey(new NodeConnectorId("test:0:0"));
-        InstanceIdentifier<NodeConnector> ncPath = InstanceIdentifier.builder(NODE_INSTANCE_ID_BA)
-                .child(NodeConnector.class, ncKey).toInstance();
-        InstanceIdentifier<FlowCapableNodeConnector> ncAugmentPath = InstanceIdentifier.builder(ncPath)
-                .augmentation(FlowCapableNodeConnector.class).toInstance();
+        InstanceIdentifier<NodeConnector> ncPath = NODE_INSTANCE_ID_BA
+                .child(NodeConnector.class, ncKey);
+        InstanceIdentifier<FlowCapableNodeConnector> ncAugmentPath = ncPath
+                .augmentation(FlowCapableNodeConnector.class);
 
         NodeConnectorBuilder nc = new NodeConnectorBuilder();
         nc.setKey(ncKey);
index 35b4e92..f7b81a4 100644 (file)
@@ -54,13 +54,11 @@ public class WriteParentReadChildTest extends AbstractDataServiceTest {
             .child(Node.class, NODE_KEY).toInstance();
 
     private static final InstanceIdentifier<Table> TABLE_INSTANCE_ID_BA = //
-    InstanceIdentifier.builder(NODE_INSTANCE_ID_BA) //
+            NODE_INSTANCE_ID_BA.builder() //
             .augmentation(FlowCapableNode.class).child(Table.class, TABLE_KEY).build();
 
     private static final InstanceIdentifier<? extends DataObject> FLOW_INSTANCE_ID_BA = //
-    InstanceIdentifier.builder(TABLE_INSTANCE_ID_BA) //
-            .child(Flow.class, FLOW_KEY) //
-            .toInstance();
+            TABLE_INSTANCE_ID_BA.child(Flow.class, FLOW_KEY);
     /**
      *
      * The scenario tests writing parent node, which also contains child items
@@ -103,11 +101,11 @@ public class WriteParentReadChildTest extends AbstractDataServiceTest {
         DataObject readedTable = baDataService.readConfigurationData(TABLE_INSTANCE_ID_BA);
         assertNotNull("Readed table should not be nul.", readedTable);
         assertTrue(readedTable instanceof Table);
-        
+
         DataObject readedFlow = baDataService.readConfigurationData(FLOW_INSTANCE_ID_BA);
         assertNotNull("Readed flow should not be null.",readedFlow);
         assertTrue(readedFlow instanceof Flow);
         assertEquals(flow, readedFlow);
 
     }
-}
\ No newline at end of file
+}
index 1661ff2..422b9cc 100644 (file)
@@ -110,16 +110,14 @@ public class ChangeOriginatedInDomBrokerTest extends AbstractDataServiceTest {
     private static final TableKey TABLE_KEY_BA = new TableKey((short) 0);
 
     private static final InstanceIdentifier<Flow> FLOWS_PATH_BA = //
-    InstanceIdentifier.builder(NODE_INSTANCE_ID_BA) //
+            NODE_INSTANCE_ID_BA.builder() //
             .augmentation(FlowCapableNode.class) //
             .child(Table.class, TABLE_KEY_BA) //
             .child(Flow.class) //
             .toInstance();
 
     private static final InstanceIdentifier<Flow> FLOW_INSTANCE_ID_BA = //
-    InstanceIdentifier.builder(FLOWS_PATH_BA.firstIdentifierOf(Table.class)) //
-            .child(Flow.class, FLOW_KEY) //
-            .toInstance();
+    FLOWS_PATH_BA.firstIdentifierOf(Table.class).child(Flow.class, FLOW_KEY);
 
     @Test
     public void simpleModifyOperation() throws Exception {
index 63094ef..9457051 100644 (file)
@@ -61,8 +61,8 @@ public class CrossBrokerMountPointTest {
             .child(Node.class, NODE_KEY).toInstance();
     private static GroupKey GROUP_KEY = new GroupKey(new GroupId(0L));
 
-    private static final InstanceIdentifier<GroupStatistics> GROUP_STATISTICS_ID_BA = InstanceIdentifier
-            .builder(NODE_INSTANCE_ID_BA).augmentation(FlowCapableNode.class) //
+    private static final InstanceIdentifier<GroupStatistics> GROUP_STATISTICS_ID_BA = NODE_INSTANCE_ID_BA
+            .builder().augmentation(FlowCapableNode.class) //
             .child(Group.class, GROUP_KEY) //
             .augmentation(NodeGroupStatistics.class) //
             .child(GroupStatistics.class) //
index a7952ac..375376f 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * 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.dom.store.impl;
 
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
index 3dfca40..af47974 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * 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.dom.store.impl;
 
 import java.util.Collections;
index 9961fcc..11028dc 100644 (file)
@@ -16,7 +16,6 @@ import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
 import com.google.common.base.Optional;
-import com.google.common.primitives.UnsignedLong;
 
 class DataAndMetadataSnapshot {
 
@@ -39,22 +38,14 @@ class DataAndMetadataSnapshot {
 
     public static DataAndMetadataSnapshot createEmpty(final NodeIdentifier rootNode) {
         NormalizedNode<?, ?> data = Builders.containerBuilder().withNodeIdentifier(rootNode).build();
-        StoreMetadataNode metadata = StoreMetadataNode.builder()
-                .setNodeVersion(UnsignedLong.ZERO)
-                .setSubtreeVersion(UnsignedLong.ZERO)
-                .setData(data)
-                .build();
+        StoreMetadataNode metadata = StoreMetadataNode.createEmpty(data);
         return new DataAndMetadataSnapshot(metadata,Optional.<SchemaContext>absent());
     }
 
     public static DataAndMetadataSnapshot createEmpty(final SchemaContext ctx) {
         NodeIdentifier rootNodeIdentifier = new NodeIdentifier(ctx.getQName());
         NormalizedNode<?, ?> data = Builders.containerBuilder().withNodeIdentifier(rootNodeIdentifier).build();
-        StoreMetadataNode metadata = StoreMetadataNode.builder()
-                .setData(data)
-                .setNodeVersion(UnsignedLong.ZERO)
-                .setSubtreeVersion(UnsignedLong.ZERO)
-                .build();
+        StoreMetadataNode metadata = StoreMetadataNode.createEmpty(data);
         return new DataAndMetadataSnapshot(metadata, Optional.of(ctx));
     }
 
index d3a892a..d8f0240 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * 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.dom.store.impl;
 
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
@@ -6,17 +13,11 @@ import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
-public interface DataChangeListenerRegistration<L extends AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>>
-extends ListenerRegistration<L> {
-
-
+public interface DataChangeListenerRegistration<L extends AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>> extends ListenerRegistration<L> {
     @Override
-    public L getInstance();
+    L getInstance();
 
     InstanceIdentifier getPath();
 
     DataChangeScope getScope();
-
-
-
 }
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DataPreconditionFailedException.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DataPreconditionFailedException.java
new file mode 100644 (file)
index 0000000..6baf764
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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.dom.store.impl;
+
+import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+
+public class DataPreconditionFailedException extends Exception {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = 596430355175413427L;
+    private final InstanceIdentifier path;
+
+    public DataPreconditionFailedException(final InstanceIdentifier path) {
+        this.path = path;
+    }
+
+    public DataPreconditionFailedException(final InstanceIdentifier path,final String message) {
+        super(message);
+        this.path = path;
+    }
+
+
+    public DataPreconditionFailedException(final InstanceIdentifier path,final Throwable cause) {
+        super(cause);
+        this.path = path;
+    }
+
+    public DataPreconditionFailedException(final InstanceIdentifier path,final String message, final Throwable cause) {
+        super(message, cause);
+        this.path = path;
+    }
+
+    public DataPreconditionFailedException(final InstanceIdentifier path,final String message, final Throwable cause, final boolean enableSuppression,
+            final boolean writableStackTrace) {
+        super(message, cause, enableSuppression, writableStackTrace);
+        this.path = path;
+    }
+
+    public InstanceIdentifier getPath() {
+        return path;
+    }
+
+}
index 0a2b66c..005e3b7 100644 (file)
@@ -54,7 +54,6 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
     private static final Logger LOG = LoggerFactory.getLogger(InMemoryDOMDataStore.class);
     private static final InstanceIdentifier PUBLIC_ROOT_PATH = InstanceIdentifier.builder().build();
 
-
     private final ListeningExecutorService executor;
     private final String name;
     private final AtomicLong txCounter = new AtomicLong(0);
@@ -104,15 +103,15 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
             final InstanceIdentifier path, final L listener, final DataChangeScope scope) {
 
         /*
-         * Make sure commit is not occurring right now. Listener has to be registered and its
-         * state capture enqueued at a consistent point.
+         * Make sure commit is not occurring right now. Listener has to be
+         * registered and its state capture enqueued at a consistent point.
          *
-         * FIXME: improve this to read-write lock, such that multiple listener registrations
-         *        can occur simultaneously
+         * FIXME: improve this to read-write lock, such that multiple listener
+         * registrations can occur simultaneously
          */
         final DataChangeListenerRegistration<L> reg;
         synchronized (this) {
-            LOG.debug("{}: Registering data change listener {} for {}",name,listener,path);
+            LOG.debug("{}: Registering data change listener {} for {}", name, listener, path);
 
             reg = listenerTree.registerDataChangeListener(path, listener, scope);
 
@@ -138,9 +137,8 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
         };
     }
 
-    private synchronized DOMStoreThreePhaseCommitCohort submit(
-            final SnapshotBackedWriteTransaction writeTx) {
-        LOG.debug("Tx: {} is submitted. Modifications: {}",writeTx.getIdentifier(),writeTx.getMutatedView());
+    private synchronized DOMStoreThreePhaseCommitCohort submit(final SnapshotBackedWriteTransaction writeTx) {
+        LOG.debug("Tx: {} is submitted. Modifications: {}", writeTx.getIdentifier(), writeTx.getMutatedView());
         return new ThreePhaseCommitImpl(writeTx);
     }
 
@@ -148,12 +146,13 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
         return name + "-" + txCounter.getAndIncrement();
     }
 
-    private void commit(final DataAndMetadataSnapshot currentSnapshot,
-            final StoreMetadataNode newDataTree, final ResolveDataChangeEventsTask listenerResolver) {
-        LOG.debug("Updating Store snaphot version: {} with version:{}",currentSnapshot.getMetadataTree().getSubtreeVersion(),newDataTree.getSubtreeVersion());
+    private void commit(final DataAndMetadataSnapshot currentSnapshot, final StoreMetadataNode newDataTree,
+            final ResolveDataChangeEventsTask listenerResolver) {
+        LOG.debug("Updating Store snaphot version: {} with version:{}", currentSnapshot.getMetadataTree()
+                .getSubtreeVersion(), newDataTree.getSubtreeVersion());
 
-        if(LOG.isTraceEnabled()) {
-            LOG.trace("Data Tree is {}",StoreUtils.toStringTree(newDataTree));
+        if (LOG.isTraceEnabled()) {
+            LOG.trace("Data Tree is {}", StoreUtils.toStringTree(newDataTree));
         }
 
         final DataAndMetadataSnapshot newSnapshot = DataAndMetadataSnapshot.builder() //
@@ -162,14 +161,15 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
                 .build();
 
         /*
-         * The commit has to occur atomically with regard to listener registrations.
+         * The commit has to occur atomically with regard to listener
+         * registrations.
          */
         synchronized (this) {
             final boolean success = snapshot.compareAndSet(currentSnapshot, newSnapshot);
             checkState(success, "Store snapshot and transaction snapshot differ. This should never happen.");
 
             for (ChangeListenerNotifyTask task : listenerResolver.call()) {
-                LOG.trace("Scheduling invocation of listeners: {}",task);
+                LOG.trace("Scheduling invocation of listeners: {}", task);
                 executor.submit(task);
             }
         }
@@ -195,7 +195,8 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
         /**
          * Add class-specific toString attributes.
          *
-         * @param toStringHelper ToStringHelper instance
+         * @param toStringHelper
+         *            ToStringHelper instance
          * @return ToStringHelper instance which was passed in
          */
         protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
@@ -203,13 +204,15 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
         }
     }
 
-    private static class SnapshotBackedReadTransaction extends AbstractDOMStoreTransaction implements DOMStoreReadTransaction {
+    private static class SnapshotBackedReadTransaction extends AbstractDOMStoreTransaction implements
+            DOMStoreReadTransaction {
         private DataAndMetadataSnapshot stableSnapshot;
 
         public SnapshotBackedReadTransaction(final Object identifier, final DataAndMetadataSnapshot snapshot) {
             super(identifier);
             this.stableSnapshot = Preconditions.checkNotNull(snapshot);
-            LOG.debug("ReadOnly Tx: {} allocated with snapshot {}", identifier, snapshot.getMetadataTree().getSubtreeVersion());
+            LOG.debug("ReadOnly Tx: {} allocated with snapshot {}", identifier, snapshot.getMetadataTree()
+                    .getSubtreeVersion());
         }
 
         @Override
@@ -226,7 +229,8 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
         }
     }
 
-    private static class SnapshotBackedWriteTransaction extends AbstractDOMStoreTransaction implements DOMStoreWriteTransaction {
+    private static class SnapshotBackedWriteTransaction extends AbstractDOMStoreTransaction implements
+            DOMStoreWriteTransaction {
         private MutableDataTree mutableTree;
         private InMemoryDOMDataStore store;
         private boolean ready = false;
@@ -236,7 +240,8 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
             super(identifier);
             mutableTree = MutableDataTree.from(snapshot, applyOper);
             this.store = store;
-            LOG.debug("Write Tx: {} allocated with snapshot {}",identifier,snapshot.getMetadataTree().getSubtreeVersion());
+            LOG.debug("Write Tx: {} allocated with snapshot {}", identifier, snapshot.getMetadataTree()
+                    .getSubtreeVersion());
         }
 
         @Override
@@ -250,11 +255,11 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
         public void write(final InstanceIdentifier path, final NormalizedNode<?, ?> data) {
             checkNotReady();
             try {
-                LOG.trace("Tx: {} Write: {}:{}",getIdentifier(),path,data);
+                LOG.trace("Tx: {} Write: {}:{}", getIdentifier(), path, data);
                 mutableTree.write(path, data);
-              // FIXME: Add checked exception
+                // FIXME: Add checked exception
             } catch (Exception e) {
-                LOG.error("Tx: {}, failed to write {}:{} in {}",getIdentifier(),path,data,mutableTree,e);
+                LOG.error("Tx: {}, failed to write {}:{} in {}", getIdentifier(), path, data, mutableTree, e);
             }
         }
 
@@ -262,11 +267,11 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
         public void merge(final InstanceIdentifier path, final NormalizedNode<?, ?> data) {
             checkNotReady();
             try {
-                LOG.trace("Tx: {} Merge: {}:{}",getIdentifier(),path,data);
+                LOG.trace("Tx: {} Merge: {}:{}", getIdentifier(), path, data);
                 mutableTree.merge(path, data);
-              // FIXME: Add checked exception
+                // FIXME: Add checked exception
             } catch (Exception e) {
-                LOG.error("Tx: {}, failed to write {}:{} in {}",getIdentifier(),path,data,mutableTree,e);
+                LOG.error("Tx: {}, failed to write {}:{} in {}", getIdentifier(), path, data, mutableTree, e);
             }
         }
 
@@ -274,11 +279,11 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
         public void delete(final InstanceIdentifier path) {
             checkNotReady();
             try {
-                LOG.trace("Tx: {} Delete: {}",getIdentifier(),path);
+                LOG.trace("Tx: {} Delete: {}", getIdentifier(), path);
                 mutableTree.delete(path);
-             // FIXME: Add checked exception
+                // FIXME: Add checked exception
             } catch (Exception e) {
-                LOG.error("Tx: {}, failed to delete {} in {}",getIdentifier(),path,mutableTree,e);
+                LOG.error("Tx: {}, failed to delete {} in {}", getIdentifier(), path, mutableTree, e);
             }
         }
 
@@ -320,11 +325,11 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
 
         @Override
         public ListenableFuture<Optional<NormalizedNode<?, ?>>> read(final InstanceIdentifier path) {
-            LOG.trace("Tx: {} Read: {}",getIdentifier(),path);
+            LOG.trace("Tx: {} Read: {}", getIdentifier(), path);
             try {
                 return Futures.immediateFuture(getMutatedView().read(path));
             } catch (Exception e) {
-                LOG.error("Tx: {} Failed Read of {}",getIdentifier(),path,e);
+                LOG.error("Tx: {} Failed Read of {}", getIdentifier(), path, e);
                 throw e;
             }
         }
@@ -353,9 +358,16 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
 
                 @Override
                 public Boolean call() throws Exception {
-                    boolean applicable = snapshotOperation.isApplicable(modification,
+                    Boolean applicable = false;
+                    try {
+                        snapshotOperation.checkApplicable(PUBLIC_ROOT_PATH, modification,
                             Optional.of(snapshotCapture.getMetadataTree()));
-                    LOG.debug("Store Transcation: {} : canCommit : {}", transaction.getIdentifier(), applicable);
+                        applicable = true;
+                    } catch (DataPreconditionFailedException e) {
+                        LOG.warn("Store Tx: {} Data Precondition failed for {}.",transaction.getIdentifier(),e.getPath(),e);
+                        applicable = false;
+                    }
+                    LOG.debug("Store Transaction: {} : canCommit : {}", transaction.getIdentifier(), applicable);
                     return applicable;
                 }
             });
@@ -364,13 +376,11 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
         @Override
         public ListenableFuture<Void> preCommit() {
             storeSnapshot = snapshot.get();
-            if(modification.getModificationType() == ModificationType.UNMODIFIED) {
+            if (modification.getModificationType() == ModificationType.UNMODIFIED) {
                 return Futures.immediateFuture(null);
             }
             return executor.submit(new Callable<Void>() {
 
-
-
                 @Override
                 public Void call() throws Exception {
                     StoreMetadataNode metadataTree = storeSnapshot.getMetadataTree();
@@ -399,14 +409,14 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
 
         @Override
         public ListenableFuture<Void> commit() {
-            if(modification.getModificationType() == ModificationType.UNMODIFIED) {
+            if (modification.getModificationType() == ModificationType.UNMODIFIED) {
                 return Futures.immediateFuture(null);
             }
 
-            checkState(proposedSubtree != null,"Proposed subtree must be computed");
-            checkState(storeSnapshot != null,"Proposed subtree must be computed");
+            checkState(proposedSubtree != null, "Proposed subtree must be computed");
+            checkState(storeSnapshot != null, "Proposed subtree must be computed");
             // return ImmediateFuture<>;
-            InMemoryDOMDataStore.this.commit(storeSnapshot, proposedSubtree.get(),listenerResolver);
+            InMemoryDOMDataStore.this.commit(storeSnapshot, proposedSubtree.get(), listenerResolver);
             return Futures.<Void> immediateFuture(null);
         }
 
@@ -421,7 +431,7 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
         }
 
         @Override
-        public boolean isApplicable(final NodeModification modification, final Optional<StoreMetadataNode> storeMetadata) {
+        public void checkApplicable(final InstanceIdentifier path,final NodeModification modification, final Optional<StoreMetadataNode> storeMetadata) {
             throw new IllegalStateException("Schema Context is not available.");
         }
 
index d02f110..361be68 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.controller.md.sal.dom.store.impl;
 import org.opendaylight.controller.md.sal.dom.store.impl.tree.NodeModification;
 import org.opendaylight.controller.md.sal.dom.store.impl.tree.StoreMetadataNode;
 import org.opendaylight.controller.md.sal.dom.store.impl.tree.StoreTreeNode;
+import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
 
 import com.google.common.base.Optional;
@@ -59,17 +60,6 @@ public interface ModificationApplyOperation extends StoreTreeNode<ModificationAp
      */
     Optional<StoreMetadataNode> apply(NodeModification modification, Optional<StoreMetadataNode> storeMeta, UnsignedLong subtreeVersion);
 
-    /**
-     *
-     * Checks if provided node modification could be applied to current metadata node.
-     *
-     * @param modification Modification
-     * @param current Metadata Node to which modification should be applied
-     * @return true if modification is applicable
-     *         false if modification is no applicable
-     */
-    boolean isApplicable(NodeModification modification, Optional<StoreMetadataNode> current);
-
     /**
      *
      * Performs structural verification of NodeModification, such as writen values / types
@@ -87,8 +77,17 @@ public interface ModificationApplyOperation extends StoreTreeNode<ModificationAp
      *    if suboperation is not supported for specified tree node.
      */
     @Override
-    public Optional<ModificationApplyOperation> getChild(PathArgument child);
-
-
+    Optional<ModificationApplyOperation> getChild(PathArgument child);
 
+    /**
+    *
+    * Checks if provided node modification could be applied to current metadata node.
+    *
+    * @param modification Modification
+    * @param current Metadata Node to which modification should be applied
+    * @return true if modification is applicable
+    *         false if modification is no applicable
+     * @throws DataPreconditionFailedException
+    */
+    void checkApplicable(InstanceIdentifier path, NodeModification modification, Optional<StoreMetadataNode> current) throws DataPreconditionFailedException;
 }
index 35864b6..780291e 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * 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.dom.store.impl;
 
 import org.opendaylight.controller.md.sal.dom.store.impl.tree.NodeModification;
@@ -38,10 +45,6 @@ public class OperationWithModification {
         return applyOperation;
     }
 
-    public boolean isApplicable(final Optional<StoreMetadataNode> data) {
-        return applyOperation.isApplicable(modification, data);
-    }
-
     public Optional<StoreMetadataNode> apply(final Optional<StoreMetadataNode> data, final UnsignedLong subtreeVersion) {
         return applyOperation.apply(modification, data, subtreeVersion);
     }
@@ -63,4 +66,4 @@ public class OperationWithModification {
         Optional<ModificationApplyOperation> childOp = applyOperation.getChild(childId);
         return from(childOp.get(),childMod);
     }
-}
\ No newline at end of file
+}
index 7ea4d4e..2af522e 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * 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.dom.store.impl;
 
 import static com.google.common.base.Preconditions.checkArgument;
@@ -13,6 +20,7 @@ import org.opendaylight.controller.md.sal.dom.store.impl.tree.NodeModification;
 import org.opendaylight.controller.md.sal.dom.store.impl.tree.StoreMetadataNode;
 import org.opendaylight.controller.md.sal.dom.store.impl.tree.StoreNodeCompositeBuilder;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.AugmentationIdentifier;
 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates;
@@ -27,11 +35,12 @@ import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeContainer;
+import org.opendaylight.yangtools.yang.data.api.schema.OrderedLeafSetNode;
 import org.opendaylight.yangtools.yang.data.api.schema.OrderedMapNode;
 import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode;
-import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeContainerBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableAugmentationNodeBuilder;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableChoiceNodeBuilder;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafSetNodeBuilder;
@@ -59,8 +68,6 @@ import com.google.common.cache.CacheBuilder;
 import com.google.common.cache.CacheLoader;
 import com.google.common.cache.LoadingCache;
 import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.ImmutableSet.Builder;
 import com.google.common.primitives.UnsignedLong;
 
 public abstract class SchemaAwareApplyOperation implements ModificationApplyOperation {
@@ -135,55 +142,52 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
     protected abstract void verifyWritenStructure(NormalizedNode<?, ?> writenValue);
 
     @Override
-    public boolean isApplicable(final NodeModification modification, final Optional<StoreMetadataNode> current) {
+    public void checkApplicable(final InstanceIdentifier path,final NodeModification modification, final Optional<StoreMetadataNode> current) throws DataPreconditionFailedException {
         switch (modification.getModificationType()) {
         case DELETE:
-            return isDeleteApplicable(modification, current);
+            checkDeleteApplicable(modification, current);
         case SUBTREE_MODIFIED:
-            return isSubtreeModificationApplicable(modification, current);
+            checkSubtreeModificationApplicable(path,modification, current);
+            return;
         case WRITE:
-            return isWriteApplicable(modification, current);
+            checkWriteApplicable(path,modification, current);
+            return;
         case MERGE:
-            return isMergeApplicable(modification,current);
+            checkMergeApplicable(path,modification,current);
+            return;
         case UNMODIFIED:
-            return true;
+            return;
         default:
-            return false;
+            throw new UnsupportedOperationException("Suplied modification type "+modification.getModificationType()+ "is not supported.");
         }
+
     }
 
-    private boolean isMergeApplicable(final NodeModification modification, final Optional<StoreMetadataNode> current) {
+    protected void checkMergeApplicable(final InstanceIdentifier path,final NodeModification modification, final Optional<StoreMetadataNode> current) throws DataPreconditionFailedException {
         Optional<StoreMetadataNode> original = modification.getOriginal();
         if (original.isPresent() && current.isPresent()) {
-            return isNotConflicting(original.get(), current.get());
-        } else if (current.isPresent()) {
-            return true;
+            checkNotConflicting(path,original.get(), current.get());
         }
-        return true;
     }
 
-    protected boolean isWriteApplicable(final NodeModification modification, final Optional<StoreMetadataNode> current) {
+    protected void checkWriteApplicable(final InstanceIdentifier path,final NodeModification modification, final Optional<StoreMetadataNode> current) throws DataPreconditionFailedException {
         Optional<StoreMetadataNode> original = modification.getOriginal();
         if (original.isPresent() && current.isPresent()) {
-            return isNotConflicting(original.get(), current.get());
-        } else if (current.isPresent()) {
-            return false;
+            checkNotConflicting(path,original.get(), current.get());
+        } else if(original.isPresent()) {
+            throw new DataPreconditionFailedException(path,"Node was deleted by other transaction.");
         }
-        return true;
-
     }
 
-    protected final boolean isNotConflicting(final StoreMetadataNode original, final StoreMetadataNode current) {
-        return original.getNodeVersion().equals(current.getNodeVersion())
-                && original.getSubtreeVersion().equals(current.getSubtreeVersion());
+    protected static final void checkNotConflicting(final InstanceIdentifier path,final StoreMetadataNode original, final StoreMetadataNode current) throws DataPreconditionFailedException {
+        checkDataPrecondition(path, original.getNodeVersion().equals(current.getNodeVersion()),"Node was replaced by other transaction.");
+        checkDataPrecondition(path,original.getSubtreeVersion().equals(current.getSubtreeVersion()), "Node children was modified by other transaction");
     }
 
-    protected abstract boolean isSubtreeModificationApplicable(final NodeModification modification,
-            final Optional<StoreMetadataNode> current);
+    protected abstract void checkSubtreeModificationApplicable(InstanceIdentifier path,final NodeModification modification,
+            final Optional<StoreMetadataNode> current) throws DataPreconditionFailedException;
 
-    private boolean isDeleteApplicable(final NodeModification modification, final Optional<StoreMetadataNode> current) {
-        // FiXME: Add delete conflict detection.
-        return true;
+    private void checkDeleteApplicable(final NodeModification modification, final Optional<StoreMetadataNode> current) {
     }
 
     @Override
@@ -265,9 +269,9 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
         }
 
         @Override
-        protected boolean isSubtreeModificationApplicable(final NodeModification modification,
-                final Optional<StoreMetadataNode> current) {
-            return false;
+        protected void checkSubtreeModificationApplicable(final InstanceIdentifier path,final NodeModification modification,
+                final Optional<StoreMetadataNode> current) throws DataPreconditionFailedException {
+            throw new DataPreconditionFailedException(path, "Subtree modification is not allowed.");
         }
 
     }
@@ -306,6 +310,14 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
             }
         }
 
+        @Override
+        protected void checkWriteApplicable(final InstanceIdentifier path, final NodeModification modification,
+                final Optional<StoreMetadataNode> current) throws DataPreconditionFailedException {
+            // FIXME: Implement proper write check for replacement of node container
+            //        prerequisite is to have transaction chain available for clients
+            //        otherwise this will break chained writes to same node.
+        }
+
         @SuppressWarnings("rawtypes")
         @Override
         protected void verifyWritenStructure(final NormalizedNode<?, ?> writenValue) {
@@ -321,30 +333,28 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
         @Override
         protected StoreMetadataNode applyWrite(final NodeModification modification,
                 final Optional<StoreMetadataNode> currentMeta, final UnsignedLong subtreeVersion) {
-            //
+
             NormalizedNode<?, ?> newValue = modification.getWritenValue();
 
-            UnsignedLong nodeVersion = subtreeVersion;
+            final UnsignedLong nodeVersion;
             if (currentMeta.isPresent()) {
                 nodeVersion = StoreUtils.increase(currentMeta.get().getNodeVersion());
+            } else {
+                nodeVersion = subtreeVersion;
             }
-            StoreMetadataNode newValueMeta = StoreMetadataNode.createRecursively(newValue, nodeVersion, nodeVersion);
 
+            final StoreMetadataNode newValueMeta = StoreMetadataNode.createRecursively(newValue, nodeVersion, nodeVersion);
             if (!modification.hasAdditionalModifications()) {
                 return newValueMeta;
             }
+
             @SuppressWarnings("rawtypes")
-            NormalizedNodeContainerBuilder dataBuilder = createBuilder(modification.getIdentifier());
+            NormalizedNodeContainerBuilder dataBuilder = createBuilder(newValue);
             StoreNodeCompositeBuilder builder = StoreNodeCompositeBuilder.from(dataBuilder) //
                     .setNodeVersion(nodeVersion) //
                     .setSubtreeVersion(subtreeVersion);
 
-            Set<PathArgument> processedPreexisting = applyPreexistingChildren(modification, newValueMeta.getChildren(),
-                    builder, nodeVersion);
-            applyNewChildren(modification, processedPreexisting, builder, nodeVersion);
-
-            return builder.build();
-
+            return mutateChildren(modification.getModifications(), newValueMeta, builder, nodeVersion);
         }
 
         @Override
@@ -357,75 +367,64 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
         @Override
         public StoreMetadataNode applySubtreeChange(final NodeModification modification,
                 final StoreMetadataNode currentMeta, final UnsignedLong subtreeVersion) {
+            // Bump subtree version to its new target
+            final UnsignedLong updatedSubtreeVersion = StoreUtils.increase(currentMeta.getSubtreeVersion());
 
-            UnsignedLong updatedSubtreeVersion = StoreUtils.increase(currentMeta.getSubtreeVersion());
             @SuppressWarnings("rawtypes")
-            NormalizedNodeContainerBuilder dataBuilder = createBuilder(modification.getIdentifier());
-            StoreNodeCompositeBuilder builder = StoreNodeCompositeBuilder.from(dataBuilder)
+            NormalizedNodeContainerBuilder dataBuilder = createBuilder(currentMeta.getData());
+            StoreNodeCompositeBuilder builder = StoreNodeCompositeBuilder.from(dataBuilder, currentMeta)
                     .setIdentifier(modification.getIdentifier()).setNodeVersion(currentMeta.getNodeVersion())
                     .setSubtreeVersion(updatedSubtreeVersion);
-            // We process preexisting nodes
-            Set<PathArgument> processedPreexisting = applyPreexistingChildren(modification, currentMeta.getChildren(),
-                    builder, updatedSubtreeVersion);
-            applyNewChildren(modification, processedPreexisting, builder, updatedSubtreeVersion);
-            return builder.build();
+
+            return mutateChildren(modification.getModifications(), currentMeta, builder, updatedSubtreeVersion);
         }
 
-        private void applyNewChildren(final NodeModification modification, final Set<PathArgument> ignore,
-                final StoreNodeCompositeBuilder builder, final UnsignedLong subtreeVersion) {
-            for (NodeModification childModification : modification.getModifications()) {
-                PathArgument childIdentifier = childModification.getIdentifier();
-                // We skip allready processed modifications
-                if (ignore.contains(childIdentifier)) {
-                    continue;
-                }
+        private StoreMetadataNode mutateChildren(final Iterable<NodeModification> modifications, final StoreMetadataNode meta,
+                final StoreNodeCompositeBuilder builder, final UnsignedLong nodeVersion) {
 
-                builder.addIfPresent(resolveChildOperation(childIdentifier) //
-                        .apply(childModification, Optional.<StoreMetadataNode> absent(), subtreeVersion));
-            }
-        }
+            for (NodeModification mod : modifications) {
+                final PathArgument id = mod.getIdentifier();
+                final Optional<StoreMetadataNode> cm = meta.getChild(id);
 
-        private Set<PathArgument> applyPreexistingChildren(final NodeModification modification,
-                final Iterable<StoreMetadataNode> children, final StoreNodeCompositeBuilder nodeBuilder,
-                final UnsignedLong subtreeVersion) {
-            Builder<PathArgument> processedModifications = ImmutableSet.<PathArgument> builder();
-            for (StoreMetadataNode childMeta : children) {
-                PathArgument childIdentifier = childMeta.getIdentifier();
-                // We retrieve Child modification metadata
-                Optional<NodeModification> childModification = modification.getChild(childIdentifier);
-                // Node is modified
-                if (childModification.isPresent()) {
-                    processedModifications.add(childIdentifier);
-                    Optional<StoreMetadataNode> result = resolveChildOperation(childIdentifier) //
-                            .apply(childModification.get(), Optional.of(childMeta), subtreeVersion);
-                    nodeBuilder.addIfPresent(result);
+                Optional<StoreMetadataNode> result = resolveChildOperation(id).apply(mod, cm, nodeVersion);
+                if (result.isPresent()) {
+                    builder.add(result.get());
                 } else {
-                    // Child is unmodified - reuse existing metadata and data
-                    // snapshot
-                    nodeBuilder.add(childMeta);
+                    builder.remove(id);
                 }
             }
-            return processedModifications.build();
+
+            return builder.build();
         }
 
         @Override
-        protected boolean isSubtreeModificationApplicable(final NodeModification modification,
-                final Optional<StoreMetadataNode> current) {
-            if (false == current.isPresent()) {
-                return false;
-            }
-            boolean result = true;
+        protected void checkSubtreeModificationApplicable(final InstanceIdentifier path,final NodeModification modification,
+                final Optional<StoreMetadataNode> current) throws DataPreconditionFailedException {
+            checkDataPrecondition(path, current.isPresent(), "Node was deleted by other transaction.");
+            checkChildPreconditions(path,modification,current);
+
+        }
+
+        private void checkChildPreconditions(final InstanceIdentifier path, final NodeModification modification, final Optional<StoreMetadataNode> current) throws DataPreconditionFailedException {
             StoreMetadataNode currentMeta = current.get();
             for (NodeModification childMod : modification.getModifications()) {
                 PathArgument childId = childMod.getIdentifier();
                 Optional<StoreMetadataNode> childMeta = currentMeta.getChild(childId);
-                result &= resolveChildOperation(childId).isApplicable(childMod, childMeta);
+                InstanceIdentifier childPath = StoreUtils.append(path, childId);
+                resolveChildOperation(childId).checkApplicable(childPath,childMod, childMeta);
+            }
+        }
+
+        @Override
+        protected void checkMergeApplicable(final InstanceIdentifier path, final NodeModification modification,
+                final Optional<StoreMetadataNode> current) throws DataPreconditionFailedException {
+            if(current.isPresent()) {
+                checkChildPreconditions(path,modification,current);
             }
-            return result;
         }
 
         @SuppressWarnings("rawtypes")
-        protected abstract NormalizedNodeContainerBuilder createBuilder(PathArgument identifier);
+        protected abstract NormalizedNodeContainerBuilder createBuilder(NormalizedNode<?, ?> original);
     }
 
     public static abstract class DataNodeContainerModificationStrategy<T extends DataNodeContainer> extends
@@ -470,7 +469,7 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
 
         @Override
         @SuppressWarnings("rawtypes")
-        protected abstract DataContainerNodeBuilder createBuilder(PathArgument identifier);
+        protected abstract DataContainerNodeBuilder createBuilder(NormalizedNode<?, ?> original);
 
         @Override
         public String toString() {
@@ -488,12 +487,10 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
 
         @Override
         @SuppressWarnings("rawtypes")
-        protected DataContainerNodeBuilder createBuilder(final PathArgument identifier) {
-            // TODO Auto-generated method stub
-            checkArgument(identifier instanceof NodeIdentifier);
-            return ImmutableContainerNodeBuilder.create().withNodeIdentifier((NodeIdentifier) identifier);
+        protected DataContainerNodeBuilder createBuilder(final NormalizedNode<?, ?> original) {
+            checkArgument(original instanceof ContainerNode);
+            return ImmutableContainerNodeBuilder.create((ContainerNode) original);
         }
-
     }
 
     public static class UnkeyedListItemModificationStrategy extends
@@ -505,11 +502,10 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
 
         @Override
         @SuppressWarnings("rawtypes")
-        protected DataContainerNodeBuilder createBuilder(final PathArgument identifier) {
-            checkArgument(identifier instanceof NodeIdentifier);
-            return ImmutableUnkeyedListEntryNodeBuilder.create().withNodeIdentifier((NodeIdentifier) identifier);
+        protected DataContainerNodeBuilder createBuilder(final NormalizedNode<?, ?> original) {
+            checkArgument(original instanceof UnkeyedListEntryNode);
+            return ImmutableUnkeyedListEntryNodeBuilder.create((UnkeyedListEntryNode) original);
         }
-
     }
 
     public static class AugmentationModificationStrategy extends
@@ -517,15 +513,14 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
 
         protected AugmentationModificationStrategy(final AugmentationSchema schema, final DataNodeContainer resolved) {
             super(createAugmentProxy(schema,resolved), AugmentationNode.class);
-            // FIXME: Use resolved children instead of unresolved.
-
         }
 
         @Override
-        protected DataContainerNodeBuilder createBuilder(final PathArgument identifier) {
-            return Builders.augmentationBuilder().withNodeIdentifier((AugmentationIdentifier) identifier);
+        @SuppressWarnings("rawtypes")
+        protected DataContainerNodeBuilder createBuilder(final NormalizedNode<?, ?> original) {
+            checkArgument(original instanceof AugmentationNode);
+            return ImmutableAugmentationNodeBuilder.create((AugmentationNode) original);
         }
-
     }
 
     public static class ChoiceModificationStrategy extends NormalizedNodeContainerModificationStrategy {
@@ -554,11 +549,10 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
 
         @Override
         @SuppressWarnings("rawtypes")
-        protected DataContainerNodeBuilder createBuilder(final PathArgument identifier) {
-            checkArgument(identifier instanceof NodeIdentifier);
-            return ImmutableChoiceNodeBuilder.create().withNodeIdentifier((NodeIdentifier) identifier);
+        protected DataContainerNodeBuilder createBuilder(final NormalizedNode<?, ?> original) {
+            checkArgument(original instanceof org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode);
+            return ImmutableChoiceNodeBuilder.create((org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode) original);
         }
-
     }
 
     public static class ListEntryModificationStrategy extends DataNodeContainerModificationStrategy<ListSchemaNode> {
@@ -569,10 +563,10 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
 
         @Override
         @SuppressWarnings("rawtypes")
-        protected final DataContainerNodeBuilder createBuilder(final PathArgument identifier) {
-            return ImmutableMapEntryNodeBuilder.create().withNodeIdentifier((NodeIdentifierWithPredicates) identifier);
+        protected final DataContainerNodeBuilder createBuilder(final NormalizedNode<?, ?> original) {
+            checkArgument(original instanceof MapEntryNode);
+            return ImmutableMapEntryNodeBuilder.create((MapEntryNode) original);
         }
-
     }
 
     public static class UnorderedLeafSetModificationStrategy extends NormalizedNodeContainerModificationStrategy {
@@ -587,8 +581,9 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
 
         @SuppressWarnings("rawtypes")
         @Override
-        protected NormalizedNodeContainerBuilder createBuilder(final PathArgument identifier) {
-            return ImmutableLeafSetNodeBuilder.create().withNodeIdentifier((NodeIdentifier) identifier);
+        protected NormalizedNodeContainerBuilder createBuilder(final NormalizedNode<?, ?> original) {
+            checkArgument(original instanceof LeafSetNode<?>);
+            return ImmutableLeafSetNodeBuilder.create((LeafSetNode<?>) original);
         }
 
         @Override
@@ -598,7 +593,6 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
             }
             return Optional.absent();
         }
-
     }
 
     public static class OrderedLeafSetModificationStrategy extends NormalizedNodeContainerModificationStrategy {
@@ -613,8 +607,9 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
 
         @SuppressWarnings("rawtypes")
         @Override
-        protected NormalizedNodeContainerBuilder createBuilder(final PathArgument identifier) {
-            return ImmutableOrderedLeafSetNodeBuilder.create().withNodeIdentifier((NodeIdentifier) identifier);
+        protected NormalizedNodeContainerBuilder createBuilder(final NormalizedNode<?, ?> original) {
+            checkArgument(original instanceof OrderedLeafSetNode<?>);
+            return ImmutableOrderedLeafSetNodeBuilder.create((OrderedLeafSetNode<?>) original);
         }
 
         @Override
@@ -624,7 +619,6 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
             }
             return Optional.absent();
         }
-
     }
 
     public static class UnkeyedListModificationStrategy extends SchemaAwareApplyOperation {
@@ -667,9 +661,9 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
         }
 
         @Override
-        protected boolean isSubtreeModificationApplicable(final NodeModification modification,
-                final Optional<StoreMetadataNode> current) {
-            return false;
+        protected void checkSubtreeModificationApplicable(final InstanceIdentifier path,final NodeModification modification,
+                final Optional<StoreMetadataNode> current) throws DataPreconditionFailedException {
+            throw new DataPreconditionFailedException(path, "Subtree modification is not allowed.");
         }
 
     }
@@ -685,8 +679,9 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
 
         @SuppressWarnings("rawtypes")
         @Override
-        protected NormalizedNodeContainerBuilder createBuilder(final PathArgument identifier) {
-            return ImmutableMapNodeBuilder.create().withNodeIdentifier((NodeIdentifier) identifier);
+        protected NormalizedNodeContainerBuilder createBuilder(final NormalizedNode<?, ?> original) {
+            checkArgument(original instanceof MapNode);
+            return ImmutableMapNodeBuilder.create((MapNode) original);
         }
 
         @Override
@@ -714,8 +709,9 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
 
         @SuppressWarnings("rawtypes")
         @Override
-        protected NormalizedNodeContainerBuilder createBuilder(final PathArgument identifier) {
-            return ImmutableOrderedMapNodeBuilder.create().withNodeIdentifier((NodeIdentifier) identifier);
+        protected NormalizedNodeContainerBuilder createBuilder(final NormalizedNode<?, ?> original) {
+            checkArgument(original instanceof OrderedMapNode);
+            return ImmutableOrderedMapNodeBuilder.create((OrderedMapNode) original);
         }
 
         @Override
@@ -744,4 +740,11 @@ public abstract class SchemaAwareApplyOperation implements ModificationApplyOper
         return new AugmentationSchemaProxy(schema, realChildSchemas);
     }
 
+    public static boolean checkDataPrecondition(final InstanceIdentifier path, final boolean condition, final String message) throws DataPreconditionFailedException {
+        if(!condition) {
+            throw new DataPreconditionFailedException(path, message);
+        }
+        return condition;
+    }
+
 }
index e7265de..8a539ff 100644 (file)
@@ -7,16 +7,14 @@
  */
 package org.opendaylight.controller.md.sal.dom.store.impl;
 
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
 public class SchemaAwareApplyOperationRoot extends SchemaAwareApplyOperation.DataNodeContainerModificationStrategy<ContainerSchemaNode> {
-
     private final SchemaContext context;
 
     public SchemaAwareApplyOperationRoot(final SchemaContext context) {
@@ -24,11 +22,6 @@ public class SchemaAwareApplyOperationRoot extends SchemaAwareApplyOperation.Dat
         this.context = context;
     }
 
-    @Override
-    protected DataContainerNodeBuilder createBuilder(final PathArgument identifier) {
-        return ImmutableContainerNodeBuilder.create().withNodeIdentifier((NodeIdentifier) identifier);
-    }
-
     public SchemaContext getContext() {
         return context;
     }
@@ -38,4 +31,9 @@ public class SchemaAwareApplyOperationRoot extends SchemaAwareApplyOperation.Dat
         return "SchemaAwareApplyOperationRoot [context=" + context + "]";
     }
 
+    @Override
+    @SuppressWarnings("rawtypes")
+    protected DataContainerNodeBuilder createBuilder(NormalizedNode<?, ?> original) {
+        return ImmutableContainerNodeBuilder.create((ContainerNode) original);
+    }
 }
index 830d7e3..0f77ac5 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * 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.dom.store.impl;
 
 import java.util.Collections;
index d42f36f..455777b 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.controller.md.sal.dom.store.impl.tree;
 
 import static com.google.common.base.Preconditions.checkState;
 
+import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
@@ -46,10 +47,24 @@ public class StoreMetadataNode implements Immutable, Identifiable<PathArgument>,
         this.children = Preconditions.checkNotNull(children);
     }
 
+    public static StoreMetadataNode createEmpty(final NormalizedNode<?, ?> data) {
+        return new StoreMetadataNode(data, UnsignedLong.ZERO, UnsignedLong.ZERO,
+                Collections.<PathArgument, StoreMetadataNode>emptyMap());
+    }
+
+    public StoreMetadataNode(final NormalizedNode<?, ?> data, final UnsignedLong nodeVersion,
+            final UnsignedLong subtreeVersion) {
+        this(data, nodeVersion, subtreeVersion, Collections.<PathArgument, StoreMetadataNode>emptyMap());
+    }
+
     public static Builder builder() {
         return new Builder();
     }
 
+    public static Builder builder(StoreMetadataNode node) {
+        return new Builder(node);
+    }
+
     public UnsignedLong getNodeVersion() {
         return this.nodeVersion;
     }
@@ -118,11 +133,16 @@ public class StoreMetadataNode implements Immutable, Identifiable<PathArgument>,
         private UnsignedLong nodeVersion;
         private UnsignedLong subtreeVersion;
         private NormalizedNode<?, ?> data;
-        private Map<PathArgument, StoreMetadataNode> children = new LinkedHashMap<>();
+        private Map<PathArgument, StoreMetadataNode> children;
         private boolean dirty = false;
 
-        private Builder() {}
+        private Builder() {
+            children = new LinkedHashMap<>();
+        }
 
+        public Builder(StoreMetadataNode node) {
+            children = new LinkedHashMap<>(node.children);
+        }
 
         public UnsignedLong getVersion() {
             return nodeVersion;
@@ -153,6 +173,15 @@ public class StoreMetadataNode implements Immutable, Identifiable<PathArgument>,
             return this;
         }
 
+        public Builder remove(final PathArgument id) {
+            if (dirty) {
+                children = new LinkedHashMap<>(children);
+                dirty = false;
+            }
+            children.remove(id);
+            return this;
+        }
+
         public StoreMetadataNode build() {
             checkState(data != null, "Data node should not be null.");
             checkState(subtreeVersion.compareTo(nodeVersion) >= 0,
@@ -165,5 +194,4 @@ public class StoreMetadataNode implements Immutable, Identifiable<PathArgument>,
     public static StoreMetadataNode createRecursively(final NormalizedNode<?, ?> node, final UnsignedLong version) {
         return createRecursively(node, version, version);
     }
-
 }
index 41fc823..a66a1d5 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.controller.md.sal.dom.store.impl.tree;
 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeContainerBuilder;
 
-import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
 import com.google.common.primitives.UnsignedLong;
 
 /**
@@ -28,7 +28,12 @@ public class StoreNodeCompositeBuilder {
 
     private StoreNodeCompositeBuilder(final NormalizedNodeContainerBuilder nodeBuilder) {
         this.metadata = StoreMetadataNode.builder();
-        this.data = nodeBuilder;
+        this.data = Preconditions.checkNotNull(nodeBuilder);
+    }
+
+    public StoreNodeCompositeBuilder(NormalizedNodeContainerBuilder nodeBuilder, StoreMetadataNode currentMeta) {
+        this.metadata = StoreMetadataNode.builder(currentMeta);
+        this.data = Preconditions.checkNotNull(nodeBuilder);
     }
 
     @SuppressWarnings("unchecked")
@@ -39,12 +44,9 @@ public class StoreNodeCompositeBuilder {
     }
 
     @SuppressWarnings("unchecked")
-    public StoreNodeCompositeBuilder addIfPresent(final Optional<StoreMetadataNode> potential) {
-        if (potential.isPresent()) {
-            StoreMetadataNode node = potential.get();
-            metadata.add(node);
-            data.addChild(node.getData());
-        }
+    public StoreNodeCompositeBuilder remove(PathArgument id) {
+        metadata.remove(id);
+        data.removeChild(id);
         return this;
     }
 
@@ -56,6 +58,10 @@ public class StoreNodeCompositeBuilder {
         return new StoreNodeCompositeBuilder(nodeBuilder);
     }
 
+    public static StoreNodeCompositeBuilder from(final NormalizedNodeContainerBuilder nodeBuilder, StoreMetadataNode currentMeta) {
+        return new StoreNodeCompositeBuilder(nodeBuilder, currentMeta);
+    }
+
     @SuppressWarnings("unchecked")
     public StoreNodeCompositeBuilder setIdentifier(final PathArgument identifier) {
         data.withNodeIdentifier(identifier);
@@ -71,5 +77,4 @@ public class StoreNodeCompositeBuilder {
         metadata.setSubtreeVersion(updatedSubtreeVersion);
         return this;
     }
-
 }
index 339d9cb..732352d 100644 (file)
@@ -21,7 +21,10 @@ import com.google.common.base.Preconditions;
 import com.google.common.base.Predicate;
 import com.google.common.base.Predicates;
 
-public class TreeNodeUtils {
+public final class TreeNodeUtils {
+    private TreeNodeUtils() {
+        throw new UnsupportedOperationException("Utility class should not be instantiated");
+    }
 
     /**
      * Finds a node in tree
@@ -40,7 +43,6 @@ public class TreeNodeUtils {
         return current;
     }
 
-
     public static <T extends StoreTreeNode<T>> T findNodeChecked(final T tree, final InstanceIdentifier path) {
         T current = tree;
         List<PathArgument> nested = new ArrayList<>(path.getPath().size());
index 9aa558b..ac7b87a 100644 (file)
@@ -49,12 +49,8 @@ public class DataNormalizerTest {
 
         InstanceIdentifier normalizedPath = normalizer.toNormalized(LEAF_TWO_PATH_LEGACY);
 
-        Node<?> outerListLegacy = normalizer.toLegacy(OUTER_LIST_WITH_CHOICE);
+        Node<?> outerListLegacy = DataNormalizer.toLegacy(OUTER_LIST_WITH_CHOICE);
         assertNotNull(outerListLegacy);
-
-
-
-
     }
 
 }
index 5a43c7b..c0f0a35 100644 (file)
@@ -7,6 +7,7 @@ import static org.junit.Assert.assertTrue;
 import java.util.concurrent.ExecutionException;
 
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
@@ -119,6 +120,7 @@ public class InMemoryDataStoreTest {
     }
 
     @Test
+    @Ignore
     public void testTransactionConflict() throws InterruptedException, ExecutionException {
         DOMStoreReadWriteTransaction txOne = domStore.newReadWriteTransaction();
         DOMStoreReadWriteTransaction txTwo = domStore.newReadWriteTransaction();
index d8a76b9..9ad95c1 100644 (file)
@@ -38,7 +38,6 @@
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>netconf-client</artifactId>
-      <version>${netconf.version}</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
index edcef83..53fbb92 100644 (file)
@@ -8,7 +8,7 @@
 
 package org.opendaylight.controller.sal.connector.remoterpc;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkState;
 
 import java.util.Collection;
 import java.util.Collections;
@@ -174,7 +174,7 @@ public class RemoteRpcProvider implements
     Optional<RoutingTable<RpcRouter.RouteIdentifier, String>> routingTable =
         routingTableProvider.getRoutingTable();
 
-    checkNotNull(routingTable.isPresent(), "Routing table is null");
+    checkState(routingTable.isPresent(), "Routing table is null");
 
     return routingTable.get();
   }
index 519791a..21d02be 100644 (file)
@@ -8,11 +8,17 @@
 
 package org.opendaylight.controller.sal.connector.remoterpc.dto;
 
-import org.opendaylight.controller.sal.connector.api.RpcRouter;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
 
-import java.io.*;
+import org.opendaylight.controller.sal.connector.api.RpcRouter;
 
 public class Message implements Serializable {
+    private static final long serialVersionUID = 1L;
 
  public static enum MessageType {
     PING((byte) 0),
@@ -118,12 +124,13 @@ public class Message implements Serializable {
   }
 
   public static class Response extends Message implements RpcRouter.RpcReply {
+    private static final long serialVersionUID = 1L;
     private ResponseCode code; // response code
 
     public static enum ResponseCode {
       SUCCESS(200), BADREQUEST(400), TIMEOUT(408), GONE(410), SERVERERROR(500), SERVICEUNAVAILABLE(503);
 
-      private int code;
+      private final int code;
 
       ResponseCode(int code) {
         this.code = code;
@@ -144,7 +151,7 @@ public class Message implements Serializable {
    */
   public static class MessageBuilder{
 
-    private Message message;
+    private final Message message;
 
     public MessageBuilder(){
       message = new Message();
index 4ffcf3e..53c7cc0 100644 (file)
@@ -7,13 +7,14 @@
  */
 package org.opendaylight.controller.sal.connector.remoterpc.dto;
 
+import java.io.Serializable;
+
 import org.opendaylight.controller.sal.connector.api.RpcRouter;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
 
-import java.io.Serializable;
-
 public class RouteIdentifierImpl implements RpcRouter.RouteIdentifier<QName, QName, InstanceIdentifier>,Serializable {
+  private static final long serialVersionUID = 1L;
 
   private QName context;
   private QName type;
index a5c4d85..1edd004 100644 (file)
@@ -7,7 +7,14 @@
  */
 package org.opendaylight.controller.sal.connector.remoterpc;
 
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.FutureTask;
+import java.util.concurrent.TimeUnit;
+
 import junit.framework.Assert;
+
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -17,9 +24,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.zeromq.ZMQ;
 
-import java.io.IOException;
-import java.util.concurrent.*;
-
 /**
  *
  */
@@ -69,7 +73,7 @@ public class ClientRequestHandlerTest {
       serverThread.execute(MessagingUtil.startReplyServer(context, serverAddress, 1));
       threadPool.execute(createEmptyMessageTaskAndHandle(handler, serverAddress));
     }
-    Thread.currentThread().sleep(5000);//wait for all messages to get processed
+    Thread.sleep(5000);//wait for all messages to get processed
     //should be connected to 5 remote server
     Assert.assertEquals(5, handler.getWorkerCount());
   }
index dc96b79..2fcb2f6 100644 (file)
@@ -17,7 +17,6 @@
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-binding-it</artifactId>
-      <version>1.1-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller.samples</groupId>
index e922656..e23ad0a 100644 (file)
@@ -32,9 +32,9 @@ import com.google.common.util.concurrent.JdkFutureAdapters;
 
 abstract class AbstractStatsTracker<I, K> {
     private static final Logger logger = LoggerFactory.getLogger(AbstractStatsTracker.class);
-    
+
     private static final int WAIT_FOR_REQUEST_CYCLE = 2;
-    
+
     private final FutureCallback<RpcResult<? extends TransactionAware>> callback =
             new FutureCallback<RpcResult<? extends TransactionAware>>() {
         @Override
@@ -73,7 +73,7 @@ abstract class AbstractStatsTracker<I, K> {
     }
 
     protected final InstanceIdentifierBuilder<Node> getNodeIdentifierBuilder() {
-        return InstanceIdentifier.builder(getNodeIdentifier());
+        return getNodeIdentifier().builder();
     }
 
     protected final NodeRef getNodeRef() {
index e180aaf..a775b73 100644 (file)
@@ -96,7 +96,7 @@ final class GroupDescStatsTracker extends AbstractListeningStatsTracker<GroupDes
             if (Group.class.equals(key.getTargetType())) {
                 @SuppressWarnings("unchecked")
                 InstanceIdentifier<Group> group = (InstanceIdentifier<Group>)key;
-                InstanceIdentifier<?> del = InstanceIdentifier.builder(group).augmentation(NodeGroupDescStats.class).toInstance();
+                InstanceIdentifier<?> del = group.augmentation(NodeGroupDescStats.class);
                 logger.debug("Key {} triggered remove of augmentation {}", key, del);
 
                 trans.removeOperationalData(del);
index 9735fea..c3c23c9 100644 (file)
@@ -87,7 +87,7 @@ final class GroupStatsTracker extends AbstractListeningStatsTracker<GroupStats,
             if (Group.class.equals(key.getTargetType())) {
                 @SuppressWarnings("unchecked")
                 InstanceIdentifier<Group> group = (InstanceIdentifier<Group>)key;
-                InstanceIdentifier<?> del = InstanceIdentifier.builder(group).augmentation(NodeGroupStatistics.class).toInstance();
+                InstanceIdentifier<?> del = group.augmentation(NodeGroupStatistics.class);
                 logger.debug("Key {} triggered remove of augmentation {}", key, del);
 
                 trans.removeOperationalData(del);
index e8b7fb7..ea412a0 100644 (file)
@@ -82,7 +82,7 @@ final class MeterConfigStatsTracker extends AbstractListeningStatsTracker<MeterC
                 InstanceIdentifier<Meter> meter = (InstanceIdentifier<Meter>)key;
 
                 InstanceIdentifier<?> nodeMeterStatisticsAugmentation =
-                        InstanceIdentifier.builder(meter).augmentation(NodeMeterConfigStats.class).toInstance();
+                        meter.augmentation(NodeMeterConfigStats.class);
                 trans.removeOperationalData(nodeMeterStatisticsAugmentation);
             }
         }
index b373020..be53a38 100644 (file)
@@ -86,7 +86,7 @@ final class MeterStatsTracker extends AbstractListeningStatsTracker<MeterStats,
                 InstanceIdentifier<Meter> meter = (InstanceIdentifier<Meter>)key;
 
                 InstanceIdentifier<?> nodeMeterStatisticsAugmentation =
-                        InstanceIdentifier.builder(meter).augmentation(NodeMeterStatistics.class).toInstance();
+                        meter.augmentation(NodeMeterStatistics.class);
                 trans.removeOperationalData(nodeMeterStatisticsAugmentation);
             }
         }
index 6f93eeb..03f7808 100644 (file)
@@ -122,8 +122,8 @@ final class QueueStatsTracker extends AbstractListeningStatsTracker<QueueIdAndSt
             if (Queue.class.equals(key.getTargetType())) {
                 @SuppressWarnings("unchecked")
                 final InstanceIdentifier<Queue> queue = (InstanceIdentifier<Queue>)key;
-                final InstanceIdentifier<?> del = InstanceIdentifier.builder(queue)
-                        .augmentation(FlowCapableNodeConnectorQueueStatisticsData.class).build();
+                final InstanceIdentifier<?> del = queue
+                        .augmentation(FlowCapableNodeConnectorQueueStatisticsData.class);
                 logger.debug("Key {} triggered remove of augmentation {}", key, del);
 
                 trans.removeOperationalData(del);
index f4685d2..542e972 100644 (file)
@@ -193,8 +193,7 @@ class FlowCapableTopologyExporter implements //
         }
         for (Link link : topologyData.getLink()) {
             if (id.equals(link.getSource().getSourceNode()) || id.equals(link.getDestination().getDestNode())) {
-                InstanceIdentifier<Link> path = InstanceIdentifier.builder(topologyPath)
-                        .child(Link.class, link.getKey()).build();
+                InstanceIdentifier<Link> path = topologyPath.child(Link.class, link.getKey());
                 transaction.removeOperationalData(path);
             }
         }
@@ -208,8 +207,7 @@ class FlowCapableTopologyExporter implements //
         }
         for (Link link : topologyData.getLink()) {
             if (id.equals(link.getSource().getSourceTp()) || id.equals(link.getDestination().getDestTp())) {
-                InstanceIdentifier<Link> path = InstanceIdentifier.builder(topologyPath)
-                        .child(Link.class, link.getKey()).build();
+                InstanceIdentifier<Link> path = topologyPath.child(Link.class, link.getKey());
                 transaction.removeOperationalData(path);
             }
         }
@@ -233,20 +231,20 @@ class FlowCapableTopologyExporter implements //
                 .child(Topology.class, topology).child(Link.class, link.getKey()).build();
         return linkInstanceId;
     }
-    
+
     /**
      * @param txId transaction identificator
      * @param future transaction result
      */
     private static void listenOnTransactionState(final Object txId, Future<RpcResult<TransactionStatus>> future) {
         Futures.addCallback(JdkFutureAdapters.listenInPoolThread(future),new FutureCallback<RpcResult<TransactionStatus>>() {
-            
+
             @Override
             public void onFailure(Throwable t) {
                 LOG.error("Topology export failed for Tx:{}", txId, t);
-                
+
             }
-            
+
             @Override
             public void onSuccess(RpcResult<TransactionStatus> result) {
                 if(!result.isSuccessful()) {
index be44a71..f6d070b 100644 (file)
@@ -7,12 +7,13 @@
  */
 package org.opendaylight.controller.netconf.confignetconfconnector.exception;
 
-import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
-
 import java.util.Collections;
 import java.util.Map;
 
+import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
+
 public class NetconfConfigHandlingException extends NetconfDocumentedException {
+    private static final long serialVersionUID = 1L;
 
     public NetconfConfigHandlingException(final String message, final ErrorType errorType, final ErrorTag errorTag,
                                           final ErrorSeverity errorSeverity) {
index ebb8054..dea8443 100644 (file)
@@ -7,12 +7,13 @@
  */
 package org.opendaylight.controller.netconf.confignetconfconnector.exception;
 
-import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
-
 import java.util.Collections;
 import java.util.Map;
 
+import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
+
 public class NoTransactionFoundException extends NetconfDocumentedException {
+    private static final long serialVersionUID = 1L;
 
     public NoTransactionFoundException(final String message, final ErrorType errorType, final ErrorTag errorTag,
                                           final ErrorSeverity errorSeverity) {
index e0d63c1..4927666 100644 (file)
@@ -7,12 +7,13 @@
  */
 package org.opendaylight.controller.netconf.confignetconfconnector.exception;
 
-import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
-
 import java.util.Collections;
 import java.util.Map;
 
+import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
+
 public class OperationNotPermittedException extends NetconfDocumentedException {
+    private static final long serialVersionUID = 1L;
 
     public OperationNotPermittedException(final String message, final ErrorType errorType, final ErrorTag errorTag,
                                        final ErrorSeverity errorSeverity) {
index 44e9027..957db50 100644 (file)
@@ -8,10 +8,19 @@
 
 package org.opendaylight.controller.netconf.persist.impl;
 
-import com.google.common.base.Function;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Stopwatch;
-import com.google.common.collect.Collections2;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.concurrent.TimeUnit;
+
+import javax.annotation.concurrent.Immutable;
+
 import org.opendaylight.controller.config.api.ConflictingVersionException;
 import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
@@ -32,17 +41,10 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.xml.sax.SAXException;
 
-import javax.annotation.concurrent.Immutable;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.concurrent.TimeUnit;
+import com.google.common.base.Function;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Stopwatch;
+import com.google.common.collect.Collections2;
 
 @Immutable
 public class ConfigPusher {
@@ -110,6 +112,8 @@ public class ConfigPusher {
     }
 
     private static class NotEnoughCapabilitiesException extends Exception {
+        private static final long serialVersionUID = 1L;
+
         private NotEnoughCapabilitiesException(String message, Throwable cause) {
             super(message, cause);
         }
index 0a3e0b3..6cc5006 100644 (file)
@@ -7,20 +7,21 @@
  */
 package org.opendaylight.controller.netconf.util.exception;
 
-import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
-
 import java.util.Collections;
 import java.util.Map;
 
+import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
+
 public class MissingNameSpaceException extends NetconfDocumentedException {
+    private static final long serialVersionUID = 1L;
 
     public MissingNameSpaceException(final String message, final ErrorType errorType, final ErrorTag errorTag,
-                                      final ErrorSeverity errorSeverity) {
+                                     final ErrorSeverity errorSeverity) {
         this(message, errorType, errorTag, errorSeverity, Collections.<String, String> emptyMap());
     }
 
     public MissingNameSpaceException(final String message, final ErrorType errorType, final ErrorTag errorTag,
-                                      final ErrorSeverity errorSeverity, final Map<String, String> errorInfo){
+                                     final ErrorSeverity errorSeverity, final Map<String, String> errorInfo){
         super(message,errorType,errorTag,errorSeverity,errorInfo);
     }
 }
index b470ce1..7b5f52e 100644 (file)
@@ -7,20 +7,21 @@
  */
 package org.opendaylight.controller.netconf.util.exception;
 
-import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
-
 import java.util.Collections;
 import java.util.Map;
 
+import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
+
 public class UnexpectedElementException extends NetconfDocumentedException {
+    private static final long serialVersionUID = 1L;
 
     public UnexpectedElementException(final String message, final ErrorType errorType, final ErrorTag errorTag,
-                                        final ErrorSeverity errorSeverity) {
+                                      final ErrorSeverity errorSeverity) {
         this(message, errorType, errorTag, errorSeverity, Collections.<String, String> emptyMap());
     }
 
     public UnexpectedElementException(final String message, final ErrorType errorType, final ErrorTag errorTag,
-                                        final ErrorSeverity errorSeverity, final Map<String, String> errorInfo){
+                                      final ErrorSeverity errorSeverity, final Map<String, String> errorInfo) {
         super(message,errorType,errorTag,errorSeverity,errorInfo);
     }
 }
index 50d7670..582fd23 100644 (file)
@@ -7,12 +7,13 @@
  */
 package org.opendaylight.controller.netconf.util.exception;
 
-import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
-
 import java.util.Collections;
 import java.util.Map;
 
+import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
+
 public class UnexpectedNamespaceException extends NetconfDocumentedException {
+    private static final long serialVersionUID = 1L;
 
     public UnexpectedNamespaceException(final String message, final ErrorType errorType, final ErrorTag errorTag,
                                           final ErrorSeverity errorSeverity) {
index 9514ec1..c8f1dd2 100644 (file)
@@ -40,7 +40,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>2.3.6</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 4d491a5..998dd44 100644 (file)
@@ -36,7 +36,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index d861e0a..ee83c93 100644 (file)
@@ -24,7 +24,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index dc481ce..c06f8b4 100644 (file)
@@ -41,7 +41,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 83699d2..09c0757 100644 (file)
@@ -72,7 +72,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 7c17c74..a0940e3 100644 (file)
@@ -42,7 +42,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 1d91ab5..457b1bd 100644 (file)
@@ -43,7 +43,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 6c79f9d..07d34cb 100644 (file)
@@ -51,7 +51,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 2281aa8..205b68a 100644 (file)
@@ -46,7 +46,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index d8dee62..bf1b082 100644 (file)
@@ -46,7 +46,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 33f2048..c7b9cfc 100644 (file)
@@ -19,7 +19,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>2.4.0</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index f984d4e..62af41a 100644 (file)
@@ -19,7 +19,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index e78035f..f112978 100644 (file)
@@ -46,7 +46,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index a528f7c..728316a 100644 (file)
@@ -54,7 +54,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>2.3.6</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 0e496a4..dd2a2e6 100644 (file)
@@ -42,7 +42,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 5935db4..76ce062 100644 (file)
@@ -42,7 +42,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 7c68f41..5aa2f7f 100644 (file)
@@ -43,7 +43,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 8f54a28..590f0bb 100644 (file)
@@ -43,7 +43,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 838a15d..4a1142b 100644 (file)
@@ -43,7 +43,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 01e4308..c7ab2fa 100644 (file)
@@ -39,7 +39,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index e479335..a8fceec 100644 (file)
@@ -39,7 +39,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index fc760e4..540c9af 100644 (file)
@@ -26,7 +26,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index d923c45..b691308 100644 (file)
@@ -47,7 +47,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 070029f..3ee239a 100644 (file)
@@ -39,7 +39,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 2340a82..b194f76 100644 (file)
@@ -27,7 +27,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index e771f84..7150683 100644 (file)
@@ -27,7 +27,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index d8a7d7b..88986dc 100644 (file)
@@ -32,7 +32,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index ed3b391..5b2269a 100644 (file)
@@ -23,7 +23,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 38944e6..508c9bd 100644 (file)
@@ -27,7 +27,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 4d82122..7939083 100644 (file)
@@ -43,7 +43,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 9dd0f99..5854d55 100644 (file)
@@ -43,7 +43,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index d65980e..1208506 100644 (file)
@@ -43,7 +43,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 7ac2dbb..896e718 100644 (file)
@@ -30,7 +30,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index bcc4f40..aa9b88e 100644 (file)
@@ -26,7 +26,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 623c028..10abb3d 100644 (file)
@@ -65,7 +65,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 223bb88..94ba021 100644 (file)
@@ -47,7 +47,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 542470a..a0718db 100644 (file)
@@ -66,7 +66,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 7461358..196982b 100644 (file)
@@ -44,7 +44,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index ab2bb4f..c932a7c 100644 (file)
@@ -43,7 +43,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
@@ -67,7 +66,6 @@
               org.springframework.security.core.userdetails,
               javax.xml.bind.annotation</Import-Package>
             <Export-Package>org.opendaylight.controller.usermanager,</Export-Package>
-            <Bundle-Activator></Bundle-Activator>
           </instructions>
           <manifestLocation>${project.basedir}/META-INF</manifestLocation>
         </configuration>
index 58539ae..9567db0 100644 (file)
@@ -55,7 +55,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 8ec05a1..8906946 100644 (file)
@@ -50,7 +50,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 718b6df..f62c6ac 100644 (file)
@@ -42,7 +42,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index fc680a5..fc04088 100644 (file)
@@ -19,7 +19,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>2.4.0</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 441aab8..6f0a098 100644 (file)
@@ -63,7 +63,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index fbd07fb..e65c19f 100644 (file)
@@ -51,7 +51,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 1c03f30..b668892 100644 (file)
@@ -46,7 +46,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>

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