2 * Copyright (c) 2014 Cisco Systems, Inc. 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.ovsdb.southbound.ovsdb.transact;
10 import java.util.ArrayList;
11 import java.util.List;
13 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
14 import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
15 import org.opendaylight.yangtools.yang.binding.DataObject;
16 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
18 public class TransactCommandAggregator implements TransactCommand {
20 private List<TransactCommand> commands = new ArrayList<TransactCommand>();
21 private AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes;
22 private BridgeOperationalState operationalState;
24 public TransactCommandAggregator(BridgeOperationalState state,AsyncDataChangeEvent<InstanceIdentifier<?>,
25 DataObject> changes) {
26 this.operationalState = state;
27 this.changes = changes;
28 commands.add(new BridgeCreateCommand(state,changes));
29 commands.add(new OpenVSwitchBridgeAddCommand());
30 commands.add(new BridgeRemovedCommand(state,changes));
31 commands.add(new TerminationPointCreateCommand(state,changes));
32 commands.add(new TerminationPointDeleteCommand(state, changes));
33 commands.add(new OvsdbNodeUpdateCommand(changes));
37 public void execute(TransactionBuilder transaction) {
38 for (TransactCommand command:commands) {
39 command.execute(transaction);