Merge "Fail build on checkstyle errors"
[ovsdb.git] / southbound / southbound-impl / src / main / java / org / opendaylight / ovsdb / southbound / transactions / md / OvsdbOperationalCommandAggregator.java
1 package org.opendaylight.ovsdb.southbound.transactions.md;
2
3 import java.util.ArrayList;
4 import java.util.List;
5
6 import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
7 import org.opendaylight.ovsdb.lib.message.TableUpdates;
8 import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
9 import org.opendaylight.ovsdb.southbound.OvsdbClientKey;
10
11 public class OvsdbOperationalCommandAggregator implements TransactionCommand {
12
13
14     private List<TransactionCommand> commands = new ArrayList<TransactionCommand>();
15
16     public OvsdbOperationalCommandAggregator(OvsdbClientKey key,TableUpdates updates, DatabaseSchema dbSchema) {
17         commands.add(new OvsdbBridgeUpdateCommand(key, updates,  dbSchema));
18         commands.add(new OvsdbBridgeRemovedCommand(key, updates,  dbSchema));
19         commands.add(new OvsdbPortUpdateCommand(key, updates, dbSchema));
20         commands.add(new OvsdbPortRemoveCommand(key, updates, dbSchema));
21         commands.add(new OpenVSwitchUpdateCommand(key, updates, dbSchema));
22     }
23
24     @Override
25     public void execute(ReadWriteTransaction transaction) {
26         for (TransactionCommand command: commands) {
27             command.execute(transaction);
28         }
29     }
30 }