Implementation of Rpc interfaces
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / rpc / RequestContextImpl.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 com.google.common.util.concurrent.SettableFuture;
11 import java.util.concurrent.Future;
12 import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
13 import org.opendaylight.openflowplugin.api.openflow.rpc.RpcContext;
14 import org.opendaylight.yangtools.yang.binding.DataObject;
15 import org.opendaylight.yangtools.yang.common.RpcResult;
16
17 /**
18  * @author joe
19  */
20 public class RequestContextImpl<T extends DataObject> implements RequestContext {
21
22     private final RpcContext rpcContext;
23     private SettableFuture<RpcResult<T>> rpcResultFuture;
24
25     public RequestContextImpl(final RpcContext rpcContext) {
26         this.rpcContext = rpcContext;
27     }
28
29     /*
30      * (non-Javadoc)
31      * 
32      * @see
33      * org.opendaylight.openflowplugin.api.openflow.device.RequestContext#createRequestFuture(org.opendaylight.yangtools
34      * .yang.binding.DataObject)
35      */
36     @Override
37     public Future<RpcResult<T>> createRequestFuture(final DataObject dataObject) {
38         rpcResultFuture = SettableFuture.create();
39         return rpcResultFuture;
40     }
41
42     /*
43      * (non-Javadoc)
44      * 
45      * @see org.opendaylight.openflowplugin.api.openflow.device.RequestContext#requestSucceeded()
46      */
47     @Override
48     public void requestSucceeded() {
49         // TODO Auto-generated method stub
50
51     }
52
53     /*
54      * (non-Javadoc)
55      * 
56      * @see org.opendaylight.openflowplugin.api.openflow.device.RequestContext#requestFailed(java.lang.String)
57      */
58     @Override
59     public void requestFailed(final String exception) {
60         // TODO Auto-generated method stub
61
62     }
63 }