Search in sources :

Example 1 with OutboundQueueProvider

use of org.opendaylight.openflowplugin.api.openflow.connection.OutboundQueueProvider in project openflowplugin by opendaylight.

the class DeviceManagerImpl method createContext.

@Override
public DeviceContext createContext(@Nonnull final ConnectionContext connectionContext) {
    LOG.info("ConnectionEvent: Device connected to controller, Device:{}, NodeId:{}", connectionContext.getConnectionAdapter().getRemoteAddress(), connectionContext.getDeviceInfo().getNodeId());
    connectionContext.getConnectionAdapter().setPacketInFiltering(true);
    final OutboundQueueProvider outboundQueueProvider = new OutboundQueueProviderImpl(connectionContext.getDeviceInfo().getVersion());
    connectionContext.setOutboundQueueProvider(outboundQueueProvider);
    final OutboundQueueHandlerRegistration<OutboundQueueProvider> outboundQueueHandlerRegistration = connectionContext.getConnectionAdapter().registerOutboundQueueHandler(outboundQueueProvider, config.getBarrierCountLimit().getValue(), TimeUnit.MILLISECONDS.toNanos(config.getBarrierIntervalTimeoutLimit().getValue()));
    connectionContext.setOutboundQueueHandleRegistration(outboundQueueHandlerRegistration);
    final DeviceContext deviceContext = new DeviceContextImpl(connectionContext, dataBroker, messageSpy, translatorLibrary, convertorExecutor, config.isSkipTableFeatures(), hashedWheelTimer, config.isUseSingleLayerSerialization(), deviceInitializerProvider, config.isEnableFlowRemovedNotification(), config.isSwitchFeaturesMandatory(), contextChainHolder);
    ((ExtensionConverterProviderKeeper) deviceContext).setExtensionConverterProvider(extensionConverterProvider);
    deviceContext.setNotificationPublishService(notificationPublishService);
    deviceContexts.put(connectionContext.getDeviceInfo(), deviceContext);
    updatePacketInRateLimiters();
    final OpenflowProtocolListenerFullImpl messageListener = new OpenflowProtocolListenerFullImpl(connectionContext.getConnectionAdapter(), deviceContext);
    connectionContext.getConnectionAdapter().setMessageListener(messageListener);
    connectionContext.getConnectionAdapter().setAlienMessageListener(messageListener);
    return deviceContext;
}
Also used : OutboundQueueProvider(org.opendaylight.openflowplugin.api.openflow.connection.OutboundQueueProvider) DeviceContext(org.opendaylight.openflowplugin.api.openflow.device.DeviceContext) OpenflowProtocolListenerFullImpl(org.opendaylight.openflowplugin.impl.device.listener.OpenflowProtocolListenerFullImpl) OutboundQueueProviderImpl(org.opendaylight.openflowplugin.impl.connection.OutboundQueueProviderImpl) ExtensionConverterProviderKeeper(org.opendaylight.openflowplugin.extension.api.ExtensionConverterProviderKeeper)

Aggregations

OutboundQueueProvider (org.opendaylight.openflowplugin.api.openflow.connection.OutboundQueueProvider)1 DeviceContext (org.opendaylight.openflowplugin.api.openflow.device.DeviceContext)1 ExtensionConverterProviderKeeper (org.opendaylight.openflowplugin.extension.api.ExtensionConverterProviderKeeper)1 OutboundQueueProviderImpl (org.opendaylight.openflowplugin.impl.connection.OutboundQueueProviderImpl)1 OpenflowProtocolListenerFullImpl (org.opendaylight.openflowplugin.impl.device.listener.OpenflowProtocolListenerFullImpl)1