- public static Set<org.opendaylight.controller.sal.action.Action> actionFrom(Action source) {
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.Action sourceAction = source
- .getAction();
- Set<org.opendaylight.controller.sal.action.Action> targetAction = new HashSet<>();
- if (sourceAction instanceof ControllerAction) {
- targetAction.add(new Controller());
- } else if (sourceAction instanceof OutputAction) {
-
- List<Uri> nodeConnectors = ((OutputAction) sourceAction).getOutputNodeConnector();
- for (Uri uri : nodeConnectors) {
- targetAction.add(new Output(fromNodeConnectorRef(uri)));
- }
- } else if (sourceAction instanceof PopMplsAction) {
- // TODO: define maping
- } else if (sourceAction instanceof PushMplsAction) {
- // TODO: define maping
- } else if (sourceAction instanceof PushPbbAction) {
- // TODO: define maping
- } else if (sourceAction instanceof PushVlanAction) {
- // TODO: define maping
- // PushVlanAction vlanAction = (PushVlanAction) sourceAction;
- // targetAction.add(new PushVlan(vlanAction., pcp, cfi, vlanId);
- } else if (sourceAction instanceof SetMplsTtlAction) {
- // TODO: define maping
- // targetAction = //no action to map
- } else if (sourceAction instanceof SetNwTtlAction) {
- // TODO: define maping
- } else if (sourceAction instanceof SetQueueAction) {
- // TODO: define maping
- // targetAction = //no action to map
- } else if (sourceAction instanceof DropAction) {
- targetAction.add(new Drop());
- } else if (sourceAction instanceof FloodAction) {
- targetAction.add(new Flood());
- } else if (sourceAction instanceof FloodAllAction) {
- targetAction.add(new FloodAll());
- } else if (sourceAction instanceof HwPathAction) {
- targetAction.add(new HwPath());
- } else if (sourceAction instanceof LoopbackAction) {
- targetAction.add(new Loopback());
- } else if (sourceAction instanceof PopVlanAction) {
- targetAction.add(new PopVlan());
- } else if (sourceAction instanceof PushVlanAction) {
- PushVlanAction pushVlanAction = (PushVlanAction) sourceAction;
- PushVlan pushVlan = pushVlanFrom(pushVlanAction);
- if (pushVlan != null) {
- targetAction.add(pushVlan);
- }
- } else if (sourceAction instanceof SetDlDstAction) {
- MacAddress addressL2Dest = ((SetDlDstAction) sourceAction).getAddress();
- if (addressL2Dest != null) {
- String addressValue = addressL2Dest.getValue();
- if (addressValue != null) {
- targetAction.add(new SetDlDst(addressValue.getBytes()));