Class PCCSessionListener
- java.lang.Object
-
- org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCSessionListener
-
- All Implemented Interfaces:
EventListener
,PCCSession
,PCEPSessionListener
public final class PCCSessionListener extends Object implements PCEPSessionListener, PCCSession
-
-
Constructor Summary
Constructors Constructor Description PCCSessionListener(int sessionId, PCCTunnelManager tunnelManager, boolean errorMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getId()
Tlvs
getRemoteTlvs()
Tlvs
localSessionCharacteristics()
void
onMessage(PCEPSession psession, Message message)
Fired when a normal protocol message is received.void
onSessionDown(PCEPSession psession, Exception exception)
Fired when the session went down because of an IO error.void
onSessionTerminated(PCEPSession psession, PCEPTerminationReason cause)
Fired when the session is terminated locally.void
onSessionUp(PCEPSession psession)
Fired when the session was established successfully.void
sendError(Pcerr errorMessage)
void
sendReport(Pcrpt reportMessage)
-
-
-
Constructor Detail
-
PCCSessionListener
public PCCSessionListener(int sessionId, PCCTunnelManager tunnelManager, boolean errorMode)
-
-
Method Detail
-
onMessage
public void onMessage(PCEPSession psession, Message message)
Description copied from interface:PCEPSessionListener
Fired when a normal protocol message is received.- Specified by:
onMessage
in interfacePCEPSessionListener
message
- Protocol message
-
onSessionUp
public void onSessionUp(PCEPSession psession)
Description copied from interface:PCEPSessionListener
Fired when the session was established successfully.- Specified by:
onSessionUp
in interfacePCEPSessionListener
- Parameters:
psession
- Peer address families which we accepted
-
onSessionDown
public void onSessionDown(PCEPSession psession, Exception exception)
Description copied from interface:PCEPSessionListener
Fired when the session went down because of an IO error. Implementation should take care of closing underlying session.- Specified by:
onSessionDown
in interfacePCEPSessionListener
- Parameters:
psession
- that went downexception
- Exception that was thrown as the cause of session being down
-
onSessionTerminated
public void onSessionTerminated(PCEPSession psession, PCEPTerminationReason cause)
Description copied from interface:PCEPSessionListener
Fired when the session is terminated locally. The session has already been closed and transitioned to IDLE state. Any outstanding queued messages were not sent. The user should not attempt to make any use of the session.- Specified by:
onSessionTerminated
in interfacePCEPSessionListener
cause
- the cause why the session went down
-
sendReport
public void sendReport(Pcrpt reportMessage)
- Specified by:
sendReport
in interfacePCCSession
-
sendError
public void sendError(Pcerr errorMessage)
- Specified by:
sendError
in interfacePCCSession
-
getId
public int getId()
- Specified by:
getId
in interfacePCCSession
-
getRemoteTlvs
public Tlvs getRemoteTlvs()
- Specified by:
getRemoteTlvs
in interfacePCCSession
-
localSessionCharacteristics
public Tlvs localSessionCharacteristics()
- Specified by:
localSessionCharacteristics
in interfacePCCSession
-
-