public class PcepClientImpl extends Object implements PcepClientDriver
| Modifier and Type | Field and Description |
|---|---|
protected String |
channelId |
protected boolean |
isHandShakeComplete |
protected org.slf4j.Logger |
log |
protected boolean |
startDriverHandshakeCalled |
| Constructor and Description |
|---|
PcepClientImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addNode(PcepClient pc)
Adds PCEP device when session is successfully established.
|
void |
addSyncMsgToList(PccId pccId,
PcepStateReport rptMsg)
Adds report message received during LSPDB sync into temporary cache.
|
ClientCapability |
capability()
Obtains capability supported by client.
|
String |
channelId()
Identifies the channel used to communicate with the pcc.
|
boolean |
connectClient()
Announce to the Pcep agent that this pcc client has connected.
|
Boolean |
delegationInfo(LspKey lspKey)
Returns delegation flag for the given LSP info.
|
void |
deleteNode(PccId pccId)
Removes PCEP device when session is disconnected.
|
void |
disconnectClient()
Disconnects the pcc by closing the TCP connection.
|
PcepFactory |
factory()
Provides the factory for this PCEP version.
|
PccId |
getPccId()
Gets the ipAddress of the client.
|
String |
getStringId()
Gets a string version of the ID for this pcc.
|
List<PcepStateReport> |
getSyncMsgList(PccId pccId)
Returns the list of report messages received during LSPDB sync.
|
void |
handleMessage(PcepMessage m)
Handle a message from the pcc.
|
void |
init(PccId pccId,
PcepVersion pcepVersion,
PcepPacketStats pktStats)
Initializes the behavior.
|
void |
initializeSyncMsgList(PccId pccId)
Creates a temporary cache to hold report messages received during LSPDB sync.
|
boolean |
isConnected()
Checks if the pcc is still connected.
|
boolean |
isHandshakeComplete()
Checks whether the handshake is complete.
|
boolean |
isOptical()
Indicates if this pcc is optical.
|
PcepSyncStatus |
labelDbSyncStatus()
Indicates the label DB synchronization status of this pcc.
|
PcepSyncStatus |
lspDbSyncStatus()
Indicates the LSP state synchronization status of this pcc.
|
void |
removeConnectedClient()
Remove this pcc client from the Pcep agent.
|
void |
removeSyncMsgList(PccId pccId)
Removes the list of report messages received during LSPDB sync.
|
void |
sendMessage(List<PcepMessage> msgs)
Writes the PcepMessage list to the driver.
|
void |
sendMessage(PcepMessage m)
Writes the message to the driver.
|
void |
setAgent(PcepAgent ag)
Sets the Pcep agent to be used.
|
void |
setCapability(ClientCapability capability)
Sets capability negotiated during open message exchange.
|
void |
setChannel(org.jboss.netty.channel.Channel channel)
Sets the associated Netty channel for this pcc.
|
void |
setConnected(boolean connected)
Sets whether the pcc is connected.
|
void |
setLabelDbSyncStatus(PcepSyncStatus syncStatus)
Sets the status of label DB synchronization.
|
void |
setLspAndDelegationInfo(LspKey lspKey,
boolean dFlag)
Sets D flag for the given LSP and its LSP info.
|
void |
setLspDbSyncStatus(PcepSyncStatus syncStatus)
Sets the status of LSP state synchronization.
|
void |
setPcDeadTime(byte deadTime)
Sets the dead time for this pcc.
|
void |
setPcKeepAliveTime(byte keepAliveTime)
Sets the keep alive time for this pcc.
|
void |
setPcSessionId(byte sessionId)
Sets the session id for this pcc.
|
void |
setPcVersion(PcepVersion pcepVersion)
Sets the PCEP version for this pcc.
|
String |
toString() |
protected final org.slf4j.Logger log
protected String channelId
protected boolean startDriverHandshakeCalled
protected boolean isHandShakeComplete
public void init(PccId pccId, PcepVersion pcepVersion, PcepPacketStats pktStats)
PcepClientDriverinit in interface PcepClientDriverpccId - id of pccpcepVersion - Pcep versionpktStats - Pcep Packet Statspublic final void disconnectClient()
PcepClientdisconnectClient in interface PcepClientpublic void setCapability(ClientCapability capability)
PcepClientsetCapability in interface PcepClientcapability - supported by clientpublic ClientCapability capability()
PcepClientcapability in interface PcepClientpublic final void sendMessage(PcepMessage m)
PcepClientsendMessage in interface PcepClientm - the message to writepublic final void sendMessage(List<PcepMessage> msgs)
PcepClientsendMessage in interface PcepClientmsgs - the messages to be writtenpublic final boolean isConnected()
PcepClientisConnected in interface PcepClientpublic final void setConnected(boolean connected)
PcepClientDriversetConnected in interface PcepClientDriverconnected - whether the pcc is connectedpublic final void setChannel(org.jboss.netty.channel.Channel channel)
PcepClientDriversetChannel in interface PcepClientDriverchannel - the Netty channelpublic String channelId()
PcepClientchannelId in interface PcepClientpublic final PccId getPccId()
PcepClientgetPccId in interface PcepClientpublic final String getStringId()
PcepClientgetStringId in interface PcepClientpublic final void setPcVersion(PcepVersion pcepVersion)
PcepClientDriversetPcVersion in interface PcepClientDriverpcepVersion - the version to set.public void setPcKeepAliveTime(byte keepAliveTime)
PcepClientDriversetPcKeepAliveTime in interface PcepClientDriverkeepAliveTime - the keep alive time to set.public void setPcDeadTime(byte deadTime)
PcepClientDriversetPcDeadTime in interface PcepClientDriverdeadTime - the dead timer value to set.public void setPcSessionId(byte sessionId)
PcepClientDriversetPcSessionId in interface PcepClientDriversessionId - the session id value to set.public void setLspDbSyncStatus(PcepSyncStatus syncStatus)
PcepClientsetLspDbSyncStatus in interface PcepClientsyncStatus - LSP synchronization status to be setpublic PcepSyncStatus lspDbSyncStatus()
PcepClientlspDbSyncStatus in interface PcepClientpublic void setLabelDbSyncStatus(PcepSyncStatus syncStatus)
PcepClientsetLabelDbSyncStatus in interface PcepClientsyncStatus - label DB synchronization status to be setpublic PcepSyncStatus labelDbSyncStatus()
PcepClientlabelDbSyncStatus in interface PcepClientpublic final void handleMessage(PcepMessage m)
PcepClienthandleMessage in interface PcepClientm - the message to handlepublic void addNode(PcepClient pc)
PcepClientaddNode in interface PcepClientpc - PCEP client detailspublic void deleteNode(PccId pccId)
PcepClientdeleteNode in interface PcepClientpccId - PCEP client IDpublic final boolean connectClient()
PcepClientDriverconnectClient in interface PcepClientDriverpublic final void removeConnectedClient()
PcepClientDriverremoveConnectedClient in interface PcepClientDriverpublic PcepFactory factory()
PcepClientfactory in interface PcepClientpublic boolean isHandshakeComplete()
PcepClientDriverisHandshakeComplete in interface PcepClientDriverpublic final void setAgent(PcepAgent ag)
PcepClientDriversetAgent in interface PcepClientDriverag - the agent to set.public void setLspAndDelegationInfo(LspKey lspKey, boolean dFlag)
PcepClientsetLspAndDelegationInfo in interface PcepClientlspKey - contains LSP infodFlag - delegation flag in LSP objectpublic Boolean delegationInfo(LspKey lspKey)
PcepClientdelegationInfo in interface PcepClientlspKey - contains LSP infopublic void initializeSyncMsgList(PccId pccId)
PcepClientinitializeSyncMsgList in interface PcepClientpccId - PCC id which is the key to store report messagespublic List<PcepStateReport> getSyncMsgList(PccId pccId)
PcepClientgetSyncMsgList in interface PcepClientpccId - PCC id which is the key for all the report messagespublic void removeSyncMsgList(PccId pccId)
PcepClientremoveSyncMsgList in interface PcepClientpccId - PCC id which is the key for all the report messagespublic void addSyncMsgToList(PccId pccId, PcepStateReport rptMsg)
PcepClientaddSyncMsgToList in interface PcepClientpccId - PCC id which is the key to store report messagesrptMsg - the report message to be storedpublic boolean isOptical()
PcepClientisOptical in interface PcepClient