@Beta public interface LabelResourceService extends ListenerService<LabelResourceEvent,LabelResourceListener>
Modifier and Type | Method and Description |
---|---|
java.util.Collection<LabelResource> |
applyFromDevicePool(DeviceId deviceId,
long applyNum)
Returns labels from resource pool by a specific device id.
|
java.util.Collection<LabelResource> |
applyFromGlobalPool(long applyNum)
Returns labels from the global label resource pool.
|
LabelResourcePool |
getDeviceLabelResourcePool(DeviceId deviceId)
Returns the label resource pool of a label resource by a specific device
id.
|
long |
getFreeNumOfDevicePool(DeviceId deviceId)
Returns the unused label number of a label resource pool by a specific device
id.
|
long |
getFreeNumOfGlobalPool()
Returns the unused label number of a global label resource pool.
|
LabelResourcePool |
getGlobalLabelResourcePool()
Returns the global label resource pool.
|
boolean |
isDevicePoolFull(DeviceId deviceId)
Judges if the pool of a specific device id is full.
|
boolean |
isGlobalPoolFull()
Judges if the global resource pool is full.
|
boolean |
releaseToDevicePool(com.google.common.collect.Multimap<DeviceId,LabelResource> release)
Releases unused labels to device pools .
|
boolean |
releaseToGlobalPool(java.util.Set<LabelResourceId> release)
Releases unused labels to the global resource pool.
|
addListener, removeListener
java.util.Collection<LabelResource> applyFromDevicePool(DeviceId deviceId, long applyNum)
deviceId
- device identifierapplyNum
- the applying numberjava.util.Collection<LabelResource> applyFromGlobalPool(long applyNum)
applyNum
- the applying numberboolean releaseToDevicePool(com.google.common.collect.Multimap<DeviceId,LabelResource> release)
release
- the collection of releasing labelsboolean releaseToGlobalPool(java.util.Set<LabelResourceId> release)
release
- release the collection of releasing labelsboolean isDevicePoolFull(DeviceId deviceId)
deviceId
- device identifierboolean isGlobalPoolFull()
long getFreeNumOfDevicePool(DeviceId deviceId)
deviceId
- device identifierlong getFreeNumOfGlobalPool()
LabelResourcePool getDeviceLabelResourcePool(DeviceId deviceId)
deviceId
- device identifierLabelResourcePool getGlobalLabelResourcePool()