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

   1 mike  1.1 //BEGIN_LICENSE
   2           //
   3           // Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM
   4           //
   5           // Permission is hereby granted, free of charge, to any person obtaining a
   6           // copy of this software and associated documentation files (the "Software"),
   7           // to deal in the Software without restriction, including without limitation
   8           // the rights to use, copy, modify, merge, publish, distribute, sublicense,
   9           // and/or sell copies of the Software, and to permit persons to whom the
  10           // Software is furnished to do so, subject to the following conditions:
  11           //
  12           // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13           // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14           // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  15           // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16           // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  17           // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  18           // DEALINGS IN THE SOFTWARE.
  19           //
  20           //END_LICENSE
  21           //BEGIN_HISTORY
  22 mike  1.1 //
  23           // Author:
  24           //
  25 mike  1.2 // $Log: Repository.cpp,v $
  26 bob   1.8 // Revision 1.7  2001/02/16 02:06:09  mike
  27           // Renamed many classes and headers.
  28           //
  29 mike  1.7 // Revision 1.6  2001/02/13 07:00:18  mike
  30           // Added partial createInstance() method to repository.
  31           //
  32 mike  1.6 // Revision 1.5  2001/02/11 05:45:33  mike
  33           // Added case insensitive logic for files in Repository
  34           //
  35 mike  1.5 // Revision 1.4  2001/01/31 08:20:51  mike
  36           // Added dispatcher framework.
  37           // Added enumerateInstanceNames.
  38           //
  39 mike  1.4 // Revision 1.3  2001/01/28 04:11:03  mike
  40           // fixed qualifier resolution
  41           //
  42 mike  1.3 // Revision 1.2  2001/01/25 02:12:05  mike
  43           // Added meta-qualifiers to LoadRepository program.
  44           //
  45 mike  1.2 // Revision 1.1.1.1  2001/01/14 19:53:55  mike
  46           // Pegasus import
  47           //
  48 mike  1.1 //
  49           //END_HISTORY
  50           
  51           #include <cctype>
  52 bob   1.8 #include <cstdio>  // for sprintf on linux
  53 mike  1.1 #include <fstream>
  54           #include <Pegasus/Common/Pair.h>
  55           #include <Pegasus/Common/Destroyer.h>
  56           #include <Pegasus/Common/FileSystem.h>
  57           #include <Pegasus/Common/Exception.h>
  58           #include <Pegasus/Common/XmlReader.h>
  59           #include <Pegasus/Common/XmlWriter.h>
  60           #include <Pegasus/Common/DeclContext.h>
  61 mike  1.6 #include <Pegasus/Common/DeclContext.h>
  62 mike  1.1 #include "Repository.h"
  63 mike  1.6 #include "InstanceIndexFile.h"
  64 mike  1.1 
  65           #define INDENT_XML_FILES
  66           
  67           PEGASUS_NAMESPACE_BEGIN
  68           
  69           ////////////////////////////////////////////////////////////////////////////////
  70           //
  71           // Local functions
  72           //
  73           ////////////////////////////////////////////////////////////////////////////////
  74           
  75           //------------------------------------------------------------------------------
  76           //
  77           // This routine matches files in the classes directory (given by path)
  78           // that match the second and third arguments, which are eight class names
  79           // or asterisks (which are wild cards). All the files in the ./classes
  80           // directory are of the form <className.superClassName>. For classes
  81           // with no superClass, the superClassName is "#". We consider a couple of
  82           // examples. To find all direct subclasses of "MyClass", we invoke it
  83           // as follows:
  84           //
  85 mike  1.1 //	_GlobClassesDir(path, "*", "MyClass");
  86           //
  87           // To find the file which contains the class called "MyClass", we invoke
  88           // it like this.
  89           //
  90           //	_GlobClassesDir(path, "MyClass", "*");
  91           //
  92           // Since base classes are of the form "<ClassName>.#", all baseclasses may
  93           // be found with:
  94           //
  95           //	_GlobClassesDir(path, "*", "#");
  96           //
  97           // Note that the results (the array of filenames which are returned) must
  98           // be processed further to get the actual class names. The name of the
  99           // class is the filename less the extension. Or this:
 100           //
 101           //	String className = fileName.subString(fileName.find(0, '.'));
 102           //
 103           //------------------------------------------------------------------------------
 104           
 105           Array<String> _GlobClassesDir(
 106 mike  1.1     const String& path, 
 107 mike  1.5     const String& className_,
 108               const String& superClassName_)
 109 mike  1.1 {
 110 mike  1.5     String className = className_;
 111               String superClassName = superClassName_;
 112 mike  1.1     Array<String> fileNames;
 113           
 114               if (!FileSystem::getDirectoryContents(path, fileNames))
 115           	throw NoSuchDirectory(path);
 116           
 117               Array<String> result;
 118           
 119               for (Uint32 i = 0; i < fileNames.getSize(); i++)
 120               {
 121           	const String& tmp = fileNames[i];
 122           
 123           	Uint32 dot = tmp.find('.');
 124           
 125           	// Ignore files that do not contain a dot:
 126           
 127           	if (dot == Uint32(-1))
 128           	    continue;
 129           
 130           	String first = tmp.subString(0, dot);
 131           	String second = tmp.subString(dot + 1);
 132           
 133 mike  1.1 	if ((className == "*" || first == className) &&
 134           	    (superClassName == "*" || second == superClassName))
 135           	{
 136           	    result.append(tmp);
 137           	}
 138               }
 139           
 140               return result;
 141           }
 142           
 143           static Boolean _SkipIdentifier(Char16*& p)
 144           {
 145               if (!*p || !(isalpha(*p) || *p == '_'))
 146           	return false;
 147           
 148               for (p++; *p; p++)
 149               {
 150           	if (!(isalnum(*p) || *p == '_'))
 151           	    return true;
 152               }
 153           
 154 mike  1.1     return true;
 155           }
 156           
 157           static void _MakeNameSpacePath(
 158               const String& root,
 159               const String& nameSpace,
 160               String& path)
 161           {
 162               path = root;
 163               path.append('/');
 164           
 165               path.append(nameSpace);
 166           
 167               Char16* p = (Char16*)(path.getData() + root.getLength() + 1);
 168           
 169               while (*p)
 170               {
 171           	// Either we will encounter a slash or an identifier:
 172           
 173           	if (*p == '/')
 174           	{
 175 mike  1.1 	    if (p[1] == '/')
 176           		throw CimException(CimException::INVALID_NAMESPACE);
 177           	    
 178           	    *p++ = '#';
 179           	}
 180           	else if (!_SkipIdentifier(p))
 181           	    throw CimException(CimException::INVALID_NAMESPACE);
 182               }
 183           
 184               // The last element may NOT be a slash (slashes are translated to
 185               // #'s above).
 186           
 187               if (p[-1] == '#')
 188           	throw CimException(CimException::INVALID_NAMESPACE);
 189           }
 190           
 191           void _FindClass(
 192               const String& root, 
 193               const String& nameSpace, 
 194               const String& className,
 195               String& path)
 196 mike  1.1 {
 197               const char CLASSES[] = "/classes/";
 198               _MakeNameSpacePath(root, nameSpace, path);
 199           
 200               if (!FileSystem::isDirectory(path))
 201           	throw CimException(CimException::INVALID_NAMESPACE);
 202           
 203               path.append(CLASSES);
 204           
 205               Array<String> fileNames = _GlobClassesDir(path, className, "*");
 206           
 207               Uint32 size = fileNames.getSize();
 208           
 209               if (size == 0)
 210           	throw CimException(CimException::INVALID_CLASS);
 211           
 212               PEGASUS_ASSERT(size == 1);
 213               path.append(fileNames[0]);
 214           }
 215           
 216           inline Uint32 _min(Uint32 x, Uint32 y)
 217 mike  1.1 {
 218               return x < y ? x : y;
 219           }
 220           
 221           static void _MakeNewClassPath(
 222               const String& root,
 223               const String& nameSpace,
 224               const String& className,
 225               const String& superClassName,
 226               String& path)
 227           {
 228               const char CLASSES[] = "/classes/";
 229               _MakeNameSpacePath(root, nameSpace, path);
 230           
 231               if (!FileSystem::isDirectory(path))
 232           	throw CimException(CimException::INVALID_NAMESPACE);
 233           
 234               path.append(CLASSES);
 235               path.append(className);
 236               path.append('.');
 237           
 238 mike  1.1     if (superClassName.getLength() == 0)
 239           	path.append("#");
 240               else
 241           	path.append(superClassName);
 242           }
 243           
 244           static void _MakeQualfierPath(
 245               const String& root,
 246               const String& nameSpace,
 247               const String& qualifierName,
 248               String& path)
 249           {
 250               const char QUALIFIERS[] = "/qualifiers/";
 251               _MakeNameSpacePath(root, nameSpace, path);
 252           
 253               if (!FileSystem::isDirectory(path))
 254           	throw CimException(CimException::INVALID_NAMESPACE);
 255           
 256               path.append(QUALIFIERS);
 257               path.append(qualifierName);
 258           }
 259 mike  1.1 
 260 mike  1.6 static void _MakeInstanceIndexPath(
 261               const String& root,
 262               const String& nameSpace,
 263               const String& className,
 264               String& path)
 265           {
 266               const char INSTANCES[] = "/instances/";
 267               _MakeNameSpacePath(root, nameSpace, path);
 268           
 269               if (!FileSystem::isDirectory(path))
 270           	throw CimException(CimException::INVALID_NAMESPACE);
 271           
 272               path.append(INSTANCES);
 273               path.append(className);
 274               path.append(".idx");
 275           }
 276           
 277           static void _MakeInstancePath(
 278               const String& root,
 279               const String& nameSpace,
 280               const String& className,
 281 mike  1.6     Uint32 index,
 282               String& path)
 283           {
 284               const char INSTANCES[] = "/instances/";
 285               _MakeNameSpacePath(root, nameSpace, path);
 286           
 287               if (!FileSystem::isDirectory(path))
 288           	throw CimException(CimException::INVALID_NAMESPACE);
 289           
 290               path.append(INSTANCES);
 291               path.append(className);
 292               path.append('.');
 293           
 294               char buffer[32];
 295               sprintf(buffer, "%d", index);
 296               path.append(buffer);
 297           }
 298           
 299 mike  1.1 template<class Object>
 300           void _LoadObject(
 301               const String& path,
 302               Object& object)
 303           {
 304 mike  1.5     // Get the real path of the file:
 305 mike  1.1 
 306 mike  1.5     String realPath;
 307 mike  1.1 
 308 mike  1.5     if (!FileSystem::existsIgnoreCase(path, realPath))
 309 mike  1.1 	throw CannotOpenFile(path);
 310           
 311               // Load file into memory:
 312           
 313               Array<Sint8> data;
 314 mike  1.5     FileSystem::loadFileToMemory(data, realPath);
 315 mike  1.1     data.append('\0');
 316           
 317               XmlParser parser((char*)data.getData());
 318           
 319               XmlReader::getObject(parser, object);
 320           }
 321           
 322           template<class Object>
 323           void _SaveObject(const String& path, Object& object)
 324           {
 325               Array<Sint8> out;
 326               object.toXml(out);
 327               out.append('\0');
 328           
 329               Destroyer<char> destroyer(path.allocateCString());
 330           
 331           #ifdef PEGASUS_OS_TYPE_WINDOWS
 332               std::ofstream os(destroyer.getPointer(), std::ios::binary);
 333           #else
 334               std::ofstream os(destroyer.getPointer());
 335           #endif
 336 mike  1.1 
 337               if (!os)
 338           	throw CannotOpenFile(path);
 339           
 340           #ifdef INDENT_XML_FILES
 341               XmlWriter::indentedPrint(os, out.getData(), 2);
 342           #else
 343               os.write((char*)out.getData(), out.getSize());
 344           #endif
 345           }
 346           
 347           static void _AppendClassNames(
 348               const String& path,
 349               const String& className,
 350               const String& superClassName,
 351               Array<String>& classNames)
 352           {
 353               Array<String> allFiles;
 354           
 355               if (!FileSystem::getDirectoryContents(path, allFiles))
 356           	throw NoSuchDirectory(path);
 357 mike  1.1 
 358               // Append all the direct sublclasses of the class to the output argument:
 359           
 360               Array<String> fileNames = 
 361           	_GlobClassesDir(path, className, superClassName);
 362           
 363               for (Uint32 i = 0, n = fileNames.getSize(); i < n; i++)
 364               {
 365           	String& tmp = fileNames[i];
 366           	Uint32 pos = tmp.find('.');
 367           
 368           	PEGASUS_ASSERT(pos != Uint32(-1));
 369           
 370           	if (pos != Uint32(-1))
 371           	    tmp.remove(pos);
 372           
 373           	classNames.append(tmp);
 374               }
 375           }
 376           
 377           typedef Pair<String,String> Node;
 378 mike  1.1 
 379           static void _AppendSubclassesDeepAux(
 380               const Array<Node>& table,
 381               const String& className,
 382               Array<String>& classNames)
 383           {
 384               for (Uint32 i = 0, n = table.getSize(); i < n; i++)
 385               {
 386           	if (className == table[i].second)
 387           	{
 388           	    classNames.append(table[i].first);
 389           	    _AppendSubclassesDeepAux(table, table[i].first, classNames);
 390           	}
 391               }
 392           }
 393           
 394           static void _AppendSubclassesDeep(
 395               const String& path,
 396               const String& className,
 397               Array<String>& classNames)
 398           {
 399 mike  1.1     Array<String> allFiles;
 400           
 401               if (!FileSystem::getDirectoryContents(path, allFiles))
 402           	throw NoSuchDirectory(path);
 403           
 404               Array<Node> table;
 405               table.reserve(allFiles.getSize());
 406           
 407               for (Uint32 i = 0, n = allFiles.getSize(); i < n; i++)
 408               {
 409           	const String& fileName = allFiles[i];
 410           
 411           	Uint32 dot = fileName.find('.');
 412           
 413           	if (dot == Uint32(-1))
 414           	    continue;
 415           
 416           	String first = fileName.subString(0, dot);
 417           	String second = fileName.subString(dot + 1);
 418           
 419           	if (second == "#")
 420 mike  1.1 	    table.append(Node(first, String()));
 421           	else
 422           	    table.append(Node(first, second));
 423               }
 424           
 425               _AppendSubclassesDeepAux(table, className, classNames);
 426           }
 427           
 428           static Boolean _HasSubclasses(
 429               const String& root,
 430               const String& nameSpace,
 431               const String& className)	
 432           {
 433               const char CLASSES[] = "/classes";
 434               String path;
 435               _MakeNameSpacePath(root, nameSpace, path);
 436               path.append(CLASSES);
 437           
 438               Array<String> fileNames = _GlobClassesDir(path, "*", className);
 439           
 440               return fileNames.getSize() != 0;
 441 mike  1.1 }
 442           
 443           ////////////////////////////////////////////////////////////////////////////////
 444           //
 445           // RepositoryDeclContext
 446           //
 447           ////////////////////////////////////////////////////////////////////////////////
 448           
 449           class RepositoryDeclContext : public DeclContext
 450           {
 451           public:
 452           
 453               RepositoryDeclContext(Repository* repository);
 454           
 455               virtual ~RepositoryDeclContext();
 456           
 457 mike  1.7     virtual CIMQualifierDecl lookupQualifierDecl(
 458 mike  1.1 	const String& nameSpace, 
 459           	const String& qualifierName) const;
 460           
 461 mike  1.7     virtual CIMClass lookupClassDecl(
 462 mike  1.1 	const String& nameSpace, 
 463           	const String& className) const;
 464           
 465           private:
 466           
 467               Repository* _repository;
 468           };
 469           
 470           RepositoryDeclContext::RepositoryDeclContext(Repository* repository) 
 471               : _repository(repository)
 472           {
 473           
 474           }
 475           
 476           RepositoryDeclContext::~RepositoryDeclContext()
 477           {
 478           
 479           }
 480           
 481 mike  1.7 CIMQualifierDecl RepositoryDeclContext::lookupQualifierDecl(
 482 mike  1.1     const String& nameSpace,
 483               const String& qualifierName) const
 484           {
 485               // Ignore the exception since this routine is only supposed report
 486               // whether it can be found:
 487           
 488               try
 489               {
 490           	return _repository->getQualifier(nameSpace, qualifierName);
 491               }
 492               catch (Exception&)
 493               {
 494 mike  1.7 	return CIMQualifierDecl();
 495 mike  1.1     }
 496           }
 497           
 498 mike  1.7 CIMClass RepositoryDeclContext::lookupClassDecl(
 499 mike  1.1     const String& nameSpace,
 500               const String& className) const
 501           {
 502               // Ignore the exception since this routine is only supposed report
 503               // whether it can be found:
 504           
 505               try
 506               {
 507           	return _repository->getClass(nameSpace, className, false, true, true);
 508               }
 509               catch (Exception&)
 510               {
 511 mike  1.7 	return CIMClass();
 512 mike  1.1     }
 513           }
 514           
 515           ////////////////////////////////////////////////////////////////////////////////
 516           //
 517           // Repository
 518           //
 519           ////////////////////////////////////////////////////////////////////////////////
 520           
 521           Repository::Repository(const String& path)
 522           {
 523               const char REPOSITORY[] = "/repository";
 524               _root = path;
 525               _root.append(REPOSITORY);
 526           
 527               if (!FileSystem::isDirectory(_root))
 528               {
 529           	if (!FileSystem::makeDirectory(_root))
 530           	    throw CannotCreateDirectory(_root);
 531               }
 532           
 533 mike  1.1     _context = new RepositoryDeclContext(this);
 534           }
 535           
 536           Repository::~Repository()
 537           {
 538           
 539           }
 540           
 541 mike  1.7 CIMClass Repository::getClass(
 542 mike  1.1     const String& nameSpace,
 543               const String& className,
 544               Boolean localOnly,
 545               Boolean includeQualifiers,
 546               Boolean includeClassOrigin,
 547               const Array<String>& propertyList)
 548           {
 549               // Form the path to the class:
 550           
 551               String path;
 552               _FindClass(_root, nameSpace, className, path);
 553           
 554               // Load the class:
 555           
 556 mike  1.7     CIMClass classDecl;
 557 mike  1.1     _LoadObject(path, classDecl);
 558           
 559 mike  1.7     return CIMClass(classDecl);
 560 mike  1.1 }
 561           
 562 mike  1.7 CIMInstance Repository::getInstance(
 563 mike  1.1     const String& nameSpace,
 564 mike  1.7     const CIMReference& instanceName,
 565 mike  1.1     Boolean localOnly,
 566               Boolean includeQualifiers,
 567               Boolean includeClassOrigin,
 568               const Array<String>& propertyList)
 569           {
 570               throw CimException(CimException::NOT_SUPPORTED);
 571 mike  1.7     return CIMInstance();
 572 mike  1.1 }
 573           
 574           void Repository::deleteClass(
 575               const String& nameSpace,
 576               const String& className)
 577           {
 578               // Get path of class file:
 579           
 580               String path;
 581               _FindClass(_root, nameSpace, className, path);
 582           
 583               // Disallow if the class has subclasses:
 584           
 585               if (_HasSubclasses(_root, nameSpace, className))
 586           	throw CimException(CimException::CLASS_HAS_CHILDREN);
 587           
 588               // ATTN-C: check to see if the class has instances:
 589           
 590               // Remove the class:
 591           
 592               if (!FileSystem::removeFile(path))
 593 mike  1.1 	throw FailedToRemoveFile(path);
 594           }
 595           
 596           void Repository::deleteInstance(
 597               const String& nameSpace,
 598 mike  1.7     const CIMReference& instanceName) 
 599 mike  1.1 { 
 600               throw CimException(CimException::NOT_SUPPORTED);
 601           }
 602           
 603           void Repository::createClass(
 604               const String& nameSpace,
 605 mike  1.7     CIMClass& newClass) 
 606 mike  1.1 {
 607               // Form the path to the class:
 608           
 609               String path;
 610               const String& className = newClass.getClassName();
 611               const String& superClassName = newClass.getSuperClassName();
 612 mike  1.5     _MakeNewClassPath(
 613           	_root, nameSpace, className, superClassName, path);
 614 mike  1.1 
 615 mike  1.5     String realPath;
 616           
 617               if (FileSystem::existsIgnoreCase(path, realPath))
 618 mike  1.1 	throw CimException(CimException::ALREADY_EXISTS);
 619 mike  1.5     else
 620           	realPath = path;
 621 mike  1.1 
 622               // Validate the new class:
 623           
 624               newClass.resolve(_context, nameSpace);
 625           
 626               // Save the class:
 627           
 628 mike  1.5     _SaveObject(realPath, newClass);
 629 mike  1.1 }
 630           
 631           void Repository::createInstance(
 632               const String& nameSpace,
 633 mike  1.7     CIMInstance& newInstance) 
 634 mike  1.6 {
 635               // Form the reference to this instance:
 636           
 637               String instanceName;
 638           
 639           #if 0
 640               // ATTN: fix this:
 641 mike  1.7     CIMReference::referenceToInstanceName(
 642 mike  1.6 	newInstance.makeReference(), instanceName);
 643           #else
 644               instanceName = "MyClass.key1=123456";
 645           #endif
 646           
 647               // Get the instance-name and create an entry
 648           
 649               String indexPath;
 650           
 651               _MakeInstanceIndexPath(
 652           	_root, nameSpace, newInstance.getClassName(), indexPath);
 653           
 654               Uint32 index;
 655           
 656               if (!InstanceIndexFile::insert(indexPath, instanceName, index))
 657           	throw CimException(CimException::FAILED);
 658           
 659               // Save the instance to file:
 660           
 661               String path;
 662           
 663 mike  1.6     _MakeInstancePath(
 664           	_root, nameSpace, newInstance.getClassName(), index, path);
 665           
 666               newInstance.resolve(_context, nameSpace);
 667           
 668               _SaveObject(path, newInstance);
 669 mike  1.1 }
 670           
 671           void Repository::modifyClass(
 672               const String& nameSpace,
 673 mike  1.7     CIMClass& modifiedClass) 
 674 mike  1.1 {
 675               // ATTN: need lots of semantic checking here:
 676           
 677               // Get the old class:
 678           
 679 mike  1.7     CIMClass oldClass = getClass(
 680 mike  1.1 	nameSpace, modifiedClass.getClassName(), false, true, true);
 681           
 682               // Disallow changing the name of the super-class:
 683           
 684               if (modifiedClass.getSuperClassName() != oldClass.getSuperClassName())
 685           	throw CimException(CimException::INVALID_SUPERCLASS);
 686           
 687               // Delete the old class:
 688           
 689               deleteClass(nameSpace, modifiedClass.getClassName());
 690           
 691               // Create the class again:
 692           
 693               createClass(nameSpace, modifiedClass);
 694           }
 695           
 696           void Repository::modifyInstance(
 697               const String& nameSpace,
 698 mike  1.7     const CIMInstance& modifiedInstance) 
 699 mike  1.1 {
 700               throw CimException(CimException::NOT_SUPPORTED);
 701           }
 702           
 703 mike  1.7 Array<CIMClass> Repository::enumerateClasses(
 704 mike  1.1     const String& nameSpace,
 705               const String& className,
 706               Boolean deepInheritance,
 707               Boolean localOnly,
 708               Boolean includeQualifiers,
 709               Boolean includeClassOrigin)
 710           {
 711               Array<String> classNames = 
 712           	enumerateClassNames(nameSpace, className, deepInheritance);
 713           
 714 mike  1.7     Array<CIMClass> result;
 715 mike  1.1 
 716               for (Uint32 i = 0; i < classNames.getSize(); i++)
 717               {
 718           	result.append(getClass(nameSpace, classNames[i], localOnly, 
 719           	    includeQualifiers, includeClassOrigin));
 720               }
 721           
 722               return result;
 723           }
 724           
 725           Array<String> Repository::enumerateClassNames(
 726               const String& nameSpace,
 727               const String& className,
 728               Boolean deepInheritance)
 729           {
 730               // Build the path to the classes directory:
 731           
 732               const char CLASSES[] = "/classes/";
 733               String path;
 734               _MakeNameSpacePath(_root, nameSpace, path);
 735               path.append(CLASSES);
 736 mike  1.1 
 737               if (!FileSystem::isDirectory(path))
 738           	throw CimException(CimException::INVALID_NAMESPACE);
 739           
 740               if (deepInheritance)
 741               {
 742           	if (className == String::EMPTY)
 743           	{
 744           	    Array<String> classNames;
 745           	    _AppendSubclassesDeep(path, String(), classNames);
 746           	    return classNames;
 747           	}
 748           	else
 749           	{
 750           	    Array<String> classNames;
 751           	    _AppendSubclassesDeep(path, className, classNames);
 752           	    return classNames;
 753           	}
 754               }
 755               else
 756               {
 757 mike  1.1 	if (className == String::EMPTY)
 758           	{
 759           	    Array<String> classNames;
 760           	    _AppendClassNames(path, "*", "#", classNames);
 761           	    return classNames;
 762           	}
 763           	else
 764           	{
 765           	    Array<String> classNames;
 766           	    _AppendClassNames(path, "*", className, classNames);
 767           	    return classNames;
 768           	}
 769               }
 770           
 771               // Unreachable:
 772               return Array<String>();
 773           }
 774           
 775 mike  1.7 Array<CIMInstance> Repository::enumerateInstances(
 776 mike  1.1     const String& nameSpace,
 777               const String& className,
 778               Boolean deepInheritance,
 779               Boolean localOnly,
 780               Boolean includeQualifiers,
 781               Boolean includeClassOrigin,
 782               const Array<String>& propertyList)
 783           { 
 784               throw CimException(CimException::NOT_SUPPORTED);
 785 mike  1.7     return Array<CIMInstance>();
 786 mike  1.1 }
 787           
 788 mike  1.7 Array<CIMReference> Repository::enumerateInstanceNames(
 789 mike  1.1     const String& nameSpace,
 790               const String& className) 
 791           { 
 792               throw CimException(CimException::NOT_SUPPORTED);
 793 mike  1.7     return Array<CIMReference>();
 794 mike  1.1 }
 795           
 796 mike  1.7 Array<CIMInstance> Repository::execQuery(
 797 mike  1.1     const String& queryLanguage,
 798               const String& query) 
 799           { 
 800               throw CimException(CimException::NOT_SUPPORTED);
 801 mike  1.7     return Array<CIMInstance>();
 802 mike  1.1 }
 803           
 804 mike  1.7 Array<CIMInstance> Repository::associators(
 805 mike  1.1     const String& nameSpace,
 806 mike  1.7     const CIMReference& objectName,
 807 mike  1.1     const String& assocClass,
 808               const String& resultClass,
 809               const String& role,
 810               const String& resultRole,
 811               Boolean includeQualifiers,
 812               Boolean includeClassOrigin,
 813               const Array<String>& propertyList)
 814           {
 815               throw CimException(CimException::NOT_SUPPORTED);
 816 mike  1.7     return Array<CIMInstance>();
 817 mike  1.1 }
 818           
 819 mike  1.7 Array<CIMReference> Repository::associatorNames(
 820 mike  1.1     const String& nameSpace,
 821 mike  1.7     const CIMReference& objectName,
 822 mike  1.1     const String& assocClass,
 823               const String& resultClass,
 824               const String& role,
 825               const String& resultRole)
 826           { 
 827               throw CimException(CimException::NOT_SUPPORTED);
 828 mike  1.7     return Array<CIMReference>();
 829 mike  1.1 }
 830           
 831 mike  1.7 Array<CIMInstance> Repository::references(
 832 mike  1.1     const String& nameSpace,
 833 mike  1.7     const CIMReference& objectName,
 834 mike  1.1     const String& resultClass,
 835               const String& role,
 836               Boolean includeQualifiers,
 837               Boolean includeClassOrigin,
 838               const Array<String>& propertyList)
 839           {
 840               throw CimException(CimException::NOT_SUPPORTED);
 841 mike  1.7     return Array<CIMInstance>();
 842 mike  1.1 }
 843           
 844 mike  1.7 Array<CIMReference> Repository::referenceNames(
 845 mike  1.1     const String& nameSpace,
 846 mike  1.7     const CIMReference& objectName,
 847 mike  1.1     const String& resultClass,
 848               const String& role)
 849           { 
 850               throw CimException(CimException::NOT_SUPPORTED);
 851 mike  1.7     return Array<CIMReference>();
 852 mike  1.1 }
 853           
 854 mike  1.7 CIMValue Repository::getProperty(
 855 mike  1.1     const String& nameSpace,
 856 mike  1.7     const CIMReference& instanceName,
 857 mike  1.1     const String& propertyName) 
 858           { 
 859               throw CimException(CimException::NOT_SUPPORTED);
 860 mike  1.7     return CIMValue();
 861 mike  1.1 }
 862           
 863           void Repository::setProperty(
 864               const String& nameSpace,
 865 mike  1.7     const CIMReference& instanceName,
 866 mike  1.1     const String& propertyName,
 867 mike  1.7     const CIMValue& newValue)
 868 mike  1.1 { 
 869               throw CimException(CimException::NOT_SUPPORTED);
 870           }
 871           
 872 mike  1.7 CIMQualifierDecl Repository::getQualifier(
 873 mike  1.1     const String& nameSpace,
 874               const String& qualifierName) 
 875           {
 876               // Form the path of the qualifier file:
 877           
 878               String path;
 879               _MakeQualfierPath(_root, nameSpace, qualifierName, path);
 880           
 881               // If it does not exist:
 882           
 883 mike  1.5     String realPath;
 884           
 885               if (!FileSystem::existsIgnoreCase(path, realPath))
 886 mike  1.1 	throw CimException(CimException::NOT_FOUND);
 887           
 888               // Load the qualifier:
 889           
 890 mike  1.7     CIMQualifierDecl qualifierDecl;
 891 mike  1.5     _LoadObject(realPath, qualifierDecl);
 892           
 893               // Return the qualifier:
 894 mike  1.1 
 895 mike  1.7     return CIMQualifierDecl(qualifierDecl);
 896 mike  1.1 }
 897           
 898           void Repository::setQualifier(
 899               const String& nameSpace,
 900 mike  1.7     const CIMQualifierDecl& qualifierDecl) 
 901 mike  1.1 {
 902               // Form the path of the qualifier:
 903           
 904               String path;
 905               _MakeQualfierPath(_root, nameSpace, qualifierDecl.getName(), path);
 906           
 907               // If the qualifier already exists, delete it:
 908           
 909 mike  1.5     String realPath;
 910           
 911               if (FileSystem::existsIgnoreCase(path, realPath))
 912 mike  1.1     {
 913 mike  1.5 	if (!FileSystem::removeFile(realPath))
 914 mike  1.1 	    throw FailedToRemoveDirectory(path);
 915               }
 916 mike  1.5     else
 917           	realPath = path;
 918 mike  1.1 
 919               // Write the qualifier to file:
 920           
 921 mike  1.5     _SaveObject(realPath, qualifierDecl);
 922 mike  1.1 }
 923           
 924           void Repository::deleteQualifier(
 925               const String& nameSpace,
 926               const String& qualifierName) 
 927           {
 928               String path;
 929               _MakeQualfierPath(_root, nameSpace, qualifierName, path);
 930           
 931 mike  1.5     String realPath;
 932           
 933               if (!FileSystem::existsIgnoreCase(path, realPath))
 934 mike  1.1 	throw CimException(CimException::NOT_FOUND);
 935           
 936 mike  1.5     if (!FileSystem::removeFile(realPath))
 937 mike  1.1 	throw FailedToRemoveFile(path);
 938           }
 939           
 940 mike  1.7 Array<CIMQualifierDecl> Repository::enumerateQualifiers(
 941 mike  1.1     const String& nameSpace)
 942           {
 943               // Build the path to the qualifiers directory:
 944           
 945               const char QUALIFIERS[] = "/qualifiers/";
 946               String path;
 947               _MakeNameSpacePath(_root, nameSpace, path);
 948               path.append(QUALIFIERS);
 949           
 950               if (!FileSystem::isDirectory(path))
 951           	throw CimException(CimException::INVALID_NAMESPACE);
 952           
 953               // Get the names of the qualifiers:
 954           
 955               Array<String> qualifierNames;
 956           
 957               if (!FileSystem::getDirectoryContents(path, qualifierNames))
 958           	throw NoSuchDirectory(path);
 959           
 960               // Load each qualifier into the result array:
 961           
 962 mike  1.7     Array<CIMQualifierDecl> result;
 963 mike  1.1 
 964               for (Uint32 i = 0, n = qualifierNames.getSize(); i < n; i++)
 965               {
 966 mike  1.7 	CIMQualifierDecl tmp = getQualifier(nameSpace, qualifierNames[i]);
 967 mike  1.1 	result.append(tmp);
 968               }
 969           
 970               return result;
 971           }
 972           
 973 mike  1.7 CIMValue Repository::invokeMethod(
 974 mike  1.1     const String& nameSpace,
 975 mike  1.7     const CIMReference& instanceName,
 976 mike  1.1     const String& methodName,
 977 mike  1.7     const Array<CIMValue>& inParameters,
 978               Array<CIMValue>& outParameters) 
 979 mike  1.1 {
 980               throw CimException(CimException::NOT_SUPPORTED);
 981 mike  1.7     return CIMValue();
 982 mike  1.1 }
 983           
 984           ////////////////////////////////////////////////////////////////////////////////
 985           //
 986           // New methods
 987           //
 988           ////////////////////////////////////////////////////////////////////////////////
 989           
 990           void Repository::createNameSpace(const String& nameSpace)
 991           {
 992               String path;
 993               _MakeNameSpacePath(_root, nameSpace, path);
 994           
 995               if (FileSystem::exists(path))
 996           	throw AlreadyExists(nameSpace);
 997           
 998               if (!FileSystem::makeDirectory(path))
 999           	throw CannotCreateDirectory(path);
1000           
1001               // Create "./qualifiers" directory:
1002           
1003 mike  1.1     String qualifiersDir = path;
1004               qualifiersDir.append("/qualifiers");
1005           
1006               if (!FileSystem::makeDirectory(qualifiersDir))
1007           	throw CannotCreateDirectory(qualifiersDir);
1008           
1009               // Create "./classes" directory:
1010           
1011               String classesDir = path;
1012               classesDir.append("/classes");
1013           
1014               if (!FileSystem::makeDirectory(classesDir))
1015           	throw CannotCreateDirectory(classesDir);
1016           
1017               // Create "./instances" directory:
1018           
1019               String instancesDir = path;
1020               instancesDir.append("/instances");
1021           
1022               if (!FileSystem::makeDirectory(instancesDir))
1023           	throw CannotCreateDirectory(instancesDir);
1024 mike  1.1 }
1025           
1026           Array<String> Repository::enumerateNameSpaces() const
1027           {
1028               Array<String> result;
1029           
1030               if (!FileSystem::getDirectoryContents(_root, result))
1031           	throw NoSuchDirectory(_root);
1032           
1033               for (Uint32 i = 0, n = result.getSize(); i < n; i++)
1034               {
1035           	const String& tmp = result[i];
1036           
1037           	for (Char16* p = (Char16*)tmp.getData(); *p; p++)
1038           	{
1039           	    if (*p == '#')
1040           		*p = '/';
1041           	}
1042               }
1043           
1044               return result;
1045 mike  1.3 }
1046           
1047           // Recall flavor defaults: TOSUBCLASS | OVERRIDABLE
1048           
1049           void Repository::createMetaQualifiers(const String& nameSpace)
1050           {
1051 mike  1.7     // CIMQualifier CimType : string = null, 
1052               //     CIMScope(property, parameter)
1053 mike  1.3 
1054 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("cimtype", String(),
1055           	CIMScope::PROPERTY | CIMScope::REFERENCE | CIMScope::PARAMETER));
1056 mike  1.3 
1057 mike  1.7     // CIMQualifier id : sint32 = null, 
1058               //     CIMScope(any), 
1059               //     CIMFlavor(toinstance)
1060 mike  1.3 
1061 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("id", Sint32(0),
1062           	CIMScope::ANY,
1063           	CIMFlavor::TOINSTANCE));
1064 mike  1.3 
1065 mike  1.7     // CIMQualifier OctetString : boolean = false, CIMScope(property)
1066 mike  1.3 
1067 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("octetstring", false,
1068           	CIMScope::PROPERTY));
1069 mike  1.3     
1070 mike  1.7     // CIMQualifier Abstract : boolean = false, 
1071               //     CIMScope(class, association, indication),
1072               //     CIMFlavor(disableoverride, restricted);
1073 mike  1.3 
1074 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("abstract", false, 
1075           	CIMScope::CLASS | CIMScope::ASSOCIATION | CIMScope::INDICATION,
1076           	CIMFlavor::NONE));
1077 mike  1.3 
1078 mike  1.7     // CIMQualifier Aggregate : boolean = false, 
1079               //    CIMScope(reference),
1080               //    CIMFlavor(disableoverride, tosubclass);
1081 mike  1.3 
1082 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("aggregate", false, 
1083           	CIMScope::REFERENCE, CIMFlavor::TOSUBCLASS));
1084 mike  1.3 
1085 mike  1.7     // CIMQualifier Aggregation : boolean = false, 
1086               //     CIMScope(association),
1087               //     CIMFlavor(disableoverride, tosubclass);
1088 mike  1.3 
1089 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("aggregation", false, 
1090           	CIMScope::ASSOCIATION, CIMFlavor::TOSUBCLASS));
1091 mike  1.3 
1092 mike  1.7     // CIMQualifier Alias : string = null, 
1093               //     CIMScope(property, reference, method), 
1094               //     CIMFlavor(translatable);
1095 mike  1.3 
1096 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("alias", String(),
1097           	CIMScope::PROPERTY | CIMScope::REFERENCE | CIMScope::METHOD,
1098           	CIMFlavor::DEFAULTS | CIMFlavor::TRANSLATABLE));
1099 mike  1.3 
1100 mike  1.7     // CIMQualifier ArrayType : string = "Bag", 
1101               //     CIMScope(property, parameter);
1102 mike  1.3 
1103 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("arraytype", "Bag",
1104           	CIMScope::PROPERTY | CIMScope::PARAMETER));
1105 mike  1.3 
1106 mike  1.7     // CIMQualifier Association : boolean = false, 
1107               //     CIMScope(class, association),
1108               //     CIMFlavor(disableoverride);
1109 mike  1.3 
1110 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("association", false,
1111           	CIMScope::CLASS | CIMScope::ASSOCIATION,
1112           	CIMFlavor::TOSUBCLASS));
1113 mike  1.3 
1114 mike  1.7     // CIMQualifier BitMap : string[], 
1115               //     CIMScope(property, method, parameter);
1116 mike  1.3 
1117 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("bitmap", Array<String>(),
1118           	CIMScope::PROPERTY | CIMScope::METHOD | CIMScope::PARAMETER));
1119 mike  1.3 
1120 mike  1.7     // CIMQualifier BitValues : string[], 
1121               //     CIMScope(property, method, parameter),
1122               //     CIMFlavor(Translatable);
1123 mike  1.3 
1124 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("bitvalues", Array<String>(),
1125           	CIMScope::PROPERTY | CIMScope::METHOD | CIMScope::PARAMETER,
1126           	CIMFlavor::DEFAULTS | CIMFlavor::TRANSLATABLE));
1127 mike  1.3 
1128 mike  1.7     // CIMQualifier Counter : boolean = false, 
1129               //     CIMScope(property, method, parameter);
1130 mike  1.3 
1131 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("counter", false,
1132           	CIMScope::PROPERTY | CIMScope::METHOD | CIMScope::PARAMETER));
1133 mike  1.3 
1134 mike  1.7     // CIMQualifier Delete : boolean = false, 
1135               //     CIMScope(association, reference);
1136 mike  1.3 
1137 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("delete", false,
1138           	CIMScope::ASSOCIATION | CIMScope::REFERENCE));
1139 mike  1.3 
1140 mike  1.7     // CIMQualifier Description : string = null, 
1141               //     CIMScope(any), 
1142               //     CIMFlavor(translatable);
1143 mike  1.3 
1144 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("description", String(),
1145           	CIMScope::ANY, 
1146           	CIMFlavor::TRANSLATABLE));
1147 mike  1.3 
1148 mike  1.7     // CIMQualifier DisplayName : string = null, 
1149               //     CIMScope(any), 
1150               //     CIMFlavor(translatable);
1151 mike  1.3 
1152 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("displayname", String(),
1153           	CIMScope::ANY,
1154           	CIMFlavor::DEFAULTS | CIMFlavor::TRANSLATABLE));
1155 mike  1.3 
1156 mike  1.7     // CIMQualifier Expensive : boolean = false,
1157               //     CIMScope(property, reference, method, class, association);
1158 mike  1.3 
1159 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("expensive", false,
1160           	CIMScope::PROPERTY | CIMScope::REFERENCE | CIMScope::METHOD | CIMScope::CLASS |
1161           	CIMScope::ASSOCIATION));
1162 mike  1.3 
1163 mike  1.7     // CIMQualifier Gauge : boolean = false, 
1164               //     CIMScope(property, method, parameter);
1165 mike  1.3 
1166 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("gauge", false,
1167           	CIMScope::PROPERTY | CIMScope::METHOD | CIMScope::PARAMETER));
1168 mike  1.3 
1169 mike  1.7     // CIMQualifier Ifdeleted : boolean = false, 
1170               //     CIMScope(association, reference);
1171 mike  1.3 
1172 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("ifdeleted", false,
1173           	CIMScope::ASSOCIATION | CIMScope::REFERENCE));
1174 mike  1.3 
1175 mike  1.7     // CIMQualifier In : boolean = true, 
1176               //     CIMScope(parameter), 
1177               //     CIMFlavor(disableoverride);
1178 mike  1.3 
1179 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("in", true,
1180           	CIMScope::PARAMETER,
1181           	CIMFlavor::TOSUBCLASS));
1182 mike  1.3 
1183 mike  1.7     // CIMQualifier Indication : boolean = false, 
1184               //     CIMScope(class, indication),
1185               //     CIMFlavor(disableoverride);
1186 mike  1.3 
1187 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("indication", false,
1188           	CIMScope::CLASS | CIMScope::INDICATION,
1189           	CIMFlavor::TOSUBCLASS));
1190 mike  1.3 
1191 mike  1.7     // CIMQualifier Invisible : boolean = false,
1192               //     CIMScope(reference, association, class, property, method);
1193 mike  1.3 
1194 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("invisible", false,
1195           	CIMScope::REFERENCE | CIMScope::ASSOCIATION | CIMScope::CLASS | CIMScope::PROPERTY |
1196           	CIMScope::METHOD));
1197 mike  1.3 
1198 mike  1.7     // CIMQualifier Key : boolean = false, 
1199               //     CIMScope(property, reference),
1200               //     CIMFlavor(disableoverride);
1201 mike  1.3 
1202 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("key", false,
1203           	CIMScope::PROPERTY | CIMScope::REFERENCE,
1204           	CIMFlavor::TOSUBCLASS));
1205 mike  1.3 
1206 mike  1.7     // CIMQualifier Large : boolean = false, 
1207               //     CIMScope(property, class);
1208 mike  1.3 
1209 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("large", false,
1210           	CIMScope::PROPERTY | CIMScope::CLASS));
1211 mike  1.3 
1212 mike  1.7     // CIMQualifier MappingStrings : string[],
1213               //     CIMScope(class, property, association, indication, reference);
1214 mike  1.3 
1215 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("mappingstrings", Array<String>(),
1216           	CIMScope::CLASS | CIMScope::PROPERTY | CIMScope::ASSOCIATION | 
1217           	CIMScope::INDICATION | CIMScope::REFERENCE));
1218 mike  1.3 
1219 mike  1.7     // CIMQualifier Max : uint32 = null, CIMScope(reference);
1220 mike  1.3 
1221 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("max", Sint32(0),
1222           	CIMScope::PROPERTY | CIMScope::REFERENCE));
1223 mike  1.3 
1224 mike  1.7     // CIMQualifier MaxLen : uint32 = null, 
1225               //     CIMScope(property, method, parameter);
1226 mike  1.3 
1227           #if 0
1228 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("maxlen", Uint32(0),
1229           	CIMScope::PROPERTY | CIMScope::METHOD | CIMScope::PARAMETER));
1230 mike  1.3 #else
1231 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("maxlen", Sint32(0),
1232           	CIMScope::PROPERTY | CIMScope::METHOD | CIMScope::PARAMETER));
1233 mike  1.3 #endif
1234           
1235 mike  1.7     // CIMQualifier MaxValue : sint64 = null, 
1236               //     CIMScope(property, method, parameter);
1237 mike  1.3     // ATTN: XML schema requires sint32!
1238           
1239 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("maxvalue", Sint32(0),
1240           	CIMScope::PROPERTY | CIMScope::METHOD | CIMScope::PARAMETER));
1241 mike  1.3     
1242 mike  1.7     // CIMQualifier Min : sint32 = null, CIMScope(reference);
1243 mike  1.3 
1244 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("min", Sint32(0),
1245           	CIMScope::REFERENCE));
1246 mike  1.3 
1247 mike  1.7     // CIMQualifier MinValue : sint64 = null, 
1248               //     CIMScope(property, method, parameter);
1249               // ATTN: CIMType expected by XML spec is sint32!
1250 mike  1.3 
1251 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("minvalue", Sint32(0),
1252           	CIMScope::PROPERTY | CIMScope::METHOD | CIMScope::PARAMETER));
1253 mike  1.3 
1254 mike  1.7     // CIMQualifier ModelCorrespondence : string[], 
1255               //     CIMScope(property);
1256 mike  1.3 
1257 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("modelcorrespondence", 
1258 mike  1.3 	Array<String>(),
1259 mike  1.7 	CIMScope::PROPERTY));
1260 mike  1.3 
1261 mike  1.7     // CIMQualifier NonLocal : string = null, 
1262               //     CIMScope(reference);
1263 mike  1.3 
1264 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("nonlocal", String(),
1265           	CIMScope::REFERENCE));
1266 mike  1.3 
1267 mike  1.7     // CIMQualifier NullValue : string = null, 
1268               //     CIMScope(property),
1269               //     CIMFlavor(tosubclass, disableoverride);
1270 mike  1.3 
1271 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("nullvalue", String(),
1272           	CIMScope::PROPERTY,
1273           	CIMFlavor::TOSUBCLASS));
1274 mike  1.3 
1275 mike  1.7     // CIMQualifier Out : boolean = false, 
1276               //     CIMScope(parameter), 
1277               //     CIMFlavor(disableoverride);
1278 mike  1.3 
1279 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("out", false,
1280           	CIMScope::PARAMETER,
1281           	CIMFlavor::TOSUBCLASS));
1282 mike  1.3 
1283 mike  1.7     // CIMQualifier Override : string = null, 
1284               //     CIMScope(property, method, reference),
1285               //     CIMFlavor(disableoverride);
1286 mike  1.3 
1287 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("override", String(),
1288           	CIMScope::PROPERTY | CIMScope::METHOD | CIMScope::REFERENCE,
1289           	CIMFlavor::TOSUBCLASS));
1290 mike  1.3 
1291 mike  1.7     // CIMQualifier Propagated : string = null, 
1292               //     CIMScope(property, reference),
1293               //     CIMFlavor(disableoverride);
1294 mike  1.3 
1295 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("propagated", String(),
1296           	CIMScope::PROPERTY | CIMScope::REFERENCE,
1297           	CIMFlavor::TOSUBCLASS));
1298 mike  1.3 
1299 mike  1.7     // CIMQualifier Provider : string = null, 
1300               //     CIMScope(any);
1301 mike  1.3 
1302 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("provider", String(),
1303           	CIMScope::ANY));
1304 mike  1.3 
1305 mike  1.7     // CIMQualifier Read : boolean = true, CIMScope(property);
1306 mike  1.3 
1307 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("read", true,
1308           	CIMScope::PROPERTY));
1309 mike  1.3 
1310 mike  1.7     // CIMQualifier Required : boolean = false, 
1311               //     CIMScope(property);
1312 mike  1.3 
1313 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("required", false,
1314           	CIMScope::PROPERTY));
1315 mike  1.3 
1316 mike  1.7     // CIMQualifier Revision : string = null,
1317               //     CIMScope(schema, class, association, indication),
1318               //     CIMFlavor(translatable);
1319               // ATTN: No such scope as CIMScope::SCHEMA
1320 mike  1.3 
1321 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("revision", String(),
1322           	CIMScope::CLASS | CIMScope::ASSOCIATION | CIMScope::INDICATION,
1323           	CIMFlavor::DEFAULTS | CIMFlavor::TRANSLATABLE));
1324 mike  1.3 
1325 mike  1.7     // CIMQualifier Schema : string = null, 
1326               //     CIMScope(property, method),
1327               //     CIMFlavor(disableoverride, translatable);
1328 mike  1.3 
1329 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("schema", String(),
1330           	CIMScope::PROPERTY | CIMScope::METHOD,
1331           	CIMFlavor::TOSUBCLASS | CIMFlavor::TRANSLATABLE));
1332 mike  1.3 
1333 mike  1.7     // CIMQualifier Source : string = null, 
1334               //     CIMScope(class, association, indication);
1335 mike  1.3 
1336 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("source", String(),
1337           	CIMScope::CLASS | CIMScope::ASSOCIATION | CIMScope::INDICATION));
1338 mike  1.3 
1339 mike  1.7     // CIMQualifier SourceType : string = null,
1340               //     CIMScope(class, association, indication,reference);
1341 mike  1.3 
1342 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("sourcetype", String(),
1343           	CIMScope::CLASS | CIMScope::ASSOCIATION | CIMScope:: INDICATION |
1344           	CIMScope::REFERENCE));
1345 mike  1.3     
1346 mike  1.7     // CIMQualifier Static : boolean = false,
1347               //     CIMScope(property, method), CIMFlavor(disableoverride);
1348 mike  1.3 
1349 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("static", false,
1350           	CIMScope::PROPERTY | CIMScope::METHOD,
1351           	CIMFlavor::TOSUBCLASS));
1352 mike  1.3 
1353 mike  1.7     // CIMQualifier Syntax : string = null,
1354               //     CIMScope(property, reference, method, parameter);
1355 mike  1.3 
1356 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("syntax", String(),
1357           	CIMScope::PROPERTY | CIMScope::REFERENCE | CIMScope::METHOD | CIMScope::PARAMETER));
1358 mike  1.3 
1359 mike  1.7     // CIMQualifier SyntaxType : string = null,
1360               //     CIMScope(property, reference, method, parameter);
1361 mike  1.3 
1362 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("syntaxtype", String(),
1363           	CIMScope::PROPERTY | CIMScope::REFERENCE | CIMScope::METHOD | CIMScope::PARAMETER));
1364 mike  1.3 
1365 mike  1.7     // CIMQualifier Terminal : boolean = false, 
1366               //     CIMScope(class);
1367 mike  1.3 
1368 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("terminal", false,
1369           	CIMScope::CLASS));
1370 mike  1.3 
1371 mike  1.7     // CIMQualifier TriggerType : string = null,
1372               //     CIMScope(class, property, reference, method, association, indication);
1373 mike  1.3 
1374 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("triggertype", String(),
1375           	CIMScope::CLASS | CIMScope::PROPERTY | CIMScope::REFERENCE | CIMScope::METHOD |
1376           	CIMScope::ASSOCIATION | CIMScope::INDICATION));
1377 mike  1.3 
1378 mike  1.7     // CIMQualifier Units : string = null, 
1379               //     CIMScope(property, method, parameter),
1380               //     CIMFlavor(translatable);
1381 mike  1.3 
1382 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("units", String(),
1383           	CIMScope::PROPERTY | CIMScope::METHOD | CIMScope::PARAMETER,
1384           	CIMFlavor::DEFAULTS | CIMFlavor::TRANSLATABLE));
1385 mike  1.3 
1386 mike  1.7     // CIMQualifier UnknownValues : string[], 
1387               //     CIMScope(property), 
1388               //     CIMFlavor(disableoverride, tosubclass);
1389 mike  1.3 
1390 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("unknownvalues", Array<String>(),
1391           	CIMScope::PROPERTY,
1392           	CIMFlavor::TOSUBCLASS));
1393 mike  1.3 
1394 mike  1.7     // CIMQualifier UnsupportedValues : string[], 
1395               //     CIMScope(property),
1396               //     CIMFlavor(disableoverride, tosubclass);
1397 mike  1.3 
1398 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("unsupportedvalues", Array<String>(),
1399           	CIMScope::PROPERTY,
1400           	CIMFlavor::TOSUBCLASS));
1401 mike  1.3 
1402 mike  1.7     // CIMQualifier ValueMap : string[], 
1403               //     CIMScope(property, method, parameter);
1404 mike  1.3 
1405 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("valuemap", Array<String>(),
1406           	CIMScope::PROPERTY | CIMScope::METHOD | CIMScope::PARAMETER));
1407 mike  1.3 
1408 mike  1.7     // CIMQualifier Values : string[], 
1409               //     CIMScope(property, method, parameter),
1410               //     CIMFlavor(translatable);
1411 mike  1.3 
1412 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("values", Array<String>(),
1413           	CIMScope::PROPERTY | CIMScope::METHOD | CIMScope::PARAMETER,
1414           	CIMFlavor::DEFAULTS | CIMFlavor::TRANSLATABLE));
1415 mike  1.3 
1416 mike  1.7     // CIMQualifier Version : string = null,
1417               //     CIMScope(schema, class, association, indication), 
1418               //     CIMFlavor(translatable);
1419               // ATTN: No such scope as CIMScope::SCHEMA
1420 mike  1.3 
1421 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("version", String(),
1422           	CIMScope::CLASS | CIMScope::ASSOCIATION | CIMScope::INDICATION,
1423           	CIMFlavor::DEFAULTS | CIMFlavor::TRANSLATABLE));
1424 mike  1.3 
1425 mike  1.7     // CIMQualifier Weak : boolean = false, 
1426               //     CIMScope(reference),
1427               //     CIMFlavor(disableoverride, tosubclass);
1428 mike  1.3 
1429 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("weak", false,
1430           	CIMScope::REFERENCE,
1431           	CIMFlavor::TOSUBCLASS));
1432 mike  1.3 
1433 mike  1.7     // CIMQualifier Write : boolean = false, 
1434               //     CIMScope(property);
1435 mike  1.3 
1436 mike  1.7     setQualifier(nameSpace, CIMQualifierDecl("write", false,
1437           	CIMScope::PROPERTY));
1438 mike  1.1 }
1439           
1440           PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2