Class ConnectionContextImpl
- java.lang.Object
- 
- org.opendaylight.openflowplugin.impl.connection.ConnectionContextImpl
 
- 
- All Implemented Interfaces:
- ConnectionContext
 
 public class ConnectionContextImpl extends Object implements ConnectionContext 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContextConnectionContext.CONNECTION_STATE
 
- 
 - 
Constructor SummaryConstructors Constructor Description ConnectionContextImpl(ConnectionAdapter connectionAdapter, DeviceConnectionStatusProvider deviceConnectionStatusProvider)Constructor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeStateToHandshaking()change internal state toConnectionContext.CONNECTION_STATE.HANDSHAKING.voidchangeStateToTimeouting()change internal state toConnectionContext.CONNECTION_STATE.TIMEOUTING.voidchangeStateToWorking()change internal state toConnectionContext.CONNECTION_STATE.WORKING.voidcloseConnection(boolean propagate)actively drop associated connection.booleanequals(Object object)ConnectionAdaptergetConnectionAdapter()Returns connection adapter.ConnectionContext.CONNECTION_STATEgetConnectionState()Method returns current connection state.DeviceInfogetDeviceInfo()Create and return basic device info.FeaturesReplygetFeatures()Getter.org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeIdgetNodeId()Method returns identifier of device whic connection represents this context.OutboundQueuegetOutboundQueueProvider()Returns reference to OFJava outbound queue provider.StringgetSafeNodeIdForLOG()Get safe nodeId for logging.voidhandlePortStatusMessage(PortStatusMessage portStatusMessage)Handle received port status message.voidhandshakeSuccessful()This method creates a basic device information.inthashCode()voidonConnectionClosed()cleanup context upon connection closed event (by device).List<PortStatusMessage>retrieveAndClearPortStatusMessages()voidsetDeviceDisconnectedHandler(DeviceDisconnectedHandler deviceDisconnectedHandler)Method sets handler for handling closing connections.voidsetFeatures(FeaturesReply newFeaturesReply)Setter.voidsetHandshakeContext(HandshakeContext handshakeContext)Setter.voidsetNodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId)Setter for nodeId.voidsetOutboundQueueHandleRegistration(OutboundQueueHandlerRegistration<OutboundQueueProvider> newRegistration)voidsetOutboundQueueProvider(OutboundQueueProvider outboundQueueProvider)Method sets reference to OFJava outbound queue provider.
 
- 
- 
- 
Constructor Detail- 
ConnectionContextImplpublic ConnectionContextImpl(ConnectionAdapter connectionAdapter, DeviceConnectionStatusProvider deviceConnectionStatusProvider) Constructor.- Parameters:
- connectionAdapter- - connection adapter
 
 
- 
 - 
Method Detail- 
getConnectionAdapterpublic ConnectionAdapter getConnectionAdapter() Description copied from interface:ConnectionContextReturns connection adapter.- Specified by:
- getConnectionAdapterin interface- ConnectionContext
- Returns:
- the connectionAdapter
 
 - 
getOutboundQueueProviderpublic OutboundQueue getOutboundQueueProvider() Description copied from interface:ConnectionContextReturns reference to OFJava outbound queue provider. Outbound queue is used for outbound messages processing.- Specified by:
- getOutboundQueueProviderin interface- ConnectionContext
- Returns:
- OutboundQueueProvider
 
 - 
setOutboundQueueProviderpublic void setOutboundQueueProvider(OutboundQueueProvider outboundQueueProvider) Description copied from interface:ConnectionContextMethod sets reference to OFJava outbound queue provider.- Specified by:
- setOutboundQueueProviderin interface- ConnectionContext
- Parameters:
- outboundQueueProvider-- OutboundQueueProvider
 
 - 
getConnectionStatepublic ConnectionContext.CONNECTION_STATE getConnectionState() Description copied from interface:ConnectionContextMethod returns current connection state.- Specified by:
- getConnectionStatein interface- ConnectionContext
- Returns:
- ConnectionContext.CONNECTION_STATE
 
 - 
getNodeIdpublic org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId getNodeId() Description copied from interface:ConnectionContextMethod returns identifier of device whic connection represents this context.- Specified by:
- getNodeIdin interface- ConnectionContext
- Returns:
- NodeId
 
 - 
