package org.opendaylight.openflowjava.protocol.api.keys;
-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.actions.grouping.Action;
/**
* @author michal.polkorab
package org.opendaylight.openflowjava.protocol.api.keys;
-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.types.rev130731.ActionBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
* @param <T> action type
*/
-public class ActionSerializerKey<T extends ActionBase> extends MessageTypeKey<Action> {
+public class ActionSerializerKey<T extends ActionChoice> extends MessageTypeKey<Action> {
private Class<T> actionType;
private Long experimenterId;
package org.opendaylight.openflowjava.protocol.api.keys;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Experimenter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.ExperimenterActionSubType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.action.container.action.choice.ExperimenterIdCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.ExperimenterActionSubType;
/**
* @author michal.polkorab
*/
-public final class ExperimenterActionSerializerKey extends ActionSerializerKey<Experimenter>
+public final class ExperimenterActionSerializerKey extends ActionSerializerKey<ExperimenterIdCase>
implements ExperimenterSerializerKey {
private Class<? extends ExperimenterActionSubType> actionSubType;
* @param actionSubType vendor defined subtype
*/
public ExperimenterActionSerializerKey(short msgVersion, Long experimenterId, Class<? extends ExperimenterActionSubType> actionSubType) {
- super(msgVersion, Experimenter.class, experimenterId);
+ super(msgVersion, ExperimenterIdCase.class, experimenterId);
this.actionSubType = actionSubType;
}
namespace "urn:opendaylight:openflow:common:action";
prefix "ofaction";
+ import ietf-inet-types {prefix inet;}
+ import ietf-yang-types {prefix yang;}
+
import openflow-types { prefix oft; }
+ import openflow-extensible-match { prefix oxm;}
- revision "2013-07-31" {
+ revision "2015-02-03" {
description "OpenFlow 1.3 - action model";
}
- identity output {
- description " Output to switch port. (both OF v1.0 and v1.3)";
- base oft:action-base;
- }
- identity copy_ttl_out {
- description " Copy TTL \"outwards\" -- from next-to-outermost to outermost ";
- base oft:action-base;
- }
- identity copy_ttl_in {
- description " Copy TTL \"inwards\" -- from outermost to next-to-outermost ";
- base oft:action-base;
- }
- identity set_mpls_ttl {
- description " MPLS TTL ";
- base oft:action-base;
- }
- identity dec_mpls_ttl {
- description " Decrement MPLS TTL ";
- base oft:action-base;
- }
- identity push_vlan {
- description " Push a new VLAN tag ";
- base oft:action-base;
- }
- identity pop_vlan {
- description " Pop the outer VLAN tag ";
- base oft:action-base;
- }
- identity push_mpls {
- description " Push a new MPLS tag ";
- base oft:action-base;
- }
- identity pop_mpls {
- description " Pop the outer MPLS tag ";
- base oft:action-base;
- }
- identity set_queue {
- description " Set queue id when outputting to a port ";
- base oft:action-base;
- }
- identity group {
- description " Apply group. ";
- base oft:action-base;
- }
- identity set_nw_ttl {
- description " IP TTL. ";
- base oft:action-base;
- }
- identity dec_nw_ttl {
- description " Decrement IP TTL. ";
- base oft:action-base;
- }
- identity set_field {
- description " Set a header field using OXM TLV format. ";
- base oft:action-base;
- }
- identity push_pbb {
- description " Push a new PBB service tag (I-TAG) ";
- base oft:action-base;
- }
- identity pop_pbb {
- description " Pop the outer PBB service tag (I-TAG) ";
- base oft:action-base;
- }
- identity experimenter {
- description "";
- base oft:action-base;
- }
-
identity experimenter-action-sub-type {
description "The base identity for vendor's actions.";
}
- container actions-container {
- uses actions-grouping;
+ container action-container {
+ uses action-grouping;
}
grouping actions-grouping {
list action {
- config false;
- leaf type {
- type identityref {
- base oft:action-base;
- }
- }
+ uses action-grouping;
}
}
- // OF1.0 structures
- identity set_vlan_vid {
- description "Set the 802.1q VLAN id (OF v1.0).";
- base oft:action-base;
- }
- identity set_vlan_pcp {
- description "Set the 802.1q priority (OF v1.0).";
- base oft:action-base;
- }
- identity strip_vlan {
- description "Strip the 802.1q header (OF v1.0).";
- base oft:action-base;
- }
- identity set_dl_src {
- description "Ethernet source address (OF v1.0).";
- base oft:action-base;
- }
- identity set_dl_dst {
- description "Ethernet destination address (OF v1.0).";
- base oft:action-base;
- }
- identity set_nw_src {
- description "IP source address (OF v1.0).";
- base oft:action-base;
- }
- identity set_nw_dst {
- description "IP destination address (OF v1.0).";
- base oft:action-base;
- }
- identity set_nw_tos {
- description "IP ToS (DSCP field, 6 bits) (OF v1.0).";
- base oft:action-base;
- }
- identity set_tp_src {
- description "TCP/UDP source port (OF v1.0).";
- base oft:action-base;
- }
- identity set_tp_dst {
- description "TCP/UDP destination port (OF v1.0).";
- base oft:action-base;
- }
- identity enqueue {
- description "Output to queue (OF v1.0).";
- base oft:action-base;
+ grouping action-grouping {
+ choice action-choice {
+ case output-action-case {
+ container output-action {
+ leaf port {
+ type oft:port-number;
+ }
+ leaf max-length {
+ type uint16;
+ }
+ }
+ }
+ case copy-ttl-out-case {
+ // empty action
+ }
+ case copy-ttl-in-case {
+ // empty action
+ }
+ case set-mpls-ttl-case {
+ container set-mpls-ttl-action {
+ leaf mpls-ttl {
+ type uint8;
+ }
+ }
+ }
+ case dec-mpls-ttl-case {
+ // empty action
+ }
+ case push-vlan-case {
+ container push-vlan-action {
+ leaf ethertype {
+ type oft:ether-type;
+ }
+ }
+ }
+ case pop-vlan-case {
+ // empty action
+ }
+ case push-mpls-case {
+ container push-mpls-action {
+ leaf ethertype {
+ type oft:ether-type;
+ }
+ }
+ }
+ case pop-mpls-case {
+ container pop-mpls-action {
+ leaf ethertype {
+ type oft:ether-type;
+ }
+ }
+ }
+ case set-queue-case {
+ container set-queue-action {
+ leaf queue-id {
+ type uint32;
+ }
+ }
+ }
+ case group-case {
+ container group-action {
+ leaf group-id {
+ type uint32;
+ }
+ }
+ }
+ case set-nw-ttl-case {
+ container set-nw-ttl-action {
+ leaf nw-ttl {
+ type uint8;
+ }
+ }
+ }
+ case dec-nw-ttl-case {
+ // empty action
+ }
+ case set-field-case {
+ container set-field-action {
+ uses oxm:match-entries-grouping;
+ }
+ }
+ case push-pbb-case {
+ container push-pbb-action {
+ leaf ethertype {
+ type oft:ether-type;
+ }
+ }
+ }
+ case pop-pbb-case {
+ // empty action
+ }
+ // OF1.0 structures
+ case set-vlan-vid-case {
+ container set-vlan-vid-action {
+ leaf vlan-vid {
+ type uint16;
+ }
+ }
+ }
+ case set-vlan-pcp-case {
+ container set-vlan-pcp-action {
+ leaf vlan-pcp {
+ type uint8;
+ }
+ }
+ }
+ case strip-vlan-case {
+ // empty action
+ }
+ case set-dl-src-case {
+ container set-dl-src-action {
+ leaf dl-src-address {
+ type yang:mac-address;
+ }
+ }
+ }
+ case set-dl-dst-case {
+ container set-dl-dst-action {
+ leaf dl-dst-address {
+ type yang:mac-address;
+ }
+ }
+ }
+ case set-nw-src-case {
+ container set-nw-src-action {
+ leaf ip-address {
+ type inet:ipv4-address;
+ }
+ }
+ }
+ case set-nw-dst-case {
+ container set-nw-dst-action {
+ leaf ip-address {
+ type inet:ipv4-address;
+ }
+ }
+ }
+ case set-nw-tos-case {
+ container set-nw-tos-action {
+ leaf nw-tos {
+ type uint8;
+ }
+ }
+ }
+ case set-tp-src-case {
+ container set-tp-src-action {
+ leaf port {
+ type oft:port-number;
+ }
+ }
+ }
+ case set-tp-dst-case {
+ container set-tp-dst-action {
+ leaf port {
+ type oft:port-number;
+ }
+ }
+ }
+ case enqueue-case {
+ container enqueue-action {
+ leaf port {
+ type oft:port-number;
+ }
+ leaf queue-id {
+ type oft:queue-id;
+ }
+ }
+ }
+ }
}
}
}
// OFP_ACTION AUGMENTS
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "port-action";
- leaf port {
- type oft:port-number;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "max-length-action";
- leaf max-length {
- type uint16;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "mpls-ttl-action";
- leaf mpls-ttl {
- type uint8;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "ethertype-action";
- leaf ethertype {
- type oft:ether-type;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "queue-id-action";
- leaf queue-id {
- type uint32;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "group-id-action";
- leaf group-id {
- type uint32;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "nw-ttl-action";
- leaf nw-ttl {
- type uint8;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "oxm-fields-action";
- uses oxm:match-entries-grouping;
- }
- augment "/ofaction:actions-container/ofaction:action" {
+ augment "/ofaction:action-container/ofaction:action-choice" {
ext:augment-identifier "experimenter-id-action";
- leaf experimenter {
- type oft:experimenter-id;
- }
- leaf sub-type {
- type identityref {
- base ofaction:experimenter-action-sub-type;
- }
- }
- }
- // OF1.0 structures
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "vlan-vid-action";
- leaf vlan-vid {
- type uint16;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "vlan-pcp-action";
- leaf vlan-pcp {
- type uint8;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "dl-address-action";
- leaf dl-address {
- type yang:mac-address;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "nw-tos-action";
- leaf nw-tos {
- type uint8;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "ip-address-action";
- leaf ip-address {
- type inet:ipv4-address;
+ case experimenter-id-case {
+ container experimenter {
+ leaf experimenter {
+ type oft:experimenter-id;
+ }
+ leaf sub-type {
+ type identityref {
+ base ofaction:experimenter-action-sub-type;
+ }
+ }
+ }
}
}
uses ofHeader;
uses ofaction:actions-grouping;
-
leaf data {
type binary;
}
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetField;
-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.action.grouping.action.choice.SetFieldCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
/**
@Test
public void test() {
EnhancedMessageTypeKey<?,?> key1 =
- new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, Output.class);
+ new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, OutputActionCase.class);
EnhancedMessageTypeKey<?,?> key2 =
- new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, Output.class);
+ new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, OutputActionCase.class);
Assert.assertTrue("Wrong equals", key1.equals(key2));
Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
- key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Action.class, Output.class);
+ key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Action.class, OutputActionCase.class);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
- key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, null, Output.class);
+ key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, null, OutputActionCase.class);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
- key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Instruction.class, Output.class);
+ key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Instruction.class, OutputActionCase.class);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Action.class, null);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
- key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Action.class, SetField.class);
+ key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Action.class, SetFieldCase.class);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
}
public void testEquals() {
EnhancedMessageTypeKey<?,?> key1;
EnhancedMessageTypeKey<?,?> key2;
- key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, Output.class);
- key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, Output.class);
+ key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, OutputActionCase.class);
+ key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, OutputActionCase.class);
Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object()));
key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, null);
Assert.assertFalse("Wrong equal by msgType2.", key1.equals(key2));
- key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, Output.class);
- key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, SetField.class);
+ key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, OutputActionCase.class);
+ key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, SetFieldCase.class);
Assert.assertFalse("Wrong equal by msgType2 class name.", key1.equals(key2));
}
@Test
public void testToString() {
EnhancedMessageTypeKey<?,?> key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID,
- Action.class, Output.class);
+ Action.class, OutputActionCase.class);
- Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectType: org.opendaylight.yang.gen.v1.urn.opendaylight"
- + ".openflow.common.action.rev130731.actions.grouping.Action msgType2: org.opendaylight.yang.gen.v1.urn"
- + ".opendaylight.openflow.common.action.rev130731.Output", key1.toString());
+ Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectType: org.opendaylight.yang.gen.v1.urn"
+ + ".opendaylight.openflow.common.action.rev150203.actions.grouping.Action msgType2:"
+ + " org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action"
+ + ".grouping.action.choice.OutputActionCase", key1.toString());
}
}
\ No newline at end of file
ActionDeserializerKey key1 = new ActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, null);
Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectClass: org.opendaylight.yang.gen.v1.urn"
- + ".opendaylight.openflow.common.action.rev130731.actions.grouping.Action msgType: 11"
+ + ".opendaylight.openflow.common.action.rev150203.actions.grouping.Action msgType: 11"
+ " experimenterID: null", key1.toString());
}
}
\ No newline at end of file
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlIn;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlOut;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlInCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlOutCase;
/**
* @author michal.polkorab
*/
@Test
public void test() {
- ActionSerializerKey<CopyTtlIn> key1 =
- new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlIn.class, 42L);
+ ActionSerializerKey<CopyTtlInCase> key1 =
+ new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, 42L);
ActionSerializerKey<?> key2 =
- new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlIn.class, 42L);
+ new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, 42L);
Assert.assertTrue("Wrong equals", key1.equals(key2));
Assert.assertTrue("Wrong hashCode", key1.hashCode() == key2.hashCode());
- key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlIn.class, null);
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, null);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, null);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
- key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlOut.class, 42L);
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlOutCase.class, 42L);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
- key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlIn.class, 55L);
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, 55L);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
- key2 = new ActionSerializerKey<>(EncodeConstants.OF13_VERSION_ID, CopyTtlIn.class, 55L);
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF13_VERSION_ID, CopyTtlInCase.class, 55L);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
}
@Test
public void testEquals(){
ActionSerializerKey<?> key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, 42L);
- ActionSerializerKey<?> key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlIn.class, 42L);
+ ActionSerializerKey<?> key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID,
+ CopyTtlInCase.class, 42L);
Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
Assert.assertFalse("Wrong equal by actionType", key1.equals(key2));
key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, 42L);
Assert.assertTrue("Wrong equal by action type", key1.equals(key2));
- key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlIn.class, null);
+ key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, null);
Assert.assertFalse("Wrong equal by experimenterId", key1.equals(key2));
- key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlIn.class, null);
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, null);
Assert.assertTrue("Wrong equal by experimenterId", key1.equals(key2));
}
*/
@Test
public void testToString(){
- ActionSerializerKey<CopyTtlIn> key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlIn.class, 42L);
+ ActionSerializerKey<CopyTtlInCase> key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID,
+ CopyTtlInCase.class, 42L);
- Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectType: org.opendaylight.yang.gen.v1.urn.opendaylight"
- + ".openflow.common.action.rev130731.actions.grouping.Action action type: org.opendaylight.yang.gen.v1.urn"
- + ".opendaylight.openflow.common.action.rev130731.CopyTtlIn experimenterID: 42", key1.toString());
+ Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectType: org.opendaylight.yang.gen.v1.urn"
+ + ".opendaylight.openflow.common.action.rev150203.actions.grouping.Action action type:"
+ + " org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action"
+ + ".grouping.action.choice.CopyTtlInCase experimenterID: 42", key1.toString());
}
}
\ No newline at end of file
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Experimenter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.ExperimenterActionSubType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.action.container.action.choice.ExperimenterIdCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.ExperimenterActionSubType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPort;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
*/
@Test
public void testEqualsAndHashcodeOfActionDeserializerKeys() {
- ActionSerializerKey<Experimenter> actionSerializerKey = new ActionSerializerKey<>(
- EncodeConstants.OF13_VERSION_ID, Experimenter.class, 1L);
+ ActionSerializerKey<ExperimenterIdCase> actionSerializerKey = new ActionSerializerKey<>(
+ EncodeConstants.OF13_VERSION_ID, ExperimenterIdCase.class, 1L);
ExperimenterActionSerializerKey experimenterActionSerializerKey = new ExperimenterActionSerializerKey(
EncodeConstants.OF13_VERSION_ID, 1L, ExpSubType.class);
Assert.assertFalse(actionSerializerKey.equals(experimenterActionSerializerKey));
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterActionSerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.ExperimenterActionSubType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.ExperimenterActionSubType;
/**
* @author michal.polkorab
Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
}
+ /**
+ * Test ExperimenterActionSerializerKey equals
+ */
@Test
public void testEquals() {
ExperimenterActionSerializerKey key1;
import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-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.openflow.common.types.rev130731.ActionBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
@Override
public Action deserializeHeader(ByteBuf input) {
ActionBuilder actionBuilder = new ActionBuilder();
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- actionBuilder.setType(getType());
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ actionBuilder.setActionChoice(getType());
return actionBuilder.build();
}
- protected abstract Class<? extends ActionBase> getType();
+ protected abstract ActionChoice getType();
}
+++ /dev/null
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.deserialization.action;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeActionBuilder;
-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.openflow.common.types.rev130731.EtherType;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class AbstractEthertypeActionDeserializer extends AbstractActionDeserializer {
-
- @Override
- public Action deserialize(ByteBuf input) {
- ActionBuilder builder = new ActionBuilder();
- builder.setType(getType());
- input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- EthertypeActionBuilder etherType = new EthertypeActionBuilder();
- etherType.setEthertype(new EtherType(input.readUnsignedShort()));
- builder.addAugmentation(EthertypeAction.class, etherType.build());
- input.skipBytes(ActionConstants.ETHERTYPE_ACTION_PADDING);
- return builder.build();
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.deserialization.action;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-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;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class AbstractHeaderActionDeserializer extends AbstractActionDeserializer {
-
- @Override
- public Action deserialize(ByteBuf input) {
- ActionBuilder builder = new ActionBuilder();
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- builder.setType(getType());
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);
- return builder.build();
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.deserialization.action;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressActionBuilder;
-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.yangtools.yang.binding.Augmentation;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class OF10AbstractIpAddressActionDeserializer extends AbstractActionDeserializer {
-
- @Override
- public Action deserialize(final ByteBuf input) {
- ActionBuilder builder = new ActionBuilder();
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- builder.setType(getType());
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- builder.addAugmentation(IpAddressAction.class,
- createNwAddressAugmentationAndPad(input));
- return builder.build();
- }
-
- private static Augmentation<Action> createNwAddressAugmentationAndPad(final ByteBuf input) {
- IpAddressActionBuilder ipBuilder = new IpAddressActionBuilder();
- ipBuilder.setIpAddress(new Ipv4Address(ByteBufUtils.readIpv4Address(input)));
- return ipBuilder.build();
- }
-
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.deserialization.action;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.DlAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.DlAddressActionBuilder;
-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;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class OF10AbstractMacAddressActionDeserializer extends AbstractActionDeserializer {
-
- @Override
- public Action deserialize(ByteBuf input) {
- ActionBuilder builder = new ActionBuilder();
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- builder.setType(getType());
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- builder.addAugmentation(DlAddressAction.class, createDlAugmentationAndPad(input));
- return builder.build();
- }
-
- private static DlAddressAction createDlAugmentationAndPad(ByteBuf input) {
- DlAddressActionBuilder dlBuilder = new DlAddressActionBuilder();
- byte[] address = new byte[EncodeConstants.MAC_ADDRESS_LENGTH];
- input.readBytes(address);
- dlBuilder.setDlAddress(new MacAddress(ByteBufUtils.macAddressToString(address)));
- input.skipBytes(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION);
- return dlBuilder.build();
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.deserialization.action;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
-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.openflow.common.types.rev130731.PortNumber;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class OF10AbstractPortActionDeserializer extends AbstractActionDeserializer {
-
- @Override
- public Action deserialize(ByteBuf input) {
- ActionBuilder builder = new ActionBuilder();
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- builder.setType(getType());
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- createPortAugmentation(input, builder);
- input.skipBytes(ActionConstants.PADDING_IN_TP_PORT_ACTION);
- return builder.build();
- }
-
- protected static void createPortAugmentation(ByteBuf input, ActionBuilder actionBuilder) {
- PortActionBuilder portBuilder = new PortActionBuilder();
- portBuilder.setPort(new PortNumber((long) input.readUnsignedShort()));
- actionBuilder.addAugmentation(PortAction.class, portBuilder.build());
- }
-}
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Enqueue;
-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.openflow.common.types.rev130731.ActionBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.EnqueueCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.enqueue._case.EnqueueActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId;
/**
* @author michal.polkorab
*
*/
-public class OF10EnqueueActionDeserializer extends OF10AbstractPortActionDeserializer {
+public class OF10EnqueueActionDeserializer extends AbstractActionDeserializer {
@Override
public Action deserialize(ByteBuf input) {
ActionBuilder builder = new ActionBuilder();
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- builder.setType(getType());
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- createPortAugmentation(input, builder);
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ EnqueueCaseBuilder caseBuilder = new EnqueueCaseBuilder();
+ EnqueueActionBuilder actionBuilder = new EnqueueActionBuilder();
+ actionBuilder.setPort(new PortNumber((long) input.readUnsignedShort()));
input.skipBytes(ActionConstants.PADDING_IN_ENQUEUE_ACTION);
- QueueIdActionBuilder queueBuilder = new QueueIdActionBuilder();
- queueBuilder.setQueueId(input.readUnsignedInt());
- builder.addAugmentation(QueueIdAction.class, queueBuilder.build());
+ actionBuilder.setQueueId(new QueueId(input.readUnsignedInt()));
+ caseBuilder.setEnqueueAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
return builder.build();
}
@Override
- protected Class<? extends ActionBase> getType() {
- return Enqueue.class;
+ protected ActionChoice getType() {
+ return new OutputActionCaseBuilder().build();
}
}
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
-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.openflow.common.types.rev130731.ActionBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.output.action._case.OutputActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
/**
* @author michal.polkorab
*
*/
-public class OF10OutputActionDeserializer extends OF10AbstractPortActionDeserializer {
+public class OF10OutputActionDeserializer extends AbstractActionDeserializer {
@Override
public Action deserialize(ByteBuf input) {
ActionBuilder builder = new ActionBuilder();
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- builder.setType(getType());
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- createPortAugmentation(input, builder);
- MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();
- maxLen.setMaxLength(input.readUnsignedShort());
- builder.addAugmentation(MaxLengthAction.class, maxLen.build());
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
+ OutputActionBuilder actionBuilder = new OutputActionBuilder();
+ actionBuilder.setPort(new PortNumber((long) input.readUnsignedShort()));
+ actionBuilder.setMaxLength(input.readUnsignedShort());
+ caseBuilder.setOutputAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
return builder.build();
}
@Override
- protected Class<? extends ActionBase> getType() {
- return Output.class;
+ protected ActionChoice getType() {
+ return new OutputActionCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetDlDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.dl.dst._case.SetDlDstActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
*
*/
-public class OF10SetDlDstActionDeserializer extends OF10AbstractMacAddressActionDeserializer {
+public class OF10SetDlDstActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ SetDlDstCaseBuilder caseBuilder = new SetDlDstCaseBuilder();
+ SetDlDstActionBuilder actionBuilder = new SetDlDstActionBuilder();
+ byte[] address = new byte[EncodeConstants.MAC_ADDRESS_LENGTH];
+ input.readBytes(address);
+ actionBuilder.setDlDstAddress(new MacAddress(ByteBufUtils.macAddressToString(address)));
+ caseBuilder.setSetDlDstAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
+ input.skipBytes(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION);
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return SetDlDst.class;
+ protected ActionChoice getType() {
+ return new SetDlDstCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetDlSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.dl.src._case.SetDlSrcActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
*
*/
-public class OF10SetDlSrcActionDeserializer extends OF10AbstractMacAddressActionDeserializer {
+public class OF10SetDlSrcActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ SetDlSrcCaseBuilder caseBuilder = new SetDlSrcCaseBuilder();
+ SetDlSrcActionBuilder actionBuilder = new SetDlSrcActionBuilder();
+ byte[] address = new byte[EncodeConstants.MAC_ADDRESS_LENGTH];
+ input.readBytes(address);
+ actionBuilder.setDlSrcAddress(new MacAddress(ByteBufUtils.macAddressToString(address)));
+ caseBuilder.setSetDlSrcAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
+ input.skipBytes(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION);
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return SetDlSrc.class;
+ protected ActionChoice getType() {
+ return new SetDlSrcCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.nw.dst._case.SetNwDstActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
*
*/
-public class OF10SetNwDstActionDeserializer extends OF10AbstractIpAddressActionDeserializer {
+public class OF10SetNwDstActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(final ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ SetNwDstCaseBuilder caseBuilder = new SetNwDstCaseBuilder();
+ SetNwDstActionBuilder actionBuilder = new SetNwDstActionBuilder();
+ actionBuilder.setIpAddress(new Ipv4Address(ByteBufUtils.readIpv4Address(input)));
+ caseBuilder.setSetNwDstAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return SetNwDst.class;
+ protected ActionChoice getType() {
+ return new SetNwDstCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.nw.src._case.SetNwSrcActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
*
*/
-public class OF10SetNwSrcActionDeserializer extends OF10AbstractIpAddressActionDeserializer {
+public class OF10SetNwSrcActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(final ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ SetNwSrcCaseBuilder caseBuilder = new SetNwSrcCaseBuilder();
+ SetNwSrcActionBuilder actionBuilder = new SetNwSrcActionBuilder();
+ actionBuilder.setIpAddress(new Ipv4Address(ByteBufUtils.readIpv4Address(input)));
+ caseBuilder.setSetNwSrcAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return SetNwSrc.class;
+ protected ActionChoice getType() {
+ return new SetNwSrcCaseBuilder().build();
}
}
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTosAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTosActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTos;
-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.openflow.common.types.rev130731.ActionBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTosCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.nw.tos._case.SetNwTosActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
@Override
public Action deserialize(ByteBuf input) {
ActionBuilder builder = new ActionBuilder();
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- builder.setType(getType());
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- NwTosActionBuilder tosBuilder = new NwTosActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ SetNwTosCaseBuilder caseBuilder = new SetNwTosCaseBuilder();
+ SetNwTosActionBuilder tosBuilder = new SetNwTosActionBuilder();
tosBuilder.setNwTos(input.readUnsignedByte());
- builder.addAugmentation(NwTosAction.class, tosBuilder.build());
+ caseBuilder.setSetNwTosAction(tosBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
input.skipBytes(ActionConstants.PADDING_IN_SET_NW_TOS_ACTION);
return builder.build();
}
@Override
- protected Class<? extends ActionBase> getType() {
- return SetNwTos.class;
+ protected ActionChoice getType() {
+ return new SetNwTosCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetTpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.tp.dst._case.SetTpDstActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
/**
* @author michal.polkorab
*
*/
-public class OF10SetTpDstActionDeserializer extends OF10AbstractPortActionDeserializer {
+public class OF10SetTpDstActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ SetTpDstCaseBuilder caseBuilder = new SetTpDstCaseBuilder();
+ SetTpDstActionBuilder actionBuilder = new SetTpDstActionBuilder();
+ actionBuilder.setPort(new PortNumber((long) input.readUnsignedShort()));
+ caseBuilder.setSetTpDstAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
+ input.skipBytes(ActionConstants.PADDING_IN_TP_PORT_ACTION);
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return SetTpDst.class;
+ protected ActionChoice getType() {
+ return new SetTpDstCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetTpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.tp.src._case.SetTpSrcActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
/**
* @author michal.polkorab
*
*/
-public class OF10SetTpSrcActionDeserializer extends OF10AbstractPortActionDeserializer {
+public class OF10SetTpSrcActionDeserializer extends AbstractActionDeserializer {
@Override
- protected Class<? extends ActionBase> getType() {
- return SetTpSrc.class;
+ public Action deserialize(ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ SetTpSrcCaseBuilder caseBuilder = new SetTpSrcCaseBuilder();
+ SetTpSrcActionBuilder actionBuilder = new SetTpSrcActionBuilder();
+ actionBuilder.setPort(new PortNumber((long) input.readUnsignedShort()));
+ caseBuilder.setSetTpSrcAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
+ input.skipBytes(ActionConstants.PADDING_IN_TP_PORT_ACTION);
+ return builder.build();
}
+ @Override
+ protected ActionChoice getType() {
+ return new SetTpSrcCaseBuilder().build();
+ }
}
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanPcpAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanPcpActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanPcp;
-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.openflow.common.types.rev130731.ActionBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetVlanPcpCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.vlan.pcp._case.SetVlanPcpActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
@Override
public Action deserialize(ByteBuf input) {
- ActionBuilder builder = new ActionBuilder();
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- builder.setType(getType());
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- VlanPcpActionBuilder vlanBuilder = new VlanPcpActionBuilder();
- vlanBuilder.setVlanPcp(input.readUnsignedByte());
+ org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ SetVlanPcpCaseBuilder caseBuilder = new SetVlanPcpCaseBuilder();
+ SetVlanPcpActionBuilder actionBuilder = new SetVlanPcpActionBuilder();
+ actionBuilder.setVlanPcp(input.readUnsignedByte());
+ caseBuilder.setSetVlanPcpAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
input.skipBytes(ActionConstants.PADDING_IN_SET_VLAN_PCP_ACTION);
- builder.addAugmentation(VlanPcpAction.class, vlanBuilder.build());
return builder.build();
}
@Override
- protected Class<? extends ActionBase> getType() {
- return SetVlanPcp.class;
+ protected ActionChoice getType() {
+ return new SetVlanPcpCaseBuilder().build();
}
}
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanVidAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanVidActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanVid;
-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.openflow.common.types.rev130731.ActionBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetVlanVidCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.vlan.vid._case.SetVlanVidActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
@Override
public Action deserialize(ByteBuf input) {
- ActionBuilder builder = new ActionBuilder();
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- builder.setType(getType());
- input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- VlanVidActionBuilder vlanBuilder = new VlanVidActionBuilder();
- vlanBuilder.setVlanVid(input.readUnsignedShort());
+ org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ SetVlanVidCaseBuilder caseBuilder = new SetVlanVidCaseBuilder();
+ SetVlanVidActionBuilder actionBuilder = new SetVlanVidActionBuilder();
+ actionBuilder.setVlanVid(input.readUnsignedShort());
+ caseBuilder.setSetVlanVidAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
input.skipBytes(ActionConstants.PADDING_IN_SET_VLAN_VID_ACTION);
- builder.addAugmentation(VlanVidAction.class, vlanBuilder.build());
return builder.build();
}
@Override
- protected Class<? extends ActionBase> getType() {
- return SetVlanVid.class;
+ protected ActionChoice getType() {
+ return new SetVlanVidCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.StripVlan;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.StripVlanCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
*
*/
-public class OF10StripVlanActionDeserializer extends AbstractHeaderActionDeserializer {
+public class OF10StripVlanActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ builder.setActionChoice(getType());
+ input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return StripVlan.class;
+ protected ActionChoice getType() {
+ return new StripVlanCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlIn;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlInCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
*
*/
-public class OF13CopyTtlInActionDeserializer extends AbstractHeaderActionDeserializer {
+public class OF13CopyTtlInActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ builder.setActionChoice(getType());
+ input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return CopyTtlIn.class;
+ protected ActionChoice getType() {
+ return new CopyTtlInCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlOut;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlOutCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
*
*/
-public class OF13CopyTtlOutActionDeserializer extends AbstractHeaderActionDeserializer {
+public class OF13CopyTtlOutActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ builder.setActionChoice(getType());
+ input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return CopyTtlOut.class;
+ protected ActionChoice getType() {
+ return new CopyTtlOutCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.DecMplsTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecMplsTtlCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
*
*/
-public class OF13DecMplsTtlActionDeserializer extends AbstractHeaderActionDeserializer {
+public class OF13DecMplsTtlActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ builder.setActionChoice(getType());
+ input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return DecMplsTtl.class;
+ protected ActionChoice getType() {
+ return new DecMplsTtlCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.DecNwTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecNwTtlCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
*
*/
-public class OF13DecNwTtlActionDeserializer extends AbstractHeaderActionDeserializer {
+public class OF13DecNwTtlActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ builder.setActionChoice(getType());
+ input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return DecNwTtl.class;
+ protected ActionChoice getType() {
+ return new DecNwTtlCaseBuilder().build();
}
}
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Group;
-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.openflow.common.types.rev130731.ActionBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.GroupCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.group._case.GroupActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
@Override
public Action deserialize(ByteBuf input) {
- ActionBuilder builder = new ActionBuilder();
- builder.setType(getType());
+ org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder builder = new ActionBuilder();
input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- GroupIdActionBuilder group = new GroupIdActionBuilder();
- group.setGroupId(input.readUnsignedInt());
- builder.addAugmentation(GroupIdAction.class, group.build());
+ GroupCaseBuilder caseBuilder = new GroupCaseBuilder();
+ GroupActionBuilder actionBuilder = new GroupActionBuilder();
+ actionBuilder.setGroupId(input.readUnsignedInt());
+ caseBuilder.setGroupAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
return builder.build();
}
@Override
- protected Class<? extends ActionBase> getType() {
- return Group.class;
+ protected ActionChoice getType() {
+ return new GroupCaseBuilder().build();
}
}
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
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.MaxLengthActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
-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.openflow.common.types.rev130731.ActionBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.output.action._case.OutputActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
/**
@Override
public Action deserialize(ByteBuf input) {
- ActionBuilder builder = new ActionBuilder();
- builder.setType(getType());
+ org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder builder = new ActionBuilder();
input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- PortActionBuilder port = new PortActionBuilder();
- port.setPort(new PortNumber(input.readUnsignedInt()));
- builder.addAugmentation(PortAction.class, port.build());
- MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();
- maxLen.setMaxLength(input.readUnsignedShort());
- builder.addAugmentation(MaxLengthAction.class, maxLen.build());
+ OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
+ OutputActionBuilder actionBuilder = new OutputActionBuilder();
+ actionBuilder.setPort(new PortNumber(input.readUnsignedInt()));
+ actionBuilder.setMaxLength(input.readUnsignedShort());
+ caseBuilder.setOutputAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
input.skipBytes(ActionConstants.OUTPUT_PADDING);
return builder.build();
}
@Override
- protected Class<? extends ActionBase> getType() {
- return Output.class;
+ protected ActionChoice getType() {
+ return new OutputActionCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopMpls;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopMplsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.pop.mpls._case.PopMplsActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
/**
* @author michal.polkorab
*
*/
-public class OF13PopMplsActionDeserializer extends AbstractEthertypeActionDeserializer {
+public class OF13PopMplsActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ PopMplsCaseBuilder caseBuilder = new PopMplsCaseBuilder();
+ PopMplsActionBuilder mplsBuilder = new PopMplsActionBuilder();
+ mplsBuilder.setEthertype(new EtherType(input.readUnsignedShort()));
+ caseBuilder.setPopMplsAction(mplsBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
+ input.skipBytes(ActionConstants.ETHERTYPE_ACTION_PADDING);
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return PopMpls.class;
+ protected ActionChoice getType() {
+ return new PopMplsCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopPbb;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopPbbCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
*
*/
-public class OF13PopPbbActionDeserializer extends AbstractHeaderActionDeserializer {
+public class OF13PopPbbActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ builder.setActionChoice(getType());
+ input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return PopPbb.class;
+ protected ActionChoice getType() {
+ return new PopPbbCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopVlan;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopVlanCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
*
*/
-public class OF13PopVlanActionDeserializer extends AbstractHeaderActionDeserializer {
+public class OF13PopVlanActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ builder.setActionChoice(getType());
+ input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return PopVlan.class;
+ protected ActionChoice getType() {
+ return new PopVlanCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushMpls;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushMplsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.mpls._case.PushMplsActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
/**
* @author michal.polkorab
*
*/
-public class OF13PushMplsActionDeserializer extends AbstractEthertypeActionDeserializer {
+public class OF13PushMplsActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ PushMplsCaseBuilder caseBuilder = new PushMplsCaseBuilder();
+ PushMplsActionBuilder mplsBuilder = new PushMplsActionBuilder();
+ mplsBuilder.setEthertype(new EtherType(input.readUnsignedShort()));
+ caseBuilder.setPushMplsAction(mplsBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
+ input.skipBytes(ActionConstants.ETHERTYPE_ACTION_PADDING);
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return PushMpls.class;
+ protected ActionChoice getType() {
+ return new PushMplsCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushPbb;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushPbbCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.pbb._case.PushPbbActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
/**
* @author michal.polkorab
*
*/
-public class OF13PushPbbActionDeserializer extends AbstractEthertypeActionDeserializer {
+public class OF13PushPbbActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ PushPbbCaseBuilder caseBuilder = new PushPbbCaseBuilder();
+ PushPbbActionBuilder pbbBuilder = new PushPbbActionBuilder();
+ pbbBuilder.setEthertype(new EtherType(input.readUnsignedShort()));
+ caseBuilder.setPushPbbAction(pbbBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
+ input.skipBytes(ActionConstants.ETHERTYPE_ACTION_PADDING);
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return PushPbb.class;
+ protected ActionChoice getType() {
+ return new PushPbbCaseBuilder().build();
}
}
package org.opendaylight.openflowjava.protocol.impl.deserialization.action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushVlan;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushVlanCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.vlan._case.PushVlanActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
/**
* @author michal.polkorab
*
*/
-public class OF13PushVlanActionDeserializer extends AbstractEthertypeActionDeserializer {
+public class OF13PushVlanActionDeserializer extends AbstractActionDeserializer {
+
+ @Override
+ public Action deserialize(ByteBuf input) {
+ ActionBuilder builder = new ActionBuilder();
+ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ PushVlanCaseBuilder caseBuilder = new PushVlanCaseBuilder();
+ PushVlanActionBuilder vlanBuilder = new PushVlanActionBuilder();
+ vlanBuilder.setEthertype(new EtherType(input.readUnsignedShort()));
+ caseBuilder.setPushVlanAction(vlanBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
+ input.skipBytes(ActionConstants.ETHERTYPE_ACTION_PADDING);
+ return builder.build();
+ }
@Override
- protected Class<? extends ActionBase> getType() {
- return PushVlan.class;
+ protected ActionChoice getType() {
+ return new PushVlanCaseBuilder().build();
}
}
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetField;
-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.openflow.common.types.rev130731.ActionBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
/**
@Override
public Action deserialize(ByteBuf input) {
- ActionBuilder builder = new ActionBuilder();
- builder.setType(getType());
+ org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder builder = new ActionBuilder();
int startIndex = input.readerIndex();
input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- OxmFieldsActionBuilder matchEntries = new OxmFieldsActionBuilder();
+ SetFieldCaseBuilder caseBuilder = new SetFieldCaseBuilder();
+ SetFieldActionBuilder actionBuilder = new SetFieldActionBuilder();
int oxmClass = input.getUnsignedShort(input.readerIndex());
// get oxm_field & hasMask byte and extract the field value
int oxmField = input.getUnsignedByte(input.readerIndex()
OFDeserializer<MatchEntry> matchDeserializer = registry.getDeserializer(key);
List<MatchEntry> entry = new ArrayList<>();
entry.add(matchDeserializer.deserialize(input));
- matchEntries.setMatchEntry(entry);
- builder.addAugmentation(OxmFieldsAction.class, matchEntries.build());
+ actionBuilder.setMatchEntry(entry);
+ caseBuilder.setSetFieldAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
int paddingRemainder = (input.readerIndex() - startIndex) % EncodeConstants.PADDING;
if (paddingRemainder != 0) {
input.skipBytes(EncodeConstants.PADDING - paddingRemainder);
}
@Override
- protected Class<? extends ActionBase> getType() {
- return SetField.class;
+ protected ActionChoice getType() {
+ return new SetFieldCaseBuilder().build();
}
@Override
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetMplsTtl;
-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.openflow.common.types.rev130731.ActionBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetMplsTtlCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.mpls.ttl._case.SetMplsTtlActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
@Override
public Action deserialize(ByteBuf input) {
ActionBuilder builder = new ActionBuilder();
- builder.setType(getType());
input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- MplsTtlActionBuilder mplsTtl = new MplsTtlActionBuilder();
- mplsTtl.setMplsTtl(input.readUnsignedByte());
- builder.addAugmentation(MplsTtlAction.class, mplsTtl.build());
+ SetMplsTtlCaseBuilder caseBuilder = new SetMplsTtlCaseBuilder();
+ SetMplsTtlActionBuilder actionBuilder = new SetMplsTtlActionBuilder();
+ actionBuilder.setMplsTtl(input.readUnsignedByte());
+ caseBuilder.setSetMplsTtlAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
input.skipBytes(ActionConstants.SET_MPLS_TTL_PADDING);
return builder.build();
}
@Override
- protected Class<? extends ActionBase> getType() {
- return SetMplsTtl.class;
+ protected ActionChoice getType() {
+ return new SetMplsTtlCaseBuilder().build();
}
}
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTtl;
-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.openflow.common.types.rev130731.ActionBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTtlCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.nw.ttl._case.SetNwTtlActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
@Override
public Action deserialize(ByteBuf input) {
ActionBuilder builder = new ActionBuilder();
- builder.setType(getType());
input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- NwTtlActionBuilder nwTtl = new NwTtlActionBuilder();
- nwTtl.setNwTtl(input.readUnsignedByte());
- builder.addAugmentation(NwTtlAction.class, nwTtl.build());
+ SetNwTtlCaseBuilder caseBuilder = new SetNwTtlCaseBuilder();
+ SetNwTtlActionBuilder actionBuilder = new SetNwTtlActionBuilder();
+ actionBuilder.setNwTtl(input.readUnsignedByte());
+ caseBuilder.setSetNwTtlAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
input.skipBytes(ActionConstants.SET_NW_TTL_PADDING);
return builder.build();
}
@Override
- protected Class<? extends ActionBase> getType() {
- return SetNwTtl.class;
+ protected ActionChoice getType() {
+ return new SetNwTtlCaseBuilder().build();
}
}
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetQueue;
-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.openflow.common.types.rev130731.ActionBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetQueueCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.queue._case.SetQueueActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
/**
* @author michal.polkorab
@Override
public Action deserialize(ByteBuf input) {
ActionBuilder builder = new ActionBuilder();
- builder.setType(getType());
input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- QueueIdActionBuilder queueId = new QueueIdActionBuilder();
- queueId.setQueueId(input.readUnsignedInt());
- builder.addAugmentation(QueueIdAction.class, queueId.build());
+ SetQueueCaseBuilder caseBuilder = new SetQueueCaseBuilder();
+ SetQueueActionBuilder actionBuilder = new SetQueueActionBuilder();
+ actionBuilder.setQueueId(input.readUnsignedInt());
+ caseBuilder.setSetQueueAction(actionBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
return builder.build();
}
@Override
- protected Class<? extends ActionBase> getType() {
- return SetQueue.class;
+ protected ActionChoice getType() {
+ return new SetQueueCaseBuilder().build();
}
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmRelatedTableFeaturePropertyBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.table.features.properties.container.table.feature.properties.NextTableIds;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.table.features.properties.container.table.feature.properties.NextTableIdsBuilder;
-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.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlags;
import org.opendaylight.openflowjava.protocol.impl.util.OF10MatchDeserializer;
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.openflowjava.util.ExperimenterDeserializerKeyFactory;
-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.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
import org.opendaylight.openflowjava.protocol.impl.util.ListDeserializer;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstructionBuilder;
-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.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.InstructionBase;
import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstructionBuilder;
-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.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;
import org.opendaylight.openflowjava.protocol.impl.serialization.action.OF13SetNwTtlActionSerializer;
import org.opendaylight.openflowjava.protocol.impl.serialization.action.OF13SetQueueActionSerializer;
import org.opendaylight.openflowjava.protocol.impl.util.ActionSerializerRegistryHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlIn;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlOut;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.DecMplsTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.DecNwTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Enqueue;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopMpls;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopPbb;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopVlan;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushMpls;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushPbb;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushVlan;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetDlDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetDlSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetMplsTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTos;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetQueue;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetTpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetTpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanPcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanVid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.StripVlan;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlInCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlOutCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecMplsTtlCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecNwTtlCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.EnqueueCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.GroupCase;
+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.action.grouping.action.choice.PopMplsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopPbbCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopVlanCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushMplsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushPbbCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushVlanCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetMplsTtlCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTosCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTtlCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetQueueCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetVlanPcpCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetVlanVidCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.StripVlanCase;
+//import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Group;
/**
* Initializes serializer registry with action serializers
// register OF v1.0 action serializers
ActionSerializerRegistryHelper helper = new ActionSerializerRegistryHelper(
EncodeConstants.OF10_VERSION_ID, serializerRegistry);
- helper.registerSerializer(Output.class, new OF10OutputActionSerializer());
- helper.registerSerializer(SetVlanVid.class, new OF10SetVlanVidActionSerializer());
- helper.registerSerializer(SetVlanPcp.class, new OF10SetVlanPcpActionSerializer());
- helper.registerSerializer(StripVlan.class, new OF10StripVlanActionSerializer());
- helper.registerSerializer(SetDlSrc.class, new OF10SetDlSrcActionSerializer());
- helper.registerSerializer(SetDlDst.class, new OF10SetDlDstActionSerializer());
- helper.registerSerializer(SetNwSrc.class, new OF10SetNwSrcActionSerializer());
- helper.registerSerializer(SetNwDst.class, new OF10SetNwDstActionSerializer());
- helper.registerSerializer(SetNwTos.class, new OF10SetNwTosActionSerializer());
- helper.registerSerializer(SetTpSrc.class, new OF10SetTpSrcActionSerializer());
- helper.registerSerializer(SetTpDst.class, new OF10SetTpDstActionSerializer());
- helper.registerSerializer(Enqueue.class, new OF10EnqueueActionSerializer());
+ helper.registerSerializer(OutputActionCase.class, new OF10OutputActionSerializer());
+ helper.registerSerializer(SetVlanVidCase.class, new OF10SetVlanVidActionSerializer());
+ helper.registerSerializer(SetVlanPcpCase.class, new OF10SetVlanPcpActionSerializer());
+ helper.registerSerializer(StripVlanCase.class, new OF10StripVlanActionSerializer());
+ helper.registerSerializer(SetDlSrcCase.class, new OF10SetDlSrcActionSerializer());
+ helper.registerSerializer(SetDlDstCase.class, new OF10SetDlDstActionSerializer());
+ helper.registerSerializer(SetNwSrcCase.class, new OF10SetNwSrcActionSerializer());
+ helper.registerSerializer(SetNwDstCase.class, new OF10SetNwDstActionSerializer());
+ helper.registerSerializer(SetNwTosCase.class, new OF10SetNwTosActionSerializer());
+ helper.registerSerializer(SetTpSrcCase.class, new OF10SetTpSrcActionSerializer());
+ helper.registerSerializer(SetTpDstCase.class, new OF10SetTpDstActionSerializer());
+ helper.registerSerializer(EnqueueCase.class, new OF10EnqueueActionSerializer());
// register OF v1.0 action serializers
helper = new ActionSerializerRegistryHelper(
EncodeConstants.OF13_VERSION_ID, serializerRegistry);
- helper.registerSerializer(Output.class, new OF13OutputActionSerializer());
- helper.registerSerializer(CopyTtlOut.class, new OF13CopyTtlOutActionSerializer());
- helper.registerSerializer(CopyTtlIn.class, new OF13CopyTtlInActionSerializer());
- helper.registerSerializer(SetMplsTtl.class, new OF13SetMplsTtlActionSerializer());
- helper.registerSerializer(DecMplsTtl.class, new OF13DecMplsTtlActionSerializer());
- helper.registerSerializer(PushVlan.class, new OF13PushVlanActionSerializer());
- helper.registerSerializer(PopVlan.class, new OF13PopVlanActionSerializer());
- helper.registerSerializer(PushMpls.class, new OF13PushMplsActionSerializer());
- helper.registerSerializer(PopMpls.class, new OF13PopMplsActionSerializer());
- helper.registerSerializer(SetQueue.class, new OF13SetQueueActionSerializer());
- helper.registerSerializer(Group.class, new OF13GroupActionSerializer());
- helper.registerSerializer(SetNwTtl.class, new OF13SetNwTtlActionSerializer());
- helper.registerSerializer(DecNwTtl.class, new OF13DecNwTtlActionSerializer());
- helper.registerSerializer(SetField.class, new OF13SetFieldActionSerializer());
- helper.registerSerializer(PushPbb.class, new OF13PushPbbActionSerializer());
- helper.registerSerializer(PopPbb.class, new OF13PopPbbActionSerializer());
+ helper.registerSerializer(OutputActionCase.class, new OF13OutputActionSerializer());
+ helper.registerSerializer(CopyTtlOutCase.class, new OF13CopyTtlOutActionSerializer());
+ helper.registerSerializer(CopyTtlInCase.class, new OF13CopyTtlInActionSerializer());
+ helper.registerSerializer(SetMplsTtlCase.class, new OF13SetMplsTtlActionSerializer());
+ helper.registerSerializer(DecMplsTtlCase.class, new OF13DecMplsTtlActionSerializer());
+ helper.registerSerializer(PushVlanCase.class, new OF13PushVlanActionSerializer());
+ helper.registerSerializer(PopVlanCase.class, new OF13PopVlanActionSerializer());
+ helper.registerSerializer(PushMplsCase.class, new OF13PushMplsActionSerializer());
+ helper.registerSerializer(PopMplsCase.class, new OF13PopMplsActionSerializer());
+ helper.registerSerializer(SetQueueCase.class, new OF13SetQueueActionSerializer());
+ helper.registerSerializer(GroupCase.class, new OF13GroupActionSerializer());
+ helper.registerSerializer(SetNwTtlCase.class, new OF13SetNwTtlActionSerializer());
+ helper.registerSerializer(DecNwTtlCase.class, new OF13DecNwTtlActionSerializer());
+ helper.registerSerializer(SetFieldCase.class, new OF13SetFieldActionSerializer());
+ helper.registerSerializer(PushPbbCase.class, new OF13PushPbbActionSerializer());
+ helper.registerSerializer(PopPbbCase.class, new OF13PopPbbActionSerializer());
}
}
\ No newline at end of file
import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-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.actions.grouping.Action;
/**
* @author michal.polkorab
+++ /dev/null
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.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.EthertypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class AbstractEthertypeActionSerializer extends AbstractActionSerializer {
-
- @Override
- public void serialize(Action action, ByteBuf outBuffer) {
- super.serialize(action, outBuffer);
- EthertypeAction ethertype = action.getAugmentation(EthertypeAction.class);
- outBuffer.writeShort(ethertype.getEthertype().getValue());
- outBuffer.writeZero(ActionConstants.ETHERTYPE_ACTION_PADDING);
- }
-
- @Override
- protected int getLength() {
- return ActionConstants.GENERAL_ACTION_LENGTH;
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.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.common.action.rev130731.actions.grouping.Action;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class AbstractHeaderActionSerializer extends AbstractActionSerializer {
-
- @Override
- public void serialize(Action action, ByteBuf outBuffer) {
- super.serialize(action, outBuffer);
- outBuffer.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);
- }
-
- @Override
- protected int getLength() {
- return ActionConstants.GENERAL_ACTION_LENGTH;
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.serialization.action;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class OF10AbstractIpAddressActionSerializer extends AbstractActionSerializer {
-
- @Override
- public void serialize(final Action action, final ByteBuf outBuffer) {
- super.serialize(action, outBuffer);
- Iterable<String> addressGroups = ByteBufUtils.DOT_SPLITTER
- .split(action.getAugmentation(IpAddressAction.class).getIpAddress().getValue());
- for (String group : addressGroups) {
- outBuffer.writeByte(Short.parseShort(group));
- }
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.serialization.action;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.DlAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class OF10AbstractMacAddressActionSerializer extends AbstractActionSerializer {
-
- @Override
- public void serialize(Action action, ByteBuf outBuffer) {
- super.serialize(action, outBuffer);
- outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(action
- .getAugmentation(DlAddressAction.class).getDlAddress().getValue()));
- outBuffer.writeZero(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION);
- }
-
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.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.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class OF10AbstractPortActionSerializer 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());
- outBuffer.writeZero(ActionConstants.PADDING_IN_TP_PORT_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.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
-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.EnqueueCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
@Override
public void serialize(Action action, ByteBuf outBuffer) {
super.serialize(action, outBuffer);
- PortAction port = action.getAugmentation(PortAction.class);
- outBuffer.writeShort(port.getPort().getValue().intValue());
+ outBuffer.writeShort(((EnqueueCase) action.getActionChoice()).getEnqueueAction()
+ .getPort().getValue().intValue());
outBuffer.writeZero(ActionConstants.PADDING_IN_ENQUEUE_ACTION);
- QueueIdAction queueId = action.getAugmentation(QueueIdAction.class);
- outBuffer.writeInt(queueId.getQueueId().intValue());
+ outBuffer.writeInt(((EnqueueCase) action.getActionChoice()).getEnqueueAction()
+ .getQueueId().getValue().intValue());
}
@Override
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
@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
package org.opendaylight.openflowjava.protocol.impl.serialization.action;
+import io.netty.buffer.ByteBuf;
+
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF10SetDlDstActionSerializer extends OF10AbstractMacAddressActionSerializer {
+public class OF10SetDlDstActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(Action action, ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(((SetDlDstCase) action.getActionChoice())
+ .getSetDlDstAction().getDlDstAddress().getValue()));
+ outBuffer.writeZero(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION);
+ }
@Override
protected int getType() {
package org.opendaylight.openflowjava.protocol.impl.serialization.action;
+import io.netty.buffer.ByteBuf;
+
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF10SetDlSrcActionSerializer extends OF10AbstractMacAddressActionSerializer {
+public class OF10SetDlSrcActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(Action action, ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(((SetDlSrcCase) action.getActionChoice())
+ .getSetDlSrcAction().getDlSrcAddress().getValue()));
+ outBuffer.writeZero(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION);
+ }
@Override
protected int getType() {
package org.opendaylight.openflowjava.protocol.impl.serialization.action;
+import io.netty.buffer.ByteBuf;
+
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF10SetNwDstActionSerializer extends OF10AbstractIpAddressActionSerializer {
+public class OF10SetNwDstActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(final Action action, final ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ Iterable<String> addressGroups = ByteBufUtils.DOT_SPLITTER
+ .split(((SetNwDstCase) action.getActionChoice()).getSetNwDstAction()
+ .getIpAddress().getValue());
+ for (String group : addressGroups) {
+ outBuffer.writeByte(Short.parseShort(group));
+ }
+ }
@Override
protected int getType() {
package org.opendaylight.openflowjava.protocol.impl.serialization.action;
+import io.netty.buffer.ByteBuf;
+
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF10SetNwSrcActionSerializer extends OF10AbstractIpAddressActionSerializer {
+public class OF10SetNwSrcActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(final Action action, final ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ Iterable<String> addressGroups = ByteBufUtils.DOT_SPLITTER
+ .split(((SetNwSrcCase) action.getActionChoice()).getSetNwSrcAction()
+ .getIpAddress().getValue());
+ for (String group : addressGroups) {
+ outBuffer.writeByte(Short.parseShort(group));
+ }
+ }
@Override
protected int getType() {
return ActionConstants.SET_NW_SRC_CODE;
}
+
@Override
protected int getLength() {
return ActionConstants.GENERAL_ACTION_LENGTH;
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTosAction;
-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.SetNwTosCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
@Override
public void serialize(Action action, ByteBuf outBuffer) {
super.serialize(action, outBuffer);
- outBuffer.writeByte(action.getAugmentation(NwTosAction.class).getNwTos());
+ outBuffer.writeByte(((SetNwTosCase) action.getActionChoice()).getSetNwTosAction().getNwTos());
outBuffer.writeZero(ActionConstants.PADDING_IN_SET_NW_TOS_ACTION);
}
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.common.action.rev150203.action.grouping.action.choice.SetTpDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF10SetTpDstActionSerializer extends OF10AbstractPortActionSerializer {
+public class OF10SetTpDstActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(Action action, ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ outBuffer.writeShort(((SetTpDstCase) action.getActionChoice()).getSetTpDstAction()
+ .getPort().getValue().intValue());
+ outBuffer.writeZero(ActionConstants.PADDING_IN_TP_PORT_ACTION);
+ }
@Override
protected int getType() {
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.common.action.rev150203.action.grouping.action.choice.SetTpSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF10SetTpSrcActionSerializer extends OF10AbstractPortActionSerializer {
+public class OF10SetTpSrcActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(Action action, ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ outBuffer.writeShort(((SetTpSrcCase) action.getActionChoice()).getSetTpSrcAction()
+ .getPort().getValue().intValue());
+ outBuffer.writeZero(ActionConstants.PADDING_IN_TP_PORT_ACTION);
+ }
@Override
protected int getType() {
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanPcpAction;
-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.SetVlanPcpCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
@Override
public void serialize(Action action, ByteBuf outBuffer) {
super.serialize(action, outBuffer);
- outBuffer.writeByte(action.getAugmentation(VlanPcpAction.class).getVlanPcp());
+ outBuffer.writeByte(((SetVlanPcpCase) action.getActionChoice()).getSetVlanPcpAction().getVlanPcp());
outBuffer.writeZero(ActionConstants.PADDING_IN_SET_VLAN_PCP_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.VlanVidAction;
-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.SetVlanVidCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
@Override
public void serialize(Action action, ByteBuf outBuffer) {
super.serialize(action, outBuffer);
- outBuffer.writeShort(action.getAugmentation(VlanVidAction.class).getVlanVid());
+ outBuffer.writeShort(((SetVlanVidCase) action.getActionChoice()).getSetVlanVidAction().getVlanVid());
outBuffer.writeZero(ActionConstants.PADDING_IN_SET_VLAN_VID_ACTION);
}
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.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF10StripVlanActionSerializer extends AbstractHeaderActionSerializer {
+public class OF10StripVlanActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(Action action, ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ outBuffer.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);
+ }
+
+ @Override
+ protected int getLength() {
+ return ActionConstants.GENERAL_ACTION_LENGTH;
+ }
@Override
protected int getType() {
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.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF13CopyTtlInActionSerializer extends AbstractHeaderActionSerializer {
+public class OF13CopyTtlInActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(Action action, ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ outBuffer.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);
+ }
+
+ @Override
+ protected int getLength() {
+ return ActionConstants.GENERAL_ACTION_LENGTH;
+ }
@Override
protected int getType() {
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.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF13CopyTtlOutActionSerializer extends AbstractHeaderActionSerializer {
+public class OF13CopyTtlOutActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(Action action, ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ outBuffer.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);
+ }
+
+ @Override
+ protected int getLength() {
+ return ActionConstants.GENERAL_ACTION_LENGTH;
+ }
@Override
protected int getType() {
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.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF13DecMplsTtlActionSerializer extends AbstractHeaderActionSerializer {
+public class OF13DecMplsTtlActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(Action action, ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ outBuffer.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);
+ }
+
+ @Override
+ protected int getLength() {
+ return ActionConstants.GENERAL_ACTION_LENGTH;
+ }
@Override
protected int getType() {
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.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF13DecNwTtlActionSerializer extends AbstractHeaderActionSerializer {
+public class OF13DecNwTtlActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(Action action, ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ outBuffer.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);
+ }
+
+ @Override
+ protected int getLength() {
+ return ActionConstants.GENERAL_ACTION_LENGTH;
+ }
@Override
protected int getType() {
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdAction;
-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.GroupCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
@Override
public void serialize(Action action, ByteBuf outBuffer) {
super.serialize(action, outBuffer);
- GroupIdAction groupId = action.getAugmentation(GroupIdAction.class);
- outBuffer.writeInt(groupId.getGroupId().intValue());
+ outBuffer.writeInt(((GroupCase) action.getActionChoice()).getGroupAction().getGroupId().intValue());
}
@Override
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
@Override
public void serialize(Action action, ByteBuf outBuffer) {
super.serialize(action, outBuffer);
- PortAction port = action.getAugmentation(PortAction.class);
- outBuffer.writeInt(port.getPort().getValue().intValue());
- MaxLengthAction maxlength = action.getAugmentation(MaxLengthAction.class);
- outBuffer.writeShort(maxlength.getMaxLength());
+ outBuffer.writeInt(((OutputActionCase) action.getActionChoice()).getOutputAction()
+ .getPort().getValue().intValue());
+ outBuffer.writeShort(((OutputActionCase) action.getActionChoice()).getOutputAction().getMaxLength());
outBuffer.writeZero(ActionConstants.OUTPUT_PADDING);
}
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.common.action.rev150203.action.grouping.action.choice.PopMplsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF13PopMplsActionSerializer extends AbstractEthertypeActionSerializer {
+public class OF13PopMplsActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(Action action, ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ outBuffer.writeShort(((PopMplsCase) action.getActionChoice())
+ .getPopMplsAction().getEthertype().getValue());
+ outBuffer.writeZero(ActionConstants.ETHERTYPE_ACTION_PADDING);
+ }
+
+ @Override
+ protected int getLength() {
+ return ActionConstants.GENERAL_ACTION_LENGTH;
+ }
@Override
protected int getType() {
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.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF13PopPbbActionSerializer extends AbstractHeaderActionSerializer {
+public class OF13PopPbbActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(Action action, ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ outBuffer.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);
+ }
+
+ @Override
+ protected int getLength() {
+ return ActionConstants.GENERAL_ACTION_LENGTH;
+ }
@Override
protected int getType() {
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.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF13PopVlanActionSerializer extends AbstractHeaderActionSerializer {
+public class OF13PopVlanActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(Action action, ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ outBuffer.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);
+ }
+
+ @Override
+ protected int getLength() {
+ return ActionConstants.GENERAL_ACTION_LENGTH;
+ }
@Override
protected int getType() {
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.common.action.rev150203.action.grouping.action.choice.PushMplsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF13PushMplsActionSerializer extends AbstractEthertypeActionSerializer {
+public class OF13PushMplsActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(Action action, ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ outBuffer.writeShort(((PushMplsCase) action.getActionChoice())
+ .getPushMplsAction().getEthertype().getValue());
+ outBuffer.writeZero(ActionConstants.ETHERTYPE_ACTION_PADDING);
+ }
+
+ @Override
+ protected int getLength() {
+ return ActionConstants.GENERAL_ACTION_LENGTH;
+ }
@Override
protected int getType() {
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.common.action.rev150203.action.grouping.action.choice.PushPbbCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF13PushPbbActionSerializer extends AbstractEthertypeActionSerializer {
+public class OF13PushPbbActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(Action action, ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ outBuffer.writeShort(((PushPbbCase) action.getActionChoice())
+ .getPushPbbAction().getEthertype().getValue());
+ outBuffer.writeZero(ActionConstants.ETHERTYPE_ACTION_PADDING);
+ }
+
+ @Override
+ protected int getLength() {
+ return ActionConstants.GENERAL_ACTION_LENGTH;
+ }
@Override
protected int getType() {
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.common.action.rev150203.action.grouping.action.choice.PushVlanCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*
*/
-public class OF13PushVlanActionSerializer extends AbstractEthertypeActionSerializer {
+public class OF13PushVlanActionSerializer extends AbstractActionSerializer {
+
+ @Override
+ public void serialize(Action action, ByteBuf outBuffer) {
+ super.serialize(action, outBuffer);
+ outBuffer.writeShort(((PushVlanCase) action.getActionChoice())
+ .getPushVlanAction().getEthertype().getValue());
+ outBuffer.writeZero(ActionConstants.ETHERTYPE_ACTION_PADDING);
+ }
+
+ @Override
+ protected int getLength() {
+ return ActionConstants.GENERAL_ACTION_LENGTH;
+ }
@Override
protected int getType() {
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCase;
-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.SetFieldCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ExperimenterClass;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
outBuffer.writeShort(ActionConstants.SET_FIELD_CODE);
int lengthIndex = outBuffer.writerIndex();
outBuffer.writeShort(EncodeConstants.EMPTY_LENGTH);
- OxmFieldsAction oxmField = action.getAugmentation(OxmFieldsAction.class);
- MatchEntry entry = oxmField.getMatchEntry().get(0);
+ MatchEntry entry = ((SetFieldCase) action.getActionChoice()).getSetFieldAction()
+ .getMatchEntry().get(0);
MatchEntrySerializerKey<?, ?> key = new MatchEntrySerializerKey<>(
EncodeConstants.OF13_VERSION_ID, entry.getOxmClass(), entry.getOxmMatchField());
if (entry.getOxmClass().equals(ExperimenterClass.class)) {
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlAction;
-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.SetMplsTtlCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
*/
public class OF13SetMplsTtlActionSerializer extends AbstractActionSerializer {
-
-
@Override
public void serialize(Action action, ByteBuf outBuffer) {
super.serialize(action, outBuffer);
- MplsTtlAction mplsTtl = action.getAugmentation(MplsTtlAction.class);
- outBuffer.writeByte(mplsTtl.getMplsTtl());
+ outBuffer.writeByte(((SetMplsTtlCase) action.getActionChoice()).getSetMplsTtlAction().getMplsTtl());
outBuffer.writeZero(ActionConstants.SET_MPLS_TTL_PADDING);
}
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlAction;
-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.SetNwTtlCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
@Override
public void serialize(Action action, ByteBuf outBuffer) {
super.serialize(action, outBuffer);
- NwTtlAction nwTtl = action.getAugmentation(NwTtlAction.class);
- outBuffer.writeByte(nwTtl.getNwTtl());
+ outBuffer.writeByte(((SetNwTtlCase) action.getActionChoice()).getSetNwTtlAction().getNwTtl());
outBuffer.writeZero(ActionConstants.SET_NW_TTL_PADDING);
}
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
-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.SetQueueCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
@Override
public void serialize(Action action, ByteBuf outBuffer) {
super.serialize(action, outBuffer);
- QueueIdAction queueId = action.getAugmentation(QueueIdAction.class);
- outBuffer.writeInt(queueId.getQueueId().intValue());
+ outBuffer.writeInt(((SetQueueCase) action.getActionChoice()).getSetQueueAction()
+ .getQueueId().intValue());
}
@Override
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NextTableRelatedTableFeatureProperty;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmRelatedTableFeatureProperty;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.table.features.properties.container.table.feature.properties.NextTableIds;
-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.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableConfig;
import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMaker;
import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory;
import org.opendaylight.openflowjava.util.ByteBufUtils;
-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.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlagsV10;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory;
import org.opendaylight.openflowjava.protocol.impl.util.ListSerializer;
+import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
/**
import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMaker;
import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstruction;
-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.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
/**
import org.opendaylight.openflowjava.protocol.api.extensibility.OFGeneralSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.keys.ActionSerializerKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
/**
* @author michal.polkorab
* @param actionType
* @param serializer
*/
- public <T extends ActionBase> void registerSerializer(Class<T> actionType,
+ public <T extends ActionChoice> void registerSerializer(Class<T> actionType,
OFGeneralSerializer serializer) {
serializerRegistry.registerSerializer(new ActionSerializerKey<>(version,
actionType, null), serializer);
import org.opendaylight.openflowjava.protocol.api.keys.InstructionSerializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Experimenter;
-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.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ExperimenterClass;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
return new AbstractTypeKeyMaker<Action>(version) {
@Override
public MessageTypeKey<?> make(Action entry) {
- if (entry.getType().equals(Experimenter.class)) {
+ if (entry.getActionChoice() instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflow
+ .augments.rev150225.action.container.action.choice.ExperimenterIdCase) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.action
+ .container.action.choice.ExperimenterIdCase expIdCase = (org.opendaylight.yang.gen.v1.urn
+ .opendaylight.openflow.augments.rev150225.action.container.action.choice
+ .ExperimenterIdCase) entry.getActionChoice();
return new ExperimenterActionSerializerKey(getVersion(),
- entry.getAugmentation(ExperimenterIdAction.class).getExperimenter().getValue(), entry.getAugmentation(ExperimenterIdAction.class).getSubType());
+ expIdCase.getExperimenter().getExperimenter().getValue(),
+ expIdCase.getExperimenter().getSubType());
}
- return new ActionSerializerKey<>(getVersion(), entry.getType(), null);
+ return new ActionSerializerKey<>(getVersion(), (Class<ActionChoice>) entry.getActionChoice().getImplementedInterface(), null);
}
};
}
import org.opendaylight.openflowjava.protocol.impl.core.ServerFacade;
import org.opendaylight.openflowjava.protocol.impl.core.SwitchConnectionProviderImpl;
import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.ExperimenterActionSubType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.ExperimenterActionSubType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.TransportProtocol;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlIn;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlOut;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.DecMplsTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.DecNwTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopMpls;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopPbb;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopVlan;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushMpls;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushPbb;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushVlan;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetMplsTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetQueue;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlInCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlOutCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecMplsTtlCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecNwTtlCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.GroupCase;
+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.action.grouping.action.choice.PopMplsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopPbbCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopVlanCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushMplsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushPbbCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushVlanCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetMplsTtlCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTtlCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetQueueCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPort;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
Assert.assertEquals("Wrong bucketWatchGroup", 4,
message.getGroupDesc().get(0).getBucketsList().get(0).getWatchGroup().intValue());
- Assert.assertEquals("Wrong outputType", Output.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
- .getType());
+ Assert.assertTrue("Wrong outputType",message.getGroupDesc().get(0).getBucketsList().get(0)
+ .getAction().get(0).getActionChoice() instanceof OutputActionCase);
- Assert.assertEquals("Wrong outputPort", 4351,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
- .getAugmentation(PortAction.class).
- getPort().getValue().intValue());
+ Assert.assertEquals("Wrong outputPort", 4351, ((OutputActionCase) message.getGroupDesc().get(0)
+ .getBucketsList().get(0).getAction().get(0).getActionChoice())
+ .getOutputAction().getPort().getValue().intValue());
- Assert.assertEquals("Wrong outputMaxLen", 65535,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
- .getAugmentation(MaxLengthAction.class).
- getMaxLength().intValue());
+ Assert.assertEquals("Wrong outputMaxLen", 65535, ((OutputActionCase) message.getGroupDesc().get(0)
+ .getBucketsList().get(0).getAction().get(0).getActionChoice())
+ .getOutputAction().getMaxLength().intValue());
- Assert.assertEquals("Wrong copyTtlOutType", CopyTtlOut.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
- .getType());
+ Assert.assertTrue("Wrong copyTtlOutType", message.getGroupDesc().get(0).getBucketsList()
+ .get(0).getAction().get(1).getActionChoice() instanceof CopyTtlOutCase);
- Assert.assertEquals("Wrong copyTtlInType", CopyTtlIn.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(2)
- .getType());
+ Assert.assertTrue("Wrong copyTtlInType", message.getGroupDesc().get(0).getBucketsList()
+ .get(0).getAction().get(2).getActionChoice() instanceof CopyTtlInCase);
}
/**
message.getGroupDesc().get(0).getBucketsList().get(0).getWatchPort().getValue().intValue());
Assert.assertEquals("Wrong bucketWatchGroup", 4,
message.getGroupDesc().get(0).getBucketsList().get(0).getWatchGroup().intValue());
- Assert.assertEquals("Wrong setMplsTtlType", SetMplsTtl.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
- .getType());
- Assert.assertEquals("Wrong setMplsTtlMPLS_TTL", 9,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
- .getAugmentation(MplsTtlAction.class).
- getMplsTtl().intValue());
- Assert.assertEquals("Wrong decMplsTtlType", DecMplsTtl.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
- .getType());
- Assert.assertEquals("Wrong pushVlanType", PushVlan.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(2)
- .getType());
- Assert.assertEquals("Wrong pushVlanEthertype", 32,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(2)
- .getAugmentation(EthertypeAction.class).
- getEthertype().getValue().intValue());
- Assert.assertEquals("Wrong pushMplsType", PushMpls.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(3)
- .getType());
- Assert.assertEquals("Wrong pushMplsEthertype", 255,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(3).
- getAugmentation(EthertypeAction.class).
- getEthertype().getValue().intValue());
- Assert.assertEquals("Wrong pushPbbType", PushPbb.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(4)
- .getType());
- Assert.assertEquals("Wrong pushPbbEthertype", 4095,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(4)
- .getAugmentation(EthertypeAction.class).
- getEthertype().getValue().intValue());
+ Assert.assertTrue("Wrong setMplsTtlType", message.getGroupDesc().get(0).getBucketsList().get(0)
+ .getAction().get(0).getActionChoice() instanceof SetMplsTtlCase);
+ Assert.assertEquals("Wrong setMplsTtlMPLS_TTL", 9, ((SetMplsTtlCase) message.getGroupDesc().get(0)
+ .getBucketsList().get(0).getAction().get(0).getActionChoice()).getSetMplsTtlAction()
+ .getMplsTtl().intValue());
+ Assert.assertTrue("Wrong decMplsTtlType", message.getGroupDesc().get(0).getBucketsList().get(0)
+ .getAction().get(1).getActionChoice() instanceof DecMplsTtlCase);
+ Assert.assertTrue("Wrong pushVlanType", message.getGroupDesc().get(0).getBucketsList().get(0)
+ .getAction().get(2).getActionChoice() instanceof PushVlanCase);
+ Assert.assertEquals("Wrong pushVlanEthertype", 32,((PushVlanCase) message.getGroupDesc().get(0)
+ .getBucketsList().get(0).getAction().get(2).getActionChoice())
+ .getPushVlanAction().getEthertype().getValue().intValue());
+ Assert.assertTrue("Wrong pushMplsType", message.getGroupDesc().get(0).getBucketsList().get(0)
+ .getAction().get(3).getActionChoice() instanceof PushMplsCase);
+ Assert.assertEquals("Wrong pushMplsEthertype", 255, ((PushMplsCase) message.getGroupDesc().get(0)
+ .getBucketsList().get(0).getAction().get(3).getActionChoice())
+ .getPushMplsAction().getEthertype().getValue().intValue());
+ Assert.assertTrue("Wrong pushPbbType", message.getGroupDesc().get(0).getBucketsList().get(0)
+ .getAction().get(4).getActionChoice() instanceof PushPbbCase);
+ Assert.assertEquals("Wrong pushPbbEthertype", 4095, ((PushPbbCase) message.getGroupDesc().get(0)
+ .getBucketsList().get(0).getAction().get(4).getActionChoice())
+ .getPushPbbAction().getEthertype().getValue().intValue());
}
/**
message.getGroupDesc().get(0).getBucketsList().get(0).getWatchPort().getValue().intValue());
Assert.assertEquals("Wrong bucketWatchGroup", 4,
message.getGroupDesc().get(0).getBucketsList().get(0).getWatchGroup().intValue());
- Assert.assertEquals("Wrong popVlanType", PopVlan.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
- .getType());
- Assert.assertEquals("Wrong popPbbType", PopPbb.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
- .getType());
- Assert.assertEquals("Wrong popMplsType", PopMpls.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(2)
- .getType());
- Assert.assertEquals("Wrong popMplsEthertype", 207,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(2)
- .getAugmentation(EthertypeAction.class).
- getEthertype().getValue().intValue());
- Assert.assertEquals("Wrong setQueueType", SetQueue.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(3)
- .getType());
- Assert.assertEquals("Wrong setQueueQueueId", 13565952,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(3)
- .getAugmentation(QueueIdAction.class).
- getQueueId().intValue());
- Assert.assertEquals("Wrong groupType", Group.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(4)
- .getType());
- Assert.assertEquals("Wrong groupGroupId", 13565952,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(4)
- .getAugmentation(GroupIdAction.class).
- getGroupId().intValue());
- Assert.assertEquals("Wrong decNwTtlType", DecNwTtl.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(5)
- .getType());
+ Assert.assertTrue("Wrong popVlanType", message.getGroupDesc().get(0).getBucketsList().get(0)
+ .getAction().get(0).getActionChoice() instanceof PopVlanCase);
+ Assert.assertTrue("Wrong popPbbType", message.getGroupDesc().get(0).getBucketsList().get(0)
+ .getAction().get(1).getActionChoice() instanceof PopPbbCase);
+ Assert.assertTrue("Wrong popMplsType", message.getGroupDesc().get(0).getBucketsList().get(0)
+ .getAction().get(2).getActionChoice() instanceof PopMplsCase);
+ Assert.assertEquals("Wrong popMplsEthertype", 207, ((PopMplsCase) message.getGroupDesc().get(0)
+ .getBucketsList().get(0).getAction().get(2).getActionChoice())
+ .getPopMplsAction().getEthertype().getValue().intValue());
+ Assert.assertTrue("Wrong setQueueType", message.getGroupDesc().get(0).getBucketsList().get(0)
+ .getAction().get(3).getActionChoice() instanceof SetQueueCase);
+ Assert.assertEquals("Wrong setQueueQueueId", 13565952, ((SetQueueCase) message.getGroupDesc().get(0)
+ .getBucketsList().get(0).getAction().get(3).getActionChoice())
+ .getSetQueueAction().getQueueId().intValue());
+ Assert.assertTrue("Wrong groupType", message.getGroupDesc().get(0).getBucketsList().get(0)
+ .getAction().get(4).getActionChoice() instanceof GroupCase);
+ Assert.assertEquals("Wrong groupGroupId", 13565952, ((GroupCase) message.getGroupDesc().get(0)
+ .getBucketsList().get(0).getAction().get(4).getActionChoice())
+ .getGroupAction().getGroupId().intValue());
+ Assert.assertTrue("Wrong decNwTtlType", message.getGroupDesc().get(0).getBucketsList().get(0)
+ .getAction().get(5).getActionChoice() instanceof DecNwTtlCase);
}
/**
Assert.assertEquals("Wrong bucketWatchGroup", 4,
message.getGroupDesc().get(0).getBucketsList().get(0).getWatchGroup().intValue());
- Assert.assertEquals("Wrong nwTTlType", SetNwTtl.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
- .getType());
+ Assert.assertTrue("Wrong nwTTlType", message.getGroupDesc().get(0).getBucketsList().get(0)
+ .getAction().get(0).getActionChoice() instanceof SetNwTtlCase);
- Assert.assertEquals("Wrong nwTTlnwTTL", 14,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
- .getAugmentation(NwTtlAction.class).getNwTtl().intValue());
+ Assert.assertEquals("Wrong nwTTlnwTTL", 14, ((SetNwTtlCase) message.getGroupDesc().get(0)
+ .getBucketsList().get(0).getAction().get(0).getActionChoice())
+ .getSetNwTtlAction().getNwTtl().intValue());
- Assert.assertEquals("Wrong setFieldType", SetField.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
- .getType());
+ Assert.assertTrue("Wrong setFieldType", message.getGroupDesc().get(0).getBucketsList().get(0)
+ .getAction().get(1).getActionChoice() instanceof SetFieldCase);
Assert.assertEquals("Wrong setFieldOXMClass", OpenflowBasicClass.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
- .getAugmentation(OxmFieldsAction.class).getMatchEntry().get(0).getOxmClass());
+ ((SetFieldCase) message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
+ .getActionChoice()).getSetFieldAction().getMatchEntry().get(0).getOxmClass());
Assert.assertEquals("Wrong setFieldOXMField", InPort.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
- .getAugmentation(OxmFieldsAction.class).getMatchEntry().get(0).getOxmMatchField());
+ ((SetFieldCase) message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
+ .getActionChoice()).getSetFieldAction().getMatchEntry().get(0).getOxmMatchField());
- MatchEntry entry = message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
- .getAugmentation(OxmFieldsAction.class).getMatchEntry().get(0);
+ MatchEntry entry = ((SetFieldCase) message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
+ .getActionChoice()).getSetFieldAction().getMatchEntry().get(0);
Assert.assertEquals("Wrong setFieldOXMValue", 255, ((InPortCase) entry.getMatchEntryValue())
.getInPort().getPortNumber().getValue().intValue());
}
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-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.augments.rev150225.VlanVidAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanVid;
-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.action.grouping.action.choice.SetVlanVidCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyAggregateCase;
new BigInteger(1, new byte[]{(byte) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20}),
message.getFlowStats().get(0).getByteCount());
Action action1 = message.getFlowStats().get(0).getAction().get(0);
- Assert.assertEquals("Wrong action type", Output.class, action1.getType());
- Assert.assertEquals("Wrong action port", 1, action1.getAugmentation(PortAction.class)
- .getPort().getValue().intValue());
- Assert.assertEquals("Wrong action port", 2, action1.getAugmentation(MaxLengthAction.class)
- .getMaxLength().intValue());
+ Assert.assertTrue("Wrong action type", action1.getActionChoice() instanceof OutputActionCase);
+ Assert.assertEquals("Wrong action port", 1, ((OutputActionCase) action1.getActionChoice())
+ .getOutputAction().getPort().getValue().intValue());
+ Assert.assertEquals("Wrong action port", 2, ((OutputActionCase) action1.getActionChoice())
+ .getOutputAction().getMaxLength().intValue());
Action action2 = message.getFlowStats().get(0).getAction().get(1);
- Assert.assertEquals("Wrong action type", SetVlanVid.class, action2.getType());
- Assert.assertEquals("Wrong action port", 3, action2.getAugmentation(VlanVidAction.class)
- .getVlanVid().intValue());
+ Assert.assertTrue("Wrong action type",action2.getActionChoice() instanceof SetVlanVidCase);
+ Assert.assertEquals("Wrong action port", 3, ((SetVlanVidCase) action2.getActionChoice())
+ .getSetVlanVidAction().getVlanVid().intValue());
Assert.assertTrue("Unread data", bb.readableBytes() == 0);
}
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsActionBuilder;
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.augments.rev150225.oxm.container.match.entry.value.experimenter.id._case.ExperimenterBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ExperimenterClass;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
public void test(){
OF13SetFieldActionSerializer ser = new OF13SetFieldActionSerializer();
ser.injectSerializerRegistry(registry);
- ActionBuilder actionBuilder = new ActionBuilder();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder actionBuilder = new ActionBuilder();
long experimenterId = 12L;
ExperimenterIdCaseBuilder expCaseBuilder = new ExperimenterIdCaseBuilder();
ExperimenterBuilder expBuilder = new ExperimenterBuilder();
meb.setOxmClass(ExperimenterClass.class);
meb.setOxmMatchField(OxmMatchFieldClass.class);
meb.setMatchEntryValue(expCaseBuilder.build());
- List<MatchEntry> MatchEntry = new ArrayList<>();
+ List<MatchEntry> matchEntry = new ArrayList<>();
MatchEntry me = meb.build();
- MatchEntry.add(me);
- OxmFieldsActionBuilder oxmActBuilder = new OxmFieldsActionBuilder();
- oxmActBuilder.setMatchEntry(MatchEntry);
- actionBuilder.addAugmentation(OxmFieldsAction.class, oxmActBuilder.build());
- actionBuilder.setType(SetField.class);
+ matchEntry.add(me);
+ SetFieldCaseBuilder caseBuilder = new SetFieldCaseBuilder();
+ SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();
+ setFieldBuilder.setMatchEntry(matchEntry);
+ caseBuilder.setSetFieldAction(setFieldBuilder.build());
+ actionBuilder.setActionChoice(caseBuilder.build());
MatchEntrySerializerKey<?, ?> key = new MatchEntrySerializerKey<>(
EncodeConstants.OF13_VERSION_ID, ExperimenterClass.class, OxmMatchFieldClass.class);
key.setExperimenterId(experimenterId);
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MetadataInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MetadataInstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.TableIdInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.TableIdInstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
-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.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.output.action._case.OutputActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.ApplyActions;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.GotoTable;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.WriteMetadata;
insBuilder.setType(ApplyActions.class);
List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(Output.class);
- PortActionBuilder port = new PortActionBuilder();
- port.setPort(new PortNumber(42L));
- actionBuilder.addAugmentation(PortAction.class, port.build());
- MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();
- maxLen.setMaxLength(52);
- actionBuilder.addAugmentation(MaxLengthAction.class, maxLen.build());
+ OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
+ OutputActionBuilder outputBuilder = new OutputActionBuilder();
+ outputBuilder.setPort(new PortNumber(42L));
+ outputBuilder.setMaxLength(52);
+ caseBuilder.setOutputAction(outputBuilder.build());
+ actionBuilder.setActionChoice(caseBuilder.build());
actions.add(actionBuilder.build());
ActionsInstructionBuilder actionInstructionBuilder = new ActionsInstructionBuilder();
actionInstructionBuilder.setAction(actions);
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetTpSrc;
-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.openflow.common.action.rev150203.action.grouping.action.choice.SetNwDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.nw.dst._case.SetNwDstActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.tp.src._case.SetTpSrcActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModCommand;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlagsV10;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10;
builder.setFlagsV10(new FlowModFlagsV10(true, false, true));
List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetNwDst.class);
- IpAddressActionBuilder ipBuilder = new IpAddressActionBuilder();
- ipBuilder.setIpAddress(new Ipv4Address("2.2.2.2"));
- actionBuilder.addAugmentation(IpAddressAction.class, ipBuilder.build());
+ SetNwDstCaseBuilder nwDstCaseBuilder = new SetNwDstCaseBuilder();
+ SetNwDstActionBuilder nwDstBuilder = new SetNwDstActionBuilder();
+ nwDstBuilder.setIpAddress(new Ipv4Address("2.2.2.2"));
+ nwDstCaseBuilder.setSetNwDstAction(nwDstBuilder.build());
+ actionBuilder.setActionChoice(nwDstCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetTpSrc.class);
- PortActionBuilder portBuilder = new PortActionBuilder();
- portBuilder.setPort(new PortNumber(42L));
- actionBuilder.addAugmentation(PortAction.class, portBuilder.build());
+ SetTpSrcCaseBuilder tpSrcCaseBuilder = new SetTpSrcCaseBuilder();
+ SetTpSrcActionBuilder tpSrcBuilder = new SetTpSrcActionBuilder();
+ tpSrcBuilder.setPort(new PortNumber(42L));
+ tpSrcCaseBuilder.setSetTpSrcAction(tpSrcBuilder.build());
+ actionBuilder.setActionChoice(tpSrcCaseBuilder.build());
actions.add(actionBuilder.build());
builder.setAction(actions);
FlowModInput message = builder.build();
import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.StripVlan;
-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.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.StripVlanCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.output.action._case.OutputActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInputBuilder;
builder.setInPort(new PortNumber(257L));
List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(Output.class);
- PortActionBuilder portBuilder = new PortActionBuilder();
- portBuilder.setPort(new PortNumber((long) 42));
- actionBuilder.addAugmentation(PortAction.class, portBuilder.build());
- MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();
- maxLen.setMaxLength(50);
- actionBuilder.addAugmentation(MaxLengthAction.class, maxLen.build());
+ OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
+ OutputActionBuilder outputBuilder = new OutputActionBuilder();
+ outputBuilder.setPort(new PortNumber(42L));
+ outputBuilder.setMaxLength(50);
+ caseBuilder.setOutputAction(outputBuilder.build());
+ actionBuilder.setActionChoice(caseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(StripVlan.class);
+ actionBuilder.setActionChoice(new StripVlanCaseBuilder().build());
builder.setAction(actions);
actions.add(actionBuilder.build());
builder.setAction(actions);
import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopVlan;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushVlan;
-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.openflow.common.action.rev150203.action.grouping.action.choice.PopVlanCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushVlanCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.vlan._case.PushVlanActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
builder.setInPort(new PortNumber(256L));
List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(PushVlan.class);
- EthertypeActionBuilder ethertypeBuilder = new EthertypeActionBuilder();
- ethertypeBuilder.setEthertype(new EtherType(25));
- actionBuilder.addAugmentation(EthertypeAction.class, ethertypeBuilder.build());
+ PushVlanCaseBuilder pushVlanCaseBuilder = new PushVlanCaseBuilder();
+ PushVlanActionBuilder pushVlanBuilder = new PushVlanActionBuilder();
+ pushVlanBuilder.setEthertype(new EtherType(new EtherType(25)));
+ pushVlanCaseBuilder.setPushVlanAction(pushVlanBuilder.build());
+ actionBuilder.setActionChoice(pushVlanCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(PopVlan.class);
+ actionBuilder.setActionChoice(new PopVlanCaseBuilder().build());
actions.add(actionBuilder.build());
builder.setAction(actions);
builder.setData(ByteBufUtils.hexStringToBytes("00 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14"));
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmRelatedTableFeaturePropertyBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.table.features.properties.container.table.feature.properties.NextTableIds;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.table.features.properties.container.table.feature.properties.NextTableIdsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
-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.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.ApplyActions;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.ClearActions;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.GotoTable;
ActionRelatedTableFeaturePropertyBuilder actBuilder = new ActionRelatedTableFeaturePropertyBuilder();
List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(Output.class);
+ actionBuilder.setActionChoice(new OutputActionCaseBuilder().build());
actions.add(actionBuilder.build());
actBuilder.setAction(actions);
propBuilder.addAugmentation(ActionRelatedTableFeatureProperty.class, actBuilder.build());
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.deserialization.action.AbstractActionDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
-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.CopyTtlInCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlOutCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecMplsTtlCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecNwTtlCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.GroupCase;
+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.action.grouping.action.choice.PopMplsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopPbbCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopVlanCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushMplsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushPbbCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushVlanCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetMplsTtlCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTtlCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetQueueCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPhyPortCase;
import org.slf4j.Logger;
CodeKeyMaker keyMaker = CodeKeyMakerFactory.createActionsKeyMaker(EncodeConstants.OF13_VERSION_ID);
List<Action> actions = ListDeserializer.deserializeList(EncodeConstants.OF13_VERSION_ID,
message.readableBytes(), message, keyMaker, registry);
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.Output", actions.get(0).getType().getName());
+ Assert.assertTrue("Wrong action type", actions.get(0).getActionChoice() instanceof OutputActionCase);
Assert.assertEquals("Wrong action port", 1,
- actions.get(0).getAugmentation(PortAction.class).getPort().getValue().intValue());
+ ((OutputActionCase) actions.get(0).getActionChoice()).getOutputAction()
+ .getPort().getValue().intValue());
Assert.assertEquals("Wrong action max-length", 2,
- actions.get(0).getAugmentation(MaxLengthAction.class).getMaxLength().intValue());
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.CopyTtlOut", actions.get(1).getType().getName());
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.CopyTtlIn", actions.get(2).getType().getName());
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.SetMplsTtl", actions.get(3).getType().getName());
+ ((OutputActionCase) actions.get(0).getActionChoice()).getOutputAction()
+ .getMaxLength().intValue());
+ Assert.assertTrue("Wrong action type", actions.get(1).getActionChoice() instanceof CopyTtlOutCase);
+ Assert.assertTrue("Wrong action type", actions.get(2).getActionChoice() instanceof CopyTtlInCase);
+ Assert.assertTrue("Wrong action type", actions.get(3).getActionChoice() instanceof SetMplsTtlCase);
Assert.assertEquals("Wrong action value", 3,
- actions.get(3).getAugmentation(MplsTtlAction.class).getMplsTtl().shortValue());
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.DecMplsTtl", actions.get(4).getType().getName());
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.PushVlan", actions.get(5).getType().getName());
+ ((SetMplsTtlCase) actions.get(3).getActionChoice()).getSetMplsTtlAction()
+ .getMplsTtl().shortValue());
+ Assert.assertTrue("Wrong action type", actions.get(4).getActionChoice() instanceof DecMplsTtlCase);
+ Assert.assertTrue("Wrong action type", actions.get(5).getActionChoice() instanceof PushVlanCase);
Assert.assertEquals("Wrong action value", 4,
- actions.get(5).getAugmentation(EthertypeAction.class).getEthertype().getValue().intValue());
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.PopVlan", actions.get(6).getType().getName());
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.PushMpls", actions.get(7).getType().getName());
+ ((PushVlanCase) actions.get(5).getActionChoice()).getPushVlanAction()
+ .getEthertype().getValue().intValue());
+ Assert.assertTrue("Wrong action type", actions.get(6).getActionChoice() instanceof PopVlanCase);
+ Assert.assertTrue("Wrong action type", actions.get(7).getActionChoice() instanceof PushMplsCase);
Assert.assertEquals("Wrong action value", 5,
- actions.get(7).getAugmentation(EthertypeAction.class).getEthertype().getValue().intValue());
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.PopMpls", actions.get(8).getType().getName());
+ ((PushMplsCase) actions.get(7).getActionChoice()).getPushMplsAction()
+ .getEthertype().getValue().intValue());
+ Assert.assertTrue("Wrong action type", actions.get(8).getActionChoice() instanceof PopMplsCase);
Assert.assertEquals("Wrong action value", 6,
- actions.get(8).getAugmentation(EthertypeAction.class).getEthertype().getValue().intValue());
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.SetQueue", actions.get(9).getType().getName());
+ ((PopMplsCase) actions.get(8).getActionChoice()).getPopMplsAction()
+ .getEthertype().getValue().intValue());
+ Assert.assertTrue("Wrong action type", actions.get(9).getActionChoice() instanceof SetQueueCase);
Assert.assertEquals("Wrong action value", 7,
- actions.get(9).getAugmentation(QueueIdAction.class).getQueueId().intValue());
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.Group", actions.get(10).getType().getName());
+ ((SetQueueCase) actions.get(9).getActionChoice()).getSetQueueAction()
+ .getQueueId().intValue());
+ Assert.assertTrue("Wrong action type", actions.get(10).getActionChoice() instanceof GroupCase);
Assert.assertEquals("Wrong action value", 8,
- actions.get(10).getAugmentation(GroupIdAction.class).getGroupId().intValue());
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.SetNwTtl", actions.get(11).getType().getName());
+ ((GroupCase) actions.get(10).getActionChoice()).getGroupAction().getGroupId().intValue());
+ Assert.assertTrue("Wrong action type", actions.get(11).getActionChoice() instanceof SetNwTtlCase);
Assert.assertEquals("Wrong action value", 9,
- actions.get(11).getAugmentation(NwTtlAction.class).getNwTtl().intValue());
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.DecNwTtl", actions.get(12).getType().getName());
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.SetField", actions.get(13).getType().getName());
- List<MatchEntry> entries = actions.get(13).getAugmentation(OxmFieldsAction.class).getMatchEntry();
+ ((SetNwTtlCase) actions.get(11).getActionChoice()).getSetNwTtlAction().getNwTtl().intValue());
+ Assert.assertTrue("Wrong action type", actions.get(12).getActionChoice() instanceof DecNwTtlCase);
+ Assert.assertTrue("Wrong action type", actions.get(13).getActionChoice() instanceof SetFieldCase);
+ List<MatchEntry> entries = ((SetFieldCase) actions.get(13).getActionChoice())
+ .getSetFieldAction().getMatchEntry();
Assert.assertEquals("Wrong number of fields", 1, entries.size());
Assert.assertEquals("Wrong match entry class", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow."
+ "oxm.rev150225.OpenflowBasicClass", entries.get(0).getOxmClass().getName());
Assert.assertEquals("Wrong match entry value", 11,
((InPhyPortCase) entries.get(0).getMatchEntryValue()).getInPhyPort().getPortNumber()
.getValue().intValue());
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.PushPbb", actions.get(14).getType().getName());
+ Assert.assertTrue("Wrong action type", actions.get(14).getActionChoice() instanceof PushPbbCase);
Assert.assertEquals("Wrong action value", 10,
- actions.get(14).getAugmentation(EthertypeAction.class).getEthertype().getValue().intValue());
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.PopPbb", actions.get(15).getType().getName());
+ ((PushPbbCase) actions.get(14).getActionChoice()).getPushPbbAction()
+ .getEthertype().getValue().intValue());
+ Assert.assertTrue("Wrong action type", actions.get(15).getActionChoice() instanceof PopPbbCase);
Assert.assertTrue("Unread data in message", message.readableBytes() == 0);
}
List<Action> actions = ListDeserializer.deserializeHeaders(EncodeConstants.OF13_VERSION_ID,
message.readableBytes(), message, keyMaker, registry);
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.Output", actions.get(0).getType().getName());
- Assert.assertEquals("Wrong action port", null, actions.get(0).getAugmentation(PortAction.class));
- Assert.assertEquals("Wrong action max-length", null, actions.get(0).getAugmentation(MaxLengthAction.class));
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
- + "openflow.common.action.rev130731.SetField", actions.get(1).getType().getName());
- Assert.assertEquals("Wrong action oxm field", null, actions.get(1).getAugmentation(OxmFieldsAction.class));
+ Assert.assertTrue("Wrong action type", actions.get(0).getActionChoice() instanceof OutputActionCase);
+ Assert.assertNull("Wrong action port", ((OutputActionCase) actions.get(0).getActionChoice()).getOutputAction());
+ Assert.assertNull("Wrong action max-length", ((OutputActionCase) actions.get(0).getActionChoice()).getOutputAction());
+ Assert.assertTrue("Wrong action type", actions.get(1).getActionChoice() instanceof SetFieldCase);
+ Assert.assertNull("Wrong action oxm field", ((SetFieldCase) actions.get(1).getActionChoice()).getSetFieldAction());
}
}
import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MetadataInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MeterIdInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.TableIdInstruction;
-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.GroupCase;
+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.action.grouping.action.choice.SetMplsTtlCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetQueueCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
/**
+ "opendaylight.openflow.common.instruction.rev130731.WriteActions", i5.getType().getName());
Assert.assertEquals("Wrong instructions - i5", 2, i5.getAugmentation(ActionsInstruction.class).getAction().size());
Action action1 = i5.getAugmentation(ActionsInstruction.class).getAction().get(0);
- Assert.assertEquals("Wrong action", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output",
- action1.getType().getName());
- Assert.assertEquals("Wrong action", 37, action1.getAugmentation(PortAction.class).getPort().getValue().intValue());
- Assert.assertEquals("Wrong action", 53, action1.getAugmentation(MaxLengthAction.class).getMaxLength().intValue());
+ Assert.assertTrue("Wrong action", action1.getActionChoice() instanceof OutputActionCase);
+ Assert.assertEquals("Wrong action", 37, ((OutputActionCase) action1.getActionChoice()).getOutputAction()
+ .getPort().getValue().intValue());
+ Assert.assertEquals("Wrong action", 53, ((OutputActionCase) action1.getActionChoice()).getOutputAction()
+ .getMaxLength().intValue());
Action action2 = i5.getAugmentation(ActionsInstruction.class).getAction().get(1);
- Assert.assertEquals("Wrong action", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Group",
- action2.getType().getName());
- Assert.assertEquals("Wrong action", 80, action2.getAugmentation(GroupIdAction.class).getGroupId().intValue());
+ Assert.assertTrue("Wrong action", action2.getActionChoice() instanceof GroupCase);
+ Assert.assertEquals("Wrong action", 80, ((GroupCase) action2.getActionChoice()).getGroupAction().getGroupId().intValue());
Instruction i6 = instructions.get(5);
Assert.assertEquals("Wrong type - i6", "org.opendaylight.yang.gen.v1.urn."
+ "opendaylight.openflow.common.instruction.rev130731.ApplyActions", i6.getType().getName());
Assert.assertEquals("Wrong instructions - i6", 2, i6.getAugmentation(ActionsInstruction.class).getAction().size());
action1 = i6.getAugmentation(ActionsInstruction.class).getAction().get(0);
- Assert.assertEquals("Wrong action", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetQueue",
- action1.getType().getName());
- Assert.assertEquals("Wrong action", 37, action1.getAugmentation(QueueIdAction.class).getQueueId().intValue());
+ Assert.assertTrue("Wrong action", action1.getActionChoice() instanceof SetQueueCase);
+ Assert.assertEquals("Wrong action", 37, ((SetQueueCase) action1.getActionChoice()).getSetQueueAction()
+ .getQueueId().intValue());
action2 = i6.getAugmentation(ActionsInstruction.class).getAction().get(1);
- Assert.assertEquals("Wrong action", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetMplsTtl",
- action2.getType().getName());
- Assert.assertEquals("Wrong action", 5, action2.getAugmentation(MplsTtlAction.class).getMplsTtl().intValue());
+ Assert.assertTrue("Wrong action", action2.getActionChoice() instanceof SetMplsTtlCase);
+ Assert.assertEquals("Wrong action", 5, ((SetMplsTtlCase) action2.getActionChoice()).getSetMplsTtlAction()
+ .getMplsTtl().shortValue());
}
}
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
-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.actions.grouping.Action;
/**
* @author michal.polkorab
import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.DlAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTosAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanPcpAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanVidAction;
-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.EnqueueCase;
+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.action.grouping.action.choice.SetDlDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTosCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetVlanPcpCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetVlanVidCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.StripVlanCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
/**
* @author michal.polkorab
message.readableBytes(), message, keyMaker, registry);
Assert.assertEquals("Wrong number of actions", 12, actions.size());
Action action1 = actions.get(0);
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"
- + ".openflow.common.action.rev130731.Output", action1.getType().getName());
+ Assert.assertTrue("Wrong action type", action1.getActionChoice() instanceof OutputActionCase);
Assert.assertEquals("Wrong port", 16,
- action1.getAugmentation(PortAction.class).getPort().getValue().intValue());
+ ((OutputActionCase) action1.getActionChoice()).getOutputAction().getPort().getValue().intValue());
Assert.assertEquals("Wrong max-length", 8192,
- action1.getAugmentation(MaxLengthAction.class).getMaxLength().intValue());
+ ((OutputActionCase) action1.getActionChoice()).getOutputAction().getMaxLength().intValue());
Action action2 = actions.get(1);
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"
- + ".openflow.common.action.rev130731.SetVlanVid", action2.getType().getName());
+ Assert.assertTrue("Wrong action type", action2.getActionChoice() instanceof SetVlanVidCase);
Assert.assertEquals("Wrong vlan-vid", 4112,
- action2.getAugmentation(VlanVidAction.class).getVlanVid().intValue());
+ ((SetVlanVidCase) action2.getActionChoice()).getSetVlanVidAction().getVlanVid().intValue());
Action action3 = actions.get(2);
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"
- + ".openflow.common.action.rev130731.SetVlanPcp", action3.getType().getName());
+ Assert.assertTrue("Wrong action type", action3.getActionChoice() instanceof SetVlanPcpCase);
Assert.assertEquals("Wrong vlan-pcp", 37,
- action3.getAugmentation(VlanPcpAction.class).getVlanPcp().intValue());
+ ((SetVlanPcpCase) action3.getActionChoice()).getSetVlanPcpAction().getVlanPcp().intValue());
Action action4 = actions.get(3);
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"
- + ".openflow.common.action.rev130731.StripVlan", action4.getType().getName());
+ Assert.assertTrue("Wrong action type", action4.getActionChoice() instanceof StripVlanCase);
Action action5 = actions.get(4);
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"
- + ".openflow.common.action.rev130731.SetDlSrc", action5.getType().getName());
+ Assert.assertTrue("Wrong action type", action5.getActionChoice() instanceof SetDlSrcCase);
Assert.assertArrayEquals("Wrong dl-src", ByteBufUtils.macAddressToBytes("01:02:03:04:05:06"),
- ByteBufUtils.macAddressToBytes(action5.getAugmentation(DlAddressAction.class).getDlAddress().getValue()));
+ ByteBufUtils.macAddressToBytes(((SetDlSrcCase) action5.getActionChoice())
+ .getSetDlSrcAction().getDlSrcAddress().getValue()));
Action action6 = actions.get(5);
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"
- + ".openflow.common.action.rev130731.SetDlDst", action6.getType().getName());
+ Assert.assertTrue("Wrong action type", action6.getActionChoice() instanceof SetDlDstCase);
Assert.assertArrayEquals("Wrong dl-dst", ByteBufUtils.macAddressToBytes("02:03:04:05:06:07"),
- ByteBufUtils.macAddressToBytes(action6.getAugmentation(DlAddressAction.class).getDlAddress().getValue()));
+ ByteBufUtils.macAddressToBytes(((SetDlDstCase) action6.getActionChoice())
+ .getSetDlDstAction().getDlDstAddress().getValue()));
Action action7 = actions.get(6);
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"
- + ".openflow.common.action.rev130731.SetNwSrc", action7.getType().getName());
+ Assert.assertTrue("Wrong action type", action7.getActionChoice() instanceof SetNwSrcCase);
Assert.assertEquals("Wrong nw-src", new Ipv4Address("10.0.0.1"),
- action7.getAugmentation(IpAddressAction.class).getIpAddress());
+ ((SetNwSrcCase) action7.getActionChoice()).getSetNwSrcAction().getIpAddress());
Action action8 = actions.get(7);
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"
- + ".openflow.common.action.rev130731.SetNwDst", action8.getType().getName());
+ Assert.assertTrue("Wrong action type", action8.getActionChoice() instanceof SetNwDstCase);
Assert.assertEquals("Wrong nw-dst", new Ipv4Address("11.0.0.2"),
- action8.getAugmentation(IpAddressAction.class).getIpAddress());
+ ((SetNwDstCase) action8.getActionChoice()).getSetNwDstAction().getIpAddress());
Action action9 = actions.get(8);
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"
- + ".openflow.common.action.rev130731.SetNwTos", action9.getType().getName());
- Assert.assertEquals("Wrong nw-tos", 1, action9.getAugmentation(NwTosAction.class).getNwTos().intValue());
+ Assert.assertTrue("Wrong action type", action9.getActionChoice() instanceof SetNwTosCase);
+ Assert.assertEquals("Wrong nw-tos", 1, ((SetNwTosCase) action9.getActionChoice())
+ .getSetNwTosAction().getNwTos().intValue());
Action action10 = actions.get(9);
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"
- + ".openflow.common.action.rev130731.SetTpSrc", action10.getType().getName());
- Assert.assertEquals("Wrong port", 2, action10.getAugmentation(PortAction.class)
- .getPort().getValue().intValue());
+ Assert.assertTrue("Wrong action type", action10.getActionChoice() instanceof SetTpSrcCase);
+ Assert.assertEquals("Wrong port", 2, ((SetTpSrcCase) action10.getActionChoice())
+ .getSetTpSrcAction().getPort().getValue().intValue());
Action action11 = actions.get(10);
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"
- + ".openflow.common.action.rev130731.SetTpDst", action11.getType().getName());
- Assert.assertEquals("Wrong port", 3, action11.getAugmentation(PortAction.class)
- .getPort().getValue().intValue());
+ Assert.assertTrue("Wrong action type", action11.getActionChoice() instanceof SetTpDstCase);
+ Assert.assertEquals("Wrong port", 3, ((SetTpDstCase) action11.getActionChoice())
+ .getSetTpDstAction().getPort().getValue().intValue());
Action action12 = actions.get(11);
- Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"
- + ".openflow.common.action.rev130731.Enqueue", action12.getType().getName());
- Assert.assertEquals("Wrong port", 4, action12.getAugmentation(PortAction.class)
- .getPort().getValue().intValue());
- Assert.assertEquals("Wrong queue-id", 48,
- action12.getAugmentation(QueueIdAction.class).getQueueId().intValue());
+ Assert.assertTrue("Wrong action type", action12.getActionChoice() instanceof EnqueueCase);
+ Assert.assertEquals("Wrong port", 4, ((EnqueueCase) action12.getActionChoice())
+ .getEnqueueAction().getPort().getValue().intValue());
+ Assert.assertEquals("Wrong queue-id", 48, ((EnqueueCase) action12.getActionChoice())
+ .getEnqueueAction().getQueueId().getValue().intValue());
}
}
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.DlAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.DlAddressActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTosAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTosActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanPcpAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanPcpActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanVidAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanVidActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Enqueue;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetDlDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetDlSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTos;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetTpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetTpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanPcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanVid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.StripVlan;
-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.openflow.common.action.rev150203.action.grouping.action.choice.EnqueueCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTosCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetVlanPcpCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetVlanVidCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.StripVlanCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.enqueue._case.EnqueueActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.output.action._case.OutputActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.dl.dst._case.SetDlDstActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.dl.src._case.SetDlSrcActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.nw.dst._case.SetNwDstActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.nw.src._case.SetNwSrcActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.nw.tos._case.SetNwTosActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.tp.dst._case.SetTpDstActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.tp.src._case.SetTpSrcActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.vlan.pcp._case.SetVlanPcpActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.vlan.vid._case.SetVlanVidActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId;
/**
* @author michal.polkorab
public void test() {
List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(Output.class);
- PortActionBuilder portBuilder = new PortActionBuilder();
- portBuilder.setPort(new PortNumber(42L));
- actionBuilder.addAugmentation(PortAction.class, portBuilder.build());
- MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();
- maxLen.setMaxLength(32);
- actionBuilder.addAugmentation(MaxLengthAction.class, maxLen.build());
+ OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
+ OutputActionBuilder outputBuilder = new OutputActionBuilder();
+ outputBuilder.setPort(new PortNumber(42L));
+ outputBuilder.setMaxLength(32);
+ caseBuilder.setOutputAction(outputBuilder.build());
+ actionBuilder.setActionChoice(caseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetVlanVid.class);
- VlanVidActionBuilder vlanBuilder = new VlanVidActionBuilder();
- vlanBuilder.setVlanVid(15);
- actionBuilder.addAugmentation(VlanVidAction.class, vlanBuilder.build());
+ SetVlanVidCaseBuilder vlanVidCaseBuilder = new SetVlanVidCaseBuilder();
+ SetVlanVidActionBuilder vlanVidBuilder = new SetVlanVidActionBuilder();
+ vlanVidBuilder.setVlanVid(15);
+ vlanVidCaseBuilder.setSetVlanVidAction(vlanVidBuilder.build());
+ actionBuilder.setActionChoice(vlanVidCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetVlanPcp.class);
- VlanPcpActionBuilder pcpBuilder = new VlanPcpActionBuilder();
- pcpBuilder.setVlanPcp((short) 16);
- actionBuilder.addAugmentation(VlanPcpAction.class, pcpBuilder.build());
+ SetVlanPcpCaseBuilder vlanPcpCaseBuilder = new SetVlanPcpCaseBuilder();
+ SetVlanPcpActionBuilder vlanPcpBuilder = new SetVlanPcpActionBuilder();
+ vlanPcpBuilder.setVlanPcp((short) 16);
+ vlanPcpCaseBuilder.setSetVlanPcpAction(vlanPcpBuilder.build());
+ actionBuilder.setActionChoice(vlanPcpCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(StripVlan.class);
+ actionBuilder.setActionChoice(new StripVlanCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetDlSrc.class);
- DlAddressActionBuilder dlBuilder = new DlAddressActionBuilder();
- dlBuilder.setDlAddress(new MacAddress("00:00:00:02:03:04"));
- actionBuilder.addAugmentation(DlAddressAction.class, dlBuilder.build());
+ SetDlSrcCaseBuilder dlSrcCaseBuilder = new SetDlSrcCaseBuilder();
+ SetDlSrcActionBuilder dlSrcBuilder = new SetDlSrcActionBuilder();
+ dlSrcBuilder.setDlSrcAddress(new MacAddress("00:00:00:02:03:04"));
+ dlSrcCaseBuilder.setSetDlSrcAction(dlSrcBuilder.build());
+ actionBuilder.setActionChoice(dlSrcCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetDlDst.class);
- dlBuilder = new DlAddressActionBuilder();
- dlBuilder.setDlAddress(new MacAddress("00:00:00:01:02:03"));
- actionBuilder.addAugmentation(DlAddressAction.class, dlBuilder.build());
+ SetDlDstCaseBuilder dlDstCaseBuilder = new SetDlDstCaseBuilder();
+ SetDlDstActionBuilder dlDstBuilder = new SetDlDstActionBuilder();
+ dlDstBuilder.setDlDstAddress(new MacAddress("00:00:00:01:02:03"));
+ dlDstCaseBuilder.setSetDlDstAction(dlDstBuilder.build());
+ actionBuilder.setActionChoice(dlDstCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetNwSrc.class);
- IpAddressActionBuilder ipBuilder = new IpAddressActionBuilder();
- ipBuilder.setIpAddress(new Ipv4Address("10.0.0.1"));
- actionBuilder.addAugmentation(IpAddressAction.class, ipBuilder.build());
+ SetNwSrcCaseBuilder nwSrcCaseBuilder = new SetNwSrcCaseBuilder();
+ SetNwSrcActionBuilder nwSrcBuilder = new SetNwSrcActionBuilder();
+ nwSrcBuilder.setIpAddress(new Ipv4Address("10.0.0.1"));
+ nwSrcCaseBuilder.setSetNwSrcAction(nwSrcBuilder.build());
+ actionBuilder.setActionChoice(nwSrcCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetNwDst.class);
- ipBuilder = new IpAddressActionBuilder();
- ipBuilder.setIpAddress(new Ipv4Address("10.0.0.3"));
- actionBuilder.addAugmentation(IpAddressAction.class, ipBuilder.build());
+ SetNwDstCaseBuilder nwDstCaseBuilder = new SetNwDstCaseBuilder();
+ SetNwDstActionBuilder nwDstBuilder = new SetNwDstActionBuilder();
+ nwDstBuilder.setIpAddress(new Ipv4Address("10.0.0.3"));
+ nwDstCaseBuilder.setSetNwDstAction(nwDstBuilder.build());
+ actionBuilder.setActionChoice(nwDstCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetNwTos.class);
- NwTosActionBuilder tosBuilder = new NwTosActionBuilder();
+ SetNwTosCaseBuilder tosCaseBuilder = new SetNwTosCaseBuilder();
+ SetNwTosActionBuilder tosBuilder = new SetNwTosActionBuilder();
tosBuilder.setNwTos((short) 204);
- actionBuilder.addAugmentation(NwTosAction.class, tosBuilder.build());
+ tosCaseBuilder.setSetNwTosAction(tosBuilder.build());
+ actionBuilder.setActionChoice(tosCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetTpSrc.class);
- portBuilder = new PortActionBuilder();
- portBuilder.setPort(new PortNumber(6653L));
- actionBuilder.addAugmentation(PortAction.class, portBuilder.build());
+ SetTpSrcCaseBuilder tpSrcCaseBuilder = new SetTpSrcCaseBuilder();
+ SetTpSrcActionBuilder tpSrcBuilder = new SetTpSrcActionBuilder();
+ tpSrcBuilder.setPort(new PortNumber(6653L));
+ tpSrcCaseBuilder.setSetTpSrcAction(tpSrcBuilder.build());
+ actionBuilder.setActionChoice(tpSrcCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetTpDst.class);
- portBuilder = new PortActionBuilder();
- portBuilder.setPort(new PortNumber(6633L));
- actionBuilder.addAugmentation(PortAction.class, portBuilder.build());
+ SetTpDstCaseBuilder tpDstCaseBuilder = new SetTpDstCaseBuilder();
+ SetTpDstActionBuilder tpDstBuilder = new SetTpDstActionBuilder();
+ tpDstBuilder.setPort(new PortNumber(6633L));
+ tpDstCaseBuilder.setSetTpDstAction(tpDstBuilder.build());
+ actionBuilder.setActionChoice(tpDstCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(Enqueue.class);
- portBuilder = new PortActionBuilder();
- portBuilder.setPort(new PortNumber(6613L));
- actionBuilder.addAugmentation(PortAction.class, portBuilder.build());
- QueueIdActionBuilder queueBuilder = new QueueIdActionBuilder();
- queueBuilder.setQueueId(400L);
- actionBuilder.addAugmentation(QueueIdAction.class, queueBuilder.build());
+ EnqueueCaseBuilder enqueueCaseBuilder = new EnqueueCaseBuilder();
+ EnqueueActionBuilder enqueueBuilder = new EnqueueActionBuilder();
+ enqueueBuilder.setPort(new PortNumber(6613L));
+ enqueueBuilder.setQueueId(new QueueId(400L));
+ enqueueCaseBuilder.setEnqueueAction(enqueueBuilder.build());
+ actionBuilder.setActionChoice(enqueueCaseBuilder.build());
actions.add(actionBuilder.build());
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlIn;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlOut;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.DecMplsTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.DecNwTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopMpls;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopPbb;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopVlan;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushMpls;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushPbb;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushVlan;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetMplsTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetQueue;
-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.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlInCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlOutCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecMplsTtlCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecNwTtlCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.GroupCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopMplsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopPbbCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopVlanCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushMplsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushPbbCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushVlanCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetMplsTtlCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTtlCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetQueueCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.group._case.GroupActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.output.action._case.OutputActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.pop.mpls._case.PopMplsActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.mpls._case.PushMplsActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.pbb._case.PushPbbActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.vlan._case.PushVlanActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.mpls.ttl._case.SetMplsTtlActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.nw.ttl._case.SetNwTtlActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.queue._case.SetQueueActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPort;
public void test() {
List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(Output.class);
- PortActionBuilder port = new PortActionBuilder();
- port.setPort(new PortNumber(42L));
- actionBuilder.addAugmentation(PortAction.class, port.build());
- MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();
- maxLen.setMaxLength(52);
- actionBuilder.addAugmentation(MaxLengthAction.class, maxLen.build());
+ OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
+ OutputActionBuilder outputBuilder = new OutputActionBuilder();
+ outputBuilder.setPort(new PortNumber(42L));
+ outputBuilder.setMaxLength(52);
+ caseBuilder.setOutputAction(outputBuilder.build());
+ actionBuilder.setActionChoice(caseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(CopyTtlOut.class);
+ actionBuilder.setActionChoice(new CopyTtlOutCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(CopyTtlIn.class);
+ actionBuilder.setActionChoice(new CopyTtlInCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetMplsTtl.class);
- MplsTtlActionBuilder mplsTtl = new MplsTtlActionBuilder();
- mplsTtl.setMplsTtl((short) 4);
- actionBuilder.addAugmentation(MplsTtlAction.class, mplsTtl.build());
+ SetMplsTtlCaseBuilder setMplsTtlCaseBuilder = new SetMplsTtlCaseBuilder();
+ SetMplsTtlActionBuilder setMplsTtlBuilder = new SetMplsTtlActionBuilder();
+ setMplsTtlBuilder.setMplsTtl((short) 4);
+ setMplsTtlCaseBuilder.setSetMplsTtlAction(setMplsTtlBuilder.build());
+ actionBuilder.setActionChoice(setMplsTtlCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(DecMplsTtl.class);
+ actionBuilder.setActionChoice(new DecMplsTtlCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(PushVlan.class);
- EthertypeActionBuilder etherType = new EthertypeActionBuilder();
- etherType.setEthertype(new EtherType(16));
- actionBuilder.addAugmentation(EthertypeAction.class, etherType.build());
+ PushVlanCaseBuilder pushVlanCaseBuilder = new PushVlanCaseBuilder();
+ PushVlanActionBuilder pushVlanBuilder = new PushVlanActionBuilder();
+ pushVlanBuilder.setEthertype(new EtherType(new EtherType(16)));
+ pushVlanCaseBuilder.setPushVlanAction(pushVlanBuilder.build());
+ actionBuilder.setActionChoice(pushVlanCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(PopVlan.class);
+ actionBuilder.setActionChoice(new PopVlanCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(PushMpls.class);
- etherType = new EthertypeActionBuilder();
- etherType.setEthertype(new EtherType(17));
- actionBuilder.addAugmentation(EthertypeAction.class, etherType.build());
+ PushMplsCaseBuilder pushMplsCaseBuilder = new PushMplsCaseBuilder();
+ PushMplsActionBuilder pushMplsBuilder = new PushMplsActionBuilder();
+ pushMplsBuilder.setEthertype(new EtherType(new EtherType(17)));
+ pushMplsCaseBuilder.setPushMplsAction(pushMplsBuilder.build());
+ actionBuilder.setActionChoice(pushMplsCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(PopMpls.class);
- etherType = new EthertypeActionBuilder();
- etherType.setEthertype(new EtherType(18));
- actionBuilder.addAugmentation(EthertypeAction.class, etherType.build());
+ PopMplsCaseBuilder popMplsCaseBuilder = new PopMplsCaseBuilder();
+ PopMplsActionBuilder popMplsBuilder = new PopMplsActionBuilder();
+ popMplsBuilder.setEthertype(new EtherType(new EtherType(18)));
+ popMplsCaseBuilder.setPopMplsAction(popMplsBuilder.build());
+ actionBuilder.setActionChoice(popMplsCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetQueue.class);
- QueueIdActionBuilder queueId = new QueueIdActionBuilder();
- queueId.setQueueId(1234L);
- actionBuilder.addAugmentation(QueueIdAction.class, queueId.build());
+ SetQueueCaseBuilder setQueueCaseBuilder = new SetQueueCaseBuilder();
+ SetQueueActionBuilder setQueueBuilder = new SetQueueActionBuilder();
+ setQueueBuilder.setQueueId(1234L);
+ setQueueCaseBuilder.setSetQueueAction(setQueueBuilder.build());
+ actionBuilder.setActionChoice(setQueueCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(Group.class);
- GroupIdActionBuilder group = new GroupIdActionBuilder();
- group.setGroupId(555L);
- actionBuilder.addAugmentation(GroupIdAction.class, group.build());
+ GroupCaseBuilder groupCaseBuilder = new GroupCaseBuilder();
+ GroupActionBuilder groupActionBuilder = new GroupActionBuilder();
+ groupActionBuilder.setGroupId(555L);
+ groupCaseBuilder.setGroupAction(groupActionBuilder.build());
+ actionBuilder.setActionChoice(groupCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetNwTtl.class);
- NwTtlActionBuilder nwTtl = new NwTtlActionBuilder();
- nwTtl.setNwTtl((short) 8);
- actionBuilder.addAugmentation(NwTtlAction.class, nwTtl.build());
+ SetNwTtlCaseBuilder nwTtlCaseBuilder = new SetNwTtlCaseBuilder();
+ SetNwTtlActionBuilder nwTtlBuilder = new SetNwTtlActionBuilder();
+ nwTtlBuilder.setNwTtl((short) 8);
+ nwTtlCaseBuilder.setSetNwTtlAction(nwTtlBuilder.build());
+ actionBuilder.setActionChoice(nwTtlCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(DecNwTtl.class);
+ actionBuilder.setActionChoice(new DecNwTtlCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetField.class);
- OxmFieldsActionBuilder matchEntries = new OxmFieldsActionBuilder();
+ SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
+ SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();
List<MatchEntry> entries = new ArrayList<>();
MatchEntryBuilder matchBuilder = new MatchEntryBuilder();
matchBuilder.setOxmClass(OpenflowBasicClass.class);
inPortCaseBuilder.setInPort(inPortBuilder.build());
matchBuilder.setMatchEntryValue(inPortCaseBuilder.build());
entries.add(matchBuilder.build());
- matchEntries.setMatchEntry(entries);
- actionBuilder.addAugmentation(OxmFieldsAction.class, matchEntries.build());
+ setFieldBuilder.setMatchEntry(entries);
+ setFieldCaseBuilder.setSetFieldAction(setFieldBuilder.build());
+ actionBuilder.setActionChoice(setFieldCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(PushPbb.class);
- etherType = new EthertypeActionBuilder();
- etherType.setEthertype(new EtherType(19));
- actionBuilder.addAugmentation(EthertypeAction.class, etherType.build());
+ PushPbbCaseBuilder pushPbbCaseBuilder = new PushPbbCaseBuilder();
+ PushPbbActionBuilder pushPbbBuilder = new PushPbbActionBuilder();
+ pushPbbBuilder.setEthertype(new EtherType(new EtherType(19)));
+ pushPbbCaseBuilder.setPushPbbAction(pushPbbBuilder.build());
+ actionBuilder.setActionChoice(pushPbbCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(PopPbb.class);
+ actionBuilder.setActionChoice(new PopPbbCaseBuilder().build());
actions.add(actionBuilder.build());
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
public void testHeaders() {
List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(Output.class);
- PortActionBuilder port = new PortActionBuilder();
- port.setPort(new PortNumber(42L));
- actionBuilder.addAugmentation(PortAction.class, port.build());
- MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();
- maxLen.setMaxLength(52);
- actionBuilder.addAugmentation(MaxLengthAction.class, maxLen.build());
+ OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
+ OutputActionBuilder outputBuilder = new OutputActionBuilder();
+ outputBuilder.setPort(new PortNumber(42L));
+ outputBuilder.setMaxLength(52);
+ caseBuilder.setOutputAction(outputBuilder.build());
+ actionBuilder.setActionChoice(caseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetField.class);
- OxmFieldsActionBuilder matchEntries = new OxmFieldsActionBuilder();
+ SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
+ SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();
List<MatchEntry> entries = new ArrayList<>();
MatchEntryBuilder matchBuilder = new MatchEntryBuilder();
matchBuilder.setOxmClass(OpenflowBasicClass.class);
inPortCaseBuilder.setInPort(inPortBuilder.build());
matchBuilder.setMatchEntryValue(inPortCaseBuilder.build());
entries.add(matchBuilder.build());
- matchEntries.setMatchEntry(entries);
- actionBuilder.addAugmentation(OxmFieldsAction.class, matchEntries.build());
+ setFieldBuilder.setMatchEntry(entries);
+ setFieldCaseBuilder.setSetFieldAction(setFieldBuilder.build());
+ actionBuilder.setActionChoice(setFieldCaseBuilder.build());
actions.add(actionBuilder.build());
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MetadataInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MetadataInstructionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MeterIdInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MeterIdInstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.TableIdInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.TableIdInstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopPbb;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushVlan;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTtl;
-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.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopPbbCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushVlanCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTtlCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.output.action._case.OutputActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.vlan._case.PushVlanActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.nw.ttl._case.SetNwTtlActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.ApplyActions;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.ClearActions;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.GotoTable;
ActionsInstructionBuilder actionsBuilder = new ActionsInstructionBuilder();
List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(Output.class);
- PortActionBuilder portBuilder = new PortActionBuilder();
- portBuilder.setPort(new PortNumber(45L));
- actionBuilder.addAugmentation(PortAction.class, portBuilder.build());
- MaxLengthActionBuilder maxBuilder = new MaxLengthActionBuilder();
- maxBuilder.setMaxLength(55);
- actionBuilder.addAugmentation(MaxLengthAction.class, maxBuilder.build());
+ OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
+ OutputActionBuilder outputBuilder = new OutputActionBuilder();
+ outputBuilder.setPort(new PortNumber(45L));
+ outputBuilder.setMaxLength(55);
+ caseBuilder.setOutputAction(outputBuilder.build());
+ actionBuilder.setActionChoice(caseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetNwTtl.class);
- NwTtlActionBuilder nwTtl = new NwTtlActionBuilder();
- nwTtl.setNwTtl((short) 64);
- actionBuilder.addAugmentation(NwTtlAction.class, nwTtl.build());
+ SetNwTtlCaseBuilder ttlCaseBuilder = new SetNwTtlCaseBuilder();
+ SetNwTtlActionBuilder ttlActionBuilder = new SetNwTtlActionBuilder();
+ ttlActionBuilder.setNwTtl((short) 64);
+ ttlCaseBuilder.setSetNwTtlAction(ttlActionBuilder.build());
+ actionBuilder.setActionChoice(ttlCaseBuilder.build());
actions.add(actionBuilder.build());
actionsBuilder.setAction(actions);
builder.addAugmentation(ActionsInstruction.class, actionsBuilder.build());
actionsBuilder = new ActionsInstructionBuilder();
actions = new ArrayList<>();
actionBuilder = new ActionBuilder();
- actionBuilder.setType(PushVlan.class);
- EthertypeActionBuilder ethertypeBuilder = new EthertypeActionBuilder();
- ethertypeBuilder.setEthertype(new EtherType(14));
- actionBuilder.addAugmentation(EthertypeAction.class, ethertypeBuilder.build());
+ PushVlanCaseBuilder vlanCaseBuilder = new PushVlanCaseBuilder();
+ PushVlanActionBuilder vlanBuilder = new PushVlanActionBuilder();
+ vlanBuilder.setEthertype(new EtherType(new EtherType(14)));
+ vlanCaseBuilder.setPushVlanAction(vlanBuilder.build());
+ actionBuilder.setActionChoice(vlanCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
- actionBuilder.setType(PopPbb.class);
+ actionBuilder.setActionChoice(new PopPbbCaseBuilder().build());
actions.add(actionBuilder.build());
actionsBuilder.setAction(actions);
builder.addAugmentation(ActionsInstruction.class, actionsBuilder.build());
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdInstructionBuilder;
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.augments.rev150225.oxm.container.match.entry.value.experimenter.id._case.ExperimenterBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Experimenter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.ExperimenterActionSubType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
-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.openflow.common.action.rev150203.ExperimenterActionSubType;
+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.action.grouping.action.choice.OutputActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.GotoTable;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;
Assert.assertNotNull("Null keyMaker", keyMaker);
ActionBuilder builder = new ActionBuilder();
- builder.setType(Output.class);
+ builder.setActionChoice(new OutputActionCaseBuilder().build());
Action action = builder.build();
MessageTypeKey<?> key = keyMaker.make(action);
Assert.assertNotNull("Null key", key);
Assert.assertEquals("Wrong key", new ActionSerializerKey<>(EncodeConstants.OF13_VERSION_ID,
- Output.class, null), key);
+ OutputActionCase.class, null), key);
}
/**
TypeKeyMaker<Action> keyMaker = TypeKeyMakerFactory.createActionKeyMaker(EncodeConstants.OF13_VERSION_ID);
Assert.assertNotNull("Null keyMaker", keyMaker);
- ActionBuilder builder = new ActionBuilder();
- builder.setType(Experimenter.class);
- ExperimenterIdActionBuilder expIdBuilder = new ExperimenterIdActionBuilder();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder builder = new ActionBuilder();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.action.container.action.choice
+ .ExperimenterIdCaseBuilder caseBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments
+ .rev150225.action.container.action.choice.ExperimenterIdCaseBuilder();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.action.container.action.choice
+ .experimenter.id._case.ExperimenterBuilder expIdBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight
+ .openflow.augments.rev150225.action.container.action.choice.experimenter.id._case.ExperimenterBuilder();
expIdBuilder.setExperimenter(new ExperimenterId(42L));
expIdBuilder.setSubType(ActionSubtypeClass.class);
- builder.addAugmentation(ExperimenterIdAction.class, expIdBuilder.build());
+ caseBuilder.setExperimenter(expIdBuilder.build());
+ builder.setActionChoice(caseBuilder.build());
Action action = builder.build();
MessageTypeKey<?> key = keyMaker.make(action);