Bug-4866 - [Clustering]: Switch state resync is not
[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 org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
13 import org.opendaylight.yangtools.yang.binding.DataObject;
14 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
15 import org.opendaylight.yangtools.yang.common.RpcResult;
16
17 import java.util.concurrent.Future;
18
19 /**
20  * forwardingrules-manager
21  * org.opendaylight.openflowplugin.applications.frm
22  *
23  * ForwardingRulesCommiter
24  * It represent a contract between DataStore DataChangeEvent and relevant
25  * SalRpcService for device. Every implementation has to be registered for
26  * Configurational/DS tree path.
27  *
28  * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
29  *
30  * Created: Aug 25, 2014
31  */
32 public interface ForwardingRulesCommiter <D extends DataObject> extends AutoCloseable, ClusteredDataTreeChangeListener<D> {
33
34     /**
35      * Method removes DataObject which is identified by InstanceIdentifier
36      * from device.
37      *
38      * @param identifier - the whole path to DataObject
39      * @param del - DataObject for removing
40      * @param nodeIdent Node InstanceIdentifier
41      */
42     void remove(InstanceIdentifier<D> identifier, D del,
43             InstanceIdentifier<FlowCapableNode> nodeIdent);
44
45     /**
46      * Method updates the original DataObject to the update DataObject
47      * in device. Both are identified by same InstanceIdentifier
48      *
49      * @param identifier - the whole path to DataObject
50      * @param original - original DataObject (for update)
51      * @param update - changed DataObject (contain updates)
52      * @param nodeIdent Node InstanceIdentifier
53      */
54     void update(InstanceIdentifier<D> identifier, D original, D update,
55             InstanceIdentifier<FlowCapableNode> nodeIdent);
56
57     /**
58      * Method adds the DataObject which is identified by InstanceIdentifier
59      * to device.
60      *
61      * @param identifier - the whole path to new DataObject
62      * @param add - new DataObject
63      * @param nodeIdent Node InstanceIdentifier
64      */
65     void add(InstanceIdentifier<D> identifier, D add,
66             InstanceIdentifier<FlowCapableNode> nodeIdent);
67
68
69     /**
70      * Method creates stale-marked DataObject which is identified by InstanceIdentifier
71      * from device.
72      *
73      * @param identifier - the whole path to DataObject
74      * @param del - DataObject removed. Stale-Mark object to be created from this object
75      * @param nodeIdent Node InstanceIdentifier
76      */
77     void createStaleMarkEntity(InstanceIdentifier<D> identifier, D del,
78                 InstanceIdentifier<FlowCapableNode> nodeIdent);
79
80
81
82     Future<? extends RpcResult> removeWithResult(InstanceIdentifier<D> identifier, D del,
83                                                InstanceIdentifier<FlowCapableNode> nodeIdent);
84
85
86
87 }
88