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.api;
11 import javax.management.InstanceAlreadyExistsException;
12 import javax.management.InstanceNotFoundException;
13 import javax.management.ObjectName;
16 * Represents functionality provided by configuration transaction.
18 public interface ConfigTransactionController extends LookupRegistry, ServiceReferenceWritableRegistry {
21 * Create new configuration bean.
26 * name of the instance
27 * @return ObjectName of newly created module
28 * @throws InstanceAlreadyExistsException
29 * if given ifcName and instanceName is already registered
31 ObjectName createModule(String moduleName, String instanceName) throws InstanceAlreadyExistsException;
34 * Re-creates an existing module configuration bean.
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 name.
40 * @throws InstanceNotFoundException
41 * if module is not found
42 * @throws IllegalArgumentException
43 * if object name contains wrong transaction name or domain
45 void reCreateModule(ObjectName objectName) throws InstanceNotFoundException;
48 * Destroy existing module.
51 * can be either read-only module name that can be obtained using
52 * {@link ConfigRegistry#lookupConfigBean(String, String)} or
53 * writable module name that must contain current transaction name.
54 * @throws InstanceNotFoundException
55 * if module is not found
56 * @throws IllegalArgumentException
57 * if object name contains wrong transaction name or domain
59 void destroyModule(ObjectName objectName) throws InstanceNotFoundException;
62 * Destroy current transaction.
67 * This method can be called multiple times, has no side effects.
69 * @throws ValidationException
72 void validateConfig() throws ValidationException;
75 * Get the name of the transaction.
77 * @return transactionName
79 String getTransactionName();
82 * Get the names of all available modules.
84 * @return all known module factory names as reported by
85 * {@link org.opendaylight.controller.config.spi.ModuleFactory#getImplementationName()}
87 Set<String> getAvailableModuleNames();