Example #1
0
String System::getErrorMSG_NLS(int errorCode,int errorCode2)
{
    LPVOID winErrorMsg = NULL;

    if (FormatMessage(
            FORMAT_MESSAGE_ALLOCATE_BUFFER |
            FORMAT_MESSAGE_FROM_SYSTEM |
            FORMAT_MESSAGE_IGNORE_INSERTS,
            NULL,
            errorCode,
            MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
            (LPTSTR)&winErrorMsg,
            0,
            NULL))
    {
        MessageLoaderParms parms(
            "Common.System.ERROR_MESSAGE.STANDARD",
            "$0 (error code $1)",(char*)winErrorMsg,errorCode);
        LocalFree(winErrorMsg);
        return MessageLoader::getMessage(parms);
    }

    MessageLoaderParms parms(
        "Common.System.ERROR_MESSAGE.STANDARD",
        "$0 (error code $1)","",errorCode);
    return MessageLoader::getMessage(parms);

}
String IndicationFormatter::_localizeBooleanStr(
    const Boolean & booleanValue,
    const Locale & locale)
{

    PEG_METHOD_ENTER (TRC_IND_FORMATTER,
	"IndicationFormatter::_localizeBooleanStr");

    if (booleanValue)
    {
	MessageLoaderParms parms(
	    "IndicationFormatter.IndicationFormatter._MSG_BOOLEAN_TRUE",
	    "true");

        PEG_METHOD_EXIT();
        return (MessageLoader::getMessage(parms));
    }
    else
    {
	MessageLoaderParms parms(
	    "IndicationFormatter.IndicationFormatter._MSG_BOOLEAN_FALSE",
	    "false");

        PEG_METHOD_EXIT();
        return (MessageLoader::getMessage(parms));
    }
}
Example #3
0
/* PrintHelp - This is temporary until we expand the options manager to allow
   options help to be defined with the OptionRow entries and presented from
   those entries.
*/
void PrintHelp(const char* arg0)
{
    String usage = String (USAGE);
    usage.append(COMMAND_NAME);
    usage.append(" [ [ options ] | [ configProperty=value, ... ] ]\n");
    usage.append("  options\n");
    usage.append("    -v, --version   - displays CIM Server version number\n");
    usage.append("    --status        - displays the running status of"
        " the CIM Server\n");
    usage.append("    -h, --help      - prints this help message\n");
    usage.append("    -s              - shuts down CIM Server\n");
#if !defined(PEGASUS_USE_RELEASE_DIRS)
    usage.append("    -D [home]       - sets pegasus home directory\n");
#endif
#if defined(PEGASUS_OS_TYPE_WINDOWS)
    usage.append("    -install [name] - installs pegasus as a Windows "
        "Service\n");
    usage.append("                      [name] is optional and overrides "
        "the\n");
    usage.append("                      default CIM Server Service Name\n");
    usage.append("                      by appending [name]\n");
    usage.append("    -remove [name]  - removes pegasus as a Windows "
        "Service\n");
    usage.append("                      [name] is optional and overrides "
        "the\n");
    usage.append("                      default CIM Server Service Name\n");
    usage.append("                      by appending [name]\n");
    usage.append("    -start [name]   - starts pegasus as a Windows Service\n");
    usage.append("                      [name] is optional and overrides "
        "the\n");
    usage.append("                      default CIM Server Service Name\n");
    usage.append("                      by appending [name]\n");
    usage.append("    -stop [name]    - stops pegasus as a Windows Service\n");
    usage.append("                      [name] is optional and overrides "
        "the\n");
    usage.append("                      default CIM Server Service Name\n");
    usage.append("                      by appending [name]\n\n");
#endif
    usage.append("  configProperty=value\n");
    usage.append("                    - sets CIM Server configuration "
        "property\n");

    cout << endl;
    cout << _cimServerProcess->getProductName() << " " <<
        _cimServerProcess->getCompleteVersion() << endl;
    cout << endl;

#if defined(PEGASUS_OS_TYPE_WINDOWS)
    MessageLoaderParms parms("src.Server.cimserver.MENU.WINDOWS", usage);
#elif defined(PEGASUS_USE_RELEASE_DIRS)
    MessageLoaderParms parms(
        "src.Server.cimserver.MENU.HPUXLINUXIA64GNU",
        usage);
#else
    MessageLoaderParms parms("src.Server.cimserver.MENU.STANDARD", usage);
#endif
    cout << MessageLoader::getMessage(parms) << endl;
}
void SSLContextManager::reloadTrustStore(Uint32 contextType)
{
    PEG_METHOD_ENTER(TRC_SSL, "SSLContextManager::reloadTrustStore()");

    SSL_CTX* sslContext;
    String trustStore = String::EMPTY;

    if ( contextType == SERVER_CONTEXT && _sslContext )
    {
        PEG_TRACE_STRING(TRC_SSL, Tracer::LEVEL4,
            "Context Type is Server Context.");
        sslContext = _sslContext->_rep->getContext();
        trustStore = _sslContext->getTrustStore();
    }
    else if ( contextType == EXPORT_CONTEXT && _exportSSLContext )
    {
        PEG_TRACE_STRING(TRC_SSL, Tracer::LEVEL4,
            "Context Type is Export Context.");
        sslContext = _exportSSLContext->_rep->getContext();
        trustStore = _exportSSLContext->getTrustStore();
    }
    else
    {
        PEG_TRACE_STRING(TRC_SSL, Tracer::LEVEL2,
          "Could not reload the trust store, SSL Context is not initialized.");

        MessageLoaderParms parms(
         "Pegasus.Common.SSLContextManager.COULD_NOT_RELOAD_TRUSTSTORE_SSL_CONTEXT_NOT_INITIALIZED",
         "Could not reload the trust store, SSL Context is not initialized.");
        PEG_METHOD_EXIT();
        throw SSLException(parms);
    }

    if (trustStore == String::EMPTY)
    {
        PEG_TRACE_STRING(TRC_SSL, Tracer::LEVEL4,
            "Could not reload the trust store, the trust store is not configured.");

        MessageLoaderParms parms(
            "Pegasus.Common.SSLContextManager.TRUST_STORE_NOT_CONFIGURED",
            "Could not reload the trust store, the trust store is not configured.");
        PEG_METHOD_EXIT();
        throw SSLException(parms);
    }

    X509_STORE* newStore = _getNewX509Store(trustStore);

    //
    // acquire write lock to Context object and then overwrite the trust 
    // store cache
    //
    {
        WriteLock contextLock(_sslContextObjectLock);
        SSL_CTX_set_cert_store(sslContext, newStore);
    }
    PEG_METHOD_EXIT();
}
CIMPropertyList WQLSelectStatementRep::getPropertyList(
        const CIMObjectPath& inClassName)
{
    if(_ctx == NULL){
        MessageLoaderParms parms(
            "WQL.WQLSelectStatementRep.QUERY_CONTEXT_IS_NULL",
            "Trying to process a query with a NULL Query Context.");
      throw QueryRuntimeException(parms);
    }

    if(_allProperties)
     return CIMPropertyList();

    CIMName className = inClassName.getClassName();
    if (className.isNull())
    {
     // If the caller passed in an empty className, then the
     // FROM class is to be used.
     className = _className;
    }

    // check if inClassName is the From class
    if(!(className == _className)){
        // check if inClassName is a subclass of the From class
        if(!_ctx->isSubClass(_className,className)){
            MessageLoaderParms parms(
                "WQL.WQLSelectStatementRep.CLASS_NOT_FROM_LIST_CLASS",
                "Class $0 does not match the FROM class or any of its"
                    " subclasses.",
                className.getString());
            throw QueryRuntimeException(parms);
        }
    }

    Array<CIMName> names =
            getWherePropertyList(inClassName).getPropertyNameArray();
    Array<CIMName> selectList =
            getSelectPropertyList(inClassName).getPropertyNameArray();

    // check for duplicates and remove them
    for(Uint32 i = 0; i < names.size(); i++){
        for(Uint32 j = 0; j < selectList.size(); j++){
            if(names[i] == selectList[j])
                selectList.remove(j);
            }
    }

    names.appendArray(selectList);
    CIMPropertyList list = CIMPropertyList();
    list.set(names);
    return list;
}
void SSLContextManager::reloadCRLStore()
{
    PEG_METHOD_ENTER(TRC_SSL, "SSLContextManager::reloadCRLStore()");

    if (!_sslContext && !_exportSSLContext)
    {
        PEG_TRACE_STRING(TRC_SSL, Tracer::LEVEL2,
        "Could not reload the crl store, SSL Context is not initialized.");

        MessageLoaderParms parms(
         "Pegasus.Common.SSLContextManager.COULD_NOT_RELOAD_CRL_STORE_SSL_CONTEXT_NOT_INITIALIZED",
         "Could not reload the crl store, SSL Context is not initialized.");

        PEG_METHOD_EXIT();
        throw SSLException(parms);
    }

    String crlPath = _sslContext->getCRLPath();

    if (crlPath == String::EMPTY)
    {
        PEG_TRACE_STRING(TRC_SSL, Tracer::LEVEL4,
            "Could not reload the crl store, the crl store is not configured.");

        MessageLoaderParms parms(
            "Pegasus.Common.SSLContextManager.CRL_STORE_NOT_CONFIGURED",
            "Could not reload the crl store, the crl store is not configured.");
        PEG_METHOD_EXIT();
        throw SSLException(parms);
    }

    PEG_TRACE_STRING(TRC_SSL, Tracer::LEVEL4, "CRL store path is " + crlPath);

    //update the CRL store for both the server and the export server since they share the same CRL store
    X509_STORE* crlStore;
    
    {
        WriteLock contextLock(_sslContextObjectLock);
        if (_sslContext)
        {
            _sslContext->_rep->setCRLStore(_getNewX509Store(crlPath));
        }
        if (_exportSSLContext)
        {
            _exportSSLContext->_rep->setCRLStore(_getNewX509Store(crlPath));
        }
    }

    PEG_METHOD_EXIT();
}
Element LanguageBuiltinImplementation::Interpret_( Environment& environment
                                                 , std::vector<Element> const& parmsIn
                                                 , Element const& // additional_parameters
                                                 )
{
    Element out;

    if (false == parmsIn.empty())
    {
        Element parm1 = parmsIn[0];
        std::vector<Element> parms(parmsIn.begin() + 1, parmsIn.end());
        
        bool isSuperString = false;
        SuperString SS = CastToSuperString(parm1, isSuperString);

        bool isString = false;
        String S = CastToString(parm1, isString);
        
        std::string id;
        if (isSuperString)
        {
            id = SS.Value();
        }

        if (isString)
        { 
            id = S.Value();
        }

        Translator& translator = this->translators.Get(id);
        out = Translate_(environment, parms, translator);
    }

    return out;
}
void CIMOperationResponseEncoder::enqueue(Message* message)
{
    try
    {
        handleEnqueue(message);
    }
    catch(PEGASUS_STD(bad_alloc)&)
    {
        MessageLoaderParms parms(
            "Server.CIMOperationResponseEncoder.OUT_OF_MEMORY",
            "A System error has occurred. Please retry the CIM Operation "
                "at a later time.");

        Logger::put_l(
            Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE, parms);

        CIMResponseMessage* response =
            dynamic_cast<CIMResponseMessage*>(message);
        Uint32 queueId = response->queueIds.top();
        MessageQueue* queue = MessageQueue::lookup(queueId);
        HTTPConnection* httpQueue = dynamic_cast<HTTPConnection*>(queue);
        PEGASUS_ASSERT(httpQueue);

        // Handle internal error on this connection.
        httpQueue->handleInternalServerError(
            response->getIndex(), response->isComplete());

        delete message;
    }
}
Example #9
0
int main (int argc, char* argv [])
{
    OSInfoCommand    command = OSInfoCommand ();
    int                rc;

    MessageLoader::setPegasusMsgHomeRelative(argv[0]);
    try
    {
        command.setCommand (argc, argv);
    }
    catch (const CommandFormatException& cfe)
    {
        cerr << OSInfoCommand::COMMAND_NAME << ": " << cfe.getMessage() << endl;

        MessageLoaderParms parms(ERR_USAGE_KEY,ERR_USAGE);
        parms.msg_src_path = MSG_PATH;
        cerr << OSInfoCommand::COMMAND_NAME <<
            ": " << MessageLoader::getMessage(parms) << endl;

        exit (Command::RC_ERROR);
    }
    catch (const InvalidLocatorException &ile)
    {
        cerr << OSInfoCommand::COMMAND_NAME << ": " << ile.getMessage() << endl;
        exit (Command::RC_ERROR);
    }

    rc = command.execute (cout, cerr);
    exit (rc);
    return 0;
}
Example #10
0
void
cimmofMessages::getMessage(String &out, MsgCode code, const arglist &args)
{
  //l10n
  Array<String> _args;
  for (unsigned int i = 0; i < 10; i++) {
  	if(i < args.size())
  		_args.append(args[i]);
  	else
  		_args.append("");
  }
  
  MessageLoaderParms parms(_cimmofMessagesKeys[(unsigned int)code],
  						   _cimmofMessages[(unsigned int)code],
  						   _args[0],_args[1],_args[2],_args[3],_args[4],
  						   _args[5],_args[6],_args[7],_args[8],_args[9]);
  						   
  out = MessageLoader::getMessage(parms);
  
  //String s = msgCodeToString(code);
  //out = s;
  //int pos;
  //for (unsigned int i = 0; i < args.size(); i++) {
    //int state = 0;
    //char buf[40];
    //sprintf(buf, "%d", i + 1);
    //String srchstr = "%";
    //srchstr.append(buf);
    //if ( (pos = find(out, srchstr)) != -1 ) {
      //replace(out, pos, srchstr.size(), args[i]);
    //}
  //}
}
int main (int argc, char* argv [])
{
    WbemExecCommand    command = WbemExecCommand ();
    int                rc;
    MessageLoader::setPegasusMsgHomeRelative(argv[0]);

#ifdef PEGASUS_OS_ZOS
    // for z/OS set stdout and stderr to EBCDIC
    setEBCDICEncoding(STDOUT_FILENO);
    setEBCDICEncoding(STDERR_FILENO);
#endif

    try
    {
        command.setCommand (argc, argv);
    }
    catch (const CommandFormatException& cfe)
    {
        cerr << WbemExecCommand::COMMAND_NAME << ": " << cfe.getMessage()
            << endl;

        MessageLoaderParms parms(ERR_USAGE_KEY,ERR_USAGE);
        parms.msg_src_path = MSG_PATH;
        cerr << WbemExecCommand::COMMAND_NAME <<
            ": " << MessageLoader::getMessage(parms) << endl;

        exit (Command::RC_ERROR);
    }

    rc = command.execute (cout, cerr);
    exit (rc);
    return 0;
}
void EmailListenerDestination::_writeStrToFile(
    const String & mailHdrStr,
    FILE * filePtr)
{
    PEG_METHOD_ENTER (TRC_IND_HANDLER,
                      "EmailListenerDestination::_writeStrToFile");

    String exceptionStr;

    if (fprintf(filePtr, "%s\n", (const char *)mailHdrStr.getCString()) < 0)
    {
        Tracer::trace(TRC_IND_HANDLER, Tracer::LEVEL4,
                      "Failed to write the %s to the file: %s.",
                      (const char *)mailHdrStr.getCString(),
                      strerror(errno));

        MessageLoaderParms parms(
            "Handler.EmailListenerDestination.EmailListenerDestination._MSG_WRITE_TO_THE_FILE_FAILED",
            "Failed to write the $0 to the file: $1.",
            mailHdrStr,
            strerror(errno));

        exceptionStr.append(MessageLoader::getMessage(parms));

        PEG_METHOD_EXIT();

        throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED, exceptionStr);
    }

    PEG_METHOD_EXIT();
}
void EmailListenerDestination::_openFile(
    FILE **filePtr,
    char * mailFile)
{
    PEG_METHOD_ENTER (TRC_IND_HANDLER,
                      "EmailListenerDestination::_openFile");

    String exceptionStr;

    *filePtr = fopen(tmpnam(mailFile), "w");
    if (*filePtr == NULL)
    {
        Tracer::trace(TRC_IND_HANDLER, Tracer::LEVEL4,
                      "fopen of %s failed: %s.", mailFile,
                      strerror(errno));

        MessageLoaderParms parms(
            "Handler.EmailListenerDestination.EmailListenerDestination._MSG_FAILED_TO_OPEN_THE_FILE",
            "fopen of $0 failed: $1.",
            mailFile,
            strerror(errno));

        exceptionStr.append(MessageLoader::getMessage(parms));

        PEG_METHOD_EXIT();

        throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED, exceptionStr);
    }

    PEG_METHOD_EXIT();
}
Example #14
0
void QueryExpression::setQueryContext(QueryContext& inCtx)
{
  if(_ss == NULL){
    MessageLoaderParms parms("Query.QueryExpression.SS_IS_NULL",
                             "Trying to process a query with a NULL SelectStatement.");
    throw QueryException(parms);
  }

  // SelectStatement only allows this to be called once.
  _ss->setQueryContext(inCtx);

#ifndef PEGASUS_DISABLE_CQL
  String cql("CIM:CQL");

  if (_queryLang == cql)
  {
    // Now that we have a QueryContext, we can finish compiling
    // the CQL statement.
    CQLSelectStatement* tempSS = dynamic_cast<CQLSelectStatement*>(_ss);
    if (tempSS != NULL)
    {
      CQLParser::parse(getQuery(), *tempSS);
      tempSS->applyContext();
    }
  }
#endif
}
Example #15
0
void get_token_vector(const CAnimData& animData, int begin, int end, std::vector<CToken>& tokensOut, bool preLock) {
  std::set<CPrimitive> prims;
  for (int i = begin; i < end; ++i) {
    CAnimPlaybackParms parms(i, -1, 1.f, true);
    animData.GetAnimationPrimitives(parms, prims);
  }
  primitive_set_to_token_vector(animData, prims, tokensOut, preLock);
}
Example #16
0
/**

    Constructs an UnexpectedOptionException using the value of the
    unexpected option string.

    @param  optionValue  the string representing the long option that was
                         unexpected

 */
