Fix checkstyle issues to enforce it
[controller.git] / opendaylight / config / config-manager / src / main / java / org / opendaylight / controller / config / manager / impl / ConfigTransactionControllerInternal.java
1 /*
2  * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.config.manager.impl;
9
10 import java.util.Collection;
11 import java.util.List;
12 import javax.management.ObjectName;
13 import org.opendaylight.controller.config.api.ModuleIdentifier;
14 import org.opendaylight.controller.config.api.ValidationException;
15 import org.opendaylight.controller.config.spi.ModuleFactory;
16 import org.osgi.framework.BundleContext;
17
18 /**
19  * Defines contract between {@link ConfigTransactionControllerImpl} (producer)
20  * and {@link ConfigRegistryImpl} (consumer).
21  */
22 interface ConfigTransactionControllerInternal extends ConfigTransactionControllerImplMXBean, AutoCloseable {
23
24     /**
25      * 1, Copy already committed modules to current transaction. 2, Diff: compute
26      * added and removed factories from last run, then create new modules using
27      * {@link org.opendaylight.controller.config.spi
28      * .ModuleFactory#getDefaultModules(org.opendaylight.controller
29      * .config .api.DependencyResolverFactory, BundleContext)}
30      * and remove modules belonging to removed factories.
31      *
32      * @param entries
33      *            entries
34      * @param lastListOfFactories
35      *            list of factories
36      */
37     void copyExistingModulesAndProcessFactoryDiff(Collection<ModuleInternalInfo> entries,
38             List<ModuleFactory> lastListOfFactories);
39
40     /**
41      * Call {@link org.opendaylight.controller.config.spi.Module#validate()} on all
42      * beans in transaction. Lock transaction after successful validation. This
43      * method can be called multiple times if validation fails, but cannot be called
44      * after it did not throw exception.
45      *
46      * @return CommitInfo commit info
47      */
48     CommitInfo validateBeforeCommitAndLockTransaction() throws ValidationException;
49
50     /**
51      * Call {@link org.opendaylight.controller.config.spi.Module#getInstance()} on
52      * all beans in transaction. This method can be only called once.
53      *
54      * @return ordered list of module identifiers that respects dependency order
55      */
56     List<ModuleIdentifier> secondPhaseCommit();
57
58     /**
59      * Gets the objectName of this transaction controller.
60      *
61      * @return ObjectName
62      */
63     ObjectName getControllerObjectName();
64
65     /**
66      * Check if the transaction was committed or aborted.
67      *
68      * @return result of transaction
69      */
70     boolean isClosed();
71
72     List<ModuleFactory> getCurrentlyRegisteredFactories();
73
74     BundleContext getModuleFactoryBundleContext(String factoryName);
75
76     SearchableServiceReferenceWritableRegistry getWritableRegistry();
77
78     TransactionIdentifier getTransactionIdentifier();
79
80     @Override
81     void close();
82 }