NETVIRT-1630 migrate to md-sal APIs
[netvirt.git] / elanmanager / impl / src / main / java / org / opendaylight / netvirt / elan / l2gw / ha / commands / IMergeCommand.java
1 /*
2  * Copyright (c) 2016 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 package org.opendaylight.netvirt.elan.l2gw.ha.commands;
9
10 import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
11 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
12 import org.opendaylight.yangtools.concepts.Builder;
13 import org.opendaylight.yangtools.yang.binding.DataObject;
14 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
15
16 public interface IMergeCommand<T extends DataObject, Y extends Builder, Z extends DataObject> {
17
18     /**
19      * Abstract function to merge data from src to dst in Operational Topology.
20      * while existing data helps in keeping track of data only updated
21      * @param dst Builder which will be used to build concrete object
22      * @param existingData dataObject which are already exisitng
23      * @param src dataObjects of source
24      * @param nodePath nodePath of dest
25      */
26     void mergeOperationalData(Y dst,
27                               Z existingData,
28                               Z src,
29                               InstanceIdentifier<Node> nodePath);
30
31     /**
32      * Abstract function to update data from src to dst in Operational Topology.
33      * while existing data helps in keeping track of data only updated
34      * @param existingData dataObject which are already exisitng
35      * @param updatedSrc updated data source
36      * @param origSrc original data source
37      * @param nodePath nodePath of dest
38      * @param tx ReadWriteTransaction
39      */
40     void mergeOpUpdate(Z existingData,
41                        Z updatedSrc,
42                        Z origSrc,
43                        InstanceIdentifier<Node> nodePath,
44                        ReadWriteTransaction tx);
45
46     /**
47      * Abstract function to merge data from src to dst in Config Topology.
48      * @param dst builder which will be used to build concrete object
49      * @param src builder which are to be merged in destination
50      * @param nodePath nodePath of dest
51      */
52     void mergeConfigData(Y dst,
53                          Z src,
54                          InstanceIdentifier<Node> nodePath);
55 }