2 * Copyright (c) 2013, 2017 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.controller.config.manager.impl;
10 import java.util.Collections;
11 import java.util.List;
13 import javax.annotation.concurrent.Immutable;
14 import org.opendaylight.controller.config.api.ModuleIdentifier;
15 import org.opendaylight.controller.config.manager.impl.dependencyresolver.DestroyedModule;
16 import org.opendaylight.controller.config.manager.impl.dependencyresolver.ModuleInternalTransactionalInfo;
19 * Structure obtained during first phase commit, contains destroyed modules from
20 * previous transactions that need to be closed and all committed modules with
24 public class CommitInfo {
25 private final List<DestroyedModule> destroyedFromPreviousTransactions;
26 private final Map<ModuleIdentifier, ModuleInternalTransactionalInfo> commitMap;
28 public CommitInfo(final List<DestroyedModule> destroyedFromPreviousTransactions,
29 final Map<ModuleIdentifier, ModuleInternalTransactionalInfo> commitMap) {
30 this.destroyedFromPreviousTransactions = Collections.unmodifiableList(destroyedFromPreviousTransactions);
31 this.commitMap = Collections.unmodifiableMap(commitMap);
35 * Get ordered list of modules that can be closed in the same order, i.e. first
36 * element will be a leaf on which no other module depends, n-th element can
37 * only have dependencies with index smaller than n.
39 * @return list of destroyed modules
41 public List<DestroyedModule> getDestroyedFromPreviousTransactions() {
42 return destroyedFromPreviousTransactions;
45 public Map<ModuleIdentifier, ModuleInternalTransactionalInfo> getCommitted() {