BUG-3157: perfomance tuning - cache translator lookups
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / RequestContext.java
index f09a49ce1dc57a95d463e2051f6a157b220059b0..0a8f44f8b5b7a736859acce677ee8ae5c2f0553c 100644 (file)
@@ -7,20 +7,34 @@
  */
 package org.opendaylight.openflowplugin.api.openflow.device;
 
-
-import com.google.common.util.concurrent.SettableFuture;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.common.RpcResult;
+import javax.annotation.Nullable;
 
 /**
  * Request context handles all requests on device. Number of requests is limited by request quota. When this quota is
  * exceeded all rpc's will end up with exception.
- * <p/>
- * Created by Martin Bobak <mbobak@cisco.com> on 25.2.2015.
+ * <p>
+ * Created by Martin Bobak &lt;mbobak@cisco.com&gt; on 25.2.2015.
  */
-public interface RequestContext extends AutoCloseable {
-
-    <T extends DataObject> SettableFuture<RpcResult<T>> createRequestFuture();
+public interface RequestContext<T> extends RequestFutureContext<T>, AutoCloseable {
+    /**
+     * Returns XID generated for this request.
+     *
+     * @return Allocated XID, or null if the device has disconnected.
+     */
+    @Nullable Xid getXid();
 
+    @Override
     void close();
+
+    /**
+     * Returns request timeout value.
+     *
+     * @return
+     */
+    long getWaitTimeout();
+
+    /**
+     * Sets request timeout value.
+     */
+    void setWaitTimeout(long waitTimeout);
 }