@Service public class LabelResourceManager extends org.onosproject.net.provider.AbstractListenerProviderRegistry<LabelResourceEvent,LabelResourceListener,LabelResourceProvider,LabelResourceProviderService> implements LabelResourceService, LabelResourceAdminService, LabelResourceProviderRegistry
| Modifier and Type | Field and Description |
|---|---|
protected org.onosproject.net.device.DeviceService |
deviceService |
protected LabelResourceStore |
store |
| Constructor and Description |
|---|
LabelResourceManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
java.util.Collection<LabelResource> |
applyFromDevicePool(org.onosproject.net.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(org.onosproject.net.DeviceId deviceId,
LabelResourceId beginLabel,
LabelResourceId endLabel)
Creates the only label resource of some device id from begin label to end
label.
|
boolean |
createGlobalPool(LabelResourceId beginLabel,
LabelResourceId endLabel)
Creates the only global label resource pool.
|
protected LabelResourceProviderService |
createProviderService(LabelResourceProvider provider) |
void |
deactivate() |
boolean |
destroyDevicePool(org.onosproject.net.DeviceId deviceId)
Destroys a label resource pool of a specific device id.
|
boolean |
destroyGlobalPool()
Destroys the global label resource pool.
|
LabelResourcePool |
getDeviceLabelResourcePool(org.onosproject.net.DeviceId deviceId)
Returns the label resource pool of a label resource by a specific device
id.
|
long |
getFreeNumOfDevicePool(org.onosproject.net.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(org.onosproject.net.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<org.onosproject.net.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, bindEventDispatcher, post, removeListener, unbindEventDispatcherdefaultProvider, getProvider, getProvider, getProvider, getProviders, register, unregister@Reference(cardinality=MANDATORY_UNARY) protected LabelResourceStore store
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.net.device.DeviceService deviceService
@Activate public void activate()
@Deactivate public void deactivate()
public boolean createDevicePool(org.onosproject.net.DeviceId deviceId,
LabelResourceId beginLabel,
LabelResourceId endLabel)
LabelResourceAdminServicecreateDevicePool in interface LabelResourceAdminServicedeviceId - 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
poolpublic boolean createGlobalPool(LabelResourceId beginLabel, LabelResourceId endLabel)
LabelResourceAdminServicecreateGlobalPool in interface LabelResourceAdminServicebeginLabel - represents for the first label id in the range of label
poolendLabel - represents for the last label id in the range of label
poolpublic boolean destroyDevicePool(org.onosproject.net.DeviceId deviceId)
LabelResourceAdminServicedestroyDevicePool in interface LabelResourceAdminServicedeviceId - device identifierpublic boolean destroyGlobalPool()
LabelResourceAdminServicedestroyGlobalPool in interface LabelResourceAdminServicepublic java.util.Collection<LabelResource> applyFromDevicePool(org.onosproject.net.DeviceId deviceId, long applyNum)
LabelResourceServiceapplyFromDevicePool in interface LabelResourceServicedeviceId - device identifierapplyNum - the applying numberpublic java.util.Collection<LabelResource> applyFromGlobalPool(long applyNum)
LabelResourceServiceapplyFromGlobalPool in interface LabelResourceServiceapplyNum - the applying numberpublic boolean releaseToDevicePool(com.google.common.collect.Multimap<org.onosproject.net.DeviceId,LabelResource> release)
LabelResourceServicereleaseToDevicePool in interface LabelResourceServicerelease - the collection of releasing labelspublic boolean releaseToGlobalPool(java.util.Set<LabelResourceId> release)
LabelResourceServicereleaseToGlobalPool in interface LabelResourceServicerelease - release the collection of releasing labelspublic boolean isDevicePoolFull(org.onosproject.net.DeviceId deviceId)
LabelResourceServiceisDevicePoolFull in interface LabelResourceServicedeviceId - device identifierpublic boolean isGlobalPoolFull()
LabelResourceServiceisGlobalPoolFull in interface LabelResourceServicepublic long getFreeNumOfDevicePool(org.onosproject.net.DeviceId deviceId)
LabelResourceServicegetFreeNumOfDevicePool in interface LabelResourceServicedeviceId - device identifierpublic long getFreeNumOfGlobalPool()
LabelResourceServicegetFreeNumOfGlobalPool in interface LabelResourceServicepublic LabelResourcePool getDeviceLabelResourcePool(org.onosproject.net.DeviceId deviceId)
LabelResourceServicegetDeviceLabelResourcePool in interface LabelResourceServicedeviceId - device identifierpublic LabelResourcePool getGlobalLabelResourcePool()
LabelResourceServicegetGlobalLabelResourcePool in interface LabelResourceServiceprotected LabelResourceProviderService createProviderService(LabelResourceProvider provider)
createProviderService in class org.onosproject.net.provider.AbstractProviderRegistry<LabelResourceProvider,LabelResourceProviderService>