public ApplyActionsCaseBuilder(ApplyActionsCase base) { this._applyActions = base.getApplyActions(); if (base instanceof ApplyActionsCaseImpl) { ApplyActionsCaseImpl _impl = (ApplyActionsCaseImpl) base; this.augmentation = new HashMap<>(_impl.augmentation); } }
private void applyActionsCase(ApplyActionsCase applyActionCase) { List<Action> applyActions = applyActionCase.getApplyActions().getAction(); sortActionsByOrder(applyActions); this.applyActions.addAll(applyActions); }
if (other.getApplyActions() != null) { return false; } else if(!_applyActions.equals(other.getApplyActions())) { return false;
/** * Determine whether the given instruction list contains only one apply * output action that transmits packets to the given port or not. * * @param insts A flow instructions. * @param pid The target port identifier. * @return {@code true} if the given instruction list contains only one * apply output action that specifies the given port. * Otherwise {@code false}. */ public static boolean isOutput(Instructions insts, String pid) { boolean result = false; if (insts != null) { List<Instruction> instList = insts.getInstruction(); if (instList != null && instList.size() == 1) { Instruction i = instList.get(0); org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types. rev131026.instruction.Instruction ic = i.getInstruction(); if (ic instanceof ApplyActionsCase) { ApplyActionsCase apCase = (ApplyActionsCase)ic; ActionList al = apCase.getApplyActions(); result = (al != null && isOutput(al.getAction(), pid)); } } } return result; }
ApplyActionsCase.class, inst.getInstruction()); if (apCase != null) { ApplyActions apply = apCase.getApplyActions(); if (apply != null) { List<Action> actions = apply.getAction();
@Override public Optional<Instruction> process(final @Nonnull org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) { ApplyActions applyActions = source.getApplyActions(); ApplyActionsCaseBuilder applyActionsCaseBuilder = new ApplyActionsCaseBuilder(); ApplyActionsBuilder applyActionsBuilder = new ApplyActionsBuilder(); final Optional<List<Action>> actionList = convertorExecutor.convert(applyActions.getAction(), data); applyActionsBuilder.setAction(actionList.orElse(Collections.emptyList())); applyActionsCaseBuilder.setApplyActions(applyActionsBuilder.build()); InstructionBuilder instructionBuilder = new InstructionBuilder(); instructionBuilder.setInstructionChoice(applyActionsCaseBuilder.build()); return Optional.of(instructionBuilder.build()); } }
public static List<Action> getAction( org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow source) { if (source.getInstructions() != null) { for (Instruction instruction : source.getInstructions().getInstruction()) { if (instruction.getInstruction() instanceof ApplyActionsCase) { return (((ApplyActionsCase) instruction.getInstruction()).getApplyActions().getAction()); } } } // TODO Auto-generated method stub return Collections.emptyList(); }
private List<Action> getActions(short version, BigInteger datapathid, Flow flow) { Instructions instructions = flow.getInstructions(); List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> sortedInstructions = INSTRUCTION_ORDERING.sortedCopy(instructions.getInstruction()); for (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction instruction : sortedInstructions) { org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction curInstruction = instruction .getInstruction(); if (curInstruction instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase) { org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase applyActionscase = (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase) curInstruction; ApplyActions applyActions = applyActionscase.getApplyActions(); final ActionConvertorData data = new ActionConvertorData(version); data.setDatapathId(datapathid); data.setIpProtocol(FlowConvertorUtil.getIpProtocolFromFlow(flow)); Optional<List<Action>> result = getConvertorExecutor().convert(applyActions.getAction(), data); return result.orElse(Collections.emptyList()); } } return null; }
if (instCase instanceof ApplyActionsCase) { ApplyActionsCase apCase = (ApplyActionsCase)instCase; acList = apCase.getApplyActions(); } else if (instCase instanceof WriteActionsCase) { WriteActionsCase wrCase = (WriteActionsCase)instCase;
private static boolean isSetVlanIdActionCasePresent(Flow flow) { // we are trying to find if there is a set-vlan-id action (OF1.0) action present in the flow. // If yes,then we would need to two flows if (flow.getInstructions() != null && flow.getInstructions().getInstruction() != null) { for (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction instruction : flow.getInstructions().getInstruction()) { org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction curInstruction = instruction.getInstruction(); if (curInstruction instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase) { org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase applyActionscase = (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase) curInstruction; ApplyActions applyActions = applyActionscase.getApplyActions(); for (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action action : applyActions.getAction()) { if (action.getAction() instanceof SetVlanIdActionCase) { return true; } } } } } return false; }
for (Instruction in : instructions) { if (in.getInstruction() instanceof ApplyActionsCase) { existingActions = (((ApplyActionsCase) in.getInstruction()).getApplyActions().getAction()); actionList.addAll(existingActions); break;
for (Instruction in : instructions) { if (in.getInstruction() instanceof ApplyActionsCase) { existingActions = (((ApplyActionsCase) in.getInstruction()).getApplyActions().getAction()); actionList.addAll(existingActions);
for (Instruction in : instructions) { if (in.getInstruction() instanceof ApplyActionsCase) { existingActions = (((ApplyActionsCase) in.getInstruction()).getApplyActions().getAction()); actionList.addAll(existingActions);
existingActions = (((ApplyActionsCase) in.getInstruction()).getApplyActions().getAction());
for (Instruction in : instructions) { if (in.getInstruction() instanceof ApplyActionsCase) { existingActions = (((ApplyActionsCase) in.getInstruction()).getApplyActions().getAction()); actionList.addAll(existingActions); break;
List<Action> oldActionList = (((ApplyActionsCase) in.getInstruction()).getApplyActions().getAction()); NodeConnectorId ncid = new NodeConnectorId(OPENFLOW + dpidLong + ":" + localPort); final Uri localNodeConnectorUri = new Uri(ncid);
private boolean isInstructionSupported(List<TableFeatureProperties> tableFeaturePropertiesList, Instruction instruction) { List<Instruction> supportedInstructions = getInstructionList(tableFeaturePropertiesList); for (Instruction supportedInstructionProxy : supportedInstructions) { org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction supportedInstruction = supportedInstructionProxy.getInstruction(); if (instruction.getInstruction().getImplementedInterface().equals(supportedInstruction.getImplementedInterface())) { if (instruction.getInstruction() instanceof ApplyActionsCase) { ApplyActionsCase applyActionsCase = (ApplyActionsCase) instruction.getInstruction(); List<Action> supportedApplyActions = getApplyActionList(tableFeaturePropertiesList); for (Action action : applyActionsCase.getApplyActions().getAction()) { if (!isActionSupported(supportedApplyActions, action)) { return false; } } if (instruction.getInstruction() instanceof WriteActionsCase) { WriteActionsCase writeActionsCase = (WriteActionsCase) instruction.getInstruction(); List<Action> supportedWriteActions = getWriteActionList(tableFeaturePropertiesList); for (Action action : writeActionsCase.getWriteActions().getAction()) { if (!isActionSupported(supportedWriteActions, action)) { return false; } } } } return true; } } return false; }
List<Action> actionList = aac.getApplyActions().getAction();
List<Action> actionList = aac.getApplyActions().getAction();
ApplyActions applyActions = applyActionscase.getApplyActions(); List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> srcActionList = applyActions.getAction();