Merge "Remove old drop-test module and files."
[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,
28         ClusteredDataTreeChangeListener<D> {
29
30     /**
31      * Method removes DataObject which is identified by InstanceIdentifier
32      * from device.
33      *
34      * @param identifier - the whole path to DataObject
35      * @param del - DataObject for removing
36      * @param nodeIdent Node InstanceIdentifier
37      */
38     void remove(InstanceIdentifier<D> identifier, D del,
39             InstanceIdentifier<FlowCapableNode> nodeIdent);
40
41     /**
42      * Method updates the original DataObject to the update DataObject
43      * in device. Both are identified by same InstanceIdentifier
44      *
45      * @param identifier - the whole path to DataObject
46      * @param original - original DataObject (for update)
47      * @param update - changed DataObject (contain updates)
48      * @param nodeIdent Node InstanceIdentifier
49      */
50     void update(InstanceIdentifier<D> identifier, D original, D update,
51             InstanceIdentifier<FlowCapableNode> nodeIdent);
52
53     /**
54      * Method adds the DataObject which is identified by InstanceIdentifier
55      * to device.
56      *
57      * @param identifier - the whole path to new DataObject
58      * @param add - new DataObject
59      * @param nodeIdent Node InstanceIdentifier
60      * @return A future associated with RPC task. {@code null} is set to the
61      *         future if this method does not invoke RPC.
62      */
63     Future<? extends RpcResult<?>> add(InstanceIdentifier<D> identifier, D add,
64             InstanceIdentifier<FlowCapableNode> nodeIdent);
65
66
67     /**
68      * Method creates stale-marked DataObject which is identified by InstanceIdentifier
69      * from device.
70      *
71      * @param identifier - the whole path to DataObject
72      * @param del - DataObject removed. Stale-Mark object to be created from this object
73      * @param nodeIdent Node InstanceIdentifier
74      */
75     void createStaleMarkEntity(InstanceIdentifier<D> identifier, D del,
76                 InstanceIdentifier<FlowCapableNode> nodeIdent);
77
78
79
80     Future<? extends RpcResult<?>> removeWithResult(InstanceIdentifier<D> identifier, D del,
81                                                InstanceIdentifier<FlowCapableNode> nodeIdent);
82
83
84
85 }
86