Merge "BUG-6118: making the OFentityListener aware of the InJeopardy() flag"
[openflowplugin.git] / applications / forwardingrules-manager / src / main / java / org / opendaylight / openflowplugin / applications / frm / ForwardingRulesCommiter.java
1 /**
2  * Copyright (c) 2014 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.applications.frm;
10
11 import java.util.concurrent.Future;
12 import org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
14 import org.opendaylight.yangtools.yang.binding.DataObject;
15 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
16 import org.opendaylight.yangtools.yang.common.RpcResult;
17
18 /**
19  * forwardingrules-manager
20  * org.opendaylight.openflowplugin.applications.frm
21  *
22  * ForwardingRulesCommiter
23  * It represent a contract between DataStore DataTreeModification and relevant
24  * SalRpcService for device. Every implementation has to be registered for
25  * Configurational/DS tree path.
26  */
27 public interface ForwardingRulesCommiter <D extends DataObject> extends AutoCloseable, ClusteredDataTreeChangeListener<D> {
28
29     /**
30      * Method removes DataObject which is identified by InstanceIdentifier
31      * from device.
32      *
33      * @param identifier - the whole path to DataObject
34      * @param del - DataObject for removing
35      * @param nodeIdent Node InstanceIdentifier
36      */
37     void remove(InstanceIdentifier<D> identifier, D del,
38             InstanceIdentifier<FlowCapableNode> nodeIdent);
39
40     /**
41      * Method updates the original DataObject to the update DataObject
42      * in device. Both are identified by same InstanceIdentifier
43      *
44      * @param identifier - the whole path to DataObject
45      * @param original - original DataObject (for update)
46      * @param update - changed DataObject (contain updates)
47      * @param nodeIdent Node InstanceIdentifier
48      */
49     void update(InstanceIdentifier<D> identifier, D original, D update,
50             InstanceIdentifier<FlowCapableNode> nodeIdent);
51
52     /**
53      * Method adds the DataObject which is identified by InstanceIdentifier
54      * to device.
55      *
56      * @param identifier - the whole path to new DataObject
57      * @param add - new DataObject
58      * @param nodeIdent Node InstanceIdentifier
59      * @return A future associated with RPC task. {@code null} is set to the
60      *         future if this method does not invoke RPC.
61      */
62     Future<? extends RpcResult> add(InstanceIdentifier<D> identifier, D add,
63             InstanceIdentifier<FlowCapableNode> nodeIdent);
64
65
66     /**
67      * Method creates stale-marked DataObject which is identified by InstanceIdentifier
68      * from device.
69      *
70      * @param identifier - the whole path to DataObject
71      * @param del - DataObject removed. Stale-Mark object to be created from this object
72      * @param nodeIdent Node InstanceIdentifier
73      */
74     void createStaleMarkEntity(InstanceIdentifier<D> identifier, D del,
75                 InstanceIdentifier<FlowCapableNode> nodeIdent);
76
77
78
79     Future<? extends RpcResult> removeWithResult(InstanceIdentifier<D> identifier, D del,
80                                                InstanceIdentifier<FlowCapableNode> nodeIdent);
81
82
83
84 }
85