/*
- * Copyright (c) 2016 Brocade Communications Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2016, 2017 Brocade Communications Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
import java.util.List;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
-import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider;
import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProviderFactory;
-import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig;
+import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService;
+import org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(OpenFlowPluginProviderFactoryImpl.class);
@Override
- public OpenFlowPluginProvider newInstance(OpenflowProviderConfig providerConfig, DataBroker dataBroker,
- RpcProviderRegistry rpcRegistry, NotificationService notificationService,
- NotificationPublishService notificationPublishService,
- EntityOwnershipService entityOwnershipService,
- List<SwitchConnectionProvider> switchConnectionProviders) {
-
+ public OpenFlowPluginProvider newInstance(final ConfigurationService configurationService,
+ final DataBroker dataBroker,
+ final RpcProviderRegistry rpcRegistry,
+ final NotificationPublishService notificationPublishService,
+ final EntityOwnershipService entityOwnershipService,
+ final List<SwitchConnectionProvider> switchConnectionProviders,
+ final ClusterSingletonServiceProvider singletonServiceProvider,
+ final MastershipChangeServiceManager mastershipChangeServiceManager) {
LOG.info("Initializing new OFP southbound.");
-
- OpenflowPortsUtil.init();
- OpenFlowPluginProvider openflowPluginProvider = new OpenFlowPluginProviderImpl(providerConfig.getRpcRequestsQuota(),
- providerConfig.getGlobalNotificationQuota());
-
- openflowPluginProvider.setSwitchConnectionProviders(switchConnectionProviders);
- openflowPluginProvider.setDataBroker(dataBroker);
- openflowPluginProvider.setRpcProviderRegistry(rpcRegistry);
- openflowPluginProvider.setNotificationProviderService(notificationService);
- openflowPluginProvider.setNotificationPublishService(notificationPublishService);
- openflowPluginProvider.setEntityOwnershipService(entityOwnershipService);
- openflowPluginProvider.setSwitchFeaturesMandatory(providerConfig.isSwitchFeaturesMandatory());
- openflowPluginProvider.setIsStatisticsPollingOff(providerConfig.isIsStatisticsPollingOff());
- openflowPluginProvider.setIsStatisticsRpcEnabled(providerConfig.isIsStatisticsRpcEnabled());
- openflowPluginProvider.setBarrierCountLimit(providerConfig.getBarrierCountLimit().getValue());
- openflowPluginProvider.setBarrierInterval(providerConfig.getBarrierIntervalTimeoutLimit().getValue());
- openflowPluginProvider.setEchoReplyTimeout(providerConfig.getEchoReplyTimeout().getValue());
+ final OpenFlowPluginProvider openflowPluginProvider = new OpenFlowPluginProviderImpl(
+ configurationService,
+ switchConnectionProviders,
+ dataBroker,
+ rpcRegistry,
+ notificationPublishService,
+ singletonServiceProvider,
+ entityOwnershipService,
+ mastershipChangeServiceManager);
openflowPluginProvider.initialize();
-
- LOG.info("Configured values, StatisticsPollingOff:{}, SwitchFeaturesMandatory:{}, BarrierCountLimit:{}, BarrierTimeoutLimit:{}, EchoReplyTimeout:{}",
- providerConfig.isIsStatisticsPollingOff(), providerConfig.isSwitchFeaturesMandatory(),
- providerConfig.getBarrierCountLimit().getValue(),
- providerConfig.getBarrierIntervalTimeoutLimit().getValue(), providerConfig.getEchoReplyTimeout().getValue());
-
return openflowPluginProvider;
}
}