BUG-2794: incorporate openflowjava api changes to openflowplugin
[openflowplugin.git] / extension / openflowjava-extension-nicira / src / main / java / org / opendaylight / openflowjava / nx / codec / action / OutputRegCodec.java
index 813cd99a54f9564f5b871353594ceda0d453658d..ea16d1d49e83f79c73432951af6c4e2b0273d4b4 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * 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
@@ -9,11 +9,11 @@
 package org.opendaylight.openflowjava.nx.codec.action;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.nx.api.NiciraActionDeserializerKey;
 import org.opendaylight.openflowjava.nx.api.NiciraActionSerializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.NxmNxOutputReg;
@@ -24,15 +24,16 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 
 /**
  * Codec for the Nicira OutputRegAction
+ *
  * @author readams
  */
 public class OutputRegCodec extends AbstractActionCodec {
     public static final int LENGTH = 24;
     public static final byte SUBTYPE = 15; // NXAST_OUTPUT_REG
     public static final byte PADDING_IN_OUTPUT_REG_ACTION = 6;
-    public static final NiciraActionSerializerKey SERIALIZER_KEY = 
+    public static final NiciraActionSerializerKey SERIALIZER_KEY =
             new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, NxmNxOutputReg.class);
-    public static final NiciraActionDeserializerKey DESERIALIZER_KEY = 
+    public static final NiciraActionDeserializerKey DESERIALIZER_KEY =
             new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, SUBTYPE);
 
     @Override
@@ -47,7 +48,7 @@ public class OutputRegCodec extends AbstractActionCodec {
 
     @Override
     public Action deserialize(ByteBuf message) {
-        ActionBuilder actionBuilder = deserializeHeader(message);        
+        ActionBuilder actionBuilder = deserializeHeader(message);
         ActionOutputRegBuilder builder = new ActionOutputRegBuilder();
         builder.setNBits(message.readUnsignedShort());
         builder.setSrc(message.readUnsignedInt());
@@ -55,8 +56,9 @@ public class OutputRegCodec extends AbstractActionCodec {
         message.skipBytes(PADDING_IN_OUTPUT_REG_ACTION);
         OfjAugNxActionBuilder augNxActionBuilder = new OfjAugNxActionBuilder();
         augNxActionBuilder.setActionOutputReg(builder.build());
-        actionBuilder.addAugmentation(ExperimenterIdAction.class, 
-                                      createExperimenterIdAction(NxmNxOutputReg.class));
+        ExperimenterIdCaseBuilder experimenterIdCaseBuilder = new ExperimenterIdCaseBuilder();
+        actionBuilder.addAugmentation(ExperimenterIdAction.class,
+                createExperimenterIdAction(NxmNxOutputReg.class));
         actionBuilder.addAugmentation(OfjAugNxAction.class, augNxActionBuilder.build());
         return actionBuilder.build();
     }