use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice in project openflowplugin by opendaylight.
the class ActionUtil method createAction.
public static Action createAction(ActionChoice actionChoice) {
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(actionChoice);
actionBuilder.setExperimenterId(EXPERIMENTER_ID);
return actionBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice in project openflowplugin by opendaylight.
the class PacketProcessingServiceImplTest method testBuildRequest.
@Test
public void testBuildRequest() throws Exception {
TransmitPacketInput transmitPacketInput = buildTransmitPacketInput();
final OfHeader request = packetProcessingService.buildRequest(new Xid(DUMMY_XID_VALUE), transmitPacketInput);
assertEquals(DUMMY_XID_VALUE, request.getXid());
assertTrue(request instanceof PacketOutInput);
final PacketOutInput input = (PacketOutInput) request;
assertEquals(OFConstants.OFP_NO_BUFFER, input.getBufferId());
assertEquals(1, input.getAction().size());
assertEquals(OutputActionCase.class, input.getAction().get(0).getActionChoice().getImplementedInterface());
final OutputActionCase actionChoice = (OutputActionCase) input.getAction().get(0).getActionChoice();
assertEquals(1, actionChoice.getOutputAction().getPort().getValue().intValue());
assertEquals(ULTIMATE_PAYLOAD, new String(input.getData()));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice in project openflowplugin by opendaylight.
the class TableFeaturesResponseConvertor method setActionTableFeatureProperty.
private static List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> setActionTableFeatureProperty(final TableFeatureProperties properties) {
List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actionList = new ArrayList<>();
int order = 0;
for (Action action : properties.getAugmentation(ActionRelatedTableFeatureProperty.class).getAction()) {
if (action != null && null != action.getActionChoice()) {
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder();
actionBuilder.setOrder(order++);
ActionChoice actionType = action.getActionChoice();
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action salAction = OF_TO_SAL_ACTION.get(actionType.getImplementedInterface());
actionBuilder.setAction(salAction);
actionList.add(actionBuilder.build());
}
}
return actionList;
}
Aggregations