*/
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 <mbobak@cisco.com> 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);
}