1 mike 1.10.2.2 //%2006////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
6 // IBM Corp.; EMC Corporation, The Open Group.
7 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
9 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
11 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
13 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
20 //
21 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 mike 1.10.2.2 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34 #ifndef Pegasus_Repository_h
35 #define Pegasus_Repository_h
36
37 #include <Pegasus/Common/Config.h>
38 #include <Pegasus/Common/CIMClass.h>
39 #include <Pegasus/Common/CIMObject.h>
40 #include <Pegasus/Common/CIMInstance.h>
41 #include <Pegasus/Common/CIMPropertyList.h>
42 #include <Pegasus/Common/CIMQualifierDecl.h>
43 mike 1.10.2.2 #include <Pegasus/Common/ContentLanguageList.h>
44 #include <Pegasus/Common/HashTable.h>
45 #include <Pegasus/Repository/Linkage.h>
46
47 PEGASUS_NAMESPACE_BEGIN
48
49 class RepositoryDeclContext;
50 class compilerDeclContext;
51
52 /** Virtual base class for CIMRepository implementations.
53 */
54 class Repository
55 {
56 public:
57
58 typedef HashTable <String, String, EqualNoCaseFunc, HashLowerCaseFunc>
59 NameSpaceAttributes;
60
61 Repository(
62 const String& repositoryRoot,
63 Uint32 repositoryMode);
64 mike 1.10.2.2
65 virtual ~Repository();
66
67 virtual CIMClass getClass(
68 bool lock,
69 const CIMNamespaceName& nameSpace,
70 const CIMName& className,
71 Boolean localOnly,
72 Boolean includeQualifiers,
73 Boolean includeClassOrigin,
74 const CIMPropertyList& propertyList) = 0;
75
76 virtual CIMInstance getInstance(
77 bool lock,
78 const CIMNamespaceName& nameSpace,
79 const CIMObjectPath& instanceName,
80 Boolean localOnly,
81 Boolean includeQualifiers,
82 Boolean includeClassOrigin,
83 const CIMPropertyList& propertyList) = 0;
84
85 mike 1.10.2.2 virtual void deleteClass(
86 bool lock,
87 const CIMNamespaceName& nameSpace,
88 const CIMName& className) = 0;
89
90 virtual void deleteInstance(
91 bool lock,
92 const CIMNamespaceName& nameSpace,
93 const CIMObjectPath& instanceName) = 0;
94
95 virtual void createClass(
96 bool lock,
97 const CIMNamespaceName& nameSpace,
98 const CIMClass& newClass,
99 const ContentLanguageList& contentLangs) = 0;
100
101 virtual CIMObjectPath createInstance(
102 bool lock,
103 const CIMNamespaceName& nameSpace,
104 const CIMInstance& newInstance,
105 const ContentLanguageList& contentLangs) = 0;
106 mike 1.10.2.2
107 virtual void modifyClass(
108 bool lock,
109 const CIMNamespaceName& nameSpace,
110 const CIMClass& modifiedClass,
111 const ContentLanguageList& contentLangs) = 0;
112
113 virtual void modifyInstance(
114 bool lock,
115 const CIMNamespaceName& nameSpace,
116 const CIMInstance& modifiedInstance,
117 Boolean includeQualifiers,
118 const CIMPropertyList& propertyList,
119 const ContentLanguageList& contentLangs) = 0;
120
121 virtual Array<CIMClass> enumerateClasses(
122 bool lock,
123 const CIMNamespaceName& nameSpace,
124 const CIMName& className,
125 Boolean deepInheritance,
126 Boolean localOnly,
127 mike 1.10.2.2 Boolean includeQualifiers,
128 Boolean includeClassOrigin) = 0;
129
130 virtual Array<CIMName> enumerateClassNames(
131 bool lock,
132 const CIMNamespaceName& nameSpace,
133 const CIMName& className,
134 Boolean deepInheritance) = 0;
135
136 virtual Array<CIMInstance> enumerateInstancesForSubtree(
137 bool lock,
138 const CIMNamespaceName& nameSpace,
139 const CIMName& className,
140 Boolean deepInheritance,
141 Boolean localOnly,
142 Boolean includeQualifiers,
143 Boolean includeClassOrigin,
144 const CIMPropertyList& propertyList) = 0;
145
146 virtual Array<CIMInstance> enumerateInstancesForClass(
147 bool lock,
148 mike 1.10.2.2 const CIMNamespaceName& nameSpace,
149 const CIMName& className,
150 Boolean localOnly,
151 Boolean includeQualifiers,
152 Boolean includeClassOrigin,
153 const CIMPropertyList& propertyList) = 0;
154
155 virtual Array<CIMObjectPath> enumerateInstanceNamesForSubtree(
156 bool lock,
157 const CIMNamespaceName& nameSpace,
158 const CIMName& className) = 0;
159
160 virtual Array<CIMObjectPath> enumerateInstanceNamesForClass(
161 bool lock,
162 const CIMNamespaceName& nameSpace,
163 const CIMName& className) = 0;
164
165 virtual Array<CIMInstance> execQuery(
166 bool lock,
167 const String& queryLanguage,
168 const String& query) = 0;
169 mike 1.10.2.2
170 virtual Array<CIMObject> associators(
171 bool lock,
172 const CIMNamespaceName& nameSpace,
173 const CIMObjectPath& objectName,
174 const CIMName& assocClass,
175 const CIMName& resultClass,
176 const String& role,
177 const String& resultRole,
178 Boolean includeQualifiers,
179 Boolean includeClassOrigin,
180 const CIMPropertyList& propertyList) = 0;
181
182 virtual Array<CIMObjectPath> associatorNames(
183 bool lock,
184 const CIMNamespaceName& nameSpace,
185 const CIMObjectPath& objectName,
186 const CIMName& assocClass,
187 const CIMName& resultClass,
188 const String& role,
189 const String& resultRole) = 0;
190 mike 1.10.2.2
191 virtual Array<CIMObject> references(
192 bool lock,
193 const CIMNamespaceName& nameSpace,
194 const CIMObjectPath& objectName,
195 const CIMName& resultClass,
196 const String& role,
197 Boolean includeQualifiers,
198 Boolean includeClassOrigin,
199 const CIMPropertyList& propertyList) = 0;
200
201 virtual Array<CIMObjectPath> referenceNames(
202 bool lock,
203 const CIMNamespaceName& nameSpace,
204 const CIMObjectPath& objectName,
205 const CIMName& resultClass,
206 const String& role) = 0;
207
208 virtual CIMValue getProperty(
209 bool lock,
210 const CIMNamespaceName& nameSpace,
211 mike 1.10.2.2 const CIMObjectPath& instanceName,
212 const CIMName& propertyName) = 0;
213
214 virtual void setProperty(
215 bool lock,
216 const CIMNamespaceName& nameSpace,
217 const CIMObjectPath& instanceName,
218 const CIMName& propertyName,
219 const CIMValue& newValue,
220 const ContentLanguageList& contentLangs) = 0;
221
222 virtual CIMQualifierDecl getQualifier(
223 bool lock,
224 const CIMNamespaceName& nameSpace,
225 const CIMName& qualifierName) = 0;
226
227 virtual void setQualifier(
228 bool lock,
229 const CIMNamespaceName& nameSpace,
230 const CIMQualifierDecl& qualifierDecl,
231 const ContentLanguageList& contentLangs) = 0;
232 mike 1.10.2.2
233 virtual void deleteQualifier(
234 bool lock,
235 const CIMNamespaceName& nameSpace,
236 const CIMName& qualifierName) = 0;
237
238 virtual Array<CIMQualifierDecl> enumerateQualifiers(
239 bool lock,
240 const CIMNamespaceName& nameSpace) = 0;
241
242 virtual void createNameSpace(
243 bool lock,
244 const CIMNamespaceName& nameSpace,
245 const NameSpaceAttributes& attributes) = 0;
246
247 virtual void modifyNameSpace(
248 bool lock,
249 const CIMNamespaceName& nameSpace,
250 const NameSpaceAttributes& attributes) = 0;
251
252 virtual Array<CIMNamespaceName> enumerateNameSpaces(
253 mike 1.10.2.2 bool lock) const = 0;
254
255 virtual void deleteNameSpace(
256 bool lock,
257 const CIMNamespaceName& nameSpace) = 0;
258
259 virtual Boolean getNameSpaceAttributes(
260 bool lock,
261 const CIMNamespaceName& nameSpace,
262 NameSpaceAttributes& attributes) = 0;
263
264 virtual void setDeclContext(
265 bool lock,
266 RepositoryDeclContext* context) = 0;
267
268 virtual Boolean isDefaultInstanceProvider(
269 bool lock) = 0;
270
271 virtual void getSubClassNames(
272 bool lock,
273 const CIMNamespaceName& nameSpace,
274 mike 1.10.2.2 const CIMName& className,
275 Boolean deepInheritance,
276 Array<CIMName>& subClassNames) const = 0;
277
278 virtual void getSuperClassNames(
279 bool lock,
280 const CIMNamespaceName& nameSpace,
281 const CIMName& className,
282 Array<CIMName>& superClassNames) const = 0;
283
284 virtual Boolean isRemoteNameSpace(
285 bool lock,
286 const CIMNamespaceName& nameSpace,
287 String& remoteInfo) = 0;
288
289 #ifdef PEGASUS_DEBUG
290 virtual void DisplayCacheStatistics(
291 bool lock) = 0;
292 #endif
293
294 protected:
295 mike 1.10.2.2
296 String _repositoryRoot;
297 Uint32 _repositoryMode;
298 };
299
300 PEGASUS_NAMESPACE_END
301
302 #endif /* Pegasus_Repository_h */
|