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
ConstructorsConstructorDescriptionConnectionContextImpl(ConnectionAdapter connectionAdapter, DeviceConnectionStatusProvider deviceConnectionStatusProvider) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidchange internal state toConnectionContext.CONNECTION_STATE.HANDSHAKING.voidchange internal state toConnectionContext.CONNECTION_STATE.TIMEOUTING.voidchange internal state toConnectionContext.CONNECTION_STATE.WORKING.voidcloseConnection(boolean propagate) actively drop associated connection.booleanReturns 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.voidhandlePortStatusMessage(PortStatusMessage portStatusMessage) Handle received port status message.voidThis method creates a basic device information.inthashCode()voidcleanup context upon connection closed event (by device).voidsetDeviceDisconnectedHandler(DeviceDisconnectedHandler deviceDisconnectedHandler) Method sets handler for handling closing connections.voidsetFeatures(FeaturesReply newFeaturesReply) Setter.voidsetHandshakeContext(HandshakeContext handshakeContext) Setter.voidSetter for nodeId.voidsetOutboundQueueHandleRegistration(OutboundQueueHandlerRegistration<OutboundQueueProvider> newRegistration) voidsetOutboundQueueProvider(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:ConnectionContextReturns connection adapter.- Specified by:
getConnectionAdapterin interfaceConnectionContext- Returns:
- the connectionAdapter
-
getOutboundQueueProvider
Description copied from interface:ConnectionContextReturns reference to OFJava outbound queue provider. Outbound queue is used for outbound messages processing.- Specified by:
getOutboundQueueProviderin interfaceConnectionContext- Returns:
OutboundQueueProvider
-
setOutboundQueueProvider
Description copied from interface:ConnectionContextMethod sets reference to OFJava outbound queue provider.- Specified by:
setOutboundQueueProviderin interfaceConnectionContext- Parameters:
outboundQueueProvider-OutboundQueueProvider
-
getConnectionState
Description copied from interface:ConnectionContextMethod returns current connection state.- Specified by:
getConnectionStatein interfaceConnectionContext- Returns:
ConnectionContext.CONNECTION_STATE
-
getNodeId
Description copied from interface:ConnectionContextMethod returns identifier of device whic connection represents this context.- Specified by:
getNodeIdin interfaceConnectionContext- Returns:
NodeId
-
setNodeId
Description copied from interface:ConnectionContextSetter for nodeId.- Specified by:
setNodeIdin interfaceConnectionContext- Parameters:
nodeId- node id
-
getFeatures
Description copied from interface:ConnectionContextGetter.- Specified by:
getFeaturesin interfaceConnectionContext- Returns:
- featureReply as received from device during handshake
-
setDeviceDisconnectedHandler
Description copied from interface:ConnectionContextMethod sets handler for handling closing connections.- Specified by:
setDeviceDisconnectedHandlerin interfaceConnectionContext- Parameters:
deviceDisconnectedHandler- handler for disconnect
-
setFeatures
Description copied from interface:ConnectionContextSetter.- Specified by:
setFeaturesin interfaceConnectionContext- Parameters:
newFeaturesReply- as received from device during handshake
-
closeConnection
public void closeConnection(boolean propagate) Description copied from interface:ConnectionContextactively drop associated connection.- Specified by:
closeConnectionin 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:ConnectionContextcleanup context upon connection closed event (by device).- Specified by:
onConnectionClosedin interfaceConnectionContext
-
getSafeNodeIdForLOG
Get safe nodeId for logging.- Specified by:
getSafeNodeIdForLOGin interfaceConnectionContext- Returns:
- string value od nodeId or string "null"
-
setOutboundQueueHandleRegistration
public void setOutboundQueueHandleRegistration(OutboundQueueHandlerRegistration<OutboundQueueProvider> newRegistration) - Specified by:
setOutboundQueueHandleRegistrationin interfaceConnectionContext
-
changeStateToHandshaking
public void changeStateToHandshaking()Description copied from interface:ConnectionContextchange internal state toConnectionContext.CONNECTION_STATE.HANDSHAKING.- Specified by:
changeStateToHandshakingin interfaceConnectionContext
-
changeStateToTimeouting
public void changeStateToTimeouting()Description copied from interface:ConnectionContextchange internal state toConnectionContext.CONNECTION_STATE.TIMEOUTING.- Specified by:
changeStateToTimeoutingin interfaceConnectionContext
-
changeStateToWorking
public void changeStateToWorking()Description copied from interface:ConnectionContextchange internal state toConnectionContext.CONNECTION_STATE.WORKING.- Specified by:
changeStateToWorkingin interfaceConnectionContext
-
handlePortStatusMessage
Description copied from interface:ConnectionContextHandle received port status message.- Specified by:
handlePortStatusMessagein interfaceConnectionContext- Parameters:
portStatusMessage- port status message
-
retrieveAndClearPortStatusMessages
- Specified by:
retrieveAndClearPortStatusMessagesin interfaceConnectionContext
-
getDeviceInfo
Description copied from interface:ConnectionContextCreate and return basic device info.- Specified by:
getDeviceInfoin interfaceConnectionContext- Returns:
- created device info
-
handshakeSuccessful
public void handshakeSuccessful()Description copied from interface:ConnectionContextThis method creates a basic device information. Should be called after nodeId and features are set in connection context.- Specified by:
handshakeSuccessfulin interfaceConnectionContext
-
setHandshakeContext
Description copied from interface:ConnectionContextSetter.- Specified by:
setHandshakeContextin interfaceConnectionContext- Parameters:
handshakeContext- corresponding handshake context used upon this connection
-
equals
-
hashCode
public int hashCode()
-