Merge "Bug 2347: Minor fixes to correct log output"
authorMoiz Raja <moraja@cisco.com>
Thu, 13 Nov 2014 21:47:14 +0000 (21:47 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 13 Nov 2014 21:47:14 +0000 (21:47 +0000)
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ToSalConversionsUtils.java
opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestToSalConversionsUtils.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/ValueSerializer.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/protobuff/messages/common/NormalizedNodeMessages.java
opendaylight/md-sal/sal-clustering-commons/src/main/resources/Common.proto
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/ValueSerializerTest.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDevice.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/schema/mapping/NetconfMessageTransformer.java
opendaylight/md-sal/sal-netconf-connector/src/test/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTest.java

index dcc1a46..99e5a80 100644 (file)
@@ -52,6 +52,7 @@ import org.opendaylight.controller.sal.action.SetVlanPcp;
 import org.opendaylight.controller.sal.action.SwPath;
 import org.opendaylight.controller.sal.core.ConstructionException;
 import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.core.Node.NodeIDType;
 import org.opendaylight.controller.sal.core.NodeConnector;
 import org.opendaylight.controller.sal.flowprogrammer.Flow;
 import org.opendaylight.controller.sal.match.Match;
@@ -207,10 +208,16 @@ public class ToSalConversionsUtils {
 
                 Uri nodeConnector = ((OutputActionCase) sourceAction).getOutputAction().getOutputNodeConnector();
                 if (nodeConnector != null) {
-                    //for (Uri uri : nodeConnectors) {
-                    Uri fullNodeConnector = new Uri(node.getType()+":"+node.getID()+":"+nodeConnector.getValue());
+                    // TODO: We should really have a bi-directional map from AD-SAL node types to
+                    //       MD-SAL node types, but lets fix that later.
+                    String type = node.getType();
+                    if( type.equals(NodeIDType.OPENFLOW) ){
+                        type = NodeMapping.OPENFLOW_ID_PREFIX;
+                    }else{
+                        type = type + ":";
+                    }
+                    Uri fullNodeConnector = new Uri(type+node.getID()+":"+nodeConnector.getValue());
                         targetAction.add(new Output(fromNodeConnectorRef(fullNodeConnector, node)));
-                    //}
                 }
             } else if (sourceAction instanceof PopMplsActionCase) {
                 // TODO: define maping
index 54ffddb..7c20c24 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.sal.compatibility.test;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.CRUDP;
 import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.ETHERNET_ARP;
@@ -199,6 +200,29 @@ public class TestToSalConversionsUtils {
         assertEquals("OF|1@OF|00:00:00:00:00:00:00:2a", nodeConnector.toString());
     }
 
+    @Test
+    public void testActionFrom() throws ConstructionException {
+        // Bug 2021: Convert AD-SAL notation into MD-SAL notation before calling NodeConnector
+        Node node = new Node(NodeIDType.OPENFLOW, 42L);
+        List<Action> odActions = new ArrayList<>();
+
+        OutputActionBuilder outputActionBuilder = new OutputActionBuilder();
+        outputActionBuilder.setOutputNodeConnector(new Uri("CONTROLLER"));
+        OutputActionCaseBuilder outputActionCaseBuilder = new OutputActionCaseBuilder();
+        outputActionCaseBuilder.setOutputAction(outputActionBuilder.build());
+        odActions.add(new ActionBuilder().setAction(outputActionCaseBuilder.build()).build());
+
+        List<org.opendaylight.controller.sal.action.Action> targetAction =
+                ToSalConversionsUtils.actionFrom(odActions, node);
+        assertNotNull(targetAction);
+        assertTrue( Output.class.isInstance(targetAction.get(0)) );
+        Output targetActionOutput = (Output) targetAction.get(0);
+        NodeConnector port = targetActionOutput.getPort();
+        assertNotNull(port);
+        assertEquals(port.getType(), NodeConnectorIDType.CONTROLLER);
+        assertEquals(port.getID(), org.opendaylight.controller.sal.core.NodeConnector.SPECIALNODECONNECTORID);
+    }
+
     private void checkSalMatch(org.opendaylight.controller.sal.match.Match match, MtchType mt) throws ConstructionException {
         switch (mt) {
         case other:
index bb7f9c3..f562d8b 100644 (file)
@@ -9,15 +9,14 @@
 package org.opendaylight.controller.cluster.datastore.node.utils.serialization;
 
 import com.google.protobuf.ByteString;
-import org.opendaylight.controller.cluster.datastore.node.utils.QNameFactory;
-import org.opendaylight.controller.cluster.datastore.util.InstanceIdentifierUtils;
-import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.HashSet;
 import java.util.Set;
+import org.opendaylight.controller.cluster.datastore.node.utils.QNameFactory;
+import org.opendaylight.controller.cluster.datastore.util.InstanceIdentifierUtils;
+import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
 public class ValueSerializer {
     public static void serialize(NormalizedNodeMessages.Node.Builder builder,
@@ -50,7 +49,27 @@ public class ValueSerializer {
             QNameSerializationContext context, Object value){
 
         builder.setType(ValueType.getSerializableType(value).ordinal());
-        builder.setValue(value.toString());
+
+        if(value instanceof YangInstanceIdentifier) {
+            builder.setInstanceIdentifierValue(
+                    InstanceIdentifierUtils.toSerializable((YangInstanceIdentifier) value, context));
+        } else if(value instanceof Set) {
+            Set<?> set = (Set<?>) value;
+            if (!set.isEmpty()) {
+                for (Object o : set) {
+                    if (o instanceof String) {
+                        builder.addBitsValue(o.toString());
+                    } else {
+                        throw new IllegalArgumentException("Expected value type to be Bits but was : " +
+                                value.toString());
+                    }
+                }
+            }
+        } else if(value instanceof byte[]){
+            builder.setBytesValue(ByteString.copyFrom((byte[]) value));
+        } else {
+            builder.setValue(value.toString());
+        }
     }
 
     public static Object deSerialize(QNameDeSerializationContext context,
@@ -68,6 +87,15 @@ public class ValueSerializer {
 
     public static Object deSerialize(QNameDeSerializationContext context,
             NormalizedNodeMessages.PathArgumentAttribute attribute) {
+
+        if(attribute.getType() == ValueType.YANG_IDENTIFIER_TYPE.ordinal()){
+            return InstanceIdentifierUtils.fromSerializable(
+                    attribute.getInstanceIdentifierValue(), context);
+        } else if(attribute.getType() == ValueType.BITS_TYPE.ordinal()){
+            return new HashSet<>(attribute.getBitsValueList());
+        } else if(attribute.getType() == ValueType.BINARY_TYPE.ordinal()){
+            return attribute.getBytesValue().toByteArray();
+        }
         return deSerializeBasicTypes(attribute.getType(), attribute.getValue());
     }
 
index 8285009..0f14c6b 100644 (file)
@@ -840,6 +840,78 @@ public final class NormalizedNodeMessages {
      * <code>optional int32 type = 3;</code>
      */
     int getType();
+
+    // optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;
+    /**
+     * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;</code>
+     *
+     * <pre>
+     * Specific values
+     * </pre>
+     */
+    boolean hasInstanceIdentifierValue();
+    /**
+     * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;</code>
+     *
+     * <pre>
+     * Specific values
+     * </pre>
+     */
+    org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierValue();
+    /**
+     * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;</code>
+     *
+     * <pre>
+     * Specific values
+     * </pre>
+     */
+    org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierValueOrBuilder();
+
+    // repeated string bitsValue = 5;
+    /**
+     * <code>repeated string bitsValue = 5;</code>
+     *
+     * <pre>
+     * intValueType = Bits
+     * </pre>
+     */
+    java.util.List<java.lang.String>
+    getBitsValueList();
+    /**
+     * <code>repeated string bitsValue = 5;</code>
+     *
+     * <pre>
+     * intValueType = Bits
+     * </pre>
+     */
+    int getBitsValueCount();
+    /**
+     * <code>repeated string bitsValue = 5;</code>
+     *
+     * <pre>
+     * intValueType = Bits
+     * </pre>
+     */
+    java.lang.String getBitsValue(int index);
+    /**
+     * <code>repeated string bitsValue = 5;</code>
+     *
+     * <pre>
+     * intValueType = Bits
+     * </pre>
+     */
+    com.google.protobuf.ByteString
+        getBitsValueBytes(int index);
+
+    // optional bytes bytesValue = 6;
+    /**
+     * <code>optional bytes bytesValue = 6;</code>
+     */
+    boolean hasBytesValue();
+    /**
+     * <code>optional bytes bytesValue = 6;</code>
+     */
+    com.google.protobuf.ByteString getBytesValue();
   }
   /**
    * Protobuf type {@code org.opendaylight.controller.mdsal.PathArgumentAttribute}
@@ -915,6 +987,32 @@ public final class NormalizedNodeMessages {
               type_ = input.readInt32();
               break;
             }
+            case 34: {
+              org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder subBuilder = null;
+              if (((bitField0_ & 0x00000008) == 0x00000008)) {
+                subBuilder = instanceIdentifierValue_.toBuilder();
+              }
+              instanceIdentifierValue_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.PARSER, extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom(instanceIdentifierValue_);
+                instanceIdentifierValue_ = subBuilder.buildPartial();
+              }
+              bitField0_ |= 0x00000008;
+              break;
+            }
+            case 42: {
+              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
+                bitsValue_ = new com.google.protobuf.LazyStringArrayList();
+                mutable_bitField0_ |= 0x00000010;
+              }
+              bitsValue_.add(input.readBytes());
+              break;
+            }
+            case 50: {
+              bitField0_ |= 0x00000010;
+              bytesValue_ = input.readBytes();
+              break;
+            }
           }
         }
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
@@ -923,6 +1021,9 @@ public final class NormalizedNodeMessages {
         throw new com.google.protobuf.InvalidProtocolBufferException(
             e.getMessage()).setUnfinishedMessage(this);
       } finally {
+        if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
+          bitsValue_ = new com.google.protobuf.UnmodifiableLazyStringList(bitsValue_);
+        }
         this.unknownFields = unknownFields.build();
         makeExtensionsImmutable();
       }
@@ -1036,16 +1137,121 @@ public final class NormalizedNodeMessages {
       return type_;
     }
 
+    // optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;
+    public static final int INSTANCEIDENTIFIERVALUE_FIELD_NUMBER = 4;
+    private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierValue_;
+    /**
+     * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;</code>
+     *
+     * <pre>
+     * Specific values
+     * </pre>
+     */
+    public boolean hasInstanceIdentifierValue() {
+      return ((bitField0_ & 0x00000008) == 0x00000008);
+    }
+    /**
+     * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;</code>
+     *
+     * <pre>
+     * Specific values
+     * </pre>
+     */
+    public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierValue() {
+      return instanceIdentifierValue_;
+    }
+    /**
+     * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;</code>
+     *
+     * <pre>
+     * Specific values
+     * </pre>
+     */
+    public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierValueOrBuilder() {
+      return instanceIdentifierValue_;
+    }
+
+    // repeated string bitsValue = 5;
+    public static final int BITSVALUE_FIELD_NUMBER = 5;
+    private com.google.protobuf.LazyStringList bitsValue_;
+    /**
+     * <code>repeated string bitsValue = 5;</code>
+     *
+     * <pre>
+     * intValueType = Bits
+     * </pre>
+     */
+    public java.util.List<java.lang.String>
+        getBitsValueList() {
+      return bitsValue_;
+    }
+    /**
+     * <code>repeated string bitsValue = 5;</code>
+     *
+     * <pre>
+     * intValueType = Bits
+     * </pre>
+     */
+    public int getBitsValueCount() {
+      return bitsValue_.size();
+    }
+    /**
+     * <code>repeated string bitsValue = 5;</code>
+     *
+     * <pre>
+     * intValueType = Bits
+     * </pre>
+     */
+    public java.lang.String getBitsValue(int index) {
+      return bitsValue_.get(index);
+    }
+    /**
+     * <code>repeated string bitsValue = 5;</code>
+     *
+     * <pre>
+     * intValueType = Bits
+     * </pre>
+     */
+    public com.google.protobuf.ByteString
+        getBitsValueBytes(int index) {
+      return bitsValue_.getByteString(index);
+    }
+
+    // optional bytes bytesValue = 6;
+    public static final int BYTESVALUE_FIELD_NUMBER = 6;
+    private com.google.protobuf.ByteString bytesValue_;
+    /**
+     * <code>optional bytes bytesValue = 6;</code>
+     */
+    public boolean hasBytesValue() {
+      return ((bitField0_ & 0x00000010) == 0x00000010);
+    }
+    /**
+     * <code>optional bytes bytesValue = 6;</code>
+     */
+    public com.google.protobuf.ByteString getBytesValue() {
+      return bytesValue_;
+    }
+
     private void initFields() {
       name_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.getDefaultInstance();
       value_ = "";
       type_ = 0;
+      instanceIdentifierValue_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+      bitsValue_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+      bytesValue_ = com.google.protobuf.ByteString.EMPTY;
     }
     private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
       byte isInitialized = memoizedIsInitialized;
       if (isInitialized != -1) return isInitialized == 1;
 
+      if (hasInstanceIdentifierValue()) {
+        if (!getInstanceIdentifierValue().isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
+      }
       memoizedIsInitialized = 1;
       return true;
     }
@@ -1062,6 +1268,15 @@ public final class NormalizedNodeMessages {
       if (((bitField0_ & 0x00000004) == 0x00000004)) {
         output.writeInt32(3, type_);
       }
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
+        output.writeMessage(4, instanceIdentifierValue_);
+      }
+      for (int i = 0; i < bitsValue_.size(); i++) {
+        output.writeBytes(5, bitsValue_.getByteString(i));
+      }
+      if (((bitField0_ & 0x00000010) == 0x00000010)) {
+        output.writeBytes(6, bytesValue_);
+      }
       getUnknownFields().writeTo(output);
     }
 
@@ -1083,6 +1298,23 @@ public final class NormalizedNodeMessages {
         size += com.google.protobuf.CodedOutputStream
           .computeInt32Size(3, type_);
       }
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeMessageSize(4, instanceIdentifierValue_);
+      }
+      {
+        int dataSize = 0;
+        for (int i = 0; i < bitsValue_.size(); i++) {
+          dataSize += com.google.protobuf.CodedOutputStream
+            .computeBytesSizeNoTag(bitsValue_.getByteString(i));
+        }
+        size += dataSize;
+        size += 1 * getBitsValueList().size();
+      }
+      if (((bitField0_ & 0x00000010) == 0x00000010)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeBytesSize(6, bytesValue_);
+      }
       size += getUnknownFields().getSerializedSize();
       memoizedSerializedSize = size;
       return size;
@@ -1192,6 +1424,7 @@ public final class NormalizedNodeMessages {
       private void maybeForceBuilderInitialization() {
         if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
           getNameFieldBuilder();
+          getInstanceIdentifierValueFieldBuilder();
         }
       }
       private static Builder create() {
@@ -1210,6 +1443,16 @@ public final class NormalizedNodeMessages {
         bitField0_ = (bitField0_ & ~0x00000002);
         type_ = 0;
         bitField0_ = (bitField0_ & ~0x00000004);
+        if (instanceIdentifierValueBuilder_ == null) {
+          instanceIdentifierValue_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+        } else {
+          instanceIdentifierValueBuilder_.clear();
+        }
+        bitField0_ = (bitField0_ & ~0x00000008);
+        bitsValue_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+        bitField0_ = (bitField0_ & ~0x00000010);
+        bytesValue_ = com.google.protobuf.ByteString.EMPTY;
+        bitField0_ = (bitField0_ & ~0x00000020);
         return this;
       }
 
@@ -1254,6 +1497,24 @@ public final class NormalizedNodeMessages {
           to_bitField0_ |= 0x00000004;
         }
         result.type_ = type_;
+        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
+          to_bitField0_ |= 0x00000008;
+        }
+        if (instanceIdentifierValueBuilder_ == null) {
+          result.instanceIdentifierValue_ = instanceIdentifierValue_;
+        } else {
+          result.instanceIdentifierValue_ = instanceIdentifierValueBuilder_.build();
+        }
+        if (((bitField0_ & 0x00000010) == 0x00000010)) {
+          bitsValue_ = new com.google.protobuf.UnmodifiableLazyStringList(
+              bitsValue_);
+          bitField0_ = (bitField0_ & ~0x00000010);
+        }
+        result.bitsValue_ = bitsValue_;
+        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
+          to_bitField0_ |= 0x00000010;
+        }
+        result.bytesValue_ = bytesValue_;
         result.bitField0_ = to_bitField0_;
         onBuilt();
         return result;
@@ -1281,11 +1542,33 @@ public final class NormalizedNodeMessages {
         if (other.hasType()) {
           setType(other.getType());
         }
+        if (other.hasInstanceIdentifierValue()) {
+          mergeInstanceIdentifierValue(other.getInstanceIdentifierValue());
+        }
+        if (!other.bitsValue_.isEmpty()) {
+          if (bitsValue_.isEmpty()) {
+            bitsValue_ = other.bitsValue_;
+            bitField0_ = (bitField0_ & ~0x00000010);
+          } else {
+            ensureBitsValueIsMutable();
+            bitsValue_.addAll(other.bitsValue_);
+          }
+          onChanged();
+        }
+        if (other.hasBytesValue()) {
+          setBytesValue(other.getBytesValue());
+        }
         this.mergeUnknownFields(other.getUnknownFields());
         return this;
       }
 
       public final boolean isInitialized() {
+        if (hasInstanceIdentifierValue()) {
+          if (!getInstanceIdentifierValue().isInitialized()) {
+
+            return false;
+          }
+        }
         return true;
       }
 
@@ -1347,187 +1630,505 @@ public final class NormalizedNodeMessages {
       /**
        * <code>optional .org.opendaylight.controller.mdsal.QName name = 1;</code>
        */
-      public Builder setName(
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder builderForValue) {
-        if (nameBuilder_ == null) {
-          name_ = builderForValue.build();
+      public Builder setName(
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder builderForValue) {
+        if (nameBuilder_ == null) {
+          name_ = builderForValue.build();
+          onChanged();
+        } else {
+          nameBuilder_.setMessage(builderForValue.build());
+        }
+        bitField0_ |= 0x00000001;
+        return this;
+      }
+      /**
+       * <code>optional .org.opendaylight.controller.mdsal.QName name = 1;</code>
+       */
+      public Builder mergeName(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName value) {
+        if (nameBuilder_ == null) {
+          if (((bitField0_ & 0x00000001) == 0x00000001) &&
+              name_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.getDefaultInstance()) {
+            name_ =
+              org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.newBuilder(name_).mergeFrom(value).buildPartial();
+          } else {
+            name_ = value;
+          }
+          onChanged();
+        } else {
+          nameBuilder_.mergeFrom(value);
+        }
+        bitField0_ |= 0x00000001;
+        return this;
+      }
+      /**
+       * <code>optional .org.opendaylight.controller.mdsal.QName name = 1;</code>
+       */
+      public Builder clearName() {
+        if (nameBuilder_ == null) {
+          name_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.getDefaultInstance();
+          onChanged();
+        } else {
+          nameBuilder_.clear();
+        }
+        bitField0_ = (bitField0_ & ~0x00000001);
+        return this;
+      }
+      /**
+       * <code>optional .org.opendaylight.controller.mdsal.QName name = 1;</code>
+       */
+      public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder getNameBuilder() {
+        bitField0_ |= 0x00000001;
+        onChanged();
+        return getNameFieldBuilder().getBuilder();
+      }
+      /**
+       * <code>optional .org.opendaylight.controller.mdsal.QName name = 1;</code>
+       */
+      public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QNameOrBuilder getNameOrBuilder() {
+        if (nameBuilder_ != null) {
+          return nameBuilder_.getMessageOrBuilder();
+        } else {
+          return name_;
+        }
+      }
+      /**
+       * <code>optional .org.opendaylight.controller.mdsal.QName name = 1;</code>
+       */
+      private com.google.protobuf.SingleFieldBuilder<
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QNameOrBuilder>
+          getNameFieldBuilder() {
+        if (nameBuilder_ == null) {
+          nameBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+              org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QNameOrBuilder>(
+                  name_,
+                  getParentForChildren(),
+                  isClean());
+          name_ = null;
+        }
+        return nameBuilder_;
+      }
+
+      // optional string value = 2;
+      private java.lang.Object value_ = "";
+      /**
+       * <code>optional string value = 2;</code>
+       */
+      public boolean hasValue() {
+        return ((bitField0_ & 0x00000002) == 0x00000002);
+      }
+      /**
+       * <code>optional string value = 2;</code>
+       */
+      public java.lang.String getValue() {
+        java.lang.Object ref = value_;
+        if (!(ref instanceof java.lang.String)) {
+          java.lang.String s = ((com.google.protobuf.ByteString) ref)
+              .toStringUtf8();
+          value_ = s;
+          return s;
+        } else {
+          return (java.lang.String) ref;
+        }
+      }
+      /**
+       * <code>optional string value = 2;</code>
+       */
+      public com.google.protobuf.ByteString
+          getValueBytes() {
+        java.lang.Object ref = value_;
+        if (ref instanceof String) {
+          com.google.protobuf.ByteString b =
+              com.google.protobuf.ByteString.copyFromUtf8(
+                  (java.lang.String) ref);
+          value_ = b;
+          return b;
+        } else {
+          return (com.google.protobuf.ByteString) ref;
+        }
+      }
+      /**
+       * <code>optional string value = 2;</code>
+       */
+      public Builder setValue(
+          java.lang.String value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000002;
+        value_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>optional string value = 2;</code>
+       */
+      public Builder clearValue() {
+        bitField0_ = (bitField0_ & ~0x00000002);
+        value_ = getDefaultInstance().getValue();
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>optional string value = 2;</code>
+       */
+      public Builder setValueBytes(
+          com.google.protobuf.ByteString value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000002;
+        value_ = value;
+        onChanged();
+        return this;
+      }
+
+      // optional int32 type = 3;
+      private int type_ ;
+      /**
+       * <code>optional int32 type = 3;</code>
+       */
+      public boolean hasType() {
+        return ((bitField0_ & 0x00000004) == 0x00000004);
+      }
+      /**
+       * <code>optional int32 type = 3;</code>
+       */
+      public int getType() {
+        return type_;
+      }
+      /**
+       * <code>optional int32 type = 3;</code>
+       */
+      public Builder setType(int value) {
+        bitField0_ |= 0x00000004;
+        type_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>optional int32 type = 3;</code>
+       */
+      public Builder clearType() {
+        bitField0_ = (bitField0_ & ~0x00000004);
+        type_ = 0;
+        onChanged();
+        return this;
+      }
+
+      // optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;
+      private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierValue_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+      private com.google.protobuf.SingleFieldBuilder<
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> instanceIdentifierValueBuilder_;
+      /**
+       * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;</code>
+       *
+       * <pre>
+       * Specific values
+       * </pre>
+       */
+      public boolean hasInstanceIdentifierValue() {
+        return ((bitField0_ & 0x00000008) == 0x00000008);
+      }
+      /**
+       * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;</code>
+       *
+       * <pre>
+       * Specific values
+       * </pre>
+       */
+      public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierValue() {
+        if (instanceIdentifierValueBuilder_ == null) {
+          return instanceIdentifierValue_;
+        } else {
+          return instanceIdentifierValueBuilder_.getMessage();
+        }
+      }
+      /**
+       * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;</code>
+       *
+       * <pre>
+       * Specific values
+       * </pre>
+       */
+      public Builder setInstanceIdentifierValue(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+        if (instanceIdentifierValueBuilder_ == null) {
+          if (value == null) {
+            throw new NullPointerException();
+          }
+          instanceIdentifierValue_ = value;
+          onChanged();
+        } else {
+          instanceIdentifierValueBuilder_.setMessage(value);
+        }
+        bitField0_ |= 0x00000008;
+        return this;
+      }
+      /**
+       * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;</code>
+       *
+       * <pre>
+       * Specific values
+       * </pre>
+       */
+      public Builder setInstanceIdentifierValue(
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder builderForValue) {
+        if (instanceIdentifierValueBuilder_ == null) {
+          instanceIdentifierValue_ = builderForValue.build();
           onChanged();
         } else {
-          nameBuilder_.setMessage(builderForValue.build());
+          instanceIdentifierValueBuilder_.setMessage(builderForValue.build());
         }
-        bitField0_ |= 0x00000001;
+        bitField0_ |= 0x00000008;
         return this;
       }
       /**
-       * <code>optional .org.opendaylight.controller.mdsal.QName name = 1;</code>
+       * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;</code>
+       *
+       * <pre>
+       * Specific values
+       * </pre>
        */
-      public Builder mergeName(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName value) {
-        if (nameBuilder_ == null) {
-          if (((bitField0_ & 0x00000001) == 0x00000001) &&
-              name_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.getDefaultInstance()) {
-            name_ =
-              org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.newBuilder(name_).mergeFrom(value).buildPartial();
+      public Builder mergeInstanceIdentifierValue(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+        if (instanceIdentifierValueBuilder_ == null) {
+          if (((bitField0_ & 0x00000008) == 0x00000008) &&
+              instanceIdentifierValue_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance()) {
+            instanceIdentifierValue_ =
+              org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.newBuilder(instanceIdentifierValue_).mergeFrom(value).buildPartial();
           } else {
-            name_ = value;
+            instanceIdentifierValue_ = value;
           }
           onChanged();
         } else {
-          nameBuilder_.mergeFrom(value);
+          instanceIdentifierValueBuilder_.mergeFrom(value);
         }
-        bitField0_ |= 0x00000001;
+        bitField0_ |= 0x00000008;
         return this;
       }
       /**
-       * <code>optional .org.opendaylight.controller.mdsal.QName name = 1;</code>
+       * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;</code>
+       *
+       * <pre>
+       * Specific values
+       * </pre>
        */
-      public Builder clearName() {
-        if (nameBuilder_ == null) {
-          name_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.getDefaultInstance();
+      public Builder clearInstanceIdentifierValue() {
+        if (instanceIdentifierValueBuilder_ == null) {
+          instanceIdentifierValue_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
           onChanged();
         } else {
-          nameBuilder_.clear();
+          instanceIdentifierValueBuilder_.clear();
         }
-        bitField0_ = (bitField0_ & ~0x00000001);
+        bitField0_ = (bitField0_ & ~0x00000008);
         return this;
       }
       /**
-       * <code>optional .org.opendaylight.controller.mdsal.QName name = 1;</code>
+       * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;</code>
+       *
+       * <pre>
+       * Specific values
+       * </pre>
        */
-      public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder getNameBuilder() {
-        bitField0_ |= 0x00000001;
+      public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder getInstanceIdentifierValueBuilder() {
+        bitField0_ |= 0x00000008;
         onChanged();
-        return getNameFieldBuilder().getBuilder();
+        return getInstanceIdentifierValueFieldBuilder().getBuilder();
       }
       /**
-       * <code>optional .org.opendaylight.controller.mdsal.QName name = 1;</code>
+       * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;</code>
+       *
+       * <pre>
+       * Specific values
+       * </pre>
        */
-      public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QNameOrBuilder getNameOrBuilder() {
-        if (nameBuilder_ != null) {
-          return nameBuilder_.getMessageOrBuilder();
+      public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierValueOrBuilder() {
+        if (instanceIdentifierValueBuilder_ != null) {
+          return instanceIdentifierValueBuilder_.getMessageOrBuilder();
         } else {
-          return name_;
+          return instanceIdentifierValue_;
         }
       }
       /**
-       * <code>optional .org.opendaylight.controller.mdsal.QName name = 1;</code>
+       * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 4;</code>
+       *
+       * <pre>
+       * Specific values
+       * </pre>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QNameOrBuilder>
-          getNameFieldBuilder() {
-        if (nameBuilder_ == null) {
-          nameBuilder_ = new com.google.protobuf.SingleFieldBuilder<
-              org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QNameOrBuilder>(
-                  name_,
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
+          getInstanceIdentifierValueFieldBuilder() {
+        if (instanceIdentifierValueBuilder_ == null) {
+          instanceIdentifierValueBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+              org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>(
+                  instanceIdentifierValue_,
                   getParentForChildren(),
                   isClean());
-          name_ = null;
+          instanceIdentifierValue_ = null;
         }
-        return nameBuilder_;
+        return instanceIdentifierValueBuilder_;
       }
 
-      // optional string value = 2;
-      private java.lang.Object value_ = "";
+      // repeated string bitsValue = 5;
+      private com.google.protobuf.LazyStringList bitsValue_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+      private void ensureBitsValueIsMutable() {
+        if (!((bitField0_ & 0x00000010) == 0x00000010)) {
+          bitsValue_ = new com.google.protobuf.LazyStringArrayList(bitsValue_);
+          bitField0_ |= 0x00000010;
+         }
+      }
       /**
-       * <code>optional string value = 2;</code>
+       * <code>repeated string bitsValue = 5;</code>
+       *
+       * <pre>
+       * intValueType = Bits
+       * </pre>
        */
-      public boolean hasValue() {
-        return ((bitField0_ & 0x00000002) == 0x00000002);
+      public java.util.List<java.lang.String>
+          getBitsValueList() {
+        return java.util.Collections.unmodifiableList(bitsValue_);
       }
       /**
-       * <code>optional string value = 2;</code>
+       * <code>repeated string bitsValue = 5;</code>
+       *
+       * <pre>
+       * intValueType = Bits
+       * </pre>
        */
-      public java.lang.String getValue() {
-        java.lang.Object ref = value_;
-        if (!(ref instanceof java.lang.String)) {
-          java.lang.String s = ((com.google.protobuf.ByteString) ref)
-              .toStringUtf8();
-          value_ = s;
-          return s;
-        } else {
-          return (java.lang.String) ref;
-        }
+      public int getBitsValueCount() {
+        return bitsValue_.size();
       }
       /**
-       * <code>optional string value = 2;</code>
+       * <code>repeated string bitsValue = 5;</code>
+       *
+       * <pre>
+       * intValueType = Bits
+       * </pre>
+       */
+      public java.lang.String getBitsValue(int index) {
+        return bitsValue_.get(index);
+      }
+      /**
+       * <code>repeated string bitsValue = 5;</code>
+       *
+       * <pre>
+       * intValueType = Bits
+       * </pre>
        */
       public com.google.protobuf.ByteString
-          getValueBytes() {
-        java.lang.Object ref = value_;
-        if (ref instanceof String) {
-          com.google.protobuf.ByteString b =
-              com.google.protobuf.ByteString.copyFromUtf8(
-                  (java.lang.String) ref);
-          value_ = b;
-          return b;
-        } else {
-          return (com.google.protobuf.ByteString) ref;
-        }
+          getBitsValueBytes(int index) {
+        return bitsValue_.getByteString(index);
       }
       /**
-       * <code>optional string value = 2;</code>
+       * <code>repeated string bitsValue = 5;</code>
+       *
+       * <pre>
+       * intValueType = Bits
+       * </pre>
        */
-      public Builder setValue(
+      public Builder setBitsValue(
+          int index, java.lang.String value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  ensureBitsValueIsMutable();
+        bitsValue_.set(index, value);
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>repeated string bitsValue = 5;</code>
+       *
+       * <pre>
+       * intValueType = Bits
+       * </pre>
+       */
+      public Builder addBitsValue(
           java.lang.String value) {
         if (value == null) {
     throw new NullPointerException();
   }
-  bitField0_ |= 0x00000002;
-        value_ = value;
+  ensureBitsValueIsMutable();
+        bitsValue_.add(value);
         onChanged();
         return this;
       }
       /**
-       * <code>optional string value = 2;</code>
+       * <code>repeated string bitsValue = 5;</code>
+       *
+       * <pre>
+       * intValueType = Bits
+       * </pre>
        */
-      public Builder clearValue() {
-        bitField0_ = (bitField0_ & ~0x00000002);
-        value_ = getDefaultInstance().getValue();
+      public Builder addAllBitsValue(
+          java.lang.Iterable<java.lang.String> values) {
+        ensureBitsValueIsMutable();
+        super.addAll(values, bitsValue_);
         onChanged();
         return this;
       }
       /**
-       * <code>optional string value = 2;</code>
+       * <code>repeated string bitsValue = 5;</code>
+       *
+       * <pre>
+       * intValueType = Bits
+       * </pre>
        */
-      public Builder setValueBytes(
+      public Builder clearBitsValue() {
+        bitsValue_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+        bitField0_ = (bitField0_ & ~0x00000010);
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>repeated string bitsValue = 5;</code>
+       *
+       * <pre>
+       * intValueType = Bits
+       * </pre>
+       */
+      public Builder addBitsValueBytes(
           com.google.protobuf.ByteString value) {
         if (value == null) {
     throw new NullPointerException();
   }
-  bitField0_ |= 0x00000002;
-        value_ = value;
+  ensureBitsValueIsMutable();
+        bitsValue_.add(value);
         onChanged();
         return this;
       }
 
-      // optional int32 type = 3;
-      private int type_ ;
+      // optional bytes bytesValue = 6;
+      private com.google.protobuf.ByteString bytesValue_ = com.google.protobuf.ByteString.EMPTY;
       /**
-       * <code>optional int32 type = 3;</code>
+       * <code>optional bytes bytesValue = 6;</code>
        */
-      public boolean hasType() {
-        return ((bitField0_ & 0x00000004) == 0x00000004);
+      public boolean hasBytesValue() {
+        return ((bitField0_ & 0x00000020) == 0x00000020);
       }
       /**
-       * <code>optional int32 type = 3;</code>
+       * <code>optional bytes bytesValue = 6;</code>
        */
-      public int getType() {
-        return type_;
+      public com.google.protobuf.ByteString getBytesValue() {
+        return bytesValue_;
       }
       /**
-       * <code>optional int32 type = 3;</code>
+       * <code>optional bytes bytesValue = 6;</code>
        */
-      public Builder setType(int value) {
-        bitField0_ |= 0x00000004;
-        type_ = value;
+      public Builder setBytesValue(com.google.protobuf.ByteString value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000020;
+        bytesValue_ = value;
         onChanged();
         return this;
       }
       /**
-       * <code>optional int32 type = 3;</code>
+       * <code>optional bytes bytesValue = 6;</code>
        */
-      public Builder clearType() {
-        bitField0_ = (bitField0_ & ~0x00000004);
-        type_ = 0;
+      public Builder clearBytesValue() {
+        bitField0_ = (bitField0_ & ~0x00000020);
+        bytesValue_ = getDefaultInstance().getBytesValue();
         onChanged();
         return this;
       }
@@ -2850,6 +3451,12 @@ public final class NormalizedNodeMessages {
       byte isInitialized = memoizedIsInitialized;
       if (isInitialized != -1) return isInitialized == 1;
 
+      for (int i = 0; i < getAttributeCount(); i++) {
+        if (!getAttribute(i).isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
+      }
       for (int i = 0; i < getAttributesCount(); i++) {
         if (!getAttributes(i).isInitialized()) {
           memoizedIsInitialized = 0;
@@ -3212,6 +3819,12 @@ public final class NormalizedNodeMessages {
       }
 
       public final boolean isInitialized() {
+        for (int i = 0; i < getAttributeCount(); i++) {
+          if (!getAttribute(i).isInitialized()) {
+
+            return false;
+          }
+        }
         for (int i = 0; i < getAttributesCount(); i++) {
           if (!getAttributes(i).isInitialized()) {
 
@@ -10357,43 +10970,46 @@ public final class NormalizedNodeMessages {
     java.lang.String[] descriptorData = {
       "\n\014Common.proto\022!org.opendaylight.control" +
       "ler.mdsal\"6\n\tAttribute\022\014\n\004name\030\001 \002(\t\022\r\n\005" +
-      "value\030\002 \001(\t\022\014\n\004type\030\003 \001(\t\"l\n\025PathArgumen" +
-      "tAttribute\0226\n\004name\030\001 \001(\0132(.org.opendayli" +
-      "ght.controller.mdsal.QName\022\r\n\005value\030\002 \001(" +
-      "\t\022\014\n\004type\030\003 \001(\005\"N\n\005QName\022\r\n\005value\030\001 \001(\t\022" +
-      "\021\n\tnamespace\030\002 \001(\005\022\020\n\010revision\030\003 \001(\005\022\021\n\t" +
-      "localName\030\004 \001(\005\"\207\002\n\014PathArgument\022\r\n\005valu" +
-      "e\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022:\n\010nodeType\030\003 \001(\0132" +
-      "(.org.opendaylight.controller.mdsal.QNam",
-      "e\022K\n\tattribute\030\004 \003(\01328.org.opendaylight." +
-      "controller.mdsal.PathArgumentAttribute\022@" +
+      "value\030\002 \001(\t\022\014\n\004type\030\003 \001(\t\"\353\001\n\025PathArgume" +
+      "ntAttribute\0226\n\004name\030\001 \001(\0132(.org.opendayl" +
+      "ight.controller.mdsal.QName\022\r\n\005value\030\002 \001" +
+      "(\t\022\014\n\004type\030\003 \001(\005\022V\n\027instanceIdentifierVa" +
+      "lue\030\004 \001(\01325.org.opendaylight.controller." +
+      "mdsal.InstanceIdentifier\022\021\n\tbitsValue\030\005 " +
+      "\003(\t\022\022\n\nbytesValue\030\006 \001(\014\"N\n\005QName\022\r\n\005valu" +
+      "e\030\001 \001(\t\022\021\n\tnamespace\030\002 \001(\005\022\020\n\010revision\030\003",
+      " \001(\005\022\021\n\tlocalName\030\004 \001(\005\"\207\002\n\014PathArgument" +
+      "\022\r\n\005value\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022:\n\010nodeTyp" +
+      "e\030\003 \001(\0132(.org.opendaylight.controller.md" +
+      "sal.QName\022K\n\tattribute\030\004 \003(\01328.org.opend" +
+      "aylight.controller.mdsal.PathArgumentAtt" +
+      "ribute\022@\n\nattributes\030\005 \003(\0132,.org.openday" +
+      "light.controller.mdsal.Attribute\022\017\n\007intT" +
+      "ype\030\006 \001(\005\"f\n\022InstanceIdentifier\022B\n\targum" +
+      "ents\030\001 \003(\0132/.org.opendaylight.controller" +
+      ".mdsal.PathArgument\022\014\n\004code\030\002 \003(\t\"\271\003\n\004No",
+      "de\022\014\n\004path\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022E\n\014pathAr" +
+      "gument\030\003 \001(\0132/.org.opendaylight.controll" +
+      "er.mdsal.PathArgument\022\017\n\007intType\030\004 \001(\005\022@" +
       "\n\nattributes\030\005 \003(\0132,.org.opendaylight.co" +
-      "ntroller.mdsal.Attribute\022\017\n\007intType\030\006 \001(" +
-      "\005\"f\n\022InstanceIdentifier\022B\n\targuments\030\001 \003" +
-      "(\0132/.org.opendaylight.controller.mdsal.P" +
-      "athArgument\022\014\n\004code\030\002 \003(\t\"\271\003\n\004Node\022\014\n\004pa" +
-      "th\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022E\n\014pathArgument\030\003" +
-      " \001(\0132/.org.opendaylight.controller.mdsal" +
-      ".PathArgument\022\017\n\007intType\030\004 \001(\005\022@\n\nattrib",
-      "utes\030\005 \003(\0132,.org.opendaylight.controller" +
-      ".mdsal.Attribute\0226\n\005child\030\006 \003(\0132\'.org.op" +
-      "endaylight.controller.mdsal.Node\022\r\n\005valu" +
-      "e\030\007 \001(\t\022\021\n\tvalueType\030\010 \001(\t\022\024\n\014intValueTy" +
-      "pe\030\t \001(\005\022V\n\027instanceIdentifierValue\030\n \001(" +
-      "\01325.org.opendaylight.controller.mdsal.In" +
-      "stanceIdentifier\022\021\n\tbitsValue\030\013 \003(\t\022\014\n\004c" +
-      "ode\030\014 \003(\t\022\022\n\nbytesValue\030\r \001(\014\"`\n\tContain" +
-      "er\022\022\n\nparentPath\030\001 \002(\t\022?\n\016normalizedNode" +
-      "\030\002 \001(\0132\'.org.opendaylight.controller.mds",
-      "al.Node\"\246\001\n\014NodeMapEntry\022U\n\026instanceIden" +
-      "tifierPath\030\001 \002(\01325.org.opendaylight.cont" +
-      "roller.mdsal.InstanceIdentifier\022?\n\016norma" +
-      "lizedNode\030\002 \001(\0132\'.org.opendaylight.contr" +
-      "oller.mdsal.Node\"N\n\007NodeMap\022C\n\nmapEntrie" +
-      "s\030\001 \003(\0132/.org.opendaylight.controller.md" +
-      "sal.NodeMapEntryBO\n5org.opendaylight.con" +
-      "troller.protobuff.messages.commonB\026Norma" +
-      "lizedNodeMessages"
+      "ntroller.mdsal.Attribute\0226\n\005child\030\006 \003(\0132" +
+      "\'.org.opendaylight.controller.mdsal.Node" +
+      "\022\r\n\005value\030\007 \001(\t\022\021\n\tvalueType\030\010 \001(\t\022\024\n\014in" +
+      "tValueType\030\t \001(\005\022V\n\027instanceIdentifierVa" +
+      "lue\030\n \001(\01325.org.opendaylight.controller." +
+      "mdsal.InstanceIdentifier\022\021\n\tbitsValue\030\013 ",
+      "\003(\t\022\014\n\004code\030\014 \003(\t\022\022\n\nbytesValue\030\r \001(\014\"`\n" +
+      "\tContainer\022\022\n\nparentPath\030\001 \002(\t\022?\n\016normal" +
+      "izedNode\030\002 \001(\0132\'.org.opendaylight.contro" +
+      "ller.mdsal.Node\"\246\001\n\014NodeMapEntry\022U\n\026inst" +
+      "anceIdentifierPath\030\001 \002(\01325.org.opendayli" +
+      "ght.controller.mdsal.InstanceIdentifier\022" +
+      "?\n\016normalizedNode\030\002 \001(\0132\'.org.opendaylig" +
+      "ht.controller.mdsal.Node\"N\n\007NodeMap\022C\n\nm" +
+      "apEntries\030\001 \003(\0132/.org.opendaylight.contr" +
+      "oller.mdsal.NodeMapEntryBO\n5org.opendayl",
+      "ight.controller.protobuff.messages.commo" +
+      "nB\026NormalizedNodeMessages"
     };
     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
       new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@@ -10411,7 +11027,7 @@ public final class NormalizedNodeMessages {
           internal_static_org_opendaylight_controller_mdsal_PathArgumentAttribute_fieldAccessorTable = new
             com.google.protobuf.GeneratedMessage.FieldAccessorTable(
               internal_static_org_opendaylight_controller_mdsal_PathArgumentAttribute_descriptor,
-              new java.lang.String[] { "Name", "Value", "Type", });
+              new java.lang.String[] { "Name", "Value", "Type", "InstanceIdentifierValue", "BitsValue", "BytesValue", });
           internal_static_org_opendaylight_controller_mdsal_QName_descriptor =
             getDescriptor().getMessageTypes().get(2);
           internal_static_org_opendaylight_controller_mdsal_QName_fieldAccessorTable = new
index 842a972..a2c161c 100644 (file)
@@ -14,6 +14,11 @@ message PathArgumentAttribute{
     optional QName name =1;
     optional string value=2;
     optional int32 type=3;
+    // Specific values
+    optional InstanceIdentifier instanceIdentifierValue = 4; // intValueType = YangInstanceIdentifier
+    repeated string bitsValue = 5; // intValueType = Bits
+    optional bytes bytesValue = 6;
+
 }
 
 
index d0be36b..d9b7a18 100644 (file)
@@ -1,7 +1,15 @@
 package org.opendaylight.controller.cluster.datastore.node.utils.serialization;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
+import com.google.protobuf.ByteString;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Arrays;
+import java.util.Set;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
@@ -10,12 +18,6 @@ import org.opendaylight.controller.cluster.datastore.util.TestModel;
 import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Set;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
 
 public class ValueSerializerTest{
 
@@ -118,7 +120,8 @@ public class ValueSerializerTest{
             ImmutableSet.of("foo", "bar"));
 
         assertEquals(ValueType.BITS_TYPE.ordinal(), builder1.getType());
-        assertEquals("[foo, bar]", builder1.getValue());
+        assertTrue( "foo not in bits", builder1.getBitsValueList().contains("foo"));
+        assertTrue( "bar not in bits", builder1.getBitsValueList().contains("bar"));
 
     }
 
@@ -218,6 +221,21 @@ public class ValueSerializerTest{
         assertEquals(1, serializedYangInstanceIdentifier.getArgumentsCount());
         Mockito.verify(mockContext).addLocalName(TestModel.TEST_QNAME.getLocalName());
         Mockito.verify(mockContext).addNamespace(TestModel.TEST_QNAME.getNamespace());
+
+        NormalizedNodeMessages.PathArgumentAttribute.Builder argumentBuilder
+                = NormalizedNodeMessages.PathArgumentAttribute.newBuilder();
+
+        mockContext = mock(QNameSerializationContext.class);
+
+        ValueSerializer.serialize(argumentBuilder, mockContext, v1);
+
+        serializedYangInstanceIdentifier =
+                argumentBuilder.getInstanceIdentifierValue();
+
+        assertEquals(1, serializedYangInstanceIdentifier.getArgumentsCount());
+        Mockito.verify(mockContext).addLocalName(TestModel.TEST_QNAME.getLocalName());
+        Mockito.verify(mockContext).addNamespace(TestModel.TEST_QNAME.getNamespace());
+
     }
 
     @Test
@@ -255,6 +273,25 @@ public class ValueSerializerTest{
 
     }
 
+    @Test
+    public void testSerializeBinary(){
+        NormalizedNodeMessages.Node.Builder builder = NormalizedNodeMessages.Node.newBuilder();
+        byte[] bytes = new byte[] {1,2,3,4};
+        ValueSerializer.serialize(builder, mock(QNameSerializationContext.class),bytes);
+
+        assertEquals(ValueType.BINARY_TYPE.ordinal(), builder.getIntValueType());
+        assertEquals(ByteString.copyFrom(bytes), builder.getBytesValue());
+
+        NormalizedNodeMessages.PathArgumentAttribute.Builder builder1 = NormalizedNodeMessages.PathArgumentAttribute.newBuilder();
+
+        ValueSerializer.serialize(builder1, mock(QNameSerializationContext.class),bytes);
+
+        assertEquals(ValueType.BINARY_TYPE.ordinal(), builder1.getType());
+        assertEquals(ByteString.copyFrom(bytes), builder1.getBytesValue());
+
+    }
+
+
     @Test
     public void testDeSerializeShort(){
         NormalizedNodeMessages.Node.Builder nodeBuilder = NormalizedNodeMessages.Node.newBuilder();
@@ -358,6 +395,20 @@ public class ValueSerializerTest{
         assertTrue(((Set<?>)o).contains("foo"));
         assertTrue(((Set<?>) o).contains("bar"));
 
+        NormalizedNodeMessages.PathArgumentAttribute.Builder argumentBuilder
+                = NormalizedNodeMessages.PathArgumentAttribute.newBuilder();
+
+        argumentBuilder.setType(ValueType.BITS_TYPE.ordinal());
+        argumentBuilder.addAllBitsValue(ImmutableList.of("foo", "bar"));
+
+        o = ValueSerializer
+                .deSerialize(mock(QNameDeSerializationContext.class),
+                        argumentBuilder.build());
+
+        assertTrue(o instanceof Set);
+        assertTrue(((Set<?>)o).contains("foo"));
+        assertTrue(((Set<?>) o).contains("bar"));
+
     }
 
     @Test
@@ -386,6 +437,16 @@ public class ValueSerializerTest{
         assertTrue(o instanceof YangInstanceIdentifier);
         assertEquals(TestModel.TEST_PATH, o);
 
+        NormalizedNodeMessages.PathArgumentAttribute.Builder argumentBuilder =
+                NormalizedNodeMessages.PathArgumentAttribute.newBuilder();
+
+        argumentBuilder.setType(ValueType.YANG_IDENTIFIER_TYPE.ordinal());
+        argumentBuilder.setInstanceIdentifierValue(idBuilder);
+
+        o = ValueSerializer.deSerialize(mockContext, argumentBuilder.build());
+
+        assertTrue(o instanceof YangInstanceIdentifier);
+        assertEquals(TestModel.TEST_PATH, o);
     }
 
     @Test
@@ -432,4 +493,31 @@ public class ValueSerializerTest{
 
     }
 
+
+    @Test
+    public void testDeSerializeBinaryType(){
+        NormalizedNodeMessages.Node.Builder nodeBuilder = NormalizedNodeMessages.Node.newBuilder();
+        nodeBuilder.setIntValueType(ValueType.BINARY_TYPE.ordinal());
+        byte[] bytes = new byte[] {1,2,3,4};
+        nodeBuilder.setBytesValue(ByteString.copyFrom(bytes));
+
+        Object o = ValueSerializer.deSerialize(mock(QNameDeSerializationContext.class),nodeBuilder.build());
+
+        assertTrue("not a byte array", o instanceof byte[]);
+        assertTrue("bytes value does not match" , Arrays.equals(bytes, (byte[]) o));
+
+        NormalizedNodeMessages.PathArgumentAttribute.Builder argumentBuilder =
+                NormalizedNodeMessages.PathArgumentAttribute.newBuilder();
+        argumentBuilder.setType(ValueType.BINARY_TYPE.ordinal());
+        argumentBuilder.setBytesValue(ByteString.copyFrom(bytes));
+
+        o = ValueSerializer.deSerialize(mock(QNameDeSerializationContext.class), argumentBuilder.build());
+
+        assertTrue("not a byte array", o instanceof byte[]);
+        assertTrue("bytes value does not match" ,Arrays.equals(bytes, (byte[]) o));
+
+
+    }
+
+
 }
index cc9eb5a..31779a7 100644 (file)
@@ -134,6 +134,14 @@ public final class NetconfDevice implements RemoteDevice<NetconfSessionCapabilit
         logger.error("{}: Initialization in sal failed, disconnecting from device", id, t);
         listener.close();
         onRemoteSessionDown();
+        resetMessageTransformer();
+    }
+
+    /**
+     * Set the schema context inside transformer to null as is in initial state
+     */
+    private void resetMessageTransformer() {
+        updateMessageTransformer(null);
     }
 
     /**
@@ -162,6 +170,7 @@ public final class NetconfDevice implements RemoteDevice<NetconfSessionCapabilit
         for (final SchemaSourceRegistration<? extends SchemaSourceRepresentation> sourceRegistration : sourceRegistrations) {
             sourceRegistration.close();
         }
+        resetMessageTransformer();
     }
 
     @Override
index fccbd71..02819c1 100644 (file)
@@ -8,12 +8,9 @@
 package org.opendaylight.controller.sal.connect.netconf.schema.mapping;
 
 import com.google.common.base.Optional;
-
 import java.util.List;
 import java.util.Set;
-
 import javax.activation.UnsupportedDataTypeException;
-
 import org.opendaylight.controller.netconf.api.NetconfMessage;
 import org.opendaylight.controller.sal.connect.api.MessageTransformer;
 import org.opendaylight.controller.sal.connect.netconf.util.NetconfMessageTransformUtil;
@@ -134,6 +131,6 @@ public class NetconfMessageTransformer implements MessageTransformer<NetconfMess
 
     @Override
     public synchronized void onGlobalContextUpdated(final SchemaContext schemaContext) {
-        this.schemaContext = Optional.of(schemaContext);
+        this.schemaContext = Optional.fromNullable(schemaContext);
     }
 }
index cbddac2..80ac4d7 100644 (file)
@@ -217,7 +217,7 @@ public class NetconfDeviceTest {
         device.onRemoteSessionUp(sessionCaps, listener);
 
         verify(schemaContextProviderFactory, timeout(5000).times(2)).createSchemaContext(any(Collection.class));
-        verify(messageTransformer, timeout(5000).times(2)).onGlobalContextUpdated(any(SchemaContext.class));
+        verify(messageTransformer, timeout(5000).times(3)).onGlobalContextUpdated(any(SchemaContext.class));
         verify(facade, timeout(5000).times(2)).onDeviceConnected(any(SchemaContext.class), any(NetconfSessionCapabilities.class), any(RpcImplementation.class));
     }