multimessage collector provides way how to explicitly cancel processing on selected...
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / handlers / MultiMsgCollector.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.handlers;
10
11 import javax.annotation.Nonnull;
12 import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply;
14
15 /**
16  * <p>
17  * openflowplugin-api
18  * org.opendaylight.openflowplugin.api.openflow.device
19  * Collects multipart msgs from device by provided XID and returns them
20  * to the caller as request/collection response one-to-one contract.
21  *
22  * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
23  * @author <a href="mailto:tkubas@cisco.com">Timotej Kubas</a>
24  *         </p>
25  *         Created: Mar 23, 2015
26  */
27 public interface MultiMsgCollector {
28
29     /**
30      * Property used to know a max life time of Multipart collection in internal Cache
31      */
32     final int DEFAULT_TIME_OUT = 10;
33
34     /**
35      * Method registers a requst context to the Multipart messages collector
36      * and returns Settable future with all MultipartReply. Method has to be called before
37      * send a request to the device, otherwise there is a small possibility to miss a first msg.
38      *
39      * @param requestContext
40      */
41     void registerMultipartRequestContext(RequestContext requestContext);
42
43     /**
44      * Method adds a reply multipart message to the collection and if the message has marker
45      * "I'M A LAST" method set whole Collection to Future object and remove from cache.
46      *
47      * @param reply
48      */
49     void addMultipartMsg(@Nonnull MultipartReply reply);
50
51
52     void setDeviceReplyProcessor(DeviceReplyProcessor deviceReplyProcessor);
53
54     void invalidateRequestContext(RequestContext requestContext);
55 }