X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2FOpenFlowPluginProviderFactoryImpl.java;h=f3d63bf0e9111726afa8b8912af19a849e6a0fbd;hb=46900032011d90b165c1bf9fdafbaa7a4384a0f7;hp=c216e439b7d7a8b84e848229152da23aa39b7b0b;hpb=e88094e6616318a43caa89c0bb32df7ef6ee9506;p=openflowplugin.git diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderFactoryImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderFactoryImpl.java index c216e439b7..f3d63bf0e9 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderFactoryImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderFactoryImpl.java @@ -1,5 +1,5 @@ /* - * 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, @@ -8,16 +8,20 @@ package org.opendaylight.openflowplugin.impl; import java.util.List; +import javax.inject.Singleton; +import org.apache.aries.blueprint.annotation.service.Service; 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.infrautils.ready.SystemReadyMonitor; +import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService; +import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider; import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider; +import org.opendaylight.openflowplugin.api.diagstatus.OpenflowPluginDiagStatusProvider; 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; @@ -26,62 +30,36 @@ import org.slf4j.LoggerFactory; * * @author Thomas Pantelis */ +@Singleton +@Service(classes = OpenFlowPluginProviderFactory.class) public class OpenFlowPluginProviderFactoryImpl implements OpenFlowPluginProviderFactory { 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 switchConnectionProviders) { - + public OpenFlowPluginProvider newInstance(final ConfigurationService configurationService, + final DataBroker dataBroker, + final RpcProviderRegistry rpcRegistry, + final NotificationPublishService notificationPublishService, + final EntityOwnershipService entityOwnershipService, + final List switchConnectionProviders, + final ClusterSingletonServiceProvider singletonServiceProvider, + final MastershipChangeServiceManager mastershipChangeServiceManager, + final OpenflowPluginDiagStatusProvider ofPluginDiagstatusProvider, + final SystemReadyMonitor systemReadyMonitor) { LOG.info("Initializing new OFP southbound."); - - OpenflowPortsUtil.init(); - OpenFlowPluginProvider openflowPluginProvider = new OpenFlowPluginProviderImpl( - providerConfig.getRpcRequestsQuota(), - providerConfig.getGlobalNotificationQuota(), - providerConfig.getThreadPoolMinThreads(), - providerConfig.getThreadPoolMaxThreads().getValue(), - providerConfig.getThreadPoolTimeout()); - - 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()); - openflowPluginProvider.setNotificationFlowRemovedOff(providerConfig.isNotificationFlowRemovedOff()); + final OpenFlowPluginProvider openflowPluginProvider = new OpenFlowPluginProviderImpl( + configurationService, + switchConnectionProviders, + dataBroker, + rpcRegistry, + notificationPublishService, + singletonServiceProvider, + entityOwnershipService, + mastershipChangeServiceManager, + ofPluginDiagstatusProvider, + systemReadyMonitor); openflowPluginProvider.initialize(); - - LOG.info("Configured values, " + - "StatisticsPollingOff:{}, " + - "SwitchFeaturesMandatory:{}, " + - "BarrierCountLimit:{}, " + - "BarrierTimeoutLimit:{}, " + - "EchoReplyTimeout:{}, " + - "ThreadPoolMinThreads:{}, " + - "ThreadPoolMaxThreads:{}, " + - "ThreadPoolTimeout:{}, " + - "NotificationFlowRemovedOff:{}", - providerConfig.isIsStatisticsPollingOff(), - providerConfig.isSwitchFeaturesMandatory(), - providerConfig.getBarrierCountLimit().getValue(), - providerConfig.getBarrierIntervalTimeoutLimit().getValue(), - providerConfig.getEchoReplyTimeout().getValue(), - providerConfig.getThreadPoolMinThreads(), - providerConfig.getThreadPoolMaxThreads().getValue(), - providerConfig.getThreadPoolTimeout(), - providerConfig.isNotificationFlowRemovedOff()); - return openflowPluginProvider; } }