use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey in project openflowplugin by opendaylight.
the class GroupDescStatsResponseConvertor method toSALBucketsDesc.
private org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.Buckets toSALBucketsDesc(List<BucketsList> bucketDescStats, short version) {
final ActionResponseConvertorData data = new ActionResponseConvertorData(version);
data.setActionPath(ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION);
org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.BucketsBuilder salBucketsDesc = new org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.BucketsBuilder();
List<Bucket> allBuckets = new ArrayList<>();
int bucketKey = 0;
for (BucketsList bucketDetails : bucketDescStats) {
BucketBuilder bucketDesc = new BucketBuilder();
final Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action>> convertedSalActions = getConvertorExecutor().convert(bucketDetails.getAction(), data);
if (convertedSalActions.isPresent()) {
List<Action> actions = new ArrayList<>();
int actionKey = 0;
for (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action : convertedSalActions.get()) {
ActionBuilder wrappedAction = new ActionBuilder();
wrappedAction.setAction(action);
wrappedAction.setKey(new ActionKey(actionKey));
wrappedAction.setOrder(actionKey);
actions.add(wrappedAction.build());
actionKey++;
}
bucketDesc.setAction(actions);
} else {
bucketDesc.setAction(Collections.emptyList());
}
bucketDesc.setWeight(bucketDetails.getWeight());
bucketDesc.setWatchPort(bucketDetails.getWatchPort().getValue());
bucketDesc.setWatchGroup(bucketDetails.getWatchGroup());
BucketId bucketId = new BucketId((long) bucketKey);
bucketDesc.setBucketId(bucketId);
bucketDesc.setKey(new BucketKey(bucketId));
bucketKey++;
allBuckets.add(bucketDesc.build());
}
salBucketsDesc.setBucket(allBuckets);
return salBucketsDesc.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey in project openflowplugin by opendaylight.
the class OpenflowPluginBulkGroupTransactionProvider method createGroupAction.
private List<Action> createGroupAction() {
GroupActionBuilder groupActionB = new GroupActionBuilder();
groupActionB.setGroupId(1L);
groupActionB.setGroup("0");
ActionBuilder action = new ActionBuilder();
action.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
action.setKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey in project openflowplugin by opendaylight.
the class OpenflowPluginBulkGroupTransactionProvider method createPopVlanAction.
private List<Action> createPopVlanAction() {
PopVlanActionBuilder vlanAction = new PopVlanActionBuilder();
ActionBuilder action = new ActionBuilder();
action.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(vlanAction.build()).build());
action.setKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey in project openflowplugin by opendaylight.
the class OpenflowpluginGroupTestCommandProvider method createSetQueueAction.
private List<Action> createSetQueueAction() {
SetQueueActionBuilder setQueueActionBuilder = new SetQueueActionBuilder();
setQueueActionBuilder.setQueueId(1L);
ActionBuilder action = new ActionBuilder();
action.setAction(new SetQueueActionCaseBuilder().setSetQueueAction(setQueueActionBuilder.build()).build());
action.setKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey in project openflowplugin by opendaylight.
the class OpenflowpluginGroupTestCommandProvider method createPopVlanAction.
private List<Action> createPopVlanAction() {
PopVlanActionBuilder vlanAction = new PopVlanActionBuilder();
ActionBuilder action = new ActionBuilder();
action.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(vlanAction.build()).build());
action.setKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
Aggregations