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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2