RpcContext and RequestContext API fine tuning
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / rpc / RpcManagerImpl.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 package org.opendaylight.openflowplugin.impl.rpc;
9
10 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
11 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
12 import org.opendaylight.openflowplugin.impl.util.MdSalRegistratorUtils;
13 import org.opendaylight.openflowplugin.api.openflow.rpc.RpcContext;
14 import org.opendaylight.openflowplugin.api.openflow.rpc.RpcManager;
15
16 public class RpcManagerImpl implements RpcManager {
17
18     private DeviceContext deviceContext;
19
20
21     private final ProviderContext providerContext;
22
23     public RpcManagerImpl(final ProviderContext providerContext) {
24         this.providerContext = providerContext;
25     }
26
27     /**
28      * (non-Javadoc)
29      * 
30      * @see org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceContextReadyHandler#deviceConnected(org.opendaylight.openflowplugin.api.openflow.device.DeviceContext)
31      */
32     @Override
33     public void deviceConnected(final DeviceContext deviceContext) {
34         final RpcContext rpcContext = new RpcContextImpl(providerContext);
35         MdSalRegistratorUtils.registerServices(rpcContext);
36     }
37 }