@Beta public interface LabelResourceStore extends Store<LabelResourceEvent,LabelResourceDelegate>
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.
|
boolean |
createDevicePool(DeviceId deviceId,
LabelResourceId beginLabel,
LabelResourceId endLabel)
Creates a label resource of some device id from begin label to end label.
|
boolean |
createGlobalPool(LabelResourceId beginLabel,
LabelResourceId endLabel)
Creates the global label resource pool.
|
boolean |
destroyDevicePool(DeviceId deviceId)
Destroys a label resource pool of a specific device id.
|
boolean |
destroyGlobalPool()
Destroys a the global label resource pool.
|
LabelResourcePool |
getDeviceLabelResourcePool(DeviceId deviceId)
Returns the label resource pool 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 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.
|
hasDelegate, setDelegate, unsetDelegate
boolean createDevicePool(DeviceId deviceId, LabelResourceId beginLabel, LabelResourceId endLabel)
deviceId
- device identifierbeginLabel
- represents for the first label id in the range of label
poolendLabel
- represents for the last label id in the range of label
poolboolean createGlobalPool(LabelResourceId beginLabel, LabelResourceId endLabel)
beginLabel
- represents for the first label id in the range of label
poolendLabel
- represents for the last label id in the range of label
poolboolean destroyDevicePool(DeviceId deviceId)
deviceId
- device identifierboolean destroyGlobalPool()
java.util.Collection<LabelResource> applyFromDevicePool(DeviceId deviceId, long applyNum)
deviceId
- device identifierapplyNum
- the applying numberjava.util.Collection<LabelResource> applyFromGlobalPool(long applyNum)
applyNum
- apply the number of labelsboolean 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()