1 karl 1.56 //%2004////////////////////////////////////////////////////////////////////////
|
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 mike 1.25 //
10 // Permission is hereby granted, free of charge, to any person obtaining a copy
11 // of this software and associated documentation files (the "Software"), to
12 // deal in the Software without restriction, including without limitation the
13 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
14 // sell copies of the Software, and to permit persons to whom the Software is
15 // furnished to do so, subject to the following conditions:
|
16 kumpf 1.38 //
|
17 mike 1.25 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
18 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
19 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
20 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
21 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 //
26 //==============================================================================
27 //
28 // Author: Mike Brasher (mbrasher@bmc.com)
29 //
|
30 mike 1.27 // Modified By: Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com)
31 // Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com)
32 // Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
33 kumpf 1.36 // Carol Ann Krug Graves, Hewlett-Packard Company
34 // (carolann_graves@hp.com)
|
35 schuur 1.54 // Adrian Schuur (schuur@de.ibm.com) - PEP 129
|
36 david.dillard 1.57 // David Dillard, VERITAS Software Corp.
37 // (david.dillard@veritas.com)
|
38 mike 1.25 //
39 //%/////////////////////////////////////////////////////////////////////////////
40
41 #ifndef PegasusRepository_Repository_h
42 #define PegasusRepository_Repository_h
43
44 #include <Pegasus/Common/Config.h>
|
45 mike 1.27 #include <Pegasus/Common/IPC.h>
|
46 mike 1.25 #include <Pegasus/Common/CIMClass.h>
|
47 mike 1.27 #include <Pegasus/Common/CIMObject.h>
|
48 mike 1.25 #include <Pegasus/Common/CIMInstance.h>
|
49 mike 1.27 #include <Pegasus/Common/CIMPropertyList.h>
|
50 mike 1.25 #include <Pegasus/Common/CIMQualifierDecl.h>
|
51 mike 1.31 #include <Pegasus/Common/CIMRepositoryBase.h>
|
52 chuck 1.52 #include <Pegasus/Common/ContentLanguages.h>
|
53 mike 1.27 #include <Pegasus/Config/ConfigManager.h>
|
54 mike 1.25 #include <Pegasus/Repository/NameSpaceManager.h>
|
55 kumpf 1.40 #include <Pegasus/Repository/Linkage.h>
|
56 mike 1.25
|
57 schuur 1.54 #include <Pegasus/Common/ObjectStreamer.h>
58
|
59 mike 1.25 PEGASUS_NAMESPACE_BEGIN
60
61 class RepositoryDeclContext;
|
62 kumpf 1.51 class compilerDeclContext;
|
63 mike 1.25
|
64 mike 1.27 /** This class provides a simple implementation of a CIM repository.
|
65 kumpf 1.50 Concurrent access is controlled by an internal lock.
|
66 mike 1.25 */
|
67 mike 1.31 class PEGASUS_REPOSITORY_LINKAGE CIMRepository : public CIMRepositoryBase
|
68 mike 1.25 {
69 public:
70
71 /// Constructor
72 CIMRepository(const String& repositoryRoot);
73
74 /// Descructor
75 virtual ~CIMRepository();
76
|
77 kumpf 1.50 /// getClass
|
78 mike 1.25 virtual CIMClass getClass(
|
79 kumpf 1.41 const CIMNamespaceName& nameSpace,
80 const CIMName& className,
|
81 mike 1.27 Boolean localOnly = true,
82 Boolean includeQualifiers = true,
83 Boolean includeClassOrigin = false,
84 const CIMPropertyList& propertyList = CIMPropertyList());
|
85 mike 1.25
86 /// getInstance
87 virtual CIMInstance getInstance(
|
88 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
89 kumpf 1.34 const CIMObjectPath& instanceName,
|
90 mike 1.27 Boolean localOnly = true,
91 Boolean includeQualifiers = false,
92 Boolean includeClassOrigin = false,
|
93 mike 1.31 const CIMPropertyList& propertyList = CIMPropertyList());
|
94 mike 1.25
95 /// deleteClass
96 virtual void deleteClass(
|
97 kumpf 1.41 const CIMNamespaceName& nameSpace,
98 const CIMName& className);
|
99 mike 1.25
100 /// deleteInstance
101 virtual void deleteInstance(
|
102 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
103 kumpf 1.34 const CIMObjectPath& instanceName);
|
104 mike 1.25
105 /// createClass
106 virtual void createClass(
|
107 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
108 chuck 1.52 const CIMClass& newClass,
109 const ContentLanguages& contentLangs = ContentLanguages::EMPTY);
|
110 mike 1.25
111 /// createInstance
|
112 kumpf 1.34 virtual CIMObjectPath createInstance(
|
113 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
114 chuck 1.52 const CIMInstance& newInstance,
115 const ContentLanguages& contentLangs = ContentLanguages::EMPTY);
|
116 mike 1.25
117 /// modifyClass
118 virtual void modifyClass(
|
119 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
120 chuck 1.52 const CIMClass& modifiedClass,
121 const ContentLanguages& contentLangs = ContentLanguages::EMPTY);
|
122 mike 1.25
123 /// modifyInstance
124 virtual void modifyInstance(
|
125 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
126 kumpf 1.36 const CIMInstance& modifiedInstance,
|
127 mike 1.27 Boolean includeQualifiers = true,
|
128 chuck 1.52 const CIMPropertyList& propertyList = CIMPropertyList(),
129 const ContentLanguages& contentLangs = ContentLanguages::EMPTY);
|
130 mike 1.25
131 /// enumerateClasses
132 virtual Array<CIMClass> enumerateClasses(
|
133 kumpf 1.41 const CIMNamespaceName& nameSpace,
134 const CIMName& className = CIMName(),
|
135 mike 1.27 Boolean deepInheritance = false,
136 Boolean localOnly = true,
137 Boolean includeQualifiers = true,
138 Boolean includeClassOrigin = false);
|
139 mike 1.25
140 /// enumerateClassNames
|
141 kumpf 1.41 virtual Array<CIMName> enumerateClassNames(
142 const CIMNamespaceName& nameSpace,
143 const CIMName& className = CIMName(),
|
144 mike 1.27 Boolean deepInheritance = false);
|
145 mike 1.25
|
146 karl 1.35
|
147 kumpf 1.36 virtual Array<CIMInstance> enumerateInstances(
|
148 kumpf 1.41 const CIMNamespaceName& nameSpace,
149 const CIMName& className,
|
150 mike 1.27 Boolean deepInheritance = true,
151 Boolean localOnly = true,
152 Boolean includeQualifiers = false,
153 Boolean includeClassOrigin = false,
|
154 chuck 1.52 const CIMPropertyList& propertyList = CIMPropertyList());
|
155 mike 1.25
|
156 karl 1.35 /** enumerateInstances for a single Class. This and the forClass
157 // in enumerate instancenames are a temp hack to get a version
158 // that only gets for a single class until we can go through all
159 // code and put them back together again.
160 // This simply adds the includeInheritance property
161 */
|
162 kumpf 1.36 virtual Array<CIMInstance> enumerateInstancesForClass(
|
163 kumpf 1.41 const CIMNamespaceName& nameSpace,
164 const CIMName& className,
|
165 karl 1.35 Boolean deepInheritance = true,
166 Boolean localOnly = true,
167 Boolean includeQualifiers = false,
168 Boolean includeClassOrigin = false,
|
169 karl 1.42 Boolean includeInheritance = false,
|
170 karl 1.35 const CIMPropertyList& propertyList = CIMPropertyList());
171
172
|
173 karl 1.42 /** enumerateInstanceNames returns names of instances that
174 meet the critera. This is an extension of the CIM
175 enumerate instances client call
176 @nameSpace - target namespace
177 @param className - Name of the target class
178 @param Boolean that defines whether to search inheritance or not
179 @return CIMObjectPath defining the names of the found instances.
180 @exception - Yes
181 */
|
182 kumpf 1.34 virtual Array<CIMObjectPath> enumerateInstanceNames(
|
183 kumpf 1.41 const CIMNamespaceName& nameSpace,
184 const CIMName& className);
|
185 karl 1.35
186 /** enumerateInstanceNames for a single Class. This is a temporary
187 hack and should eventually be merged with enumerateInstanceNames
188 This function allows you to either include the inheritance tree
189 or not with teh boolean includeInheritance.
190 */
191 virtual Array<CIMObjectPath> enumerateInstanceNamesForClass(
|
192 kumpf 1.41 const CIMNamespaceName& nameSpace,
193 const CIMName& className,
|
194 chuck 1.52 const Boolean includeInheritance = true );
|
195 karl 1.35
|
196 mike 1.25
197 /// execQuery
198 virtual Array<CIMInstance> execQuery(
|
199 mike 1.27 const String& queryLanguage,
200 const String& query) ;
|
201 mike 1.25
202 /// associators
|
203 kumpf 1.37 virtual Array<CIMObject> associators(
|
204 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
205 kumpf 1.34 const CIMObjectPath& objectName,
|
206 kumpf 1.41 const CIMName& assocClass = CIMName(),
207 const CIMName& resultClass = CIMName(),
|
208 mike 1.27 const String& role = String::EMPTY,
209 const String& resultRole = String::EMPTY,
210 Boolean includeQualifiers = false,
211 Boolean includeClassOrigin = false,
212 const CIMPropertyList& propertyList = CIMPropertyList());
|
213 mike 1.25
|
214 kumpf 1.50 /// associatorNames
|
215 kumpf 1.34 virtual Array<CIMObjectPath> associatorNames(
|
216 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
217 kumpf 1.34 const CIMObjectPath& objectName,
|
218 kumpf 1.41 const CIMName& assocClass = CIMName(),
219 const CIMName& resultClass = CIMName(),
|
220 mike 1.27 const String& role = String::EMPTY,
221 const String& resultRole = String::EMPTY);
|
222 mike 1.25
223 /// references
|
224 kumpf 1.37 virtual Array<CIMObject> references(
|
225 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
226 kumpf 1.34 const CIMObjectPath& objectName,
|
227 kumpf 1.41 const CIMName& resultClass = CIMName(),
|
228 mike 1.27 const String& role = String::EMPTY,
229 Boolean includeQualifiers = false,
230 Boolean includeClassOrigin = false,
231 const CIMPropertyList& propertyList = CIMPropertyList());
|
232 mike 1.25
233 /// referenceNames
|
234 kumpf 1.34 virtual Array<CIMObjectPath> referenceNames(
|
235 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
236 kumpf 1.34 const CIMObjectPath& objectName,
|
237 karl 1.42 const CIMName& resultClass = CIMName(),
238 const String& role = String::EMPTY);
239
|
240 mike 1.25 /// getProperty
241 virtual CIMValue getProperty(
|
242 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
243 kumpf 1.34 const CIMObjectPath& instanceName,
|
244 kumpf 1.41 const CIMName& propertyName);
|
245 mike 1.25
246 /// setProperty
247 virtual void setProperty(
|
248 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
249 kumpf 1.34 const CIMObjectPath& instanceName,
|
250 kumpf 1.41 const CIMName& propertyName,
|
251 chuck 1.52 const CIMValue& newValue = CIMValue(),
252 const ContentLanguages& contentLangs = ContentLanguages::EMPTY);
|
253 mike 1.25
254 /// getQualifier
255 virtual CIMQualifierDecl getQualifier(
|
256 kumpf 1.41 const CIMNamespaceName& nameSpace,
257 const CIMName& qualifierName);
|
258 mike 1.25
259 /// setQualifier
260 virtual void setQualifier(
|
261 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
262 chuck 1.52 const CIMQualifierDecl& qualifierDecl,
263 const ContentLanguages& contentLangs = ContentLanguages::EMPTY);
|
264 mike 1.25
|
265 kumpf 1.50 /// deleteQualifier
|
266 mike 1.25 virtual void deleteQualifier(
|
267 kumpf 1.41 const CIMNamespaceName& nameSpace,
268 const CIMName& qualifierName);
|
269 mike 1.25
270 /// enumerateQualifiers
271 virtual Array<CIMQualifierDecl> enumerateQualifiers(
|
272 chuck 1.52 const CIMNamespaceName& nameSpace);
|
273 mike 1.25
274 /** CIMMethod createNameSpace - Creates a new namespace in the repository
|
275 mike 1.27 @param String with the name of the namespace
276 @exception - Throws "Already_Exists if the Namespace exits.
277 Throws "CannotCreateDirectory" if there are problems in the
278 creation.
|
279 mike 1.25 */
|
280 schuur 1.53
281 virtual void createNameSpace(const CIMNamespaceName& nameSpace,
282 const NameSpaceAttributes &attributes=NameSpaceAttributes());
283
284 virtual void modifyNameSpace(const CIMNamespaceName& nameSpace,
285 const NameSpaceAttributes &attributes=NameSpaceAttributes());
|
286 mike 1.25
287 /** CIMMethod enumerateNameSpaces - Get all of the namespaces in the
|
288 mike 1.27 repository. \Ref{NAMESPACE}
289 @return Array of strings with the namespaces
|
290 mike 1.25 */
|
291 kumpf 1.41 virtual Array<CIMNamespaceName> enumerateNameSpaces() const;
|
292 mike 1.25
293 /** CIMMethod deleteNameSpace - Deletes a namespace in the repository.
|
294 mike 1.27 The deleteNameSpace method will only delete a namespace if there are
295 no classed defined in the namespace. Today this is a Pegasus
296 characteristics and not defined as part of the DMTF standards.
297 @param String with the name of the namespace
298 @exception - Throws NoSuchDirectory if the Namespace does not exist.
|
299 mike 1.25 */
|
300 kumpf 1.41 virtual void deleteNameSpace(const CIMNamespaceName& nameSpace);
|
301 mike 1.31
|
302 schuur 1.53 virtual Boolean getNameSpaceAttributes(const CIMNamespaceName& nameSpace,
303 NameSpaceAttributes & attributes);
304
|
305 mike 1.31 ////////////////////////////////////////////////////////////////////////////
|
306 mike 1.25
|
307 bob 1.26 /** CIMMethod setDeclContext - allows the Declaration Context set
308 by default in the CIMRepository constructor to be overridden.
309 This is useful, for example, when a compiler wants to check syntax
310 without actually adding to the repository.
311 */
312 void setDeclContext(RepositoryDeclContext *context);
313
|
314 mike 1.27 /** Indicates whether instance operations that do not have a provider
315 registered should be served by this repository.
316 */
317 Boolean isDefaultInstanceProvider()
318 {
319 return _isDefaultInstanceProvider;
320 }
321
|
322 mike 1.31 /** Get subclass names of the given class in the given namespace.
|
323 sage 1.28 @param nameSpaceName
324 @param className - class whose subclass names will be gotten. If
325 className is empty, all classnames are returned.
326 @param deepInheritance - if true all descendent classes of class
|
327 karl 1.33 are returned. If className is empty, only root classes are returned.
328 @param subClassNames - output argument to hold subclass names.
|
329 sage 1.28 @exception CIMException(CIM_ERR_INVALID_CLASS)
330 */
|
331 mike 1.31 virtual void getSubClassNames(
|
332 kumpf 1.41 const CIMNamespaceName& nameSpaceName,
333 const CIMName& className,
|
334 sage 1.28 Boolean deepInheritance,
|
335 kumpf 1.41 Array<CIMName>& subClassNames) const
|
336 sage 1.28 {
|
337 kumpf 1.50 ReadLock lock(const_cast<ReadWriteSem&>(_lock));
|
338 sage 1.28 _nameSpaceManager.getSubClassNames(nameSpaceName,
339 className,
340 deepInheritance,
341 subClassNames);
342 }
343
344 /** Get the names of all superclasses (direct and indirect) of this
345 class.
346 */
|
347 mike 1.31 virtual void getSuperClassNames(
|
348 kumpf 1.41 const CIMNamespaceName& nameSpaceName,
349 const CIMName& className,
350 Array<CIMName>& subClassNames) const
|
351 sage 1.28 {
|
352 kumpf 1.50 ReadLock lock(const_cast<ReadWriteSem&>(_lock));
|
353 sage 1.28 _nameSpaceManager.getSuperClassNames(nameSpaceName,
354 className,
355 subClassNames);
356 }
357
|
358 schuur 1.55 virtual Boolean isRemoteNameSpace(
359 const CIMNamespaceName& nameSpaceName,
360 String & remoteInfo);
361
|
362 kumpf 1.50 protected:
363
364 // Internal getClass implementation that does not do access control
365 CIMClass _getClass(
366 const CIMNamespaceName& nameSpace,
367 const CIMName& className,
368 Boolean localOnly,
369 Boolean includeQualifiers,
370 Boolean includeClassOrigin,
371 const CIMPropertyList& propertyList);
372
373 /// Internal getInstance implementation that does not do access control
374 CIMInstance _getInstance(
375 const CIMNamespaceName& nameSpace,
376 const CIMObjectPath& instanceName,
377 Boolean localOnly,
378 Boolean includeQualifiers,
379 Boolean includeClassOrigin,
380 const CIMPropertyList& propertyList);
381
382 /// Internal createClass implementation that does not do access control
383 kumpf 1.50 void _createClass(
384 const CIMNamespaceName& nameSpace,
385 const CIMClass& newClass);
386
387 /// Internal createInstance implementation that does not do access control
388 CIMObjectPath _createInstance(
389 const CIMNamespaceName& nameSpace,
390 const CIMInstance& newInstance);
391
392 /// Internal modifyClass implementation that does not do access control
393 void _modifyClass(
394 const CIMNamespaceName& nameSpace,
395 const CIMClass& modifiedClass);
396
397 /// Internal associatorNames implementation that does not do access control
398 Array<CIMObjectPath> _associatorNames(
399 const CIMNamespaceName& nameSpace,
400 const CIMObjectPath& objectName,
401 const CIMName& assocClass,
402 const CIMName& resultClass,
403 const String& role,
404 kumpf 1.50 const String& resultRole);
405
406 /// Internal referenceNames implementation that does not do access control
407 Array<CIMObjectPath> _referenceNames(
408 const CIMNamespaceName& nameSpace,
409 const CIMObjectPath& objectName,
410 const CIMName& resultClass,
411 const String& role);
412
413 /// Internal getQualifier implementation that does not do access control
414 CIMQualifierDecl _getQualifier(
415 const CIMNamespaceName& nameSpace,
416 const CIMName& qualifierName);
417
418 /// Internal setQualifier implementation that does not do access control
419 void _setQualifier(
420 const CIMNamespaceName& nameSpace,
421 const CIMQualifierDecl& qualifierDecl);
422
|
423 mike 1.25 private:
424
|
425 mike 1.27 void _createAssocInstEntries(
|
426 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
427 mike 1.27 const CIMConstClass& cimClass,
428 const CIMInstance& cimInstance,
|
429 kumpf 1.34 const CIMObjectPath& instanceName);
|
430 mike 1.27
431 void _createAssocClassEntries(
|
432 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
433 mike 1.27 const CIMConstClass& assocClass);
434
435 /** Returns the index (or byte location) and size of the instance
436 record in the instance file for a given instance. Returns true
437 if successful. Returns false if the instance cannot be found.
438
439 @param nameSpace the namespace of the instance
440 @param instanceName the name of the instance
441 @param className the name of the class
442 @param size the size of the instance record found
443 @param index the byte positon of the instance record found
444 @param searchSuper if true, search all superclasses
445
446 @return true if the instance is found
447 false if the instance cannot be found
448 */
|
449 mike 1.25 Boolean _getInstanceIndex(
|
450 kumpf 1.41 const CIMNamespaceName& nameSpace,
|
451 kumpf 1.34 const CIMObjectPath& instanceName,
|
452 kumpf 1.41 CIMName& className,
|
453 mike 1.27 Uint32& size,
454 Uint32& index,
455 Boolean searchSuperClasses = false) const;
456
457 /** Returns the file path of the instance index file.
|
458 mike 1.25
|
459 mike 1.27 @param nameSpace the namespace of the instance
460 @param className the name of the class
461
462 @return a string containing the index file path
463 */
|
464 mike 1.29 String _getInstanceIndexFilePath(
|
465 kumpf 1.41 const CIMNamespaceName& nameSpace,
466 const CIMName& className) const;
|
467 mike 1.27
468 /** Returns the file path of the instance file.
469
470 @param nameSpace the namespace of the instance
471 @param className the name of the class
|
472 mike 1.25
|
473 mike 1.27 @return a string containing the instance file path
474 */
|
475 mike 1.29 String _getInstanceDataFilePath(
|
476 kumpf 1.41 const CIMNamespaceName& nameSpace,
477 const CIMName& className) const;
|
478 mike 1.25
|
479 mike 1.27 /** Saves an instance object from memory to disk file. The byte
480 position and the size of the newly inserted instance record are
481 returned. Returns true on success.
482
483 @param path the file path of the instance file
484 @param object the CIMInstance object to be saved
485 @param index the byte positon of the saved instance record
486 @param size the size of the saved instance record
487
488 @return true if successful
489 false if an error occurs in saving the instance to file
490 */
491 Boolean _saveInstance(
492 const String& path,
493 const CIMInstance& object,
494 Uint32& index,
495 Uint32& size);
496
497 /** loads an instance object from disk to memory. The caller passes
498 the byte position and the size of the instance record to be loaded.
499 Returns true on success.
500 mike 1.27
501 @param path the file path of the instance file
502 @param object the CIMInstance object to be returned
503 @param index the byte positon of the instance record
504 @param size the size of the instance record
505 @param data the buffer to hold the instance data
506
507 @return true if successful
508 false if an error occurs in loading the instance from file
509 */
510 Boolean _loadInstance(
511 const String& path,
512 CIMInstance& object,
513 Uint32 index,
514 Uint32 size);
515
516 /** loads all the instance objects from disk to memeory. Returns true
517 on success.
518
519 @param nameSpace the namespace of the instances to be loaded
520 @param className the class of the instances to be loaded
|
521 kumpf 1.36 @param namedInstances an array of CIMInstance objects to which
|
522 mike 1.27 the loaded instances are appended
523
524 @return true if successful
525 false if an error occurs in loading the instances
526 */
527 Boolean _loadAllInstances(
|
528 kumpf 1.41 const CIMNamespaceName& nameSpace,
529 const CIMName& className,
|
530 kumpf 1.36 Array<CIMInstance>& namedInstances);
|
531 mike 1.27
532 /** Modifies an instance object saved in the disk file. The byte position
533 and the size of the newly added instance record are returned. Returns
534 true on success.
535
536 @param path the file path of the instance file
537 @param object the modified CIMInstance object
538 @param oldIndex the byte positon of the old instance record
539 @param oldSize the size of the old instance record
540 @param newIndex the byte positon of the new instance record
541 @param newSize the size of the new instance record
542
543 @return true if successful
544 false if an error occurs in modifying the instance
545 */
546 Boolean _modifyInstance(
547 const String& path,
548 const CIMInstance& object,
549 Uint32 oldIndex,
550 Uint32 oldSize,
551 Uint32& newIndex,
552 mike 1.27 Uint32& newSize);
553
554 /** Renames the temporary instance and instance index files back to the
555 original files. The temporary files were created for an insert,
556 remove, or modify operation (to avoid data inconsistency between
557 the two files in case of unexpected system termination or failure).
558 This method is called after a successful insert, remove, or modify
559 operation on BOTH the index file and the instance file. Returns
560 true on success.
561
562 @param indexFilePath the file path of the instance index file
563 @param instancePath the file path of the instance file
564
565 @return true if successful
566 false if an error occurs in removing the original files
567 or renaming the temporary files.
568 */
569 Boolean _renameTempInstanceAndIndexFiles(
570 const String& indexFilePath,
571 const String& instanceFilePath);
|
572 karl 1.46
|
573 mike 1.25
574 String _repositoryRoot;
575 NameSpaceManager _nameSpaceManager;
576
|
577 kumpf 1.32 // This must be initialized in the constructor using values from the
|
578 mike 1.27 // ConfigManager.
579 Boolean _isDefaultInstanceProvider;
580
|
581 mike 1.25 protected:
|
582 mike 1.31
|
583 schuur 1.54 ObjectStreamer *streamer;
|
584 kumpf 1.50 ReadWriteSem _lock;
|
585 mike 1.31
|
586 kumpf 1.50 friend class compilerDeclContext;
587 friend class RepositoryDeclContext;
|
588 mike 1.25 RepositoryDeclContext* _context;
|
589 kumpf 1.50
590 /** Used by getInstance(); indicates whether instance should be resolved
591 after it is retrieved from the file.
592 */
|
593 mike 1.31 Boolean _resolveInstance;
|
594 mike 1.25 };
595
596 PEGASUS_NAMESPACE_END
597
598 #endif /* PegasusRepository_Repository_h */
599
|