statistics context implements dedicated services
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / RequestContext.java
index 6b45e19b70777af8fb7ffaea6c15c2b33bcf2226..e9468807208bec86cf6a739301c392b535841c84 100644 (file)
@@ -7,42 +7,42 @@
  */
 package org.opendaylight.openflowplugin.api.openflow.device;
 
-import org.opendaylight.openflowplugin.api.openflow.device.exception.RequestQuotaExceededException;
-import org.opendaylight.yangtools.yang.binding.DataObject;
 
 /**
- * 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.
+ * 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.
+ * Created by Martin Bobak &lt;mbobak@cisco.com&gt; on 25.2.2015.
  */
-public interface RequestContext {
+public interface RequestContext<T> extends RequestFutureContext<T>, AutoCloseable {
 
     /**
-     * Method to set device context which holds ConnectionContext and DeviceState.
+     * Returns xid generated for this request.
      *
-     * @param deviceContext
+     * @return
      */
-    void setDeviceContext(DeviceContext deviceContext);
+    Xid getXid();
 
     /**
-     * Method for setting request quota value.
-     * When the Request Context quota is exceeded, incoming RPCs fail immediately, with a well-defined error.
+     * Sets xid generated for this request.
      *
-     * @param maxRequestsPerDevice
+     * @return
      */
-    void setRequestContextQuota(int maxRequestsPerDevice);
+    void setXid(Xid xid);
 
     /**
-     * Method adds request to request queue which has limited quota. After
-     * number of requests exceeds quota limit
-     * {@link org.opendaylight.openflowplugin.api.openflow.device.exception.RequestQuotaExceededException}
-     * is thrown.
+     * Returns request timeout value.
      *
-     * @param data
-     * @throws RequestQuotaExceededException
+     * @return
      */
-    void addRequest(DataObject data) throws RequestQuotaExceededException;
+    long getWaitTimeout();
+
+
+    /**
+     * Sets request timeout value.
+     *
+     * @return
+     */
+    void setWaitTimeout(long waitTimeout);
 
 }