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