Search in sources :

Example 6 with GroupAction

use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupAction in project openflowplugin by opendaylight.

the class ReconcileUtilTest method createGroupWithPreconditions.

private 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();
}
Also used : GroupAction(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupAction) Action(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action) GroupActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupActionBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder) GroupBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupBuilder) ArrayList(java.util.ArrayList) BucketsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.BucketsBuilder) GroupActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupActionBuilder) Buckets(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.Buckets) GroupId(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId) GroupAction(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupAction) BucketBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.BucketBuilder) GroupActionCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCaseBuilder) Bucket(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket) GroupActionCase(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCase)

Example 7 with GroupAction

use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupAction 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();
}
Also used : GroupAction(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupAction) Action(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action) OutputActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder) GroupActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupActionBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder) GroupBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupBuilder) ArrayList(java.util.ArrayList) BucketsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.BucketsBuilder) GroupActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupActionBuilder) Buckets(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.Buckets) GroupId(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId) GroupAction(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupAction) BucketBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.BucketBuilder) GroupActionCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCaseBuilder) Bucket(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket) GroupActionCase(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCase)

Aggregations

GroupAction (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupAction)5 ArrayList (java.util.ArrayList)4 GroupActionCase (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCase)4 GroupActionCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCaseBuilder)4 GroupActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupActionBuilder)4 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder)3 GroupId (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId)3 Buckets (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.Buckets)3 BucketsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.BucketsBuilder)3 Bucket (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket)3 BucketBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.BucketBuilder)3 OutputActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder)2 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action)2 GroupBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupBuilder)2 GroupCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.GroupCaseBuilder)2 GroupActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.group._case.GroupActionBuilder)2 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action)2 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder)2 List (java.util.List)1 Nonnull (javax.annotation.Nonnull)1