Bug 2756 - Action model update
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / serialization / action / OF10OutputActionSerializer.java
index 83396c9e15ff7529a5eaa3277239701a2efdfa4a..4f90a40ca1e4b0b5132e11779bbff7f338493928 100644 (file)
@@ -11,9 +11,8 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.action;
 import io.netty.buffer.ByteBuf;
 
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
-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.rev150203.action.grouping.action.choice.OutputActionCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
 
 /**
  * @author michal.polkorab
@@ -24,10 +23,10 @@ public class OF10OutputActionSerializer extends AbstractActionSerializer {
     @Override
     public void serialize(Action action, ByteBuf outBuffer) {
         super.serialize(action, outBuffer);
-        PortAction port = action.getAugmentation(PortAction.class);
-        outBuffer.writeShort(port.getPort().getValue().intValue());
-        MaxLengthAction maxlength = action.getAugmentation(MaxLengthAction.class);
-        outBuffer.writeShort(maxlength.getMaxLength());
+        outBuffer.writeShort(((OutputActionCase) action.getActionChoice())
+                .getOutputAction().getPort().getValue().intValue());
+        outBuffer.writeShort(((OutputActionCase) action.getActionChoice())
+                .getOutputAction().getMaxLength());
     }
 
     @Override