blob: 8be32427b9adb5b25c0bfcf6a62663293e8e1e03 [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 Agrawal95b416c2016-06-07 14:00:26 +053017package org.onosproject.yangutils.datamodel;
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053018
19import java.util.List;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053020import java.util.Set;
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053021import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
22
23/**
24 * Abstraction of YANG dependency resolution information. Abstracted to obtain the
25 * resolution information.
26 */
Vinod Kumar Se4b9b0c2016-04-30 21:09:15 +053027public interface YangReferenceResolver {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053028
29 /**
30 * Returns unresolved resolution list.
31 *
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +053032 * @param type resolvable type
33 * @return list of resolution information objects
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053034 */
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +053035 List<YangResolutionInfo> getUnresolvedResolutionList(ResolvableType type);
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053036
37 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053038 * Adds to the resolution list.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053039 *
40 * @param resolutionInfo resolution information
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +053041 * @param type resolvable type
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053042 */
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +053043 void addToResolutionList(YangResolutionInfo resolutionInfo, ResolvableType type);
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053044
45 /**
46 * Creates resolution list.
47 *
48 * @param resolutionList resolution list
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +053049 * @param type resolvable type
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053050 */
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +053051 void setResolutionList(List<YangResolutionInfo> resolutionList, ResolvableType type);
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053052
53 /**
54 * Returns unresolved imported list.
55 *
56 * @return unresolved imported list
57 */
58 List<YangImport> getImportList();
59
60 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053061 * Adds to the import list.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053062 *
63 * @param yangImport import to be added
64 */
65 void addToImportList(YangImport yangImport);
66
67 /**
68 * Create import list.
69 *
70 * @param importList import list
71 */
72 void setImportList(List<YangImport> importList);
73
74 /**
75 * Returns unresolved include list.
76 *
77 * @return unresolved include list
78 */
79 List<YangInclude> getIncludeList();
80
81 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053082 * Adds to the include list.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053083 *
84 * @param yangInclude include to be added
85 */
86 void addToIncludeList(YangInclude yangInclude);
87
88 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +053089 * Creates include list.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053090 *
91 * @param includeList include list
92 */
93 void setIncludeList(List<YangInclude> includeList);
94
95 /**
96 * Returns prefix of resolution root node.
97 *
98 * @return prefix resolution root node prefix
99 */
100 String getPrefix();
101
102 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530103 * Sets prefix of resolution list root node.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530104 *
105 * @param prefix resolution root node prefix
106 */
107 void setPrefix(String prefix);
108
109 /**
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530110 * Resolves self file linking.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530111 *
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530112 * @param type resolvable type
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530113 * @throws DataModelException a violation in data model rule
114 */
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530115 void resolveSelfFileLinking(ResolvableType type)
116 throws DataModelException;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530117
118 /**
119 * Resolves inter file linking.
120 *
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530121 * @param type resolvable type
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530122 * @throws DataModelException a violation in data model rule
123 */
VinodKumarS-Huawei2ee9e7e2016-06-01 14:30:22 +0530124 void resolveInterFileLinking(ResolvableType type)
125 throws DataModelException;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530126
127 /**
128 * Adds references to include.
129 *
Gaurav Agrawal95b416c2016-06-07 14:00:26 +0530130 * @param yangNodeSet YANG node info set
131 * @throws DataModelException a violation of data model rules
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530132 */
Gaurav Agrawal95b416c2016-06-07 14:00:26 +0530133 void addReferencesToIncludeList(Set<YangNode> yangNodeSet)
134 throws DataModelException;
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530135
136 /**
137 * Adds references to import.
138 *
Gaurav Agrawal95b416c2016-06-07 14:00:26 +0530139 * @param yangNodeSet YANG node info set
140 * @throws DataModelException a violation of data model rules
Gaurav Agrawal0d43bb52016-05-17 18:06:38 +0530141 */
Gaurav Agrawal95b416c2016-06-07 14:00:26 +0530142 void addReferencesToImportList(Set<YangNode> yangNodeSet)
143 throws DataModelException;
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530144}