Search in sources :

Example 1 with ConnectionReadyListenerImpl

use of org.opendaylight.openflowplugin.impl.connection.listener.ConnectionReadyListenerImpl 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");
}
Also used : OpenflowProtocolListenerInitialImpl(org.opendaylight.openflowplugin.impl.connection.listener.OpenflowProtocolListenerInitialImpl) SystemNotificationsListener(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.SystemNotificationsListener) HandshakeListener(org.opendaylight.openflowplugin.api.openflow.md.core.HandshakeListener) ConnectionReadyListener(org.opendaylight.openflowjava.protocol.api.connection.ConnectionReadyListener) HandshakeManager(org.opendaylight.openflowplugin.api.openflow.md.core.HandshakeManager) HandshakeContext(org.opendaylight.openflowplugin.api.openflow.connection.HandshakeContext) ConnectionContext(org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext) ConnectionReadyListenerImpl(org.opendaylight.openflowplugin.impl.connection.listener.ConnectionReadyListenerImpl) OpenflowProtocolListener(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolListener) SystemNotificationsListenerImpl(org.opendaylight.openflowplugin.impl.connection.listener.SystemNotificationsListenerImpl) HandshakeListenerImpl(org.opendaylight.openflowplugin.impl.connection.listener.HandshakeListenerImpl)

Aggregations

ConnectionReadyListener (org.opendaylight.openflowjava.protocol.api.connection.ConnectionReadyListener)1 ConnectionContext (org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext)1 HandshakeContext (org.opendaylight.openflowplugin.api.openflow.connection.HandshakeContext)1 HandshakeListener (org.opendaylight.openflowplugin.api.openflow.md.core.HandshakeListener)1 HandshakeManager (org.opendaylight.openflowplugin.api.openflow.md.core.HandshakeManager)1 ConnectionReadyListenerImpl (org.opendaylight.openflowplugin.impl.connection.listener.ConnectionReadyListenerImpl)1 HandshakeListenerImpl (org.opendaylight.openflowplugin.impl.connection.listener.HandshakeListenerImpl)1 OpenflowProtocolListenerInitialImpl (org.opendaylight.openflowplugin.impl.connection.listener.OpenflowProtocolListenerInitialImpl)1 SystemNotificationsListenerImpl (org.opendaylight.openflowplugin.impl.connection.listener.SystemNotificationsListenerImpl)1 OpenflowProtocolListener (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolListener)1 SystemNotificationsListener (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.SystemNotificationsListener)1