2 * Copyright (c) 2015 China Telecom Beijing Research Institute 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
9 package org.opendaylight.ovsdb.hwvtepsouthbound.transact;
11 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
12 import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
13 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
14 import org.opendaylight.yangtools.yang.binding.Identifiable;
15 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
17 import java.util.ArrayList;
18 import java.util.Collection;
19 import java.util.List;
21 public class TransactCommandAggregator implements TransactCommand {
23 private List<TransactCommand> commands = new ArrayList<TransactCommand>();
25 public TransactCommandAggregator(HwvtepOperationalState state, Collection<DataTreeModification<Node>> changes) {
26 commands.add(new PhysicalSwitchUpdateCommand(state,changes));
27 commands.add(new PhysicalSwitchRemoveCommand(state,changes));
28 commands.add(new LogicalSwitchUpdateCommand(state,changes));
29 commands.add(new LogicalSwitchRemoveCommand(state,changes));
30 commands.add(new PhysicalPortUpdateCommand(state,changes));
31 commands.add(new PhysicalPortRemoveCommand(state,changes));
32 commands.add(new McastMacsRemoteUpdateCommand(state,changes));
33 commands.add(new McastMacsRemoteRemoveCommand(state,changes));
34 commands.add(new McastMacsLocalUpdateCommand(state,changes));
35 commands.add(new McastMacsLocalRemoveCommand(state,changes));
36 commands.add(new UcastMacsRemoteUpdateCommand(state,changes));
37 commands.add(new UcastMacsRemoteRemoveCommand(state,changes));
38 commands.add(new UcastMacsLocalUpdateCommand(state,changes));
39 commands.add(new UcastMacsLocalRemoveCommand(state,changes));
40 commands.add(new TunnelUpdateCommand(state,changes));
41 commands.add(new TunnelRemoveCommand(state,changes));
45 public void execute(TransactionBuilder transaction) {
46 for (TransactCommand command:commands) {
47 command.execute(transaction);
52 public void onConfigUpdate(TransactionBuilder transaction, InstanceIdentifier nodeIid, Identifiable data,
53 InstanceIdentifier key,
54 Object... extraData) {
58 public void doDeviceTransaction(TransactionBuilder transaction, InstanceIdentifier nodeIid, Identifiable data,
59 InstanceIdentifier key,
60 Object... extraData) {