Improve cleanup after device disconnected event
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / rpc / RpcContext.java
index 94ce2b29090bd51db2fc9421e2c0a5d60d8cffff..1dddefbef1b5b075989006bd62cae1c24c414079 100644 (file)
@@ -7,8 +7,8 @@
  */
 package org.opendaylight.openflowplugin.api.openflow.rpc;
 
+import org.opendaylight.openflowplugin.api.openflow.OFPContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
-import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceDisconnectedHandler;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 
 /**
@@ -16,19 +16,12 @@ import org.opendaylight.yangtools.yang.binding.RpcService;
  * tracks the state of any user requests and how they map onto protocol requests. It uses
  * {@link org.opendaylight.openflowplugin.api.openflow.device.RequestContext} to perform requests.
  * <p>
- * Created by Martin Bobak &lt;mbobak@cisco.com&gt; on 25.2.2015.
  */
-public interface RpcContext extends RequestContextStack, AutoCloseable, DeviceDisconnectedHandler {
-
+public interface RpcContext extends RequestContextStack, OFPContext {
     <S extends RpcService> void registerRpcServiceImplementation(Class<S> serviceClass, S serviceInstance);
 
+    <S extends RpcService> S lookupRpcService(Class<S> serviceClass);
+    <S extends RpcService> void unregisterRpcServiceImplementation(Class<S> serviceClass);
 
-    /**
-     * 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 setStatisticsRpcEnabled(boolean isStatisticsRpcEnabled);
 }