Merge "Sending each flow/group in separate bundle add rpc instead of adding all messa...
[openflowplugin.git] / applications / forwardingrules-manager / src / main / java / org / opendaylight / openflowplugin / applications / frm / BundleMessagesCommiter.java
1 /*
2  * Copyright (c) 2019 Ericsson India Global Services Pvt Ltd. 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.applications.frm;
10
11 import com.google.common.util.concurrent.ListenableFuture;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesOutput;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundleId;
15 import org.opendaylight.yangtools.yang.binding.DataObject;
16 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
17 import org.opendaylight.yangtools.yang.common.RpcResult;
18
19 public interface BundleMessagesCommiter<D extends DataObject> {
20
21     /**
22      * Method removes DataObject which is identified by InstanceIdentifier from
23      * device.
24      *
25      * @param identifier
26      *            - the whole path to DataObject
27      * @param del
28      *            - DataObject for removing
29      * @param nodeIdent
30      *            Node InstanceIdentifier
31      */
32     void remove(InstanceIdentifier<D> identifier, D del, InstanceIdentifier<FlowCapableNode> nodeIdent,
33             BundleId bundleId);
34
35     /**
36      * Method updates the original DataObject to the update DataObject in device.ForwardingRulesManager.java.
37      * Both are identified by same InstanceIdentifier.
38      *
39      * @param identifier
40      *            - the whole path to DataObject
41      * @param original
42      *            - original DataObject (for update)
43      * @param update
44      *            - changed DataObject (contain updates)
45      * @param nodeIdent
46      *            Node InstanceIdentifier
47      */
48     void update(InstanceIdentifier<D> identifier, D original, D update,
49             InstanceIdentifier<FlowCapableNode> nodeIdent, BundleId bundleId);
50
51     /**
52      * Method adds the DataObject which is identified by InstanceIdentifier to
53      * device.
54      *
55      * @param identifier
56      *            - the whole path to new DataObject
57      * @param add
58      *            - new DataObject
59      * @param nodeIdent
60      *            Node InstanceIdentifier
61      * @return A future associated with RPC task. {@code null} is set to the future
62      *         if this method does not invoke RPC.
63      */
64     ListenableFuture<RpcResult<AddBundleMessagesOutput>> add(InstanceIdentifier<D> identifier, D add,
65                                                      InstanceIdentifier<FlowCapableNode> nodeIdent, BundleId bundleId);
66
67 }