Synchronize Flow and Group Remove events
[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 package org.opendaylight.openflowplugin.api.openflow.device.handlers;
9
10 import javax.annotation.Nonnull;
11 import javax.annotation.Nullable;
12 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
14
15 /**
16  * Collects multipart msgs from device by provided XID and returns them
17  * to the caller as request/collection response one-to-one contract.
18  */
19 public interface MultiMsgCollector<T extends OfHeader> {
20     /**
21      * Method adds a reply multipart message to the collection and if the message has marker
22      * "I'M A LAST" method set whole Collection to Future object and remove from cache.
23      * @param reply reply
24      * @param reqMore request more replies
25      * @param eventIdentifier event identifier
26      */
27     void addMultipartMsg(@Nonnull T reply, boolean reqMore, @Nullable EventIdentifier eventIdentifier);
28
29     /**
30      * Null response could be a valid end multipart collecting event for barrier response scenario.
31      * We are not able to resolve an issue (it is or it isn't barrier scenario) so we have to finish
32      * collecting multipart messages successfully.
33      * @param eventIdentifier event identifier
34      */
35     void endCollecting(@Nullable EventIdentifier eventIdentifier);
36 }