(file) Return to CIMRepository.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Repository

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2