Fix checkstyle issues to enforce it
[controller.git] / opendaylight / config / config-api / src / main / java / org / opendaylight / controller / config / api / ServiceReferenceReadableRegistry.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.Map;
11 import java.util.Set;
12 import javax.management.InstanceNotFoundException;
13 import javax.management.ObjectName;
14
15 public interface ServiceReferenceReadableRegistry {
16
17     /**
18      * Lookup object name by fully qualified service interface name and service
19      * reference name.
20      *
21      * @param serviceInterfaceQName
22      *            service interface name
23      * @param refName
24      *            service reference name supplied in
25      *            {@link org.opendaylight.controller.config
26      *            .api .ConfigTransactionController#saveServiceReference(String, String, javax.management.ObjectName)}
27      * @throws java.lang.IllegalArgumentException
28      *             if module not found
29      */
30     ObjectName lookupConfigBeanByServiceInterfaceName(String serviceInterfaceQName, String refName);
31
32     /**
33      * Get mapping of services to reference names and module object names.
34      */
35     Map<String /* serviceInterfaceQName */, Map<String/* refName */, ObjectName>> getServiceMapping();
36
37     /**
38      * Get current mapping between reference names and module object names for given
39      * service interface name.
40      *
41      * @param serviceInterfaceQName
42      *            service interface name
43      * @throws IllegalArgumentException
44      *             if there is a mismatch between serviceInterfaceName and
45      *             objectName
46      */
47     Map<String /* refName */, ObjectName> lookupServiceReferencesByServiceInterfaceName(String serviceInterfaceQName);
48
49     /**
50      * Find all available service interface names of a module.
51      *
52      * @param objectName
53      *            module object name
54      * @throws InstanceNotFoundException
55      *             if search did not find exactly one instance
56      */
57     Set<String> lookupServiceInterfaceNames(ObjectName objectName) throws InstanceNotFoundException;
58
59     /**
60      * Get the name of the service interface.
61      *
62      * @param namespace
63      *            service interface namespace
64      * @param localName
65      *            service interface local name
66      * @return fully qualified name needed by all other service reference mapping
67      *         methods.
68      * @throws java.lang.IllegalArgumentException
69      *             if namespace or localName is not found
70      */
71     String getServiceInterfaceName(String namespace, String localName);
72
73     /**
74      * Get the reference to that service.
75      *
76      * @return ObjectName with type=Service that was created using
77      *         {@link org.opendaylight.controller
78      *         .config .api.ServiceReferenceWritableRegistry#saveServiceReference(String,
79      *          String, javax.management.ObjectName)}
80      */
81     ObjectName getServiceReference(String serviceInterfaceQName, String refName) throws InstanceNotFoundException;
82
83     void checkServiceReferenceExists(ObjectName objectName) throws InstanceNotFoundException;
84 }

©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.