Search in sources :

Example 6 with LabelResourceService

use of org.onosproject.incubator.net.resource.label.LabelResourceService in project onos by opennetworkinglab.

the class LabelApplyCommand method doExecute.

@Override
protected void doExecute() {
    LabelResourceService lrs = get(LabelResourceService.class);
    Collection<LabelResource> result = lrs.applyFromDevicePool(DeviceId.deviceId(deviceId), Long.parseLong(applyNum));
    if (!result.isEmpty()) {
        for (Iterator<LabelResource> iterator = result.iterator(); iterator.hasNext(); ) {
            DefaultLabelResource defaultLabelResource = (DefaultLabelResource) iterator.next();
            print(FMT, defaultLabelResource.deviceId().toString(), defaultLabelResource.labelResourceId().toString());
        }
    }
}
Also used : DefaultLabelResource(org.onosproject.incubator.net.resource.label.DefaultLabelResource) LabelResource(org.onosproject.incubator.net.resource.label.LabelResource) LabelResourceService(org.onosproject.incubator.net.resource.label.LabelResourceService) DefaultLabelResource(org.onosproject.incubator.net.resource.label.DefaultLabelResource)

Aggregations

LabelResourceService (org.onosproject.incubator.net.resource.label.LabelResourceService)6 DefaultLabelResource (org.onosproject.incubator.net.resource.label.DefaultLabelResource)3 LabelResource (org.onosproject.incubator.net.resource.label.LabelResource)3 LabelResourcePool (org.onosproject.incubator.net.resource.label.LabelResourcePool)2 HashSet (java.util.HashSet)1 LabelResourceId (org.onosproject.incubator.net.resource.label.LabelResourceId)1 DeviceId (org.onosproject.net.DeviceId)1