2 * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
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
8 package org.opendaylight.netvirt.elan.l2gw.ha.handlers;
10 import javax.inject.Inject;
11 import javax.inject.Singleton;
12 import org.opendaylight.mdsal.binding.api.DataObjectModification;
13 import org.opendaylight.mdsal.binding.util.Datastore.Configuration;
14 import org.opendaylight.mdsal.binding.util.Datastore.Operational;
15 import org.opendaylight.mdsal.binding.util.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;
20 public class HAEventHandler implements IHAEventHandler {
22 private final ConfigNodeUpdatedHandler configNodeUpdatedHandler = new ConfigNodeUpdatedHandler();
23 private final OpNodeUpdatedHandler opNodeUpdatedHandler = new OpNodeUpdatedHandler();
26 public HAEventHandler() {
30 public void copyChildGlobalOpUpdateToHAParent(InstanceIdentifier<Node> haPath,
31 DataObjectModification<Node> mod,
32 TypedReadWriteTransaction<Operational> tx) {
36 opNodeUpdatedHandler.copyChildGlobalOpUpdateToHAParent(haPath, mod, tx);
40 public void copyChildPsOpUpdateToHAParent(Node updatedSrcPSNode,
41 InstanceIdentifier<Node> haPath,
42 DataObjectModification<Node> mod,
43 TypedReadWriteTransaction<Operational> tx) {
47 opNodeUpdatedHandler.copyChildPsOpUpdateToHAParent(updatedSrcPSNode, haPath, mod, tx);
51 public void copyHAPSUpdateToChild(InstanceIdentifier<Node> haChildNodeId,
52 DataObjectModification<Node> mod,
53 TypedReadWriteTransaction<Configuration> tx) {
54 if (haChildNodeId == null) {
57 configNodeUpdatedHandler.copyHAPSUpdateToChild(haChildNodeId, mod, tx);
61 public void copyHAGlobalUpdateToChild(InstanceIdentifier<Node> haChildNodeId,
62 DataObjectModification<Node> mod,
63 TypedReadWriteTransaction<Configuration> tx) {
64 if (haChildNodeId == null) {
67 configNodeUpdatedHandler.copyHAGlobalUpdateToChild(haChildNodeId, mod, tx);