Merge "Bug 4789 - allowed address pair doesn't have port id"
[ovsdb.git] / hwvtepsouthbound / hwvtepsouthbound-impl / src / main / java / org / opendaylight / ovsdb / hwvtepsouthbound / transactions / md / HwvtepOperationalCommandAggregator.java
1 /*
2  * Copyright (c) 2015 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
9 package org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md;
10
11 import java.util.ArrayList;
12 import java.util.List;
13
14 import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
15 import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionInstance;
16 import org.opendaylight.ovsdb.lib.message.TableUpdates;
17 import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
18
19 public class HwvtepOperationalCommandAggregator implements TransactionCommand {
20
21     private List<TransactionCommand> commands = new ArrayList<>();
22
23     public HwvtepOperationalCommandAggregator(HwvtepConnectionInstance key,TableUpdates updates,
24             DatabaseSchema dbSchema) {
25         commands.add(new GlobalUpdateCommand(key, updates, dbSchema));
26         commands.add(new PhysicalSwitchUpdateCommand(key, updates, dbSchema));
27         commands.add(new PhysicalSwitchRemoveCommand(key, updates, dbSchema));
28         commands.add(new HwvtepManagerUpdateCommand(key, updates, dbSchema));
29         commands.add(new HwvtepManagerRemoveCommand(key, updates, dbSchema));
30         commands.add(new LogicalSwitchUpdateCommand(key, updates, dbSchema));
31         commands.add(new LogicalSwitchRemoveCommand(key, updates, dbSchema));
32         commands.add(new PhysicalPortUpdateCommand(key, updates, dbSchema));
33         commands.add(new PhysicalPortRemoveCommand(key, updates, dbSchema));
34         commands.add(new PhysicalLocatorUpdateCommand(key, updates, dbSchema));
35         commands.add(new PhysicalLocatorRemoveCommand(key, updates, dbSchema));
36         commands.add(new UcastMacsLocalUpdateCommand(key, updates, dbSchema));
37         commands.add(new UcastMacsRemoteUpdateCommand(key, updates, dbSchema));
38         commands.add(new McastMacsLocalUpdateCommand(key, updates, dbSchema));
39         commands.add(new McastMacsRemoteUpdateCommand(key, updates, dbSchema));
40         commands.add(new MacEntriesRemoveCommand(key, updates, dbSchema));
41     }
42
43     @Override
44     public void execute(ReadWriteTransaction transaction) {
45         for (TransactionCommand command: commands) {
46             command.execute(transaction);
47         }
48     }
49 }