bcac188ab36cdac7ec24ae2feab84e04ea01ac4c
[controller.git] / opendaylight / config / config-api / src / main / java / org / opendaylight / controller / config / api / jmx / constants / ConfigRegistryConstants.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.jmx.constants;
9
10 import javax.management.MalformedObjectNameException;
11 import javax.management.ObjectName;
12
13 public class ConfigRegistryConstants {
14
15     private ConfigRegistryConstants() {
16     }
17
18     public static final String TYPE_CONFIG_REGISTRY = "ConfigRegistry";
19
20     public static final String TYPE_CONFIG_REGISTRY_NO_NOTIFICATIONS = "ConfigRegistryNoNotifications";
21
22     public static final String ON_DOMAIN = "org.opendaylight.controller";
23
24     public static final String TYPE_KEY = "type";
25
26     public static final ObjectName OBJECT_NAME = createONWithDomainAndType(TYPE_CONFIG_REGISTRY);
27
28     public static final ObjectName OBJECT_NAME_NO_NOTIFICATIONS = createONWithDomainAndType(TYPE_CONFIG_REGISTRY_NO_NOTIFICATIONS);
29
30     public static final String GET_AVAILABLE_MODULE_NAMES_ATTRIBUT_NAME = "AvailableModuleNames";
31
32     public static ObjectName createONWithDomainAndType(String type) {
33         return createON(ON_DOMAIN, TYPE_KEY, type);
34     }
35
36     public static ObjectName createON(String name, String key, String value) {
37         try {
38             return new ObjectName(name, key, value);
39         } catch (MalformedObjectNameException e) {
40             throw new IllegalArgumentException(e);
41         }
42
43     }
44 }