Search in sources :

Example 6 with GroupType

use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupType in project openflowplugin by opendaylight.

the class GroupConvertor method salToOFBucketList.

private List<BucketsList> salToOFBucketList(Buckets buckets, short version, int groupType, BigInteger datapathid) {
    final List<BucketsList> bucketLists = new ArrayList<>();
    final ActionConvertorData data = new ActionConvertorData(version);
    data.setDatapathId(datapathid);
    for (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket groupBucket : buckets.getBucket()) {
        BucketsListBuilder bucketBuilder = new BucketsListBuilder();
        salToOFBucketListWeight(groupBucket, bucketBuilder, groupType);
        salToOFBucketListWatchGroup(groupBucket, bucketBuilder, groupType);
        salToOFBucketListWatchPort(groupBucket, bucketBuilder, groupType);
        Optional<List<Action>> bucketActionList = getConvertorExecutor().convert(groupBucket.getAction(), data);
        bucketBuilder.setAction(bucketActionList.orElse(Collections.emptyList()));
        BucketsList bucket = bucketBuilder.build();
        bucketLists.add(bucket);
    }
    return bucketLists;
}
Also used : BucketsListBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsListBuilder) ArrayList(java.util.ArrayList) ActionConvertorData(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionConvertorData) ArrayList(java.util.ArrayList) BucketsList(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList) List(java.util.List) Bucket(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket) BucketsList(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList)

Aggregations

ArrayList (java.util.ArrayList)4 GroupId (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId)3 Bucket (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket)3 BucketId (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.BucketId)2 BucketsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.BucketsBuilder)2 BucketBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.BucketBuilder)2 BucketKey (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.BucketKey)2 GroupBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupBuilder)2 GroupKey (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupKey)2 ByteBuf (io.netty.buffer.ByteBuf)1 List (java.util.List)1 ExecutionException (java.util.concurrent.ExecutionException)1 Test (org.junit.Test)1 ActionConvertorData (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionConvertorData)1 AddGroupInput (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput)1 AddGroupInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInputBuilder)1 AddGroupOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutput)1 MultipartReplyGroupFeaturesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.reply.multipart.reply.body.MultipartReplyGroupFeaturesBuilder)1 GroupCapability (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupCapability)1 GroupRef (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef)1