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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2