⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 repositoryupgrade.h

📁 Pegasus is an open-source implementationof the DMTF CIM and WBEM standards. It is designed to be por
💻 H
📖 第 1 页 / 共 2 页
字号:
//%2006//////////////////////////////////////////////////////////////////////////// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;// IBM Corp.; EMC Corporation, The Open Group.// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;// EMC Corporation; VERITAS Software Corporation; The Open Group.// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;// EMC Corporation; Symantec Corporation; The Open Group.//// Permission is hereby granted, free of charge, to any person obtaining a copy// of this software and associated documentation files (the "Software"), to// deal in the Software without restriction, including without limitation the// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or// sell copies of the Software, and to permit persons to whom the Software is// furnished to do so, subject to the following conditions:// // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.////==============================================================================//// Author: Sushma Fernandes, Hewlett-Packard Company//         (sushma_fernandes@hp.com)//// Modified By:////%/////////////////////////////////////////////////////////////////////////////#ifndef Pegasus_RepositoryUpgrade_h#define Pegasus_RepositoryUpgrade_h#include <Pegasus/Repository/CIMRepository.h>#include <Pegasus/Common/MessageQueue.h>#include <Pegasus/Common/DynamicLibrary.h>#include <Pegasus/Client/ClientAuthenticator.h>#include <Pegasus/Client/CIMOperationRequestEncoder.h>#include <Clients/cliutils/Command.h>#include <Clients/cliutils/CommandException.h>#include "RepositoryUpgradeException.h"#include "SSPModule.h"#include "SSPModuleTable.h"PEGASUS_NAMESPACE_BEGIN/**     The RepositoryUpgrade utility enables upgrade of a repository     to a newer version of CIM schema.     The utility will migrate schema extensions from an     older repository to a new repository that is already installed with a     new version of the CIM schema.     The new and old repository paths are accepted as command line     arguments. The new Repository path specifes the location of the repository     initialized with a newer version of the CIM Schema. The old Repository path     specifies the location of the Repository that contains the user defined     elements to be migrated.     Class extensions, qualifier extensions, instances that have been     added to the pre-existing namespaces and new namespaces     (includes qualifiers, classes and instances) that were     added  to the old repository will be created in the     new Repository.     During the process of upgrade if an error occurs, an error message is     displayed and the upgrade is aborted. If an Exception occurs during     the creation of a Schema element, the CIM/XML request for creating the     Schema element is logged to a file, an error message is displayed     and the upgrade process is aborted.*///// In order to create CIM/XML request messages inherit from MessageQueue class.//class RepositoryUpgrade : public MessageQueue, public Command{public:    /**        Constructs a RepositoryUpgrade and initializes instance variables.    */    RepositoryUpgrade();    /**        Destructor.    */    ~RepositoryUpgrade ();#ifdef PEGASUS_OS_OS400    Uint32 invokeRepositoryUpgrade (Uint32 argc, char* argv[]);#endif    /**        Parses the command line, validates the options, and sets instance        variables based on the option arguments.        @param  argc   the number of command line arguments        @param  argv   the string vector of command line arguments        @exception  CommandFormatException  if an error is encountered in                                            parsing the command line    */    void setCommand (Uint32 argc, char* argv []);    /**        Executes the command and writes the results to the PrintWriters.        @param  outPrintWriter    the ostream to which output should be                                  written        @param  errPrintWriter    the ostream to which error output should be                                  written        @return  0                if the command is successful                 1                if an error occurs in executing the command    */    Uint32 execute (        PEGASUS_STD(ostream)& outPrintWriter,        PEGASUS_STD(ostream)& errPrintWriter);    /**        The command name.    */    static const char   COMMAND_NAME [];    /**        Updates the new repository by importing class extensions, qualifiers,        instances and namespace additions that have been made to the        old repository.    */    void upgradeRepository();    //    // Derived from the MessageQueue base class.    //    virtual void handleEnqueue() {};private:#ifdef PEGASUS_OS_OS400    String logFileName;  // file to log upgrade messages / progress to#endif    //    // The type of operation specified on the command line.    //    Uint32 _optionType;    //    // The usage string.    //    String _usage;    //    // The option character used to specify the old repository path.    //    static const char   _OPTION_OLD_REPOSITORY_PATH;    //    // The option character used to specify the new repository path.    //    static const char   _OPTION_NEW_REPOSITORY_PATH;    //    // The option character used to display help info.    //    static const char   _OPTION_HELP;#ifdef PEGASUS_OS_OS400    //    // The option character used to suppress output.    //    static const char   _OPTION_QUIET;#endif    //    // The option character used to display version info.    //    static const char   _OPTION_VERSION;    //    // Label for the usage string for this command.    //    static const char   _USAGE [];    //    // This constant signifies that an operation option has not been recorded    //    static const Uint32 _OPTION_TYPE_UNINITIALIZED;    //    // This constant signifies that the old repository path option has    // been recorded    //    static const Uint32 _OPTION_TYPE_OLD_REPOSITORY_PATH;    //    // This constant signifies that the new repository path option has    // been recorded    //    static const Uint32 _OPTION_TYPE_NEW_REPOSITORY_PATH;    //    // The constant representing a help operation    //    static const Uint32 _OPTION_TYPE_HELP;    //    // The constant representing a version display operation    //    static const Uint32 _OPTION_TYPE_VERSION;    //    // Contains the old repository path.    //    String _oldRepositoryPath;    //    // Contains the new repository path.    //    String _newRepositoryPath;    //    // Indicates that the old repository path is set.    //    Boolean _oldRepositoryPathSet;    //    // Indicates that the new repository path is set.    //    Boolean _newRepositoryPathSet;    //    // Indicates whether the Special Processing modules have been initialized.    //    Boolean _modulesInitialized;    //    // Instance of CIMRepository used to access classes and namespaces from    // the old repository.    //    CIMRepository* _oldRepository;    //    // Instance of CIMRepository used to access classes and namespaces from    // the new repository.    //    CIMRepository* _newRepository;    //    // Instance of Client Authenticator used by Error processing to generate    // a log of a failed CIM/XML request.    //    ClientAuthenticator _authenticator;    //    // Instance of request encoder used by error processing to generate    // a log of a failed CIM/XML request.    //    CIMOperationRequestEncoder* _requestEncoder;    //    // Contains the list of classes to be ignored in the InterOp namespace.    //    Array<CIMName> _interopIgnoreClasses;    //    // Constant representing the name of the VERSION qualifier.    //    static const String 	_VERSION_QUALIFIER_NAME;    //    // Defines the file extension for a CIM/XML request file.    //    static const String 	_FILE_EXTENSION;    //    // Defines the path to store CIM/XML log file for a failed request.    //    static const String 	_LOG_PATH;    //    // Count to keep track of failed instance creations. This count    // is used in the filename that will log the failed request.    //    Uint32 instanceCount;    //    // Count to keep track of failed qualifier creations. This count    // is used in the filename that will log the failed request.    //    Uint32 qualifierCount;#ifdef ENABLE_MODULE_PROCESSING    //    // Contains handles to the Special Processing shared libraries.    //    DynamicLibrary _library[SSPModuleTable::NUM_MODULES];    //    // Indicates that the Special Processing Module is interested in

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -