import org.slf4j.LoggerFactory;
public class HandshakeListenerImpl implements HandshakeListener {
-
private static final Logger LOG = LoggerFactory.getLogger(HandshakeListenerImpl.class);
private static final Logger OF_EVENT_LOG = LoggerFactory.getLogger("OfEventLog");
private final ConnectionContext connectionContext;
private final DeviceConnectedHandler deviceConnectedHandler;
- private HandshakeContext handshakeContext;
+
+ private HandshakeContext handshakeContext = null;
/**
* Constructor.
LOG.debug("handshake succeeded: {}", connectionContext.getConnectionAdapter().getRemoteAddress());
}
OF_EVENT_LOG.debug("Connect, Node: {}", featureOutput.getDatapathId());
- this.handshakeContext.close();
+ handshakeContext.close();
connectionContext.changeStateToWorking();
connectionContext.setFeatures(featureOutput);
connectionContext.setNodeId(InventoryDataServiceUtil.nodeIdFromDatapathId(featureOutput.getDatapathId()));
.setXid(xid)
.setVersion(version)
.build();
- return this.connectionContext.getConnectionAdapter().barrier(barrierInput);
+ return connectionContext.getConnectionAdapter().barrier(barrierInput);
}
@Override
public void onHandshakeFailure() {
if (LOG.isDebugEnabled()) {
- LOG.debug("handshake failed: {}", this.connectionContext.getConnectionAdapter().getRemoteAddress());
+ LOG.debug("handshake failed: {}", connectionContext.getConnectionAdapter().getRemoteAddress());
}
- this.handshakeContext.close();
- this.connectionContext.closeConnection(false);
+ handshakeContext.close();
+ connectionContext.closeConnection(false);
}
@Override