use of org.opendaylight.openflowplugin.impl.connection.listener.SystemNotificationsListenerImpl in project openflowplugin by opendaylight.
the class ConnectionManagerImpl method onSwitchConnected.
@Override
public void onSwitchConnected(final ConnectionAdapter connectionAdapter) {
LOG.trace("prepare connection context");
final ConnectionContext connectionContext = new ConnectionContextImpl(connectionAdapter);
connectionContext.setDeviceDisconnectedHandler(this.deviceDisconnectedHandler);
HandshakeListener handshakeListener = new HandshakeListenerImpl(connectionContext, deviceConnectedHandler);
final HandshakeManager handshakeManager = createHandshakeManager(connectionAdapter, handshakeListener);
LOG.trace("prepare handshake context");
HandshakeContext handshakeContext = new HandshakeContextImpl(executorService, handshakeManager);
handshakeListener.setHandshakeContext(handshakeContext);
connectionContext.setHandshakeContext(handshakeContext);
LOG.trace("prepare connection listeners");
final ConnectionReadyListener connectionReadyListener = new ConnectionReadyListenerImpl(connectionContext, handshakeContext);
connectionAdapter.setConnectionReadyListener(connectionReadyListener);
final OpenflowProtocolListener ofMessageListener = new OpenflowProtocolListenerInitialImpl(connectionContext, handshakeContext);
connectionAdapter.setMessageListener(ofMessageListener);
final SystemNotificationsListener systemListener = new SystemNotificationsListenerImpl(connectionContext, config.getEchoReplyTimeout().getValue(), executorService);
connectionAdapter.setSystemListener(systemListener);
LOG.trace("connection ballet finished");
}
Aggregations