@Service public class PcepClientControllerImpl extends Object implements PcepClientController
| Modifier and Type | Class and Description |
|---|---|
class |
PcepClientControllerImpl.PcepClientAgent
Implementation of an Pcep Agent which is responsible for
keeping track of connected clients and the state in which
they are.
|
| Modifier and Type | Field and Description |
|---|---|
protected PcepClientControllerImpl.PcepClientAgent |
agent |
protected ConcurrentHashMap<PccId,PcepClient> |
connectedClients |
protected org.onosproject.net.device.DeviceService |
deviceService |
static long |
GLOBAL_LABEL_SPACE_MAX |
static long |
GLOBAL_LABEL_SPACE_MIN |
protected LabelResourceAdminService |
labelRsrcAdminService |
protected LabelResourceService |
labelRsrcService |
protected org.onosproject.net.link.LinkService |
linkService |
protected org.onosproject.mastership.MastershipService |
mastershipService |
protected org.onosproject.net.config.NetworkConfigService |
netCfgService |
protected Set<PcepClientListener> |
pcepClientListener |
protected Set<PcepEventListener> |
pcepEventListener |
protected Set<PcepNodeListener> |
pcepNodeListener |
protected PceLabelStore |
pceStore |
protected TunnelService |
tunnelService |
| Constructor and Description |
|---|
PcepClientControllerImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
void |
addEventListener(PcepEventListener listener)
Register a listener for PCEP msg events.
|
void |
addListener(PcepClientListener listener)
Register a listener for meta events that occur to pcep
devices.
|
void |
addNodeListener(PcepNodeListener listener)
Register a listener for PCEP msg events[carrying node descriptor details].
|
void |
allocateAdjacencyLabel(org.onosproject.net.Link link)
Allocates adjacency label for a link.
|
boolean |
allocateLocalLabel(Tunnel tunnel)
Allocates and downloads local labels for the given LSP.
|
void |
allocateNodeLabel(org.onosproject.net.Device specificDevice)
Allocates node label to specific device.
|
void |
closeConnectedClients()
Close all connected PCC clients.
|
LabelStack |
computeLabelStack(org.onosproject.net.Path path)
Create label stack from the given path.
|
LinkedList<PcepValueType> |
createPcepLabelStack(DefaultLabelStack labelStack,
org.onosproject.net.Path path)
Creates label stack for ERO object from network resource.
|
void |
deactivate() |
PcepClient |
getClient(PccId pccId)
Returns the actual pcc client for the given ip address.
|
Collection<PcepClient> |
getClients()
Returns list of pcc clients connected to this Pcep controller.
|
PcepErrorMsg |
getErrMsg(PcepFactory factory,
byte errorType,
byte errorValue)
Returns pcep error message with specific error type and value.
|
void |
processClientMessage(PccId pccId,
PcepMessage msg)
Process a message and notify the appropriate listeners.
|
void |
releaseAdjacencyLabel(org.onosproject.net.Link link)
Releases allocated adjacency label of a link.
|
void |
releaseNodeLabel(org.onosproject.net.Device specificDevice)
Releases node label of a specific device.
|
void |
removeEventListener(PcepEventListener listener)
Unregister a listener.
|
void |
removeListener(PcepClientListener listener)
Unregister a listener.
|
void |
removeNodeListener(PcepNodeListener listener)
Unregister a listener.
|
void |
writeMessage(PccId pccId,
PcepMessage msg)
Send a message to a particular pcc client.
|
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.net.device.DeviceService deviceService
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.net.link.LinkService linkService
@Reference(cardinality=MANDATORY_UNARY) protected TunnelService tunnelService
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.net.config.NetworkConfigService netCfgService
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.mastership.MastershipService mastershipService
@Reference(cardinality=MANDATORY_UNARY) protected LabelResourceAdminService labelRsrcAdminService
@Reference(cardinality=MANDATORY_UNARY) protected LabelResourceService labelRsrcService
@Reference(cardinality=MANDATORY_UNARY) protected PceLabelStore pceStore
protected ConcurrentHashMap<PccId,PcepClient> connectedClients
protected PcepClientControllerImpl.PcepClientAgent agent
protected Set<PcepClientListener> pcepClientListener
protected Set<PcepEventListener> pcepEventListener
protected Set<PcepNodeListener> pcepNodeListener
public static final long GLOBAL_LABEL_SPACE_MIN
public static final long GLOBAL_LABEL_SPACE_MAX
@Activate public void activate()
@Deactivate public void deactivate()
public Collection<PcepClient> getClients()
PcepClientControllergetClients in interface PcepClientControllerpublic PcepClient getClient(PccId pccId)
PcepClientControllergetClient in interface PcepClientControllerpccId - the id of the pcc client to fetchpublic void addListener(PcepClientListener listener)
PcepClientControlleraddListener in interface PcepClientControllerlistener - the listener to notifypublic void removeListener(PcepClientListener listener)
PcepClientControllerremoveListener in interface PcepClientControllerlistener - the listener to unregisterpublic void addEventListener(PcepEventListener listener)
PcepClientControlleraddEventListener in interface PcepClientControllerlistener - the listener to notifypublic void removeEventListener(PcepEventListener listener)
PcepClientControllerremoveEventListener in interface PcepClientControllerlistener - the listener to unregisterpublic void writeMessage(PccId pccId, PcepMessage msg)
PcepClientControllerwriteMessage in interface PcepClientControllerpccId - the id of the client to send message.msg - the message to sendpublic void addNodeListener(PcepNodeListener listener)
PcepClientControlleraddNodeListener in interface PcepClientControllerlistener - the listener to notifypublic void removeNodeListener(PcepNodeListener listener)
PcepClientControllerremoveNodeListener in interface PcepClientControllerlistener - the listener to be unregisteredpublic void processClientMessage(PccId pccId, PcepMessage msg)
PcepClientControllerprocessClientMessage in interface PcepClientControllerpccId - id of the client the message arrived onmsg - the message to process.public void closeConnectedClients()
PcepClientControllercloseConnectedClients in interface PcepClientControllerpublic PcepErrorMsg getErrMsg(PcepFactory factory, byte errorType, byte errorValue)
factory - represents pcep factoryerrorType - pcep error typeerrorValue - pcep error valuepublic void allocateNodeLabel(org.onosproject.net.Device specificDevice)
specificDevice - device to which node label needs to be allocatedpublic void releaseNodeLabel(org.onosproject.net.Device specificDevice)
specificDevice - this device label and lsr-id information will be
released in other existing devicespublic void allocateAdjacencyLabel(org.onosproject.net.Link link)
link - linkpublic void releaseAdjacencyLabel(org.onosproject.net.Link link)
link - linkpublic LabelStack computeLabelStack(org.onosproject.net.Path path)
PcepClientControllercomputeLabelStack in interface PcepClientControllerpath - from which label stack is to be computedpublic boolean allocateLocalLabel(Tunnel tunnel)
PcepClientControllerallocateLocalLabel in interface PcepClientControllertunnel - for which local labels have to be assigned and downloadedpublic LinkedList<PcepValueType> createPcepLabelStack(DefaultLabelStack labelStack, org.onosproject.net.Path path)
createPcepLabelStack in interface PcepClientControllerlabelStack - label stackpath - (hop list)