use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.group._case.GroupActionBuilder in project openflowplugin by opendaylight.
the class DSInputFactory method createGroupWithPreconditions.
public static Group createGroupWithPreconditions(final long groupIdValue, final long... requiredId) {
final List<Action> actionBag = new ArrayList<>();
for (long groupIdPrecondition : requiredId) {
final GroupAction groupAction = new GroupActionBuilder().setGroupId(groupIdPrecondition).build();
final GroupActionCase groupActionCase = new GroupActionCaseBuilder().setGroupAction(groupAction).build();
final Action action = new ActionBuilder().setAction(groupActionCase).build();
actionBag.add(action);
}
final Bucket bucket = new BucketBuilder().setAction(actionBag).build();
final Buckets buckets = new BucketsBuilder().setBucket(Collections.singletonList(bucket)).build();
return new GroupBuilder().setGroupId(new GroupId(groupIdValue)).setBuckets(buckets).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.group._case.GroupActionBuilder in project openflowplugin by opendaylight.
the class OF13GroupActionDeserializer method deserialize.
@Override
public Action deserialize(ByteBuf input) {
final 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);
GroupCaseBuilder caseBuilder = new GroupCaseBuilder();
GroupActionBuilder actionBuilder = new GroupActionBuilder();
actionBuilder.setGroupId(input.readUnsignedInt());
caseBuilder.setGroupAction(actionBuilder.build());
builder.setActionChoice(caseBuilder.build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.group._case.GroupActionBuilder in project openflowplugin by opendaylight.
the class GroupActionSerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final long group = 10L;
final Action action = new GroupActionCaseBuilder().setGroupAction(new GroupActionBuilder().setGroupId(group).build()).build();
assertAction(action, out -> assertEquals(out.readUnsignedInt(), group));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.group._case.GroupActionBuilder in project openflowplugin by opendaylight.
the class TableFeaturesResponseConvertorTest method createGroupAction.
private static GroupCase createGroupAction() {
final GroupCaseBuilder groupCaseBuilder = new GroupCaseBuilder();
final GroupActionBuilder groupActionBuilder = new GroupActionBuilder();
groupActionBuilder.setGroupId(42L);
groupCaseBuilder.setGroupAction(groupActionBuilder.build());
return groupCaseBuilder.build();
}
Aggregations