blob: 4681985d1886d8b2679cdac7a84092cce2d08caa [file] [log] [blame]
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +05303 *
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 Agrawal0d43bb52016-05-17 18:06:38 +053017package org.onosproject.yangutils.linker.impl;
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053018
19import java.util.List;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053020import java.util.Set;
21import org.onosproject.yangutils.datamodel.YangImport;
22import org.onosproject.yangutils.datamodel.YangInclude;
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053023import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053024import org.onosproject.yangutils.linker.exceptions.LinkerException;
25import org.onosproject.yangutils.plugin.manager.YangFileInfo;
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053026
27/**
28 * Abstraction of YANG dependency resolution information. Abstracted to obtain the
29 * resolution information.
30 */
Vinod Kumar Se4b9b0c2016-04-30 21:09:15 +053031public interface YangReferenceResolver {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053032
33 /**
34 * Returns unresolved resolution list.
35 *
36 * @return unresolved resolution list
37 */
38 List<YangResolutionInfo> getUnresolvedResolutionList();
39
40 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053041 * Adds to the resolution list.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053042 *
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 Agrawal0d43bb52016-05-17 18:06:38 +053062 * Adds to the import list.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053063 *
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 Agrawal0d43bb52016-05-17 18:06:38 +053083 * Adds to the include list.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053084 *
85 * @param yangInclude include to be added
86 */
87 void addToIncludeList(YangInclude yangInclude);
88
89 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053090 * Creates include list.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053091 *
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 Agrawal0d43bb52016-05-17 18:06:38 +0530104 * Sets prefix of resolution list root node.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530105 *
106 * @param prefix resolution root node prefix
107 */
108 void setPrefix(String prefix);
109
110 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530111 * Resolves self file linking.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530112 *
113 * @throws DataModelException a violation in data model rule
114 */
115 void resolveSelfFileLinking() throws DataModelException;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530116
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 Agrawald9d6cc82016-03-29 02:17:23 +0530139}