Fix so that operational store correctly removes controller entries
[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 OvsdbControllerUpdateCommand(key, updates,  dbSchema));
20         commands.add(new OvsdbControllerRemovedCommand(key, updates,  dbSchema));
21         commands.add(new OvsdbPortUpdateCommand(key, updates, dbSchema));
22         commands.add(new OvsdbPortRemoveCommand(key, updates, dbSchema));
23         commands.add(new OpenVSwitchUpdateCommand(key, updates, dbSchema));
24     }
25
26     @Override
27     public void execute(ReadWriteTransaction transaction) {
28         for (TransactionCommand command: commands) {
29             command.execute(transaction);
30         }
31     }
32 }