UnexpectedOptionException::UnexpectedOptionException (const String& optionValue) :
    CommandFormatException (String ())
{
    MessageLoaderParms parms("Clients.cliutils.CommandException.UNEXPECTED_OPTION",
    						 "option \"-$0\" was unexpected",
    						 optionValue);
    _rep->message.append(MessageLoader::getMessage(parms));
}
void
JPlotFitExp::GenerateFit()
{
	CalculateFirstPass();
	JVector parms(2);
	parms.SetElement(1, itsAParm);
	parms.SetElement(2, itsBParm);
	JPlotFitBase::GenerateFit(parms, itsChi2Start);
}
Example #18
0
void UILabel::AddToMenu( UIMenu *menu, UIObject *parent )
{
	const Posef pose( Quatf( Vector3f( 0.0f, 1.0f, 0.0f ), 0.0f ), Vector3f( 0.0f, 0.0f, 0.0f ) );

	VRMenuObjectParms parms( VRMENU_STATIC, Array< VRMenuComponent* >(), VRMenuSurfaceParms(),
			"", pose, Vector3f( 1.0f ), FontParms, menu->AllocId(),
			VRMenuObjectFlags_t(), VRMenuObjectInitFlags_t( VRMENUOBJECT_INIT_FORCE_POSITION ) );

	AddToMenuWithParms( menu, parent, parms );
}
Example #19
0
void launch_renderTile (int numTiles, 
                        int* pixels, const int width, const int height, const float time, 
                        const Vec3fa& vx, const Vec3fa& vy, const Vec3fa& vz, const Vec3fa& p, const int numTilesX, const int numTilesY)
{
  TaskScheduler::EventSync event;
  RenderTileTask parms(pixels,width,height,time,vx,vy,vz,p,numTilesX,numTilesY);
  TaskScheduler::Task task(&event,(TaskScheduler::runFunction)renderTile_parallel,&parms,numTiles,NULL,NULL,"render");
  TaskScheduler::addTask(-1,TaskScheduler::GLOBAL_FRONT,&task);
  event.sync();
}
Example #20
0
void CScriptPlayerActor::SetupOnlineModelData() {
  if (x310_loadedCharIdx != x2e8_suitRes.GetCharacterNodeId() || !x64_modelData || !x64_modelData->HasAnimData()) {
    x2e8_suitRes.SetCharacterNodeId(x310_loadedCharIdx);
    SetModelData(std::make_unique<CModelData>(x2e8_suitRes));
    CAnimPlaybackParms parms(x2e8_suitRes.GetDefaultAnim(), -1, 1.f, true);
    x64_modelData->AnimationData()->SetAnimation(parms, false);
    if (x354_24_setBoundingBox)
      SetBoundingBox(x64_modelData->GetBounds(GetTransform().getRotation()));
  }
}
Example #21
0
String QueryExpression::getQuery() const
{
  if(_ss == NULL){
    MessageLoaderParms parms("Query.QueryExpression.SS_IS_NULL",
                             "Trying to process a query with a NULL SelectStatement.");
    throw QueryException(parms);
  }

  return _ss->getQuery();
}
    ProviderManagerContainer(
        const String& physicalName,
        const String& logicalName,
        const String& interfaceName,
        PEGASUS_INDICATION_CALLBACK_T indicationCallback,
        PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback,
        Boolean subscriptionInitComplete)
    : _manager(0)
    {
#if defined (PEGASUS_OS_VMS)
    String provDir = ConfigManager::getInstance()->
                                    getCurrentValue("providerDir");
    _physicalName = ConfigManager::getHomedPath(provDir) + "/" +
                       FileSystem::buildLibraryFileName(physicalName);
#else
        _physicalName = physicalName;  // providerMgrPath comes with full path
        //_physicalName = ConfigManager::getHomedPath(PEGASUS_DEST_LIB_DIR) +
        //    String("/") + FileSystem::buildLibraryFileName(physicalName);
#endif

        _logicalName = logicalName;
        _interfaceName = interfaceName;

        _module.reset(new ProviderManagerModule(_physicalName));
        Boolean moduleLoaded = _module->load();

        if (moduleLoaded)
        {
            _manager = _module->getProviderManager(_logicalName);
        }
        else
        {
            PEG_TRACE_CSTRING(TRC_PROVIDERMANAGER, Tracer::LEVEL2,
                "ProviderManagerModule load failed.");
        }

        if (_manager == 0)
        {
            MessageLoaderParms parms(
                "ProviderManager.BasicProviderManagerRouter."
                    "PROVIDERMANAGER_LOAD_FAILED",
                "Failed to load the Provider Manager for interface "
                    "type \"$0\" from library \"$1\".",
                _interfaceName, _physicalName);
            Logger::put_l(
                Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,
                parms);
            throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);
        }

        _manager->setIndicationCallback(indicationCallback);
        _manager->setResponseChunkCallback(responseChunkCallback);

        _manager->setSubscriptionInitComplete (subscriptionInitComplete);
    }
