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
9 package org.opendaylight.controller.cluster.datastore.modification;
11 import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
13 import java.util.ArrayList;
14 import java.util.List;
17 * CompositeModification contains a list of modifications that need to be applied to the DOMStore
19 * A CompositeModification gets stored in the transaction log for a Shard. During recovery when the transaction log
20 * is being replayed a DOMStoreWriteTransaction could be created and a CompositeModification could be applied to it.
23 public class CompositeModification implements Modification {
24 private final List<Modification> modifications = new ArrayList<>();
27 public void apply(DOMStoreWriteTransaction transaction) {
28 for(Modification modification : modifications){
29 modification.apply(transaction);
33 public void addModification(Modification modification){
34 modifications.add(modification);