94ce2b29090bd51db2fc9421e2c0a5d60d8cffff
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / rpc / RpcContext.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.openflowplugin.api.openflow.rpc;
9
10 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
11 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceDisconnectedHandler;
12 import org.opendaylight.yangtools.yang.binding.RpcService;
13
14 /**
15  * This context is registered with MD-SAL as a routed RPC provider for the inventory node backed by this switch and
16  * tracks the state of any user requests and how they map onto protocol requests. It uses
17  * {@link org.opendaylight.openflowplugin.api.openflow.device.RequestContext} to perform requests.
18  * <p>
19  * Created by Martin Bobak &lt;mbobak@cisco.com&gt; on 25.2.2015.
20  */
21 public interface RpcContext extends RequestContextStack, AutoCloseable, DeviceDisconnectedHandler {
22
23     <S extends RpcService> void registerRpcServiceImplementation(Class<S> serviceClass, S serviceInstance);
24
25
26     /**
27      * Method for setting request quota value. When the Request Context quota is exceeded, incoming RPCs fail
28      * immediately, with a well-defined error.
29      *
30      * @param maxRequestsPerDevice
31      */
32     void setRequestContextQuota(int maxRequestsPerDevice);
33
34 }