use of org.onosproject.incubator.net.resource.label.LabelResourceId in project onos by opennetworkinglab.
the class DistributedLabelResourceStore method releaseToGlobalPool.
@Override
public boolean releaseToGlobalPool(Set<LabelResourceId> release) {
Set<LabelResource> set = new HashSet<>();
DefaultLabelResource resource = null;
for (LabelResourceId labelResource : release) {
resource = new DefaultLabelResource(DeviceId.deviceId(GLOBAL_RESOURCE_POOL_DEVICE_ID), labelResource);
set.add(resource);
}
LabelResourceRequest request = new LabelResourceRequest(DeviceId.deviceId(GLOBAL_RESOURCE_POOL_DEVICE_ID), LabelResourceRequest.Type.RELEASE, 0, ImmutableSet.copyOf(set));
return this.internalRelease(request);
}
use of org.onosproject.incubator.net.resource.label.LabelResourceId in project onos by opennetworkinglab.
the class GlobalLabelReleaseCommand method doExecute.
@Override
protected void doExecute() {
LabelResourceService lrs = get(LabelResourceService.class);
Set<LabelResourceId> release = new HashSet<LabelResourceId>();
String[] labelIds = releaseLabelIds.split(",");
LabelResourceId resource = null;
for (int i = 0; i < labelIds.length; i++) {
resource = LabelResourceId.labelResourceId(Long.parseLong(labelIds[i]));
release.add(resource);
}
lrs.releaseToGlobalPool(release);
}
Aggregations