2 * Copyright (c) 2016, 2017 Brocade Communications Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.openflowplugin.impl;
10 import java.util.List;
11 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
12 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
13 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
14 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
15 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
16 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
17 import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider;
18 import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProviderFactory;
19 import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
24 * Implementation of OpenFlowPluginProviderFactory.
26 * @author Thomas Pantelis
28 public class OpenFlowPluginProviderFactoryImpl implements OpenFlowPluginProviderFactory {
29 private static final Logger LOG = LoggerFactory.getLogger(OpenFlowPluginProviderFactoryImpl.class);
32 public OpenFlowPluginProvider newInstance(final ConfigurationService configurationService,
33 final DataBroker dataBroker,
34 final RpcProviderRegistry rpcRegistry,
35 final NotificationPublishService notificationPublishService,
36 final EntityOwnershipService entityOwnershipService,
37 final List<SwitchConnectionProvider> switchConnectionProviders,
38 final ClusterSingletonServiceProvider singletonServiceProvider) {
39 LOG.info("Initializing new OFP southbound.");
40 final OpenFlowPluginProvider openflowPluginProvider = new OpenFlowPluginProviderImpl(
42 switchConnectionProviders,
45 notificationPublishService,
46 singletonServiceProvider,
47 entityOwnershipService);
49 openflowPluginProvider.initialize();
50 return openflowPluginProvider;