import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
+import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
public class TransactCommandAggregator implements TransactCommand {
private List<TransactCommand> commands = new ArrayList<TransactCommand>();
- private AsyncDataChangeEvent<InstanceIdentifier<?>, OvsdbBridgeAugmentation> changes;
+ private AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes;
+ private BridgeOperationalState operationalState;
- public TransactCommandAggregator(AsyncDataChangeEvent<InstanceIdentifier<?>, OvsdbBridgeAugmentation> changes) {
- this.changes=changes;
- commands.add(new BridgeCreateCommand(changes));
+ public TransactCommandAggregator(BridgeOperationalState state,AsyncDataChangeEvent<InstanceIdentifier<?>,
+ DataObject> changes) {
+ this.operationalState = state;
+ this.changes = changes;
+ commands.add(new BridgeCreateCommand(state,changes));
+ commands.add(new OpenVSwitchBridgeAddCommand());
+ commands.add(new ControllerUpdateCommand(state,changes));
+ commands.add(new ControllerRemovedCommand(state,changes));
+ commands.add(new BridgeRemovedCommand(state,changes));
+ commands.add(new TerminationPointCreateCommand(state,changes));
+ commands.add(new TerminationPointDeleteCommand(state, changes));
+ commands.add(new OvsdbNodeUpdateCommand(changes));
}
@Override
public void execute(TransactionBuilder transaction) {
- for(TransactCommand command:commands) {
+ for (TransactCommand command:commands) {
command.execute(transaction);
}
}