1 karl 1.64 //%2006////////////////////////////////////////////////////////////////////////
|
2 mike 1.25 //
|
3 karl 1.56 // 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 karl 1.48 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.56 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.58 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.64 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 mike 1.25 //
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 karl 1.73 //
|
21 mike 1.25 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // 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 kumpf 1.72 #ifndef Pegasus_Repository_h
35 #define Pegasus_Repository_h
|
36 mike 1.25
37 #include <Pegasus/Common/Config.h>
38 #include <Pegasus/Common/CIMClass.h>
|
39 mike 1.27 #include <Pegasus/Common/CIMObject.h>
|
40 mike 1.25 #include <Pegasus/Common/CIMInstance.h>
|
41 mike 1.27 #include <Pegasus/Common/CIMPropertyList.h>
|
42 mike 1.25 #include <Pegasus/Common/CIMQualifierDecl.h>
|
43 kumpf 1.63 #include <Pegasus/Common/ContentLanguageList.h>
|
44 mike 1.27 #include <Pegasus/Config/ConfigManager.h>
|
45 mike 1.25 #include <Pegasus/Repository/NameSpaceManager.h>
|
46 kumpf 1.40 #include <Pegasus/Repository/Linkage.h>
|
47 mike 1.65 #include <Pegasus/Common/ReadWriteSem.h>
|
48 mike 1.25
|
49 schuur 1.54 #include <Pegasus/Common/ObjectStreamer.h>
|
50 mike 1.73.2.1 #include <Pegasus/Repository/MetaRepository.h>
|
51 schuur 1.54
|
52 mike 1.73.2.3 #ifdef PEGASUS_USE_MEMORY_RESIDENT_REPOSITORY
53 # include <Pegasus/Repository/MemoryResidentInstanceRepository.h>
54 #endif
55
|
56 mike 1.25 PEGASUS_NAMESPACE_BEGIN
57
58 class RepositoryDeclContext;
|
59 kumpf 1.51 class compilerDeclContext;
|
60 mike 1.25
|
61 mike 1.27 /** This class provides a simple implementation of a CIM repository.
|
62 kumpf 1.50 Concurrent access is controlled by an internal lock.
|
63 mike 1.25 */
|
64 kumpf 1.72 class PEGASUS_REPOSITORY_LINKAGE CIMRepository
|
65 mike 1.25 {
66 public:
67
|
68 kumpf 1.69 enum CIMRepositoryMode
69 {
70 MODE_DEFAULT = 0,
71 MODE_XML = 1,
72 MODE_BIN = 2,
73 MODE_COMPRESSED = 4
74 };
75
|
76 mike 1.25 /// Constructor
|
77 kumpf 1.69 CIMRepository(
78 const String& repositoryRoot,
79 Uint32 mode = CIMRepository::MODE_DEFAULT);
|
80 mike 1.25
81 /// Descructor
82 virtual ~CIMRepository();
83
|
84 kumpf 1.50 /// getClass
|
85 mike 1.25 virtual CIMClass getClass(
|
86 kumpf 1.41 const CIMNamespaceName& nameSpace,
87 const CIMName& className,
|
88 mike 1.27 Boolean localOnly = true,
89 Boolean includeQualifiers = true,
90 Boolean includeClassOrigin = false,
91 const CIMPropertyList& propertyList = CIMPropertyList());
|
92 mike 1.25
93 /// getInstance
94 virtual CIMInstance getInstance(
|
95 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
96 kumpf 1.34 const CIMObjectPath& instanceName,
|
97 mike 1.27 Boolean localOnly = true,
98 Boolean includeQualifiers = false,
99 Boolean includeClassOrigin = false,
|
100 mike 1.31 const CIMPropertyList& propertyList = CIMPropertyList());
|
101 mike 1.25
102 /// deleteClass
103 virtual void deleteClass(
|
104 kumpf 1.41 const CIMNamespaceName& nameSpace,
105 const CIMName& className);
|
106 mike 1.25
107 /// deleteInstance
108 virtual void deleteInstance(
|
109 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
110 kumpf 1.34 const CIMObjectPath& instanceName);
|
111 mike 1.25
112 /// createClass
113 virtual void createClass(
|
114 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
115 chuck 1.52 const CIMClass& newClass,
|
116 kumpf 1.71 const ContentLanguageList& contentLangs = ContentLanguageList());
|
117 mike 1.25
118 /// createInstance
|
119 kumpf 1.34 virtual CIMObjectPath createInstance(
|
120 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
121 chuck 1.52 const CIMInstance& newInstance,
|
122 kumpf 1.71 const ContentLanguageList& contentLangs = ContentLanguageList());
|
123 mike 1.25
124 /// modifyClass
125 virtual void modifyClass(
|
126 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
127 chuck 1.52 const CIMClass& modifiedClass,
|
128 kumpf 1.71 const ContentLanguageList& contentLangs = ContentLanguageList());
|
129 mike 1.25
130 /// modifyInstance
131 virtual void modifyInstance(
|
132 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
133 kumpf 1.36 const CIMInstance& modifiedInstance,
|
134 mike 1.27 Boolean includeQualifiers = true,
|
135 chuck 1.52 const CIMPropertyList& propertyList = CIMPropertyList(),
|
136 kumpf 1.71 const ContentLanguageList& contentLangs = ContentLanguageList());
|
137 mike 1.25
138 /// enumerateClasses
139 virtual Array<CIMClass> enumerateClasses(
|
140 kumpf 1.41 const CIMNamespaceName& nameSpace,
141 const CIMName& className = CIMName(),
|
142 mike 1.27 Boolean deepInheritance = false,
143 Boolean localOnly = true,
144 Boolean includeQualifiers = true,
145 Boolean includeClassOrigin = false);
|
146 mike 1.25
147 /// enumerateClassNames
|
148 kumpf 1.41 virtual Array<CIMName> enumerateClassNames(
149 const CIMNamespaceName& nameSpace,
150 const CIMName& className = CIMName(),
|
151 mike 1.27 Boolean deepInheritance = false);
|
152 mike 1.25
|
153 kumpf 1.68 /**
154 Enumerates the instances of the specified class and its subclasses.
155 This method mimics the client behavior for the EnumerateInstances
156 operation, but of course it can only return the instances that reside
157 in the repository. This method does not perform deepInheritance
158 filtering regardless of the value given for that parameter.
159
160 This method is useful mainly for testing purposes, and should not be
161 relied upon for complete results in a CIM Server environment.
162 */
163 virtual Array<CIMInstance> enumerateInstancesForSubtree(
|
164 kumpf 1.41 const CIMNamespaceName& nameSpace,
165 const CIMName& className,
|
166 mike 1.27 Boolean deepInheritance = true,
167 Boolean localOnly = true,
168 Boolean includeQualifiers = false,
169 Boolean includeClassOrigin = false,
|
170 kumpf 1.71 const CIMPropertyList& propertyList = CIMPropertyList());
|
171 mike 1.25
|
172 kumpf 1.68 /**
173 Enumerates the instances of just the specified class.
174 This method mimics the provider behavior for the EnumerateInstances
175 operation.
|
176 karl 1.35 */
|
177 kumpf 1.36 virtual Array<CIMInstance> enumerateInstancesForClass(
|
178 kumpf 1.41 const CIMNamespaceName& nameSpace,
179 const CIMName& className,
|
180 karl 1.35 Boolean localOnly = true,
181 Boolean includeQualifiers = false,
182 Boolean includeClassOrigin = false,
183 const CIMPropertyList& propertyList = CIMPropertyList());
184
185
|
186 kumpf 1.68 /**
187 Enumerates the names of the instances of the specified class and its
188 subclasses. This method mimics the client behavior for the
189 EnumerateInstanceNames operation, but of course it can only return
190 the names of the instances that reside in the repository.
191
192 This method is useful mainly for testing purposes, and should not be
193 relied upon for complete results in a CIM Server environment.
194
195 @param nameSpace The namespace in which className resides.
196 @param className The name the class for which to retrieve the instance
197 names.
198 @return An Array of CIMObjectPath objects containing the names of the
199 instances of the specified class in the specified namespace.
|
200 karl 1.42 */
|
201 kumpf 1.68 virtual Array<CIMObjectPath> enumerateInstanceNamesForSubtree(
|
202 kumpf 1.41 const CIMNamespaceName& nameSpace,
203 const CIMName& className);
|
204 karl 1.35
|
205 kumpf 1.68 /**
206 Enumerates the names of the instances of just the specified class.
207 This method mimics the provider behavior for the EnumerateInstanceNames
208 operation.
209
210 @param nameSpace The namespace in which className resides.
211 @param className The name the class for which to retrieve the instance
212 names.
213 @return An Array of CIMObjectPath objects containing the names of the
214 instances of the specified class in the specified namespace.
|
215 karl 1.35 */
216 virtual Array<CIMObjectPath> enumerateInstanceNamesForClass(
|
217 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
218 kumpf 1.68 const CIMName& className);
|
219 karl 1.35
|
220 mike 1.25
221 /// execQuery
222 virtual Array<CIMInstance> execQuery(
|
223 mike 1.27 const String& queryLanguage,
224 const String& query) ;
|
225 mike 1.25
226 /// associators
|
227 kumpf 1.37 virtual Array<CIMObject> associators(
|
228 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
229 kumpf 1.34 const CIMObjectPath& objectName,
|
230 kumpf 1.41 const CIMName& assocClass = CIMName(),
231 const CIMName& resultClass = CIMName(),
|
232 mike 1.27 const String& role = String::EMPTY,
233 const String& resultRole = String::EMPTY,
234 Boolean includeQualifiers = false,
235 Boolean includeClassOrigin = false,
236 const CIMPropertyList& propertyList = CIMPropertyList());
|
237 mike 1.25
|
238 kumpf 1.50 /// associatorNames
|
239 kumpf 1.34 virtual Array<CIMObjectPath> associatorNames(
|
240 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
241 kumpf 1.34 const CIMObjectPath& objectName,
|
242 kumpf 1.41 const CIMName& assocClass = CIMName(),
243 const CIMName& resultClass = CIMName(),
|
244 mike 1.27 const String& role = String::EMPTY,
245 const String& resultRole = String::EMPTY);
|
246 mike 1.25
247 /// references
|
248 kumpf 1.37 virtual Array<CIMObject> references(
|
249 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
250 kumpf 1.34 const CIMObjectPath& objectName,
|
251 kumpf 1.41 const CIMName& resultClass = CIMName(),
|
252 mike 1.27 const String& role = String::EMPTY,
253 Boolean includeQualifiers = false,
254 Boolean includeClassOrigin = false,
255 const CIMPropertyList& propertyList = CIMPropertyList());
|
256 mike 1.25
257 /// referenceNames
|
258 kumpf 1.34 virtual Array<CIMObjectPath> referenceNames(
|
259 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
260 kumpf 1.34 const CIMObjectPath& objectName,
|
261 karl 1.42 const CIMName& resultClass = CIMName(),
262 const String& role = String::EMPTY);
263
|
264 mike 1.25 /// getProperty
265 virtual CIMValue getProperty(
|
266 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
267 kumpf 1.34 const CIMObjectPath& instanceName,
|
268 kumpf 1.41 const CIMName& propertyName);
|
269 mike 1.25
270 /// setProperty
271 virtual void setProperty(
|
272 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
273 kumpf 1.34 const CIMObjectPath& instanceName,
|
274 kumpf 1.41 const CIMName& propertyName,
|
275 chuck 1.52 const CIMValue& newValue = CIMValue(),
|
276 kumpf 1.71 const ContentLanguageList& contentLangs = ContentLanguageList());
|
277 mike 1.25
278 /// getQualifier
279 virtual CIMQualifierDecl getQualifier(
|
280 kumpf 1.41 const CIMNamespaceName& nameSpace,
281 const CIMName& qualifierName);
|
282 mike 1.25
283 /// setQualifier
284 virtual void setQualifier(
|
285 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
286 chuck 1.52 const CIMQualifierDecl& qualifierDecl,
|
287 kumpf 1.71 const ContentLanguageList& contentLangs = ContentLanguageList());
|
288 mike 1.25
|
289 kumpf 1.50 /// deleteQualifier
|
290 mike 1.25 virtual void deleteQualifier(
|
291 kumpf 1.41 const CIMNamespaceName& nameSpace,
292 const CIMName& qualifierName);
|
293 mike 1.25
294 /// enumerateQualifiers
295 virtual Array<CIMQualifierDecl> enumerateQualifiers(
|
296 kumpf 1.71 const CIMNamespaceName& nameSpace);
|
297 mike 1.25
|
298 kumpf 1.72 typedef HashTable <String, String, EqualNoCaseFunc, HashLowerCaseFunc>
299 NameSpaceAttributes;
300
|
301 mike 1.25 /** CIMMethod createNameSpace - Creates a new namespace in the repository
|
302 mike 1.27 @param String with the name of the namespace
303 @exception - Throws "Already_Exists if the Namespace exits.
304 Throws "CannotCreateDirectory" if there are problems in the
305 creation.
|
306 mike 1.25 */
|
307 schuur 1.53
308 virtual void createNameSpace(const CIMNamespaceName& nameSpace,
|
309 kumpf 1.71 const NameSpaceAttributes& attributes = NameSpaceAttributes());
|
310 schuur 1.53
311 virtual void modifyNameSpace(const CIMNamespaceName& nameSpace,
|
312 kumpf 1.71 const NameSpaceAttributes& attributes = NameSpaceAttributes());
|
313 mike 1.25
314 /** CIMMethod enumerateNameSpaces - Get all of the namespaces in the
|
315 mike 1.27 repository. \Ref{NAMESPACE}
316 @return Array of strings with the namespaces
|
317 mike 1.25 */
|
318 kumpf 1.41 virtual Array<CIMNamespaceName> enumerateNameSpaces() const;
|
319 mike 1.25
320 /** CIMMethod deleteNameSpace - Deletes a namespace in the repository.
|
321 mike 1.27 The deleteNameSpace method will only delete a namespace if there are
322 no classed defined in the namespace. Today this is a Pegasus
323 characteristics and not defined as part of the DMTF standards.
324 @param String with the name of the namespace
325 @exception - Throws NoSuchDirectory if the Namespace does not exist.
|
326 mike 1.25 */
|
327 kumpf 1.41 virtual void deleteNameSpace(const CIMNamespaceName& nameSpace);
|
328 mike 1.31
|
329 kumpf 1.71 virtual Boolean getNameSpaceAttributes(
330 const CIMNamespaceName& nameSpace,
331 NameSpaceAttributes& attributes);
|
332 schuur 1.53
|
333 mike 1.31 ////////////////////////////////////////////////////////////////////////////
|
334 mike 1.25
|
335 bob 1.26 /** CIMMethod setDeclContext - allows the Declaration Context set
336 by default in the CIMRepository constructor to be overridden.
337 This is useful, for example, when a compiler wants to check syntax
338 without actually adding to the repository.
339 */
|
340 kumpf 1.71 void setDeclContext(RepositoryDeclContext* context);
|
341 bob 1.26
|
342 mike 1.27 /** Indicates whether instance operations that do not have a provider
343 registered should be served by this repository.
344 */
345 Boolean isDefaultInstanceProvider()
346 {
347 return _isDefaultInstanceProvider;
348 }
349
|
350 mike 1.31 /** Get subclass names of the given class in the given namespace.
|
351 sage 1.28 @param nameSpaceName
352 @param className - class whose subclass names will be gotten. If
353 className is empty, all classnames are returned.
354 @param deepInheritance - if true all descendent classes of class
|
355 karl 1.33 are returned. If className is empty, only root classes are returned.
356 @param subClassNames - output argument to hold subclass names.
|
357 sage 1.28 @exception CIMException(CIM_ERR_INVALID_CLASS)
358 */
|
359 mike 1.31 virtual void getSubClassNames(
|
360 kumpf 1.41 const CIMNamespaceName& nameSpaceName,
361 const CIMName& className,
|
362 sage 1.28 Boolean deepInheritance,
|
363 mike 1.73.2.1 Array<CIMName>& subClassNames) const;
|
364 sage 1.28
365 /** Get the names of all superclasses (direct and indirect) of this
366 class.
367 */
|
368 mike 1.31 virtual void getSuperClassNames(
|
369 kumpf 1.41 const CIMNamespaceName& nameSpaceName,
370 const CIMName& className,
|
371 mike 1.73.2.1 Array<CIMName>& superClassNames) const;
|
372 sage 1.28
|
373 schuur 1.55 virtual Boolean isRemoteNameSpace(
374 const CIMNamespaceName& nameSpaceName,
|
375 kumpf 1.71 String& remoteInfo);
|
376 dave.sudlik 1.61
377 #ifdef PEGASUS_DEBUG
|
378 kumpf 1.71 void DisplayCacheStatistics();
|
379 dave.sudlik 1.61 #endif
380
|
381 kumpf 1.50 protected:
382
383 // Internal getClass implementation that does not do access control
384 CIMClass _getClass(
385 const CIMNamespaceName& nameSpace,
386 const CIMName& className,
387 Boolean localOnly,
388 Boolean includeQualifiers,
389 Boolean includeClassOrigin,
390 const CIMPropertyList& propertyList);
391
392 /// Internal getInstance implementation that does not do access control
393 CIMInstance _getInstance(
394 const CIMNamespaceName& nameSpace,
395 const CIMObjectPath& instanceName,
396 Boolean localOnly,
397 Boolean includeQualifiers,
398 Boolean includeClassOrigin,
399 const CIMPropertyList& propertyList);
400
401 /// Internal createClass implementation that does not do access control
402 kumpf 1.50 void _createClass(
403 const CIMNamespaceName& nameSpace,
404 const CIMClass& newClass);
405
406 /// Internal createInstance implementation that does not do access control
407 CIMObjectPath _createInstance(
408 const CIMNamespaceName& nameSpace,
409 const CIMInstance& newInstance);
410
411 /// Internal modifyClass implementation that does not do access control
412 void _modifyClass(
413 const CIMNamespaceName& nameSpace,
414 const CIMClass& modifiedClass);
415
416 /// Internal associatorNames implementation that does not do access control
417 Array<CIMObjectPath> _associatorNames(
418 const CIMNamespaceName& nameSpace,
419 const CIMObjectPath& objectName,
420 const CIMName& assocClass,
421 const CIMName& resultClass,
422 const String& role,
423 kumpf 1.50 const String& resultRole);
424
425 /// Internal referenceNames implementation that does not do access control
426 Array<CIMObjectPath> _referenceNames(
427 const CIMNamespaceName& nameSpace,
428 const CIMObjectPath& objectName,
429 const CIMName& resultClass,
430 const String& role);
431
432 /// Internal getQualifier implementation that does not do access control
433 CIMQualifierDecl _getQualifier(
434 const CIMNamespaceName& nameSpace,
435 const CIMName& qualifierName);
436
437 /// Internal setQualifier implementation that does not do access control
438 void _setQualifier(
439 const CIMNamespaceName& nameSpace,
440 const CIMQualifierDecl& qualifierDecl);
441
|
442 mike 1.25 private:
443
|
444 kumpf 1.70 /**
445 Searches for incomplete instance transactions for all classes in all
446 namespaces. Restores instance index and data files to void an
447 incomplete operation. If no incomplete instance transactions are
448 outstanding, this method has no effect.
449 */
450 void _rollbackIncompleteTransactions();
451
|
452 mike 1.27 void _createAssocInstEntries(
|
453 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
454 mike 1.27 const CIMConstClass& cimClass,
455 const CIMInstance& cimInstance,
|
456 kumpf 1.34 const CIMObjectPath& instanceName);
|
457 mike 1.27
458 void _createAssocClassEntries(
|
459 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
460 mike 1.27 const CIMConstClass& assocClass);
461
|
462 kumpf 1.67 /**
463 Checks whether an instance with the specified key values exists in the
464 class hierarchy of the specified class.
|
465 mike 1.27
466 @param nameSpace the namespace of the instance
467 @param instanceName the name of the instance
|
468 kumpf 1.71
|
469 mike 1.27 @return true if the instance is found
470 false if the instance cannot be found
471 */
|
472 kumpf 1.67 Boolean _checkInstanceAlreadyExists(
|
473 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
474 kumpf 1.67 const CIMObjectPath& instanceName) const;
|
475 mike 1.27
476 /** Returns the file path of the instance index file.
|
477 mike 1.25
|
478 mike 1.27 @param nameSpace the namespace of the instance
479 @param className the name of the class
480
481 @return a string containing the index file path
482 */
|
483 mike 1.29 String _getInstanceIndexFilePath(
|
484 kumpf 1.41 const CIMNamespaceName& nameSpace,
485 const CIMName& className) const;
|
486 mike 1.27
487 /** Returns the file path of the instance file.
488
489 @param nameSpace the namespace of the instance
490 @param className the name of the class
|
491 mike 1.25
|
492 mike 1.27 @return a string containing the instance file path
493 */
|
494 mike 1.29 String _getInstanceDataFilePath(
|
495 kumpf 1.41 const CIMNamespaceName& nameSpace,
496 const CIMName& className) const;
|
497 mike 1.25
|
498 mike 1.27 /** Saves an instance object from memory to disk file. The byte
499 position and the size of the newly inserted instance record are
500 returned. Returns true on success.
501
502 @param path the file path of the instance file
503 @param object the CIMInstance object to be saved
504 @param index the byte positon of the saved instance record
505 @param size the size of the saved instance record
506
507 @return true if successful
508 false if an error occurs in saving the instance to file
509 */
510 Boolean _saveInstance(
511 const String& path,
512 const CIMInstance& object,
513 Uint32& index,
514 Uint32& size);
515
|
516 kumpf 1.71 /** loads an instance object from disk to memory. The caller passes
|
517 mike 1.27 the byte position and the size of the instance record to be loaded.
518 Returns true on success.
519
520 @param path the file path of the instance file
521 @param object the CIMInstance object to be returned
522 @param index the byte positon of the instance record
523 @param size the size of the instance record
524 @param data the buffer to hold the instance data
525
526 @return true if successful
527 false if an error occurs in loading the instance from file
528 */
529 Boolean _loadInstance(
530 const String& path,
531 CIMInstance& object,
532 Uint32 index,
533 Uint32 size);
534
535 /** loads all the instance objects from disk to memeory. Returns true
536 on success.
537
|
538 kumpf 1.71 @param nameSpace the namespace of the instances to be loaded
|
539 mike 1.27 @param className the class of the instances to be loaded
|
540 kumpf 1.36 @param namedInstances an array of CIMInstance objects to which
|
541 mike 1.27 the loaded instances are appended
542
543 @return true if successful
544 false if an error occurs in loading the instances
545 */
546 Boolean _loadAllInstances(
|
547 kumpf 1.41 const CIMNamespaceName& nameSpace,
548 const CIMName& className,
|
549 kumpf 1.36 Array<CIMInstance>& namedInstances);
|
550 mike 1.27
551 /** Modifies an instance object saved in the disk file. The byte position
552 and the size of the newly added instance record are returned. Returns
553 true on success.
554
555 @param path the file path of the instance file
556 @param object the modified CIMInstance object
557 @param oldIndex the byte positon of the old instance record
558 @param oldSize the size of the old instance record
559 @param newIndex the byte positon of the new instance record
560 @param newSize the size of the new instance record
561
562 @return true if successful
563 false if an error occurs in modifying the instance
564 */
565 Boolean _modifyInstance(
566 const String& path,
567 const CIMInstance& object,
568 Uint32 oldIndex,
569 Uint32 oldSize,
570 Uint32& newIndex,
571 mike 1.27 Uint32& newSize);
572
|
573 mike 1.25 String _repositoryRoot;
574 NameSpaceManager _nameSpaceManager;
575
|
576 kumpf 1.32 // This must be initialized in the constructor using values from the
|
577 mike 1.27 // ConfigManager.
578 Boolean _isDefaultInstanceProvider;
579
|
580 mike 1.25 protected:
|
581 mike 1.31
|
582 schuur 1.54 ObjectStreamer *streamer;
|
583 kumpf 1.50 ReadWriteSem _lock;
|
584 mike 1.31
|
585 kumpf 1.50 friend class compilerDeclContext;
586 friend class RepositoryDeclContext;
|
587 mike 1.73.2.2 DeclContext* _context;
|
588 kumpf 1.50
589 /** Used by getInstance(); indicates whether instance should be resolved
590 after it is retrieved from the file.
591 */
|
592 mike 1.31 Boolean _resolveInstance;
|
593 kumpf 1.66
|
594 mike 1.73.2.3 #ifdef PEGASUS_USE_MEMORY_RESIDENT_REPOSITORY
595 MemoryResidentInstanceRepository _memoryResidentInstanceRepository;
596 #endif /* PEGASUS_USE_MEMORY_RESIDENT_REPOSITORY */
597
|
598 kumpf 1.66 CString _lockFile;
|
599 mike 1.25 };
600
601 PEGASUS_NAMESPACE_END
602
|
603 kumpf 1.72 #endif /* Pegasus_Repository_h */
|