elanmanager dead code removal
[netvirt.git] / elanmanager / impl / src / main / java / org / opendaylight / netvirt / elan / l2gw / ha / handlers / HAEventHandler.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.handlers;
9
10 import javax.inject.Inject;
11 import javax.inject.Singleton;
12 import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
13 import org.opendaylight.genius.infra.Datastore.Configuration;
14 import org.opendaylight.genius.infra.Datastore.Operational;
15 import org.opendaylight.genius.infra.TypedReadWriteTransaction;
16 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
17 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
18
19 @Singleton
20 public class HAEventHandler implements IHAEventHandler {
21
22     private final ConfigNodeUpdatedHandler configNodeUpdatedHandler = new ConfigNodeUpdatedHandler();
23     private final OpNodeUpdatedHandler opNodeUpdatedHandler = new OpNodeUpdatedHandler();
24
25     @Inject
26     public HAEventHandler() {
27     }
28
29     @Override
30     public void copyChildGlobalOpUpdateToHAParent(InstanceIdentifier<Node> haPath,
31                                                   DataObjectModification<Node> mod,
32                                                   TypedReadWriteTransaction<Operational> tx) {
33         if (haPath == null) {
34             return;
35         }
36         opNodeUpdatedHandler.copyChildGlobalOpUpdateToHAParent(haPath, mod, tx);
37     }
38
39     @Override
40     public void copyChildPsOpUpdateToHAParent(Node updatedSrcPSNode,
41                                               InstanceIdentifier<Node> haPath,
42                                               DataObjectModification<Node> mod,
43                                               TypedReadWriteTransaction<Operational> tx) {
44         if (haPath == null) {
45             return;
46         }
47         opNodeUpdatedHandler.copyChildPsOpUpdateToHAParent(updatedSrcPSNode, haPath, mod, tx);
48     }
49
50     @Override
51     public void copyHAPSUpdateToChild(InstanceIdentifier<Node> haChildNodeId,
52                                       DataObjectModification<Node> mod,
53                                       TypedReadWriteTransaction<Configuration> tx) {
54         if (haChildNodeId == null) {
55             return;
56         }
57         configNodeUpdatedHandler.copyHAPSUpdateToChild(haChildNodeId, mod, tx);
58     }
59
60     @Override
61     public void copyHAGlobalUpdateToChild(InstanceIdentifier<Node> haChildNodeId,
62                                           DataObjectModification<Node> mod,
63                                           TypedReadWriteTransaction<Configuration> tx) {
64         if (haChildNodeId == null) {
65             return;
66         }
67         configNodeUpdatedHandler.copyHAGlobalUpdateToChild(haChildNodeId, mod, tx);
68     }
69
70 }