void IndicationFormatter::validateTextFormatParameters (
    const CIMPropertyList & propertyList,
    const CIMClass & indicationClass,
    const Array<String> & textFormatParams)
{
    PEG_METHOD_ENTER (TRC_IND_FORMATTER,
	"IndicationFormatter::validateTextFormatParameters");

    Array <String> indicationClassProperties;
    String exceptionStr;

    // All the properties are selected
    if (propertyList.isNull ())
    {
       for (Uint32 i = 0; i < indicationClass.getPropertyCount (); i++)
       {
	   indicationClassProperties.append(
	       indicationClass.getProperty (i).getName ().getString());
       }
    }
    // partial properties are selected
    else
    {
        Array<CIMName> propertyNames = propertyList.getPropertyNameArray();

	for (Uint32 j = 0; j < propertyNames.size(); j++)
	{
	    indicationClassProperties.append(propertyNames[j].getString());
	}
    }

    // check if the textFormatParams is contained in the
    // indicationClassProperties
    for (Uint32 k = 0; k < textFormatParams.size(); k++)
    {
        if (!Contains(indicationClassProperties, textFormatParams[k]))
	{
	    // The property name in TextFormatParameters is not
	    // included in the select clause of the associated filter query
	    MessageLoaderParms parms(
	    "IndicationFormatter.IndicationFormatter._MSG_MISS_MATCHED_PROPERTY_NAME",
	    "The property name $0 in $1 does not match the properties in the select clause",
	    textFormatParams[k],
	    _PROPERTY_TEXTFORMATPARAMETERS.getString());

	    exceptionStr.append(MessageLoader::getMessage(parms));

	    PEG_METHOD_EXIT();
	    throw PEGASUS_CIM_EXCEPTION (
		CIM_ERR_INVALID_PARAMETER, exceptionStr);
	}
    }

    PEG_METHOD_EXIT();
}
Example #24
0
/**

    Constructs an UnexpectedArgumentException using the value of the
    argument string.

    @param  argumentValue  the string containing the unexpected argument

 */
