removing request context from a stack extracted to separate interface
[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.binding.DataObject;
14 import org.opendaylight.yangtools.yang.common.RpcResult;
15
16 /**
17  * Created by Martin Bobak <mbobak@cisco.com> on 1.4.2015.
18  */
19 public interface RequestContextStack {
20
21     <T extends DataObject> void forgetRequestContext(RequestContext<T> requestContext);
22
23     /**
24      * Method adds request to request queue which has limited quota. After number of requests exceeds quota limit future
25      * will be done immediately and will contain information about exceeded request quota.
26      *
27      * @param data
28      */
29     <T extends DataObject> SettableFuture<RpcResult<T>> storeOrFail(RequestContext<T> data);
30
31     /**
32      * Method returns new request context for current request.
33      *
34      * @return
35      */
36     <T extends DataObject> RequestContext<T> createRequestContext();
37
38 }