Gaurav Agrawal | 1fbfae1 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 0f7908b | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Gaurav Agrawal | 1fbfae1 | 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 | |
Gaurav Agrawal | ab7c4bd | 2016-05-17 18:06:38 +0530 | [diff] [blame^] | 17 | package org.onosproject.yangutils.linker.impl; |
Gaurav Agrawal | 1fbfae1 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 18 | |
| 19 | import java.util.List; |
Gaurav Agrawal | ab7c4bd | 2016-05-17 18:06:38 +0530 | [diff] [blame^] | 20 | import java.util.Set; |
| 21 | import org.onosproject.yangutils.datamodel.YangImport; |
| 22 | import org.onosproject.yangutils.datamodel.YangInclude; |
Gaurav Agrawal | 1fbfae1 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 23 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; |
Gaurav Agrawal | ab7c4bd | 2016-05-17 18:06:38 +0530 | [diff] [blame^] | 24 | import org.onosproject.yangutils.linker.exceptions.LinkerException; |
| 25 | import org.onosproject.yangutils.plugin.manager.YangFileInfo; |
Gaurav Agrawal | 1fbfae1 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 26 | |
| 27 | /** |
| 28 | * Abstraction of YANG dependency resolution information. Abstracted to obtain the |
| 29 | * resolution information. |
| 30 | */ |
Vinod Kumar S | 79a374b | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 31 | public interface YangReferenceResolver { |
Gaurav Agrawal | 1fbfae1 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 32 | |
| 33 | /** |
| 34 | * Returns unresolved resolution list. |
| 35 | * |
| 36 | * @return unresolved resolution list |
| 37 | */ |
| 38 | List<YangResolutionInfo> getUnresolvedResolutionList(); |
| 39 | |
| 40 | /** |
Gaurav Agrawal | ab7c4bd | 2016-05-17 18:06:38 +0530 | [diff] [blame^] | 41 | * Adds to the resolution list. |
Gaurav Agrawal | 1fbfae1 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 42 | * |
| 43 | * @param resolutionInfo resolution information |
| 44 | */ |
| 45 | void addToResolutionList(YangResolutionInfo resolutionInfo); |
| 46 | |
| 47 | /** |
| 48 | * Creates resolution list. |
| 49 | * |
| 50 | * @param resolutionList resolution list |
| 51 | */ |
| 52 | void setResolutionList(List<YangResolutionInfo> resolutionList); |
| 53 | |
| 54 | /** |
| 55 | * Returns unresolved imported list. |
| 56 | * |
| 57 | * @return unresolved imported list |
| 58 | */ |
| 59 | List<YangImport> getImportList(); |
| 60 | |
| 61 | /** |
Gaurav Agrawal | ab7c4bd | 2016-05-17 18:06:38 +0530 | [diff] [blame^] | 62 | * Adds to the import list. |
Gaurav Agrawal | 1fbfae1 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 63 | * |
| 64 | * @param yangImport import to be added |
| 65 | */ |
| 66 | void addToImportList(YangImport yangImport); |
| 67 | |
| 68 | /** |
| 69 | * Create import list. |
| 70 | * |
| 71 | * @param importList import list |
| 72 | */ |
| 73 | void setImportList(List<YangImport> importList); |
| 74 | |
| 75 | /** |
| 76 | * Returns unresolved include list. |
| 77 | * |
| 78 | * @return unresolved include list |
| 79 | */ |
| 80 | List<YangInclude> getIncludeList(); |
| 81 | |
| 82 | /** |
Gaurav Agrawal | ab7c4bd | 2016-05-17 18:06:38 +0530 | [diff] [blame^] | 83 | * Adds to the include list. |
Gaurav Agrawal | 1fbfae1 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 84 | * |
| 85 | * @param yangInclude include to be added |
| 86 | */ |
| 87 | void addToIncludeList(YangInclude yangInclude); |
| 88 | |
| 89 | /** |
Gaurav Agrawal | ab7c4bd | 2016-05-17 18:06:38 +0530 | [diff] [blame^] | 90 | * Creates include list. |
Gaurav Agrawal | 1fbfae1 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 91 | * |
| 92 | * @param includeList include list |
| 93 | */ |
| 94 | void setIncludeList(List<YangInclude> includeList); |
| 95 | |
| 96 | /** |
| 97 | * Returns prefix of resolution root node. |
| 98 | * |
| 99 | * @return prefix resolution root node prefix |
| 100 | */ |
| 101 | String getPrefix(); |
| 102 | |
| 103 | /** |
Gaurav Agrawal | ab7c4bd | 2016-05-17 18:06:38 +0530 | [diff] [blame^] | 104 | * Sets prefix of resolution list root node. |
Gaurav Agrawal | 1fbfae1 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 105 | * |
| 106 | * @param prefix resolution root node prefix |
| 107 | */ |
| 108 | void setPrefix(String prefix); |
| 109 | |
| 110 | /** |
Gaurav Agrawal | ab7c4bd | 2016-05-17 18:06:38 +0530 | [diff] [blame^] | 111 | * Resolves self file linking. |
Gaurav Agrawal | 1fbfae1 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 112 | * |
| 113 | * @throws DataModelException a violation in data model rule |
| 114 | */ |
| 115 | void resolveSelfFileLinking() throws DataModelException; |
Gaurav Agrawal | ab7c4bd | 2016-05-17 18:06:38 +0530 | [diff] [blame^] | 116 | |
| 117 | /** |
| 118 | * Resolves inter file linking. |
| 119 | * |
| 120 | * @throws DataModelException a violation in data model rule |
| 121 | */ |
| 122 | void resolveInterFileLinking() throws DataModelException; |
| 123 | |
| 124 | /** |
| 125 | * Adds references to include. |
| 126 | * |
| 127 | * @param yangFileInfoSet YANG file info set |
| 128 | * @throws LinkerException a violation of linker rules |
| 129 | */ |
| 130 | void addReferencesToIncludeList(Set<YangFileInfo> yangFileInfoSet) throws LinkerException; |
| 131 | |
| 132 | /** |
| 133 | * Adds references to import. |
| 134 | * |
| 135 | * @param yangFileInfoSet YANG file info set |
| 136 | * @throws LinkerException a violation of linker rules |
| 137 | */ |
| 138 | void addReferencesToImportList(Set<YangFileInfo> yangFileInfoSet) throws LinkerException; |
Gaurav Agrawal | 1fbfae1 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 139 | } |