Fix checkstyle simplify boolean expression config-api
[controller.git] / opendaylight / config / config-api / src / main / java / org / opendaylight / controller / config / api / ConfigTransactionController.java
1 /*
2  * Copyright (c) 2013 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.api;
9
10 import java.util.Set;
11 import javax.management.InstanceAlreadyExistsException;
12 import javax.management.InstanceNotFoundException;
13 import javax.management.ObjectName;
14
15 /**
16  * Represents functionality provided by configuration transaction.
17  */
18 public interface ConfigTransactionController extends LookupRegistry, ServiceReferenceWritableRegistry {
19
20     /**
21      * Create new configuration bean.
22      *
23      * @param moduleName
24      * @param instanceName
25      * @return ObjectName of newly created module
26      * @throws InstanceAlreadyExistsException
27      *             if given ifcName and instanceName is already registered
28      */
29     ObjectName createModule(String moduleName, String instanceName)
30             throws InstanceAlreadyExistsException;
31
32     /**
33      * Destroy existing module.
34      *
35      * @param objectName
36      *            can be either read-only module name that can be obtained using
37      *            {@link ConfigRegistry#lookupConfigBean(String, String)} or
38      *            writable module name that must contain current transaction
39      *            name.
40      * @throws InstanceNotFoundException
41      *             if module is not found
42      * @throws IllegalArgumentException
43      *             if object name contains wrong transaction name or domain
44      */
45     void destroyModule(ObjectName objectName) throws InstanceNotFoundException;
46
47     /**
48      * Destroy current transaction.
49      */
50     void abortConfig();
51
52     /**
53      * This method can be called multiple times, has no side effects.
54      *
55      * @throws ValidationException
56      *             if validation fails
57      */
58     void validateConfig() throws ValidationException;
59
60     /**
61      *
62      * @return transactionName
63      */
64     String getTransactionName();
65
66     /**
67      * @return all known module factory names as reported by {@link org.opendaylight.controller.config.spi.ModuleFactory#getImplementationName()}
68      */
69     Set<String> getAvailableModuleNames();
70
71 }