setNodeIdpublic void setNodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId) Description copied from interface:ConnectionContextSetter for nodeId.- Specified by:
- setNodeIdin interface- ConnectionContext
- Parameters:
- nodeId- node id
 
 - 
getFeaturespublic FeaturesReply getFeatures() Description copied from interface:ConnectionContextGetter.- Specified by:
- getFeaturesin interface- ConnectionContext
- Returns:
- featureReply as received from device during handshake
 
 - 
setDeviceDisconnectedHandlerpublic void setDeviceDisconnectedHandler(DeviceDisconnectedHandler deviceDisconnectedHandler) Description copied from interface:ConnectionContextMethod sets handler for handling closing connections.- Specified by:
- setDeviceDisconnectedHandlerin interface- ConnectionContext
- Parameters:
- deviceDisconnectedHandler- handler for disconnect
 
 - 
setFeaturespublic void setFeatures(FeaturesReply newFeaturesReply) Description copied from interface:ConnectionContextSetter.- Specified by:
- setFeaturesin interface- ConnectionContext
- Parameters:
- newFeaturesReply- as received from device during handshake
 
 - 
closeConnectionpublic void closeConnection(boolean propagate) Description copied from interface:ConnectionContextactively drop associated connection.- Specified by:
- closeConnectionin interface- ConnectionContext
- Parameters:
- propagate- true if event need to be propagated to higher contexts (device, stats, rpc..) or false if invoked from higher context
- See Also:
- ConnectionAdapter.disconnect()
 
 - 
onConnectionClosedpublic void onConnectionClosed() Description copied from interface:ConnectionContextcleanup context upon connection closed event (by device).- Specified by:
- onConnectionClosedin interface- ConnectionContext
 
 - 
getSafeNodeIdForLOGpublic String getSafeNodeIdForLOG() Get safe nodeId for logging.- Specified by:
- getSafeNodeIdForLOGin interface- ConnectionContext
- Returns:
- string value od nodeId or string "null"
 
 - 
setOutboundQueueHandleRegistrationpublic void setOutboundQueueHandleRegistration(OutboundQueueHandlerRegistration<OutboundQueueProvider> newRegistration) - Specified by:
- setOutboundQueueHandleRegistrationin interface- ConnectionContext
 
 - 
changeStateToHandshakingpublic void changeStateToHandshaking() Description copied from interface:ConnectionContextchange internal state toConnectionContext.CONNECTION_STATE.HANDSHAKING.- Specified by:
- changeStateToHandshakingin interface- ConnectionContext
 
 - 
changeStateToTimeoutingpublic void changeStateToTimeouting() Description copied from interface:ConnectionContextchange internal state toConnectionContext.CONNECTION_STATE.TIMEOUTING.- Specified by:
- changeStateToTimeoutingin interface- ConnectionContext
 
 - 
changeStateToWorkingpublic void changeStateToWorking() Description copied from interface:ConnectionContextchange internal state toConnectionContext.CONNECTION_STATE.WORKING.- Specified by:
- changeStateToWorkingin interface- ConnectionContext
 
 - 
handlePortStatusMessagepublic void handlePortStatusMessage(PortStatusMessage portStatusMessage) Description copied from interface:ConnectionContextHandle received port status message.- Specified by:
- handlePortStatusMessagein interface- ConnectionContext
- Parameters:
- portStatusMessage- port status message
 
 - 
retrieveAndClearPortStatusMessagespublic List<PortStatusMessage> retrieveAndClearPortStatusMessages() - Specified by:
- retrieveAndClearPortStatusMessagesin interface- ConnectionContext
 
 - 
getDeviceInfopublic DeviceInfo getDeviceInfo() Description copied from interface:ConnectionContextCreate and return basic device info.- Specified by:
- getDeviceInfoin interface- ConnectionContext
- Returns:
- created device info
 
 - 
handshakeSuccessfulpublic 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 interface- ConnectionContext
 
 - 
setHandshakeContextpublic void setHandshakeContext(HandshakeContext handshakeContext) Description copied from interface:ConnectionContextSetter.- Specified by:
- setHandshakeContextin interface- ConnectionContext
- Parameters:
- handshakeContext- corresponding handshake context used upon this connection
 
 
- 
 
-