public BucketBuilder(Bucket base) { if (base.getKey() == null) { this._key = new BucketKey( base.getBucketId() ); this._bucketId = base.getBucketId(); } else { this._key = base.getKey(); this._bucketId = _key.getBucketId(); } this._action = base.getAction(); this._watchGroup = base.getWatchGroup(); this._watchPort = base.getWatchPort(); this._weight = base.getWeight(); if (base instanceof BucketImpl) { BucketImpl _impl = (BucketImpl) base; this.augmentation = new HashMap<>(_impl.augmentation); } }
private void processGroupAction(GroupActionCase actionCase, FlowTableLookUpResult result) { GroupAction groupAction = actionCase.getGroupAction(); Group group = indexedGroups.get(groupAction.getGroupId()); GroupTypes groupType = group.getGroupType(); List<Bucket> buckets = group.getBuckets().getBucket(); if (groupType.equals(GroupTypes.GroupAll)) { for (Bucket bucket : buckets) { processActionSet(bucket.getAction(), result); } } else if (groupType.equals(GroupTypes.GroupIndirect) && buckets.size() == 1) { processActionSet(buckets.get(0).getAction(), result); } }
private static void salToOFBucketListWeight(Bucket groupBucket, BucketsListBuilder bucketBuilder, int groupType) { if (null != groupBucket.getWeight()) { bucketBuilder.setWeight(groupBucket.getWeight()); } else { bucketBuilder.setWeight(DEFAULT_WEIGHT); if (groupType == GroupType.OFPGTSELECT.getIntValue()) { LOG.error("Weight value required for this OFPGT_SELECT"); } } }
private static void salToOFBucketListWatchGroup(Bucket groupBucket, BucketsListBuilder bucketBuilder, int groupType) { if (null != groupBucket.getWatchGroup()) { bucketBuilder.setWatchGroup(groupBucket.getWatchGroup()); } else { bucketBuilder.setWatchGroup(BinContent.intToUnsignedLong(DEFAULT_WATCH_GROUP.intValue())); if (groupType == GroupType.OFPGTFF.getIntValue()) { LOG.error("WatchGroup required for this OFPGT_FF"); } } }
private static void salToOFBucketListWatchPort(Bucket groupBucket, BucketsListBuilder bucketBuilder, int groupType) { if (null != groupBucket.getWatchPort()) { bucketBuilder.setWatchPort(new PortNumber(groupBucket.getWatchPort())); } else { bucketBuilder.setWatchPort(new PortNumber(BinContent.intToUnsignedLong(DEFAULT_WATCH_PORT.intValue()))); if (groupType == GroupType.OFPGTFF.getIntValue()) { LOG.error("WatchPort required for this OFPGT_FF"); } } }
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; }
if (other.getAction() != null) { return false; } else if(!_action.equals(other.getAction())) { return false; if (other.getBucketId() != null) { return false; } else if(!_bucketId.equals(other.getBucketId())) { return false; if (other.getKey() != null) { return false; } else if(!_key.equals(other.getKey())) { return false; if (other.getWatchGroup() != null) { return false; } else if(!_watchGroup.equals(other.getWatchGroup())) { return false; if (other.getWatchPort() != null) { return false; } else if(!_watchPort.equals(other.getWatchPort())) { return false;
List<Action> actions = bucket.getAction(); if (actions == null) { actions = Collections.<Action>emptyList();
int index = 0; boolean isPortDeleted = false; bucketActions = bucket.getAction(); for (Action action : bucketActions) { if (action.getAction() instanceof OutputActionCase) {
bucket.setKey(new BucketKey(new BucketId((long) bucketId))); bucketId++; List<Action> origbucketActions = origbucket.getAction(); for (Action action : origbucketActions) { if (action.getAction() instanceof OutputActionCase) {
bucketId++; List<Action> origbucketActions = origbucket.getAction(); for (Action action : origbucketActions) { if (action.getAction() instanceof OutputActionCase) {