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