Search in sources :

Example 1 with SetDlDstAction

use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstAction in project openflowplugin by opendaylight.

the class SalToOfSetDlDstActionV10Case method process.

@Nonnull
@Override
public Optional<Action> process(@Nonnull final SetDlDstActionCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
    SetDlDstAction setdldstaction = source.getSetDlDstAction();
    SetDlDstCaseBuilder setDlDstCaseBuilder = new SetDlDstCaseBuilder();
    SetDlDstActionBuilder setDlDstActionBuilder = new SetDlDstActionBuilder();
    setDlDstActionBuilder.setDlDstAddress(setdldstaction.getAddress());
    setDlDstCaseBuilder.setSetDlDstAction(setDlDstActionBuilder.build());
    return Optional.of(new ActionBuilder().setActionChoice(setDlDstCaseBuilder.build()).build());
}
Also used : SetDlDstActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.dl.dst._case.SetDlDstActionBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder) SetDlDstCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlDstCaseBuilder) SetDlDstActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.dl.dst._case.SetDlDstActionBuilder) SetDlDstAction(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstAction) Nonnull(javax.annotation.Nonnull)

Example 2 with SetDlDstAction

use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstAction in project openflowplugin by opendaylight.

the class SalToOfSetDlDstActionCase method process.

@Nonnull
@Override
public Optional<Action> process(@Nonnull final SetDlDstActionCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
    SetDlDstAction setdldstaction = source.getSetDlDstAction();
    MatchEntryBuilder matchBuilder = new MatchEntryBuilder();
    matchBuilder.setOxmClass(OpenflowBasicClass.class);
    matchBuilder.setOxmMatchField(EthDst.class);
    EthDstCaseBuilder ethDstCaseBuilder = new EthDstCaseBuilder();
    EthDstBuilder ethDstBuilder = new EthDstBuilder();
    ethDstBuilder.setMacAddress(setdldstaction.getAddress());
    matchBuilder.setHasMask(false);
    ethDstCaseBuilder.setEthDst(ethDstBuilder.build());
    matchBuilder.setMatchEntryValue(ethDstCaseBuilder.build());
    List<MatchEntry> entries = new ArrayList<>();
    entries.add(matchBuilder.build());
    SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();
    setFieldBuilder.setMatchEntry(entries);
    SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
    setFieldCaseBuilder.setSetFieldAction(setFieldBuilder.build());
    return Optional.of(new ActionBuilder().setActionChoice(setFieldCaseBuilder.build()).build());
}
Also used : EthDstBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.dst._case.EthDstBuilder) SetFieldCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCaseBuilder) MatchEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry) MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder) SetFieldActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder) EthDstCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthDstCaseBuilder) ArrayList(java.util.ArrayList) SetFieldActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder) SetDlDstAction(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstAction) Nonnull(javax.annotation.Nonnull)

Aggregations

Nonnull (javax.annotation.Nonnull)2 SetDlDstAction (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstAction)2 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder)2 ArrayList (java.util.ArrayList)1 SetDlDstCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlDstCaseBuilder)1 SetFieldCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCaseBuilder)1 SetDlDstActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.dl.dst._case.SetDlDstActionBuilder)1 SetFieldActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder)1 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)1 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)1 EthDstCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthDstCaseBuilder)1 EthDstBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.dst._case.EthDstBuilder)1