X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Fimpl%2FCommitInfo.java;fp=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Fimpl%2FCommitInfo.java;h=9d086295e3c30fc9b5524357b8e0c1ca3dc96d0a;hb=9fb64948564e252018f9b1e13e7cea2c92f991aa;hp=0000000000000000000000000000000000000000;hpb=1742b3894614be478c333a1043ced8ef1bc5dc84;p=controller.git diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/CommitInfo.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/CommitInfo.java new file mode 100644 index 0000000000..9d086295e3 --- /dev/null +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/CommitInfo.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.config.manager.impl; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import javax.annotation.concurrent.Immutable; + +import org.opendaylight.controller.config.api.ModuleIdentifier; + +/** + * Structure obtained during first phase commit, contains destroyed modules from + * previous transactions that need to be closed and all committed modules with + * meta data. + */ +@Immutable +public class CommitInfo { + private final List destroyedFromPreviousTransactions; + private final Map commitMap; + + public CommitInfo(List destroyedFromPreviousTransactions, + Map commitMap) { + this.destroyedFromPreviousTransactions = Collections + .unmodifiableList(destroyedFromPreviousTransactions); + this.commitMap = Collections.unmodifiableMap(commitMap); + } + + /** + * Get ordered list of modules that can be closed in the same order, i.e. + * first element will be a leaf on which no other module depends, n-th + * element can only have dependencies with index smaller than n. + */ + public List getDestroyedFromPreviousTransactions() { + return destroyedFromPreviousTransactions; + } + + public Map getCommitted() { + return commitMap; + } +}