Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 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 | |
Bharat saraswal | 96dfef0 | 2016-06-16 00:29:12 +0530 | [diff] [blame] | 17 | package org.onosproject.yangutils.datamodel; |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 18 | |
Gaurav Agrawal | 95b416c | 2016-06-07 14:00:26 +0530 | [diff] [blame] | 19 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; |
Bharat saraswal | 96dfef0 | 2016-06-16 00:29:12 +0530 | [diff] [blame] | 20 | import org.onosproject.yangutils.datamodel.utils.ResolvableStatus; |
Vinod Kumar S | 427d293 | 2016-04-20 13:02:58 +0530 | [diff] [blame] | 21 | |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 22 | /** |
| 23 | * Abstraction of YANG resolvable information. Abstracted to obtain the |
| 24 | * information required for linking resolution. |
janani b | 23ccc31 | 2016-07-14 19:35:22 +0530 | [diff] [blame^] | 25 | * |
| 26 | * @param <T> YANG resolvable info |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 27 | */ |
janani b | 23ccc31 | 2016-07-14 19:35:22 +0530 | [diff] [blame^] | 28 | public interface Resolvable<T> { |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 29 | |
| 30 | /** |
| 31 | * Returns the status of resolution. If completely resolved returns enum |
| 32 | * value "RESOLVED", if not returns "UNRESOLVED", in case reference of |
| 33 | * grouping/typedef is added to uses/type but it's not resolved |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 34 | * "INTRA_FILE_RESOLVED" is returned. |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 35 | * |
| 36 | * @return status of resolution |
| 37 | */ |
| 38 | ResolvableStatus getResolvableStatus(); |
| 39 | |
| 40 | /** |
| 41 | * Set the status of type/uses resolution. If completely resolved set enum |
| 42 | * value "RESOLVED", if not set it to "UNRESOLVED", in case reference of |
| 43 | * grouping/typedef is added to uses/type but it's not resolved |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 44 | * "INTRA_FILE_RESOLVED" should be set. |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 45 | * |
| 46 | * @param resolvableStatus status of resolution |
| 47 | */ |
| 48 | void setResolvableStatus(ResolvableStatus resolvableStatus); |
| 49 | |
| 50 | /** |
| 51 | * Resolves the linking. |
Vinod Kumar S | 427d293 | 2016-04-20 13:02:58 +0530 | [diff] [blame] | 52 | * |
janani b | 23ccc31 | 2016-07-14 19:35:22 +0530 | [diff] [blame^] | 53 | * @return list of entities to be added for resolution |
Gaurav Agrawal | 95b416c | 2016-06-07 14:00:26 +0530 | [diff] [blame] | 54 | * @throws DataModelException data model exception |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 55 | */ |
janani b | 23ccc31 | 2016-07-14 19:35:22 +0530 | [diff] [blame^] | 56 | T resolve() |
Gaurav Agrawal | 95b416c | 2016-06-07 14:00:26 +0530 | [diff] [blame] | 57 | throws DataModelException; |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 58 | } |