*/
public class HandshakeManagerImpl implements HandshakeManager {
+ private static final long activeXID = 20L;
+
private static final Logger LOG = LoggerFactory
.getLogger(HandshakeManagerImpl.class);
private boolean useVersionBitmap;
/**
- * @param connectionAdapter
- * @param highestVersion
- * @param versionOrder
+ * @param connectionAdapter connection adaptor for switch
+ * @param highestVersion highest openflow version
+ * @param versionOrder list of version in order for connection protocol negotiation
*/
public HandshakeManagerImpl(ConnectionAdapter connectionAdapter, Short highestVersion,
List<Short> versionOrder) {
}
LOG.trace("handshake STARTED");
- setActiveXid(20L);
+ setActiveXid(activeXID);
try {
if (receivedHello == null) {
}
/**
- * @param remoteVersion
- * @throws Exception
+ * @param remoteVersion remote version
+ * @throws Exception exception
*/
private void handleStepByStepVersionNegotiation(final Short remoteVersion) throws Exception {
LOG.debug("remoteVersion:{} lastProposedVersion:{}, highestVersion:{}",
}
/**
- * @param remoteVersion
- * @throws Exception
+ * @param remoteVersion remote version
+ * @throws Exception exception
*/
private void handleLowerVersionProposal(Short remoteVersion) throws Exception {
Short proposedVersion;
}
/**
- * @param elements
- * @throws Exception
+ * @param elements version elements
+ * @throws Exception exception
*/
private void handleVersionBitmapNegotiation(List<Elements> elements) throws Exception {
final Short proposedVersion = proposeCommonBitmapVersion(elements);
/**
*
- * @return
+ * @return next tx id
*/
private Long getNextXid() {
activeXid += 1;
}
/**
- * @param xid
+ * @param xid tx id
*/
private void setActiveXid(Long xid) {
this.activeXid = xid;
}
/**
- * @param remoteVersion
+ * @param remoteVersion remove version
*/
private void checkNegotiationStalling(Short remoteVersion) {
if (lastReceivedVersion != null && lastReceivedVersion.equals(remoteVersion)) {
/**
* find common highest supported bitmap version
- * @param list
- * @return
+ * @param list bitmap list
+ * @return proposed bitmap value
*/
protected Short proposeCommonBitmapVersion(List<Elements> list) {
Short supportedHighestVersion = null;
/**
* find supported version based on remoteVersion
- * @param remoteVersion
- * @return
+ * @param remoteVersion openflow version supported by remote entity
+ * @return openflow version
*/
protected short proposeNextVersion(short remoteVersion) {
Short proposal = null;
/**
* send hello reply without versionBitmap
- * @param helloVersion
- * @param helloXid
+ * @param helloVersion initial hello version for openflow connection negotiation
+ * @param helloXid transaction id
* @throws Exception
*/
private ListenableFuture<Void> sendHelloMessage(Short helloVersion, final Long helloXid) throws Exception {
/**
* after handshake set features, register to session
- * @param proposedVersion
- * @param xid
+ * @param proposedVersion proposed openflow version
+ * @param xid transaction id
*/
protected void postHandshake(final Short proposedVersion, final Long xid) {
// set version