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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2