UnexpectedArgumentException::UnexpectedArgumentException
    (const String& argumentValue) : CommandFormatException (String ())
{
	//l10n
    //_rep->message = _MESSAGE_UNEXPECTED_ARG1;
    //_rep->message.append (argumentValue);
    //_rep->message.append (_MESSAGE_UNEXPECTED_ARG2);
    MessageLoaderParms parms("Clients.cliutils.CommandException.UNEXPECTED_ARG",
    						 "argument \"$0\" was unexpected",
    						 argumentValue);
    _rep->message.append(MessageLoader::getMessage(parms));
}
Example #25
0
/**

    Constructs an UnexpectedOptionException using the value of the
    unexpected option character.

    @param  optionValue  the character representing the option that was
                         unexpected

 */
UnexpectedOptionException::UnexpectedOptionException (char optionValue) :
    CommandFormatException (String ())
{
	//l10n
    //_rep->message = _MESSAGE_UNEXPECTED_OPT1;
    //_rep->message.append (optionValue);
    //_rep->message.append (_MESSAGE_UNEXPECTED_OPT2);
    MessageLoaderParms parms("Clients.cliutils.CommandException.UNEXPECTED_OPTION",
    						 "option \"-$0\" was unexpected",
    						 String().append(optionValue));
    _rep->message.append(MessageLoader::getMessage(parms));
}
Example #26
0
/**

    Constructs a MissingOptionException using the value of the missing
    required option character.

    @param  missingOption  the character representing the missing required
                           option

 */
