Class ConnectionContextImpl
java.lang.Object
org.opendaylight.openflowplugin.impl.connection.ConnectionContextImpl
- All Implemented Interfaces:
ConnectionContext
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext
ConnectionContext.CONNECTION_STATE
-
Constructor Summary
ConstructorDescriptionConnectionContextImpl
(ConnectionAdapter connectionAdapter, DeviceConnectionStatusProvider deviceConnectionStatusProvider) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
change internal state toConnectionContext.CONNECTION_STATE.HANDSHAKING
.void
change internal state toConnectionContext.CONNECTION_STATE.TIMEOUTING
.void
change internal state toConnectionContext.CONNECTION_STATE.WORKING
.void
closeConnection
(boolean propagate) actively drop associated connection.boolean
Returns connection adapter.Method returns current connection state.Create and return basic device info.Getter.Method returns identifier of device whic connection represents this context.Returns reference to OFJava outbound queue provider.Get safe nodeId for logging.void
handlePortStatusMessage
(PortStatusMessage portStatusMessage) Handle received port status message.void
This method creates a basic device information.int
hashCode()
void
cleanup context upon connection closed event (by device).void
setDeviceDisconnectedHandler
(DeviceDisconnectedHandler deviceDisconnectedHandler) Method sets handler for handling closing connections.void
setFeatures
(FeaturesReply newFeaturesReply) Setter.void
setHandshakeContext
(HandshakeContext handshakeContext) Setter.void
Setter for nodeId.void
setOutboundQueueHandleRegistration
(OutboundQueueHandlerRegistration<OutboundQueueProvider> newRegistration) void
setOutboundQueueProvider
(OutboundQueueProvider outboundQueueProvider) Method sets reference to OFJava outbound queue provider.
-
Constructor Details
-
ConnectionContextImpl
public ConnectionContextImpl(ConnectionAdapter connectionAdapter, DeviceConnectionStatusProvider deviceConnectionStatusProvider) Constructor.- Parameters:
connectionAdapter
- - connection adapter
-
-
Method Details
-
getConnectionAdapter
Description copied from interface:ConnectionContext
Returns connection adapter.- Specified by:
getConnectionAdapter
in interfaceConnectionContext
- Returns:
- the connectionAdapter
-
getOutboundQueueProvider
Description copied from interface:ConnectionContext
Returns reference to OFJava outbound queue provider. Outbound queue is used for outbound messages processing.- Specified by:
getOutboundQueueProvider
in interfaceConnectionContext
- Returns:
OutboundQueueProvider
-
setOutboundQueueProvider
Description copied from interface:ConnectionContext
Method sets reference to OFJava outbound queue provider.- Specified by:
setOutboundQueueProvider
in interfaceConnectionContext
- Parameters:
outboundQueueProvider
-OutboundQueueProvider
-
getConnectionState
Description copied from interface:ConnectionContext
Method returns current connection state.- Specified by:
getConnectionState
in interfaceConnectionContext
- Returns:
ConnectionContext.CONNECTION_STATE
-
getNodeId
Description copied from interface:ConnectionContext
Method returns identifier of device whic connection represents this context.- Specified by:
getNodeId
in interfaceConnectionContext
- Returns:
NodeId
-
setNodeId
Description copied from interface:ConnectionContext
Setter for nodeId.- Specified by:
setNodeId
in interfaceConnectionContext
- Parameters:
nodeId
- node id
-
getFeatures
Description copied from interface:ConnectionContext
Getter.- Specified by:
getFeatures
in interfaceConnectionContext
- Returns:
- featureReply as received from device during handshake
-
setDeviceDisconnectedHandler
Description copied from interface:ConnectionContext
Method sets handler for handling closing connections.- Specified by:
setDeviceDisconnectedHandler
in interfaceConnectionContext
- Parameters:
deviceDisconnectedHandler
- handler for disconnect
-
setFeatures
Description copied from interface:ConnectionContext
Setter.- Specified by:
setFeatures
in interfaceConnectionContext
- Parameters:
newFeaturesReply
- as received from device during handshake
-
closeConnection
public void closeConnection(boolean propagate) Description copied from interface:ConnectionContext
actively drop associated connection.- Specified by:
closeConnection
in interfaceConnectionContext
- Parameters:
propagate
- true if event need to be propagated to higher contexts (device, stats, rpc..) or false if invoked from higher context- See Also:
-
onConnectionClosed
public void onConnectionClosed()Description copied from interface:ConnectionContext
cleanup context upon connection closed event (by device).- Specified by:
onConnectionClosed
in interfaceConnectionContext
-
getSafeNodeIdForLOG
Get safe nodeId for logging.- Specified by:
getSafeNodeIdForLOG
in interfaceConnectionContext
- Returns:
- string value od nodeId or string "null"
-
setOutboundQueueHandleRegistration
public void setOutboundQueueHandleRegistration(OutboundQueueHandlerRegistration<OutboundQueueProvider> newRegistration) - Specified by:
setOutboundQueueHandleRegistration
in interfaceConnectionContext
-
changeStateToHandshaking
public void changeStateToHandshaking()Description copied from interface:ConnectionContext
change internal state toConnectionContext.CONNECTION_STATE.HANDSHAKING
.- Specified by:
changeStateToHandshaking
in interfaceConnectionContext
-
changeStateToTimeouting
public void changeStateToTimeouting()Description copied from interface:ConnectionContext
change internal state toConnectionContext.CONNECTION_STATE.TIMEOUTING
.- Specified by:
changeStateToTimeouting
in interfaceConnectionContext
-
changeStateToWorking
public void changeStateToWorking()Description copied from interface:ConnectionContext
change internal state toConnectionContext.CONNECTION_STATE.WORKING
.- Specified by:
changeStateToWorking
in interfaceConnectionContext
-
handlePortStatusMessage
Description copied from interface:ConnectionContext
Handle received port status message.- Specified by:
handlePortStatusMessage
in interfaceConnectionContext
- Parameters:
portStatusMessage
- port status message
-
retrieveAndClearPortStatusMessages
- Specified by:
retrieveAndClearPortStatusMessages
in interfaceConnectionContext
-
getDeviceInfo
Description copied from interface:ConnectionContext
Create and return basic device info.- Specified by:
getDeviceInfo
in interfaceConnectionContext
- Returns:
- created device info
-
handshakeSuccessful
public void handshakeSuccessful()Description copied from interface:ConnectionContext
This method creates a basic device information. Should be called after nodeId and features are set in connection context.- Specified by:
handshakeSuccessful
in interfaceConnectionContext
-
setHandshakeContext
Description copied from interface:ConnectionContext
Setter.- Specified by:
setHandshakeContext
in interfaceConnectionContext
- Parameters:
handshakeContext
- corresponding handshake context used upon this connection
-
equals
-
hashCode
public int hashCode()
-