Wiring DeviceManagerImpl and RpcManager together
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / OpenFlowPluginProviderImpl.java
1 /*
2  * Copyright (c) 2015 Cisco 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
9 package org.opendaylight.openflowplugin.impl;
10
11
12 import java.util.Collection;
13 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
14 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
15 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
16 import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider;
17 import org.opendaylight.openflowplugin.api.openflow.device.DeviceManager;
18 import org.opendaylight.openflowplugin.api.openflow.rpc.RpcManager;
19 import org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsManager;
20 import org.opendaylight.openflowplugin.impl.device.DeviceManagerImpl;
21 import org.opendaylight.openflowplugin.impl.rpc.RpcManagerImpl;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.api.types.rev150327.OfpRole;
23
24 /**
25  * Created by Martin Bobak <mbobak@cisco.com> on 27.3.2015.
26  */
27 public class OpenFlowPluginProviderImpl implements OpenFlowPluginProvider {
28
29     private DeviceManager deviceManager;
30     private RpcManager rpcManager;
31     private BindingAwareBroker.ProviderContext providerContext;
32     private StatisticsManager statisticsManager;
33
34     @Override
35     public void onSessionInitiated(final BindingAwareBroker.ProviderContext session) {
36         providerContext = session;
37     }
38
39     @Override
40     public void setSwitchConnectionProviders(final Collection<SwitchConnectionProvider> switchConnectionProvider) {
41
42     }
43
44     @Override
45     public void setRole(final OfpRole role) {
46
47     }
48
49     @Override
50     public void initialize() {
51         rpcManager = new RpcManagerImpl(providerContext);
52         deviceManager = new DeviceManagerImpl(rpcManager, providerContext.getSALService(DataBroker.class));
53         //TODO : initialize statistics manager
54         //TODO : initialize translatorLibrary + inject into deviceMngr
55     }
56
57     @Override
58     public void close() throws Exception {
59
60     }
61 }