2 * Copyright (c) 2015 Cisco 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.rpc;
10 import com.google.common.util.concurrent.SettableFuture;
11 import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
12 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
13 import org.opendaylight.yangtools.yang.common.RpcResult;
15 public abstract class AbstractRequestContext<T> implements RequestContext<T> {
16 private SettableFuture<RpcResult<T>> rpcResultFuture;
17 private long waitTimeout;
20 protected AbstractRequestContext() {
25 public SettableFuture<RpcResult<T>> getFuture() {
26 if (null == rpcResultFuture) {
27 rpcResultFuture = SettableFuture.create();
29 return rpcResultFuture;
38 public void setXid(final Xid xid) {
43 public long getWaitTimeout() {
48 public void setWaitTimeout(final long waitTimeout) {
49 this.waitTimeout = waitTimeout;