MissingOptionException::MissingOptionException (char missingOption) :
    CommandFormatException (String ())
{
	//l10n
    //_rep->message = _MESSAGE_MISSING_OPTION1;
    //_rep->message.append (missingOption);
    //_rep->message.append (_MESSAGE_MISSING_OPTION2);
    MessageLoaderParms parms("Clients.cliutils.CommandException.MISSING_OPTION",
    						 "the \"-$0\" option is required",
    						 String().append(missingOption));
    _rep->message.append(MessageLoader::getMessage(parms));
}
Example #27
0
/**

    Constructs a MissingOptionArgumentException using the value of the
    option character whose argument is missing.

    @param  option  the character representing the option whose argument is
                    missing

 */
MissingOptionArgumentException::MissingOptionArgumentException (char option) :
    CommandFormatException (String ())
{
	//l10n
    //_rep->message = _MESSAGE_MISSING_OPTARG1;
    //_rep->message.append (option);
    //_rep->message.append (_MESSAGE_MISSING_OPTARG2);
    MessageLoaderParms parms("Clients.cliutils.CommandException.MISSING_OPTION_ARG",
    						 "missing argument value for \"-$0\" option",
    						 String().append(option));
    _rep->message.append(MessageLoader::getMessage(parms));
}
Example #28
0
/**

    Constructs an InvalidOptionException using the value of the invalid
    option character.

    @param  invalidOption  the character representing the invalid option

 */
