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

📄 stafhelpservice.cpp

📁 Software Testing Automation Framework (STAF)的开发代码
💻 CPP
📖 第 1 页 / 共 3 页
字号:
/*****************************************************************************//* Software Testing Automation Framework (STAF)                              *//* (C) Copyright IBM Corp. 2001, 2004, 2005                                  *//*                                                                           *//* This software is licensed under the Common Public License (CPL) V1.0.     *//*****************************************************************************/#include "STAF.h"#include "STAFProc.h"#include "STAFProcUtil.h"#include "STAFHelpService.h"#include "STAFUtil.h"// REGISTER SERVICE <Name> ERROR <#> INFO <String> DESCRIPTION <String>//// UNREGISTER SERVICE <Name> ERROR <#>//// [SERVICE <Name>] ERROR <#>//// LIST [SERVICE <Name>] [ERRORS]//// HELPstruct HelpMessageInfo{    STAFRC_t rc;    const char *info;    const char *description;};static const STAFString sErrorInfoClassName = "STAF/Service/Help/ErrorInfo";static const STAFString sErrorDetailsClassName =    "STAF/Service/Help/ErrorDetails";static const STAFString sServiceErrorClassName =     "STAF/Service/Help/ServiceError";STAFMapClassDefinitionPtr fErrorInfoClass;STAFMapClassDefinitionPtr fErrorDetailsClass;STAFMapClassDefinitionPtr fServiceErrorClass; STAFHelpService::STAFHelpService() : STAFService("HELP"){    fRegParser.addOption("REGISTER",    1, STAFCommandParser::kValueNotAllowed);    fRegParser.addOption("UNREGISTER",  1, STAFCommandParser::kValueNotAllowed);    fRegParser.addOption("SERVICE",     1, STAFCommandParser::kValueRequired);    fRegParser.addOption("ERROR",       1, STAFCommandParser::kValueRequired);    fRegParser.addOption("INFO",        1, STAFCommandParser::kValueRequired);    fRegParser.addOption("DESCRIPTION", 1, STAFCommandParser::kValueRequired);    fRegParser.addOptionGroup("REGISTER UNREGISTER", 0, 1);    fRegParser.addOptionGroup("UNREGISTER INFO", 0, 1);    fRegParser.addOptionGroup("UNREGISTER DESCRIPTION", 0, 1);    fRegParser.addOptionNeed("REGISTER", "INFO");    fRegParser.addOptionNeed("REGISTER", "DESCRIPTION");    fListParser.addOption("LIST",     1, STAFCommandParser::kValueNotAllowed);    fListParser.addOption("SERVICE",  1, STAFCommandParser::kValueRequired);    fListParser.addOption("ERRORS",   1, STAFCommandParser::kValueNotAllowed);    fListParser.addOption("SERVICES", 1, STAFCommandParser::kValueNotAllowed);    fListParser.addOptionGroup("SERVICES ERRORS", 0, 1);    fListParser.addOptionGroup("SERVICE SERVICES", 0, 1);    fErrorParser.addOption("SERVICE", 1, STAFCommandParser::kValueRequired);    fErrorParser.addOption("ERROR",   1, STAFCommandParser::kValueRequired);    // Construct map class for a error info    fErrorInfoClass = STAFMapClassDefinition::create(sErrorInfoClassName);    fErrorInfoClass->addKey("returnCode", "Return Code");    fErrorInfoClass->addKey("description", "Description");    // Construct map class for a detailed error information for a single error    fErrorDetailsClass = STAFMapClassDefinition::create(        sErrorDetailsClassName);    fErrorDetailsClass->addKey("description", "Description");    fErrorDetailsClass->addKey("details", "Details");    // Construct map class for a service error info    fServiceErrorClass = STAFMapClassDefinition::create(        sServiceErrorClassName);    fServiceErrorClass->addKey("service", "Service");    fServiceErrorClass->addKey("description", "Description");    fServiceErrorClass->addKey("details",     "Details");    HelpMessageInfo helpMsgs[] =    {        { kSTAFOk, "No error",          "No error" },        { kSTAFInvalidAPI, "Invalid API",          "This indicates that a process has tried to call an invalid "          "internal STAF API.  If this error occurs, "          "report it to the authors.{STAF/Config/Sep/Line}" },        { kSTAFUnknownService, "Unknown service",          "You have tried to submit a request to a service that is "          "unknown to STAFProc.  Verify that you "          "have correctly registered the service.{STAF/Config/Sep/Line}" },        { kSTAFInvalidHandle, "Invalid handle",          "You are passing an invalid handle to a STAF API.  Ensure that "          "you are using the handle you received "          "when you registered with STAF.{STAF/Config/Sep/Line}" },        { kSTAFHandleAlreadyExists, "Handle already exists",          "This indicates an internal STAF error. If this error occurs, "          "report it to the authors."          "{STAF/Config/Sep/Line}" },        { kSTAFHandleDoesNotExist, "Handle does not exist",          "You are trying to perform an operation on a handle that does "          "not exist.  For example, you may be "          "trying to stop a process, but you are specifying the "          "wrong handle.{STAF/Config/Sep/Line}" },        { kSTAFUnknownError, "Unknown error",          "An unknown error has occurred.  This error is usually an "          "indication of an internal STAF error.  "          "If this error occurs, report it the authors."          "{STAF/Config/Sep/Line}" },        { kSTAFInvalidRequestString, "Invalid request string",          "You have submitted an improperly formatted request to a "          "service.  See the appropriate section "          "in STAF User's Guide for the syntax of the service's "          "requests, or contact the provider of "          "the service.{STAF/Config/Sep/Line}" },        { kSTAFInvalidServiceResult, "Invalid service result",          "This indicates an internal error with the service to which a "          "request was submitted.  If this error "          "occurs, report it to the authors and the service "          "provider.{STAF/Config/Sep/Line}" },        { kSTAFREXXError, "REXX Error",          "This indicates an internal error in an external Rexx "          "service.  If this error occurs, report "          "it to the authors and the service provider."          "{STAF/Config/Sep/Line}" },        { kSTAFBaseOSError, "Base operating system error",          "This indicates that a base operating system error was "          "encountered.  The actual base operating system error code, "          "and possibly additional information about the error, will be "          "returned in the result passed back from the submit call."          "{STAF/Config/Sep/Line}" },        { kSTAFProcessAlreadyComplete, "Process already complete",          "You are trying to stop a specific process that has either "          "already been stopped or has finished "          "execution on its own.{STAF/Config/Sep/Line}" },        { kSTAFProcessNotComplete, "Process not complete",          "You are trying to free process information for a process that "          "is still executing.{STAF/Config/Sep/Line}" },        { kSTAFVariableDoesNotExist, "Variable does not exist",          "You are trying to resolve, get or delete a variable that does "          "not exist.{STAF/Config/Sep/Line}" },        { kSTAFUnResolvableString, "Unresolvable string",          "You have requested to resolve a string that cannot be resolved.  "          "This indicates that you have "          "exceeded the resolution depth of the VAR service.  "          "The most common cause of this is recursive "          "variables definitions.{STAF/Config/Sep/Line}" },        { kSTAFInvalidResolveString, "Invalid resolve string",          "The string you requested to be resolved has a non-matching left "          "or right curly brace.  Ensure that all "          "variable references have both left and right "          "curly braces.{STAF/Config/Sep/Line}" },        { kSTAFNoPathToMachine, "No path to endpoint",          "This indicates that STAFProc was not able to submit the "          "request to the requested endpoint (i.e. machine).  This error "          "usually indicates that STAF is not running on the target machine, "          "or that the requested endpoint is not valid, or that the network "          "interface or port for the requested endpoint is not supported.  "          "Alternatively, you may need to increase your CONNECTTIMEOUT "          "value for the network interface and/or increase your "          "CONNECTATTEMPTS value in your STAF.cfg file."          "{STAF/Config/Sep/Line}" },        { kSTAFFileOpenError, "File open error",          "This indicates that there was an error opening the requested "          "file.  Some possible explanations are that "          "the file/path does not exist, contains "          "invalid characters, or is locked.{STAF/Config/Sep/Line}" },        { kSTAFFileReadError, "File read error",          "This indicates that there was an error while trying to read "          "data from a file.{STAF/Config/Sep/Line}{STAF/Config/Sep/Line}"          "Note: Additional information regarding which file could not be "          "read may be provided in the result passed back "          "from the submit call.{STAF/Config/Sep/Line}" },        { kSTAFFileWriteError, "File write error",          "This indicates that there was an error while trying to write "          "data to a file.{STAF/Config/Sep/Line}{STAF/Config/Sep/Line}Note: "          "Additional information regarding which file could not be written to "          "may be provided in the result passed back from "          "the submit call.{STAF/Config/Sep/Line}" },        { kSTAFFileDeleteError, "File delete error",          "This indicates that there was an error while trying to delete "          "a file or directory.{STAF/Config/Sep/Line}"          "{STAF/Config/Sep/Line}Note: Additional information regarding which "          "file or directory could not be deleted may be "          "provided in the result passed back from the submit call."          "{STAF/Config/Sep/Line}" },        { kSTAFNotRunning, "STAF not running",          "This indicates that STAF is not running on the local machine.  "          "Verify that STAFProc is running.{STAF/Config/Sep/Line}"          "{STAF/Config/Sep/Line}If STAFProc is running, make sure you are "          "using the correct name for the STAFProc instance you are trying "          "to communicate with.  There is a special environment variable, "          "STAF_INSTANCE_NAME, that can be used to specify a name for each "          "STAFProc instance to differentiate between multiple instances of "          "STAF. If this environment variable is not set, the default value, "          "\"STAF\", is used for the instance name.{STAF/Config/Sep/Line}" },        { kSTAFCommunicationError, "Communication error",          "This indicates an error transmitting data across the network, "          "or to the local STAF process.  For "          "example, you would receive this error if STAFProc.exe was "          "terminated in the middle of a service "          "request, or if a bridge went down in the "          "middle of a remote service request.{STAF/Config/Sep/Line}" },        { kSTAFTrusteeDoesNotExist, "Trusteee does not exist",          "You have requested to delete a trustee, and the trustee does "          "not exist.  Verify that you have specified "          "the correct trustee.{STAF/Config/Sep/Line}" },        { kSTAFInvalidTrustLevel, "Invalid trust level",          "You have attempted to set a machine or default trust level to "          "an invalid level.  The valid trust levels "          "are from zero to five.{STAF/Config/Sep/Line}" },        { kSTAFAccessDenied, "Insufficient trust level",          "You have submitted a request for which you do not have the "          "required trust level to perform the request."          "{STAF/Config/Sep/Line}{STAF/Config/Sep/Line}"          "Note: Additional information regarding the required trust "          "level may be provided in the result passed back from the "          "submit call.{STAF/Config/Sep/Line}" },        { kSTAFRegistrationError, "Registration error",          "This indicates an error with the configuration of an external "          "service.  If this error occurs, report it "          "the service's authors.{STAF/Config/Sep/Line}" },        { kSTAFServiceConfigurationError, "Service configuration error",          "This indicates an error with the configuration of an external "          "service.  One possible explanation is that the LIBRARY you "          "specified when configuring the service does not exist.  Or, "          "if you specified the EXECUTE option, verify that the executable"          "exists and has the execute permission.  Or, if you specified "          "the PARMS option, verify that all of the service configuration "          "are valid.  Consult the appropriate documentation for the "          "service to verify whether you have configured the service "          "properly, or contact the service provider.{STAF/Config/Sep/Line}" },        { kSTAFQueueFull, "Queue full",          "This indicates that you are trying to queue a message to a "

⌨️ 快捷键说明

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