/**
* Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
- *
+ * <p/>
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
private static final Logger LOG = LoggerFactory.getLogger(ConnectionManagerImpl.class);
private static final int HELLO_LIMIT = 20;
- private boolean bitmapNegotiationEnabled = true;
+ private final boolean bitmapNegotiationEnabled = true;
private DeviceConnectedHandler deviceConnectedHandler;
@Override
public void onSwitchConnected(final ConnectionAdapter connectionAdapter) {
+
LOG.trace("preparing handshake: {}", connectionAdapter.getRemoteAddress());
final int handshakeThreadLimit = 1; //TODO: move to constants/parametrize
LOG.trace("prepare handshake context");
HandshakeContext handshakeContext = new HandshakeContextImpl(handshakePool, handshakeManager);
handshakeListener.setHandshakeContext(handshakeContext);
+ connectionContext.setHandshakeContext(handshakeContext);
LOG.trace("prepare connection listeners");
final ConnectionReadyListener connectionReadyListener = new ConnectionReadyListenerImpl(
new OpenflowProtocolListenerInitialImpl(connectionContext, handshakeContext);
connectionAdapter.setMessageListener(ofMessageListener);
- final SystemNotificationsListener systemListener = new SystemNotificationsListenerImpl(connectionContext, handshakeContext);
+ final SystemNotificationsListener systemListener = new SystemNotificationsListenerImpl(connectionContext);
connectionAdapter.setSystemListener(systemListener);
LOG.trace("connection ballet finished");
* @return
*/
private static ThreadPoolLoggingExecutor createHandshakePool(
- final String connectionIdentifier, int handshakeThreadLimit) {
+ final String connectionIdentifier, final int handshakeThreadLimit) {
return new ThreadPoolLoggingExecutor(handshakeThreadLimit,
handshakeThreadLimit, 0L, TimeUnit.MILLISECONDS,
new ArrayBlockingQueue<Runnable>(HELLO_LIMIT), "OFHandshake-" + connectionIdentifier);
* @return
*/
private HandshakeManager createHandshakeManager(final ConnectionAdapter connectionAdapter,
- HandshakeListener handshakeListener) {
+ final HandshakeListener handshakeListener) {
HandshakeManagerImpl handshakeManager = new HandshakeManagerImpl(connectionAdapter,
ConnectionConductor.versionOrder.get(0),
ConnectionConductor.versionOrder);
* @return parameter dedicated to hello message content
*/
public boolean isBitmapNegotiationEnabled() {
- return bitmapNegotiationEnabled ;
+ return bitmapNegotiationEnabled;
}
- /**
- * @param bitmapNegotiationEnabled the bitmapNegotiationEnabled to set
- */
- public void setBitmapNegotiationEnabled(boolean bitmapNegotiationEnabled) {
- this.bitmapNegotiationEnabled = bitmapNegotiationEnabled;
- }
@Override
- public boolean accept(InetAddress switchAddress) {
+ public boolean accept(final InetAddress switchAddress) {
// TODO add connection accept logic based on address
return true;
}
@Override
- public void setDeviceConnectedHandler(DeviceConnectedHandler deviceConnectedHandler) {
+ public void setDeviceConnectedHandler(final DeviceConnectedHandler deviceConnectedHandler) {
this.deviceConnectedHandler = deviceConnectedHandler;
}
@Override
- public void setMessageHandler(MessageHandler arg0) {
+ public void setMessageHandler(final MessageHandler arg0) {
// TODO Auto-generated method stub
}