InvalidOptionException::InvalidOptionException (char invalidOption) :
    CommandFormatException (String ())
{
	//l10n
    //_rep->message = _MESSAGE_INVALID_OPTION1;
    //_rep->message.append (invalidOption);
    //_rep->message.append (_MESSAGE_INVALID_OPTION2);
    MessageLoaderParms parms("Clients.cliutils.CommandException.INVALID_OPTION",
    						 "option \"-$0\" is not valid for this command",
    						 String().append(invalidOption));
    _rep->message.append(MessageLoader::getMessage(parms));						 
}
Example #29
0
/**

    Constructs a DuplicateOptionException using the value of the duplicate
    option character.

    @param  duplicateOption  the character representing the duplicate option

 */
DuplicateOptionException::DuplicateOptionException (char duplicateOption) :
    CommandFormatException (String ())
{
	//l10n
    //_rep->message = _MESSAGE_DUPLICATE_OPTION1;
    //_rep->message.append (duplicateOption);
    //_rep->message.append (_MESSAGE_DUPLICATE_OPTION2);
    MessageLoaderParms parms("Clients.cliutils.CommandException.DUPLICATE_OPTION",
    					     "duplicate \"-$0\" option",
    					     String().append(duplicateOption));
	_rep->message.append(MessageLoader::getMessage(parms));
}
Example #30
0
void UIImage::AddToMenuFlags( UIMenu *menu, UIWidget *parent, VRMenuObjectFlags_t const flags )
{
	const Posef pose( Quatf( Vector3f( 0.0f, 1.0f, 0.0f ), 0.0f ), Vector3f( 0.0f, 0.0f, 0.0f ) );

	Vector3f defaultScale( 1.0f );
	VRMenuFontParms fontParms( true, true, false, false, false, 1.0f );
	
	VRMenuObjectParms parms( VRMENU_BUTTON, Array< VRMenuComponent* >(), VRMenuSurfaceParms(),
			"", pose, defaultScale, fontParms, menu->AllocId(),
			flags, VRMenuObjectInitFlags_t( VRMENUOBJECT_INIT_FORCE_POSITION ) );

	AddToMenuWithParms( menu, parent, parms );
}