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.ConnectionContext
ConnectionContext.CONNECTION_STATE 
 - 
 
- 
Constructor Summary
Constructors Constructor Description ConnectionContextImpl(ConnectionAdapter connectionAdapter, DeviceConnectionStatusProvider deviceConnectionStatusProvider)Constructor. 
- 
Method Summary
All 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
- 
ConnectionContextImpl
public ConnectionContextImpl(ConnectionAdapter connectionAdapter, DeviceConnectionStatusProvider deviceConnectionStatusProvider)
Constructor.- Parameters:
 connectionAdapter- - connection adapter
 
 - 
 
- 
Method Detail
- 
getConnectionAdapter
public ConnectionAdapter getConnectionAdapter()
Description copied from interface:ConnectionContextReturns connection adapter.- Specified by:
 getConnectionAdapterin interfaceConnectionContext- Returns:
 - the connectionAdapter
 
 
- 
getOutboundQueueProvider
public OutboundQueue 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
public void setOutboundQueueProvider(OutboundQueueProvider outboundQueueProvider)
Description copied from interface:ConnectionContextMethod sets reference to OFJava outbound queue provider.- Specified by:
 setOutboundQueueProviderin interfaceConnectionContext- Parameters:
 outboundQueueProvider-OutboundQueueProvider
 
- 
getConnectionState
public ConnectionContext.CONNECTION_STATE getConnectionState()
Description copied from interface:ConnectionContextMethod returns current connection state.- Specified by:
 getConnectionStatein interfaceConnectionContext- Returns:
 ConnectionContext.CONNECTION_STATE
 
- 
getNodeId
public 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 interfaceConnectionContext- Returns:
 NodeId
 
- 
setNodeId
public void setNodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId)
Description copied from interface:ConnectionContextSetter for nodeId.- Specified by:
 setNodeIdin interfaceConnectionContext- Parameters:
 nodeId- node id
 
- 
getFeatures
public FeaturesReply getFeatures()
Description copied from interface:ConnectionContextGetter.- Specified by:
 getFeaturesin interfaceConnectionContext- Returns:
 - featureReply as received from device during handshake
 
 
- 
setDeviceDisconnectedHandler
public void setDeviceDisconnectedHandler(DeviceDisconnectedHandler deviceDisconnectedHandler)
Description copied from interface:ConnectionContextMethod sets handler for handling closing connections.- Specified by:
 setDeviceDisconnectedHandlerin interfaceConnectionContext- Parameters:
 deviceDisconnectedHandler- handler for disconnect
 
- 
setFeatures
public void setFeatures(FeaturesReply newFeaturesReply)
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:
 ConnectionAdapter.disconnect()
 
- 
onConnectionClosed
public void onConnectionClosed()
Description copied from interface:ConnectionContextcleanup context upon connection closed event (by device).- Specified by:
 onConnectionClosedin interfaceConnectionContext
 
- 
getSafeNodeIdForLOG
public String 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
public void handlePortStatusMessage(PortStatusMessage portStatusMessage)
Description copied from interface:ConnectionContextHandle received port status message.- Specified by:
 handlePortStatusMessagein interfaceConnectionContext- Parameters:
 portStatusMessage- port status message
 
- 
retrieveAndClearPortStatusMessages
public List<PortStatusMessage> retrieveAndClearPortStatusMessages()
- Specified by:
 retrieveAndClearPortStatusMessagesin interfaceConnectionContext
 
- 
getDeviceInfo
public DeviceInfo 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
public void setHandshakeContext(HandshakeContext handshakeContext)
Description copied from interface:ConnectionContextSetter.- Specified by:
 setHandshakeContextin interfaceConnectionContext- Parameters:
 handshakeContext- corresponding handshake context used upon this connection
 
 - 
 
 -