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; |
| 20 | import org.onosproject.yms.app.ynh.YangNotificationExtendedService; |
| 21 | |
| 22 | /** |
| 23 | * Abstraction of entity which provides interfaces to YANG schema registry. |
| 24 | */ |
| 25 | public interface YangSchemaRegistry { |
| 26 | |
| 27 | /** |
| 28 | * Registers applications to YMS. |
| 29 | * |
| 30 | * @param managerObject application's object |
| 31 | * @param serviceClass service class which needs to be |
| 32 | * registered |
| 33 | * @param notificationExtendedService notification extended service to |
| 34 | * register application object with YNH |
| 35 | */ |
| 36 | void registerApplication(Object managerObject, Class<?> serviceClass, |
| 37 | YangNotificationExtendedService |
| 38 | notificationExtendedService); |
| 39 | |
| 40 | /** |
| 41 | * Unregisters applications to YMS. |
| 42 | * |
| 43 | * @param managerObject application's object |
| 44 | * @param serviceClass service class which needs to be unregistered |
| 45 | */ |
| 46 | void unRegisterApplication(Object managerObject, Class<?> serviceClass); |
| 47 | |
| 48 | /** |
| 49 | * Returns application's implementation's class object. |
| 50 | * |
| 51 | * @param yangSchemaNode application's schema node |
| 52 | * @return application's implementation's class object |
| 53 | */ |
| 54 | Object getRegisteredApplication(YangSchemaNode yangSchemaNode); |
| 55 | |
| 56 | /** |
| 57 | * Returns YANG schema node using schema name. |
| 58 | * |
| 59 | * @param schemaName module name. |
| 60 | * @return YANG schema node using schema name |
| 61 | */ |
| 62 | YangSchemaNode getYangSchemaNodeUsingSchemaName(String schemaName); |
| 63 | |
| 64 | /** |
| 65 | * Returns YANG schema nodes using application name. |
| 66 | * |
| 67 | * @param appName application's service name |
| 68 | * @return YANG schema nodes using application name |
| 69 | */ |
| 70 | YangSchemaNode getYangSchemaNodeUsingAppName(String appName); |
| 71 | |
| 72 | /** |
| 73 | * Returns YANG schema nodes using root interface file name. |
| 74 | * |
| 75 | * @param rootInterfaceFileName name of generated interface file |
| 76 | * for root node |
| 77 | * @return YANG schema nodes using root interface file name |
| 78 | */ |
| 79 | YangSchemaNode |
| 80 | getYangSchemaNodeUsingGeneratedRootNodeInterfaceFileName( |
| 81 | String rootInterfaceFileName); |
| 82 | |
| 83 | /** |
| 84 | * Returns YANG schema nodes using root op param file name. |
| 85 | * |
| 86 | * @param rootOpParamFileName name of generated op param file for root node |
| 87 | * @return YANG schema nodes using root op param file name |
| 88 | */ |
| 89 | YangSchemaNode |
| 90 | getYangSchemaNodeUsingGeneratedRootNodeOpPramFileName( |
| 91 | String rootOpParamFileName); |
| 92 | |
| 93 | /** |
| 94 | * Returns YANG schema node of root for notifications. |
| 95 | * |
| 96 | * @param eventSubject event subject |
| 97 | * @return YANG schema node of root for notifications |
| 98 | */ |
| 99 | YangSchemaNode getRootYangSchemaNodeForNotification(String eventSubject); |
| 100 | |
| 101 | /** |
| 102 | * Returns registered service class. |
| 103 | * |
| 104 | * @param schemaNode YANG schema node |
| 105 | * @param appName application's name |
| 106 | * @return registered service class |
| 107 | */ |
| 108 | Class<?> getRegisteredClass(YangSchemaNode schemaNode, String appName); |
| 109 | |
| 110 | } |