Merge "Fix checkstyle violations in openflowjava-util"
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / OpenFlowPluginProviderFactoryImpl.java
1 /*
2  * Copyright (c) 2016, 2017 Brocade Communications Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.openflowplugin.impl;
9
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.sal.binding.api.RpcProviderRegistry;
14 import org.opendaylight.infrautils.ready.SystemReadyMonitor;
15 import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
16 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
17 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
18 import org.opendaylight.openflowplugin.api.diagstatus.OpenflowPluginDiagStatusProvider;
19 import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider;
20 import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProviderFactory;
21 import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService;
22 import org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager;
23 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory;
25
26 /**
27  * Implementation of OpenFlowPluginProviderFactory.
28  *
29  * @author Thomas Pantelis
30  */
31 public class OpenFlowPluginProviderFactoryImpl implements OpenFlowPluginProviderFactory {
32     private static final Logger LOG = LoggerFactory.getLogger(OpenFlowPluginProviderFactoryImpl.class);
33
34     @Override
35     public OpenFlowPluginProvider newInstance(final ConfigurationService configurationService,
36                                               final DataBroker dataBroker,
37                                               final RpcProviderRegistry rpcRegistry,
38                                               final NotificationPublishService notificationPublishService,
39                                               final EntityOwnershipService entityOwnershipService,
40                                               final List<SwitchConnectionProvider> switchConnectionProviders,
41                                               final ClusterSingletonServiceProvider singletonServiceProvider,
42                                               final MastershipChangeServiceManager mastershipChangeServiceManager,
43                                               final OpenflowPluginDiagStatusProvider ofPluginDiagstatusProvider,
44                                               final SystemReadyMonitor systemReadyMonitor) {
45         LOG.info("Initializing new OFP southbound.");
46         final OpenFlowPluginProvider openflowPluginProvider = new OpenFlowPluginProviderImpl(
47                 configurationService,
48                 switchConnectionProviders,
49                 dataBroker,
50                 rpcRegistry,
51                 notificationPublishService,
52                 singletonServiceProvider,
53                 entityOwnershipService,
54                 mastershipChangeServiceManager,
55                 ofPluginDiagstatusProvider,
56                 systemReadyMonitor);
57
58         openflowPluginProvider.initialize();
59         return openflowPluginProvider;
60     }
61 }