426edc1dec9fb4f38bf9f9d2b63cbaedb9ac26b5
[controller.git] / opendaylight / config / config-api / src / main / java / org / opendaylight / controller / config / api / ConfigRegistry.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.List;
11 import java.util.Set;
12 import javax.management.ObjectName;
13 import org.opendaylight.controller.config.api.jmx.CommitStatus;
14 import org.opendaylight.controller.config.api.jmx.constants.ConfigRegistryConstants;
15
16 /**
17  * Provides functionality for working with configuration registry - mainly
18  * creating and committing config transactions.
19  */
20 public interface ConfigRegistry extends LookupRegistry, ServiceReferenceReadableRegistry {
21
22     /**
23      * Only well-known ObjectName in configuration system, under which
24      * ConfigRegistry is registered.
25      */
26     ObjectName OBJECT_NAME = ConfigRegistryConstants.OBJECT_NAME;
27     ObjectName OBJECT_NAME_NO_NOTIFICATIONS = ConfigRegistryConstants.OBJECT_NAME_NO_NOTIFICATIONS;
28
29     /**
30      * Opens new configuration transaction.
31      *
32      * @return {@link ObjectName} of
33      *         {@link org.opendaylight.controller.config.api.jmx.ConfigTransactionControllerMXBean}
34      */
35     ObjectName beginConfig();
36
37     /**
38      * Verifies and commits transaction.
39      *
40      * @param transactionControllerON
41      *            {@link ObjectName} of
42      *            {@link org.opendaylight.controller.config.api.jmx.ConfigTransactionControllerMXBean} that was
43      *            received in {@link #beginConfig()} method call.
44      * @return CommitStatus
45      * @throws ValidationException
46      *             if validation fails
47      * @throws ConflictingVersionException
48      *             if configuration state was changed
49      */
50     CommitStatus commitConfig(ObjectName transactionControllerON)
51             throws ConflictingVersionException, ValidationException;
52
53     /**
54      * @return list of open configuration transactions.
55      */
56     List<ObjectName> getOpenConfigs();
57
58     /**
59      * Will return true unless there was a transaction that succeeded during
60      * validation but failed in second phase of commit. In this case the server
61      * is unstable and its state is undefined.
62      */
63     boolean isHealthy();
64
65     /**
66      * @return module factory names available in the system
67      */
68     Set<String> getAvailableModuleNames();
69
70 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.