Class HandshakeManagerImpl
- java.lang.Object
-
- org.opendaylight.openflowplugin.impl.connection.HandshakeManagerImpl
-
- All Implemented Interfaces:
HandshakeManager
public class HandshakeManagerImpl extends Object implements HandshakeManager
-
-
Constructor Summary
Constructors Constructor Description HandshakeManagerImpl(ConnectionAdapter connectionAdapter, Short highestVersion, List<Short> versionOrder, ErrorHandler errorHandler, HandshakeListener handshakeListener, boolean useVersionBitmap, DeviceConnectionRateLimiter deviceConnectionRateLimiter, int deviceConnectionHoldTime, DeviceConnectionStatusProvider deviceConnectionStatusProvider)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ShortgetVersion()Return negotiated version.booleanisAllowedToConnect(BigInteger nodeId)protected voidpostHandshake(Short proposedVersion, Long xid)after handshake set features, register to session.protected ShortproposeCommonBitmapVersion(List<Elements> list)find common highest supported bitmap version.protected shortproposeNextVersion(short remoteVersion)find supported version based on remoteVersion.voidshake(HelloMessage receivedHello)Process current handshake step.
-
-
-
Constructor Detail
-
HandshakeManagerImpl
public HandshakeManagerImpl(ConnectionAdapter connectionAdapter, Short highestVersion, List<Short> versionOrder, ErrorHandler errorHandler, HandshakeListener handshakeListener, boolean useVersionBitmap, DeviceConnectionRateLimiter deviceConnectionRateLimiter, int deviceConnectionHoldTime, DeviceConnectionStatusProvider deviceConnectionStatusProvider)
Constructor.- Parameters:
connectionAdapter- connection adaptor for switchhighestVersion- highest openflow versionversionOrder- list of version in order for connection protocol negotiationerrorHandler- the ErrorHandlerhandshakeListener- the HandshakeListeneruseVersionBitmap- should use negotiation bit mapdeviceConnectionRateLimiter- device connection rate limiter utilitydeviceConnectionHoldTime- deivce connection hold time in secondsdeviceConnectionStatusProvider- utility for maintaining device connection states
-
-
Method Detail
-
shake
public void shake(HelloMessage receivedHello)
Description copied from interface:HandshakeManagerProcess current handshake step.- Specified by:
shakein interfaceHandshakeManager- Parameters:
receivedHello- message from device we need to act upon
-
getVersion
public Short getVersion()
Description copied from interface:HandshakeManagerReturn negotiated version.- Specified by:
getVersionin interfaceHandshakeManager- Returns:
- negotiated version.
-
proposeCommonBitmapVersion
protected Short proposeCommonBitmapVersion(List<Elements> list)
find common highest supported bitmap version.- Parameters:
list- bitmap list- Returns:
- proposed bitmap value
-
proposeNextVersion
protected short proposeNextVersion(short remoteVersion)
find supported version based on remoteVersion.- Parameters:
remoteVersion- openflow version supported by remote entity- Returns:
- openflow version
-
postHandshake
protected void postHandshake(Short proposedVersion, Long xid)
after handshake set features, register to session.- Parameters:
proposedVersion- proposed openflow versionxid- transaction id
-
isAllowedToConnect
public boolean isAllowedToConnect(BigInteger nodeId)
-
-