public class ConnectionContextImpl extends Object implements ConnectionContext
ConnectionContext.CONNECTION_STATE
Constructor and Description |
---|
ConnectionContextImpl(ConnectionAdapter connectionAdapter)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
changeStateToHandshaking()
change internal state to
ConnectionContext.CONNECTION_STATE.HANDSHAKING . |
void |
changeStateToTimeouting()
change internal state to
ConnectionContext.CONNECTION_STATE.TIMEOUTING . |
void |
changeStateToWorking()
change internal state to
ConnectionContext.CONNECTION_STATE.WORKING . |
void |
closeConnection(boolean propagate)
actively drop associated connection.
|
boolean |
equals(Object object) |
ConnectionAdapter |
getConnectionAdapter()
Returns connection adapter.
|
ConnectionContext.CONNECTION_STATE |
getConnectionState()
Method returns current connection state.
|
DeviceInfo |
getDeviceInfo()
Create and return basic device info.
|
FeaturesReply |
getFeatures()
Getter.
|
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId |
getNodeId()
Method returns identifier of device whic connection represents this context.
|
OutboundQueue |
getOutboundQueueProvider()
Returns reference to OFJava outbound queue provider.
|
String |
getSafeNodeIdForLOG()
Get safe nodeId for logging.
|
void |
handlePortStatusMessage(PortStatusMessage portStatusMessage)
Handle received port status message.
|
void |
handshakeSuccessful()
This method creates a basic device information.
|
int |
hashCode() |
void |
onConnectionClosed()
cleanup context upon connection closed event (by device).
|
List<PortStatusMessage> |
retrieveAndClearPortStatusMessages() |
void |
setDeviceDisconnectedHandler(DeviceDisconnectedHandler deviceDisconnectedHandler)
Method sets handler for handling closing connections.
|
void |
setFeatures(FeaturesReply newFeaturesReply)
Setter.
|
void |
setHandshakeContext(HandshakeContext handshakeContext)
Setter.
|
void |
setNodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId)
Setter for nodeId.
|
void |
setOutboundQueueHandleRegistration(OutboundQueueHandlerRegistration<OutboundQueueProvider> newRegistration) |
void |
setOutboundQueueProvider(OutboundQueueProvider outboundQueueProvider)
Method sets reference to OFJava outbound queue provider.
|
public ConnectionContextImpl(ConnectionAdapter connectionAdapter)
connectionAdapter
- - connection adapterpublic ConnectionAdapter getConnectionAdapter()
ConnectionContext
getConnectionAdapter
in interface ConnectionContext
public OutboundQueue getOutboundQueueProvider()
ConnectionContext
getOutboundQueueProvider
in interface ConnectionContext
OutboundQueueProvider
public void setOutboundQueueProvider(OutboundQueueProvider outboundQueueProvider)
ConnectionContext
setOutboundQueueProvider
in interface ConnectionContext
outboundQueueProvider
- OutboundQueueProvider
public ConnectionContext.CONNECTION_STATE getConnectionState()
ConnectionContext
getConnectionState
in interface ConnectionContext
ConnectionContext.CONNECTION_STATE
public org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId getNodeId()
ConnectionContext
getNodeId
in interface ConnectionContext
NodeId
public void setNodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId)
ConnectionContext
setNodeId
in interface ConnectionContext
nodeId
- node idpublic FeaturesReply getFeatures()
ConnectionContext
getFeatures
in interface ConnectionContext
public void setDeviceDisconnectedHandler(DeviceDisconnectedHandler deviceDisconnectedHandler)
ConnectionContext
setDeviceDisconnectedHandler
in interface ConnectionContext
deviceDisconnectedHandler
- handler for disconnectpublic void setFeatures(FeaturesReply newFeaturesReply)
ConnectionContext
setFeatures
in interface ConnectionContext
newFeaturesReply
- as received from device during handshakepublic void closeConnection(boolean propagate)
ConnectionContext
closeConnection
in interface ConnectionContext
propagate
- true if event need to be propagated to higher contexts (device, stats, rpc..)
or false if invoked from higher contextConnectionAdapter.disconnect()
public void onConnectionClosed()
ConnectionContext
onConnectionClosed
in interface ConnectionContext
public String getSafeNodeIdForLOG()
getSafeNodeIdForLOG
in interface ConnectionContext
public void setOutboundQueueHandleRegistration(OutboundQueueHandlerRegistration<OutboundQueueProvider> newRegistration)
setOutboundQueueHandleRegistration
in interface ConnectionContext
public void changeStateToHandshaking()
ConnectionContext
ConnectionContext.CONNECTION_STATE.HANDSHAKING
.changeStateToHandshaking
in interface ConnectionContext
public void changeStateToTimeouting()
ConnectionContext
ConnectionContext.CONNECTION_STATE.TIMEOUTING
.changeStateToTimeouting
in interface ConnectionContext
public void changeStateToWorking()
ConnectionContext
ConnectionContext.CONNECTION_STATE.WORKING
.changeStateToWorking
in interface ConnectionContext
public void handlePortStatusMessage(PortStatusMessage portStatusMessage)
ConnectionContext
handlePortStatusMessage
in interface ConnectionContext
portStatusMessage
- port status messagepublic List<PortStatusMessage> retrieveAndClearPortStatusMessages()
retrieveAndClearPortStatusMessages
in interface ConnectionContext
public DeviceInfo getDeviceInfo()
ConnectionContext
getDeviceInfo
in interface ConnectionContext
public void handshakeSuccessful()
ConnectionContext
handshakeSuccessful
in interface ConnectionContext
public void setHandshakeContext(HandshakeContext handshakeContext)
ConnectionContext
setHandshakeContext
in interface ConnectionContext
handshakeContext
- corresponding handshake context used upon this connectionCopyright © 2020 OpenDaylight. All rights reserved.