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

📄 stafhelpservice.cpp

📁 Software Testing Automation Framework (STAF)的开发代码
💻 CPP
📖 第 1 页 / 共 3 页
字号:
          "handle's queue, but the queue is full.  "          "The maximum queue size can be increased by using the "          "MAXQUEUESIZE statement in the STAF "          "Configuration  File.{STAF/Config/Sep/Line}" },        { kSTAFNoQueueElement, "No queue element",          "This indicates that you tried to GET or PEEK a particular "          "element in a queue, but no such element "          "exists, or the queue is empty.{STAF/Config/Sep/Line}" },        { kSTAFNotifieeDoesNotExist, "Notifiee does not exist",          "This indicates that you are trying to remove a message "          "notification for a machine/process/priority "          "combination which does not exist in the notification "          "list.{STAF/Config/Sep/Line}" },        { kSTAFInvalidAPILevel, "Invalid API level",          "This indicates that a process has tried to call an invalid "          "level of an internal STAF API.  If this "          "error occurs, report it to the authors.{STAF/Config/Sep/Line}" },        { kSTAFServiceNotUnregisterable, "Service not unregisterable",          "This indicates that you are trying to unregister a service "          "that is not unregisterable."          "{STAF/Config/Sep/Line}{STAF/Config/Sep/Line}Note: Internal "          "services are not unregisterable.{STAF/Config/Sep/Line}" },        { kSTAFServiceNotAvailable, "Service not available",          "This indicates that the service you requested is not currently able "          "to accept requests.  The service may be in "          "the process of initializing or terminating.{STAF/Config/Sep/Line}" },        { kSTAFSemaphoreDoesNotExist, "Semaphore does not exist",          "This indicates that you are trying to release, query, or "          "delete a semaphore that does not exist."          "{STAF/Config/Sep/Line}" },        { kSTAFNotSemaphoreOwner, "Not sempahore owner",          "This indicates that you are trying to release a semaphore for "          "which your process is not the current "          "owner.{STAF/Config/Sep/Line}" },        { kSTAFSemaphoreHasPendingRequests, "Semaphore has pending requests",          "This indicates that you are trying to delete either a mutex "          "semaphore that is currently owned or an "          "event semaphore that has waiting processes."          "{STAF/Config/Sep/Line}" },        { kSTAFTimeout, "Timeout",          "This indicates that you submitted a request with a timeout "          "value and the request did not complete "          "within the requested time.{STAF/Config/Sep/Line}" },        { kSTAFJavaError, "Java error",          "This indicates an error performing a Java native method call.  "          "A description of the error will be "          "returned in the result passed back from the submit call."          "{STAF/Config/Sep/Line}" },        { kSTAFConverterError, "Converter error",          "This indicates an error performing a codepage conversion.  The "          "most likely cause of this error is that "          "STAF was not properly installed.  However, it is "          "possible that you are currently using a "          "codepage that was not present or specified "          "during STAF installation.{STAF/Config/Sep/Line}" },        { kSTAFNotUsed, "Not used", "Do not use this error code." },        { kSTAFInvalidObject, "Invalid object",          "This indicates that an invalid object was specified to a STAF "          "API.  If you receive this return code via "          "a standard STAFSubmit call, report it to the "          "authors and the service provider.{STAF/Config/Sep/Line}" },        { kSTAFInvalidParm, "Invalid parm",          "This indicates that an invalid parameter was specified to a "          "STAF API.  If you receive this return code "          "via a standard STAFSubmit call, report it to the "          "authors and the service provider."          "{STAF/Config/Sep/Line}" },        { kSTAFRequestNumberNotFound, "Request number not found",          "This indicates that the specified request number was not found.  "          "The specified request number may be "          "invalid, or the request's information may no longer be "          "available from the Service Service (for "          "example, if the SERVICE FREE command had "          "previously been issued for the request number)."          "{STAF/Config/Sep/Line}" },        { kSTAFInvalidAsynchOption, "Invalid asynchronous option",          "This indicates that an invalid asynchronous submit option was "          "specified.{STAF/Config/Sep/Line}" },        { kSTAFRequestNotComplete, "Request not complete",          "This indicates that the specified request is not complete.  "          "This error code would be returned, for "          "example, if you requested the result of a request which "          "has not yet completed."          "{STAF/Config/Sep/Line}" },        { kSTAFProcessAuthenticationDenied, "Process authentication denied",          "This indicates that the userid/password you specified could not be "          "authenticated.  The userid/password may not "          "be valid or authentication may be disabled."          "{STAF/Config/Sep/Line}" },        { kSTAFInvalidValue, "Invalid value",          "This indicates that an invalid value was specified.  This is "          "closely related to the Invalid Request "          "String return code, but indicates that a specific "          "value in the request is invalid.  For "          "example, you may not have specified a number "          "where a number was expected.{STAF/Config/Sep/Line}"          "{STAF/Config/Sep/Line}Note: Additional information regarding the "          "invalid value may be provided in the result "          "passed back from the submit call.{STAF/Config/Sep/Line}" },        { kSTAFDoesNotExist, "Does not exist",          "This indicates that the item you specified does not exist."          "{STAF/Config/Sep/Line}{STAF/Config/Sep/Line}Note: Additional "          "information regarding the item which could not be found "          "may be provided in the result passed back "          "from the submit call.{STAF/Config/Sep/Line}" },        { kSTAFAlreadyExists, "Already exists",          "This indicates that the item you specified already exists."          "{STAF/Config/Sep/Line}{STAF/Config/Sep/Line}Note: Additional "          "information regarding the item which already exists may "          "be provided in the result passed back "          "from the submit call.{STAF/Config/Sep/Line}" },        { kSTAFDirectoryNotEmpty, "Directory Not Empty",          "This indicates that you have tried to delete a directory, but that "          "directory is not empty.{STAF/Config/Sep/Line}"          "{STAF/Config/Sep/Line}Note: Additional information specifying the "          "directory which could not be deleted may be "          "provided in the result passed back from the submit call."          "{STAF/Config/Sep/Line}" },        { kSTAFDirectoryCopyError, "Directory Copy Error",          "This indicates that you have tried to copy a directory, but that "          "errors{STAF/Config/Sep/Line}occurred during the copy."          "{STAF/Config/Sep/Line}{STAF/Config/Sep/Line}Note: Additional "          "information specifying the entries which could not be "          "copied may be provided in the result "          "passed back from the submit call.{STAF/Config/Sep/Line}" },        { kSTAFDiagnosticsNotEnabled, "Diagnostics Not Enabled",          "This indicates that you tried to record diagnostics data, but "          "diagnostics have not been enabled.  You must "          "enable diagnostics before you can record "          "diagnostics data.{STAF/Config/Sep/Line}" },        { kSTAFHandleAuthenticationDenied, "Handle Authentication Denied",          "This indicates that the user, credentials, and/or authenticator "          "you specified could not be authenticated. "          "The user/credentials may not be valid or the "          "authenticator may not be registered.{STAF/Config/Sep/Line}"          "{STAF/Config/Sep/Line}Note: Additional information specifying why "          "authentication was denied may be provided in "          "the result passed back from the submit call."          "{STAF/Config/Sep/Line}" },        { kSTAFHandleAlreadyAuthenticated, "Handle Already Authenticated",          "This indicates that the handle is already authenticated. "          "The handle must be unauthenticated in order "          "to be authenticated.{STAF/Config/Sep/Line}" },        { kSTAFInvalidSTAFVersion, "Invalid STAF Version",          "This indicates that the version of STAF (or the version of a "          "STAF service) is lower than the minimum required version."          "{STAF/Config/Sep/Line}" },        { kSTAFRequestCancelled, "Request Cancelled",          "This indicates that the request has been cancelled."          "{STAF/Config/Sep/Line}{STAF/Config/Sep/Line}Note: Additional "          "information specifying why the request was cancelled may be "          "provided in the result passed back from the submit call."          "{STAF/Config/Sep/Line}" }    };    for (int i = 0; i < (sizeof(helpMsgs) / sizeof(HelpMessageInfo)); ++i)    {        ServiceHelpData helpData(helpMsgs[i].info, helpMsgs[i].description);        fErrorMap[helpMsgs[i].rc]["INTERNAL"] = helpData;        fServiceMap["INTERNAL"][helpMsgs[i].rc] = helpData;    }}STAFString STAFHelpService::info(unsigned int) const{    return name() + ": Internal";}STAFHelpService::~STAFHelpService(){    /* Do Nothing */}STAFServiceResult STAFHelpService::acceptRequest(    const STAFServiceRequest &requestInfo){    STAFString action = requestInfo.fRequest.subWord(0, 1).lowerCase();     if (action == "register")        return handleRegister(true, requestInfo);    else if (action == "unregister")        return handleRegister(false, requestInfo);    else if (action == "list")        return handleList(requestInfo);    else if ((action == "service") || (action == "error"))        return handleError(requestInfo);    else if (action == "help")        return handleHelp(requestInfo);        return kSTAFInvalidRequestString;}STAFServiceResult STAFHelpService::handleRegister(    bool isRegister, const STAFServiceRequest &requestInfo){    // Verify that this request came from the local machine and that    // the requesting machine/user has at least trust level 3    if (isRegister)    {        IVALIDATE_LOCAL_TRUST(3, "REGISTER");    }    else    {        IVALIDATE_LOCAL_TRUST(3, "UNREGISTER");    }     // Parse the request    STAFCommandParseResultPtr parsedResult = fRegParser.parse(        requestInfo.fRequest);     if (parsedResult->rc != kSTAFOk)    {        return STAFServiceResult(kSTAFInvalidRequestString,                                 parsedResult->errorBuffer);    }    DEFINE_VAR_POOL_LIST(varPoolList, varPoolListSize, requestInfo);    STAFString info = parsedResult->optionValue("INFO");    STAFString description = parsedResult->optionValue("DESCRIPTION");    STAFString service;    STAFString errorBuffer;    unsigned int errorNumber;    STAFRC_t rc = RESOLVE_OPTIONAL_UINT_OPTION("ERROR", errorNumber);    if (!rc) rc = RESOLVE_OPTIONAL_STRING_OPTION("SERVICE", service);    if (rc) return STAFServiceResult(rc, errorBuffer);    STAFString upperService = service.toUpperCase();    if (isRegister)    {        ServiceHelpData helpData = ServiceHelpData(info, description);        STAFMutexSemLock lock(fMapSem);        fErrorMap[errorNumber][upperService] = helpData;

⌨️ 快捷键说明

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