Bharat saraswal | f53b29a | 2016-09-27 15:35:15 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-present Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package org.onosproject.yms.app.ysr; |
| 18 | |
| 19 | import org.onosproject.yangutils.datamodel.YangSchemaNode; |
Bharat saraswal | f53b29a | 2016-09-27 15:35:15 +0530 | [diff] [blame] | 20 | |
| 21 | /** |
| 22 | * Abstraction of entity which provides interfaces to YANG schema registry. |
| 23 | */ |
| 24 | public interface YangSchemaRegistry { |
| 25 | |
| 26 | /** |
| 27 | * Registers applications to YMS. |
| 28 | * |
Gaurav Agrawal | fcc6c19 | 2016-09-20 14:29:15 +0530 | [diff] [blame^] | 29 | * @param managerObject application's object |
| 30 | * @param serviceClass service class to be registered |
Bharat saraswal | f53b29a | 2016-09-27 15:35:15 +0530 | [diff] [blame] | 31 | */ |
Gaurav Agrawal | fcc6c19 | 2016-09-20 14:29:15 +0530 | [diff] [blame^] | 32 | void registerApplication(Object managerObject, Class<?> serviceClass); |
Bharat saraswal | f53b29a | 2016-09-27 15:35:15 +0530 | [diff] [blame] | 33 | |
| 34 | /** |
| 35 | * Unregisters applications to YMS. |
| 36 | * |
| 37 | * @param managerObject application's object |
| 38 | * @param serviceClass service class which needs to be unregistered |
| 39 | */ |
| 40 | void unRegisterApplication(Object managerObject, Class<?> serviceClass); |
| 41 | |
| 42 | /** |
| 43 | * Returns application's implementation's class object. |
| 44 | * |
| 45 | * @param yangSchemaNode application's schema node |
| 46 | * @return application's implementation's class object |
| 47 | */ |
| 48 | Object getRegisteredApplication(YangSchemaNode yangSchemaNode); |
| 49 | |
| 50 | /** |
| 51 | * Returns YANG schema node using schema name. |
| 52 | * |
| 53 | * @param schemaName module name. |
| 54 | * @return YANG schema node using schema name |
| 55 | */ |
| 56 | YangSchemaNode getYangSchemaNodeUsingSchemaName(String schemaName); |
| 57 | |
| 58 | /** |
| 59 | * Returns YANG schema nodes using application name. |
| 60 | * |
| 61 | * @param appName application's service name |
| 62 | * @return YANG schema nodes using application name |
| 63 | */ |
| 64 | YangSchemaNode getYangSchemaNodeUsingAppName(String appName); |
| 65 | |
| 66 | /** |
| 67 | * Returns YANG schema nodes using root interface file name. |
| 68 | * |
| 69 | * @param rootInterfaceFileName name of generated interface file |
| 70 | * for root node |
| 71 | * @return YANG schema nodes using root interface file name |
| 72 | */ |
| 73 | YangSchemaNode |
| 74 | getYangSchemaNodeUsingGeneratedRootNodeInterfaceFileName( |
| 75 | String rootInterfaceFileName); |
| 76 | |
| 77 | /** |
| 78 | * Returns YANG schema nodes using root op param file name. |
| 79 | * |
| 80 | * @param rootOpParamFileName name of generated op param file for root node |
| 81 | * @return YANG schema nodes using root op param file name |
| 82 | */ |
| 83 | YangSchemaNode |
| 84 | getYangSchemaNodeUsingGeneratedRootNodeOpPramFileName( |
| 85 | String rootOpParamFileName); |
| 86 | |
| 87 | /** |
| 88 | * Returns YANG schema node of root for notifications. |
| 89 | * |
| 90 | * @param eventSubject event subject |
| 91 | * @return YANG schema node of root for notifications |
| 92 | */ |
| 93 | YangSchemaNode getRootYangSchemaNodeForNotification(String eventSubject); |
| 94 | |
| 95 | /** |
| 96 | * Returns registered service class. |
| 97 | * |
| 98 | * @param schemaNode YANG schema node |
| 99 | * @param appName application's name |
| 100 | * @return registered service class |
| 101 | */ |
| 102 | Class<?> getRegisteredClass(YangSchemaNode schemaNode, String appName); |
| 103 | |
| 104 | } |