RpcContext and RequestContext API fine tuning
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / rpc / RpcContext.java
index 73130af6f5b55585b9104cd3cfeb3d970c81b6ce..f651a73a1fac69cdb2fb408bcb79ea2880a543a0 100644 (file)
@@ -7,11 +7,11 @@
  */
 package org.opendaylight.openflowplugin.api.openflow.rpc;
 
-import java.util.concurrent.Future;
-import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
+import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.opendaylight.yangtools.yang.common.RpcResult;
+import java.util.concurrent.Future;
 
 /**
  * This context is registered with MD-SAL as a routed RPC provider for the inventory node backed by this switch and
@@ -24,22 +24,21 @@ public interface RpcContext extends AutoCloseable {
 
     <S extends RpcService> void registerRpcServiceImplementation(Class<S> serviceClass, S serviceInstance);
 
-    void setDeviceContext(DeviceContext deviceContext);
-
     /*
      *  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.
      *
      * @param data
      */
-    Future<RpcResult<? extends DataObject>> addNewRequest(DataObject data);
+    <T extends DataObject> Future<RpcResult<T>> addNewRequest(DataObject data);
 
     /**
      * Method for setting request quota value. When the Request Context quota is exceeded, incoming RPCs fail
      * immediately, with a well-defined error.
-     * 
+     *
      * @param maxRequestsPerDevice
      */
     void setRequestContextQuota(int maxRequestsPerDevice);
 
+    void forgetRequestContext(RequestContext requestContext);
 }