5d9c693d64f18f834115c32275992747b513c970
[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.DataTreeChangeListener;
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
16 /**
17  * forwardingrules-manager
18  * org.opendaylight.openflowplugin.applications.frm
19  *
20  * ForwardingRulesCommiter
21  * It represent a contract between DataStore DataChangeEvent and relevant
22  * SalRpcService for device. Every implementation has to be registered for
23  * Configurational/DS tree path.
24  *
25  * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
26  *
27  * Created: Aug 25, 2014
28  */
29 public interface ForwardingRulesCommiter <D extends DataObject> extends AutoCloseable, DataTreeChangeListener<D> {
30
31     /**
32      * Method removes DataObject which is identified by InstanceIdentifier
33      * from device.
34      *
35      * @param identifier - the whole path to DataObject
36      * @param del - DataObject for removing
37      * @param nodeIdent Node InstanceIdentifier
38      */
39     void remove(InstanceIdentifier<D> identifier, D del,
40             InstanceIdentifier<FlowCapableNode> nodeIdent);
41
42     /**
43      * Method updates the original DataObject to the update DataObject
44      * in device. Both are identified by same InstanceIdentifier
45      *
46      * @param identifier - the whole path to DataObject
47      * @param original - original DataObject (for update)
48      * @param update - changed DataObject (contain updates)
49      * @param nodeIdent Node InstanceIdentifier
50      */
51     void update(InstanceIdentifier<D> identifier, D original, D update,
52             InstanceIdentifier<FlowCapableNode> nodeIdent);
53
54     /**
55      * Method adds the DataObject which is identified by InstanceIdentifier
56      * to device.
57      *
58      * @param identifier - the whole path to new DataObject
59      * @param add - new DataObject
60      * @param nodeIdent Node InstanceIdentifier
61      */
62     void add(InstanceIdentifier<D> identifier, D add,
63             InstanceIdentifier<FlowCapableNode> nodeIdent);
64
65 }
66