7cde91601cc084d2f99f703cd416160ef8c84a17
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / RequestContextStack.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
9 package org.opendaylight.openflowplugin.api.openflow.device;
10
11 import com.google.common.util.concurrent.SettableFuture;
12 import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
13 import org.opendaylight.yangtools.yang.common.RpcResult;
14
15 /**
16  * Created by Martin Bobak <mbobak@cisco.com> on 1.4.2015.
17  */
18 public interface RequestContextStack {
19
20     <T> void forgetRequestContext(RequestContext<T> requestContext);
21
22     /**
23      * Method adds request to request queue which has limited quota. After number of requests exceeds quota limit future
24      * will be done immediately and will contain information about exceeded request quota.
25      *
26      * @param data
27      */
28     <T> SettableFuture<RpcResult<T>> storeOrFail(RequestContext<T> data);
29
30     /**
31      * Method returns new request context for current request.
32      *
33      * @return
34      */
35     <T> RequestContext<T> createRequestContext();
36
37 }