public final class LabelAllocator extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
LabelAllocator.FirstFitSelection
First fit label selection.
|
static interface |
LabelAllocator.LabelSelection
Interface for selection algorithms of the labels.
|
static class |
LabelAllocator.RandomSelection
Random label selection.
|
| Constructor and Description |
|---|
LabelAllocator(org.onosproject.net.resource.ResourceService rs)
Creates a new label allocator.
|
| Modifier and Type | Method and Description |
|---|---|
Map<org.onosproject.net.LinkKey,org.onlab.util.Identifier<?>> |
assignLabelToLinks(Set<org.onosproject.net.Link> links,
org.onosproject.net.resource.ResourceConsumer resourceConsumer,
org.onosproject.net.EncapsulationType type)
Allocates labels and associates them to links.
|
Map<org.onosproject.net.ConnectPoint,org.onlab.util.Identifier<?>> |
assignLabelToPorts(Set<org.onosproject.net.Link> links,
org.onosproject.net.resource.ResourceConsumer resourceConsumer,
org.onosproject.net.EncapsulationType type)
Allocates labels and associates them to source
and destination ports of a link.
|
LabelAllocator.LabelSelection |
getLabelSelection()
Retrieves the selection behavior.
|
org.onosproject.net.resource.impl.LabelAllocator.OptimizationBehavior |
getOptLabelSelection()
Retrieves the optimization behavior.
|
static boolean |
isInOptEnum(String value)
Checks if a given string is a valid Optimization Behavior.
|
static boolean |
isInSelEnum(String value)
Checks if a given string is a valid Selection Behavior.
|
void |
setLabelSelection(String type)
Changes the selection behavior.
|
void |
setOptLabelSelection(String type)
Changes the optimization behavior.
|
public LabelAllocator(org.onosproject.net.resource.ResourceService rs)
rs - the resource servicepublic static boolean isInSelEnum(String value)
value - the string to checkpublic static boolean isInOptEnum(String value)
value - the string to checkpublic void setLabelSelection(String type)
type - the behavior typepublic LabelAllocator.LabelSelection getLabelSelection()
public void setOptLabelSelection(String type)
type - the optimization typepublic org.onosproject.net.resource.impl.LabelAllocator.OptimizationBehavior getOptLabelSelection()
public Map<org.onosproject.net.LinkKey,org.onlab.util.Identifier<?>> assignLabelToLinks(Set<org.onosproject.net.Link> links, org.onosproject.net.resource.ResourceConsumer resourceConsumer, org.onosproject.net.EncapsulationType type)
links - the links where labels will be allocatedresourceConsumer - the resource consumertype - the encapsulation typepublic Map<org.onosproject.net.ConnectPoint,org.onlab.util.Identifier<?>> assignLabelToPorts(Set<org.onosproject.net.Link> links, org.onosproject.net.resource.ResourceConsumer resourceConsumer, org.onosproject.net.EncapsulationType type)
links - the links on which labels will be reservedresourceConsumer - the resource consumertype - the encapsulation type