2 * Copyright (c) 2013 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.
25 * @return ObjectName of newly created module
26 * @throws InstanceAlreadyExistsException
27 * if given ifcName and instanceName is already registered
29 ObjectName createModule(String moduleName, String instanceName)
30 throws InstanceAlreadyExistsException;
33 * Re-creates an existing module configuration bean.
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 name.
39 * @throws InstanceNotFoundException
40 * if module is not found
41 * @throws IllegalArgumentException
42 * if object name contains wrong transaction name or domain
44 void reCreateModule(ObjectName objectName) throws InstanceNotFoundException;
47 * Destroy existing module.
50 * can be either read-only module name that can be obtained using
51 * {@link ConfigRegistry#lookupConfigBean(String, String)} or
52 * writable module name that must contain current transaction
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;
76 * @return transactionName
78 String getTransactionName();
81 * @return all known module factory names as reported by {@link org.opendaylight.controller.config.spi.ModuleFactory#getImplementationName()}
83 Set<String> getAvailableModuleNames();