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