Public Member Functions | Public Attributes | Private Attributes

cfg_Server Class Reference
[Parser for config files; validation]

cfg_Server is derived from cfg_Base to handle configuration of the IVD Server. More...

#include <cfg_server.h>

Inheritance diagram for cfg_Server:
Inheritance graph
[legend]
Collaboration diagram for cfg_Server:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 cfg_Server ()
 cfg_Server (const pf_File &a_parsedFile)
virtual ~cfg_Server ()
void Refresh (const pf_File &a_parsedFile)

Public Attributes

UInt32_t criticalWaterMark
UInt32_t systemMaxNumDrivesRecall
UInt32_t systemMaxNumDrivesMigration
UInt32_t systemMaxNumDrivesAdmin
UInt32_t systemMaxNumDrivesRecovery
UInt32_t systemMaxNumDrivesMaint
UInt32_t resourceAllocationTreshold
UInt32_t resourceAllocationThreshold
UInt32_t timeStep
UInt32_t phaseFactor
UInt32_t systemAdminPriority
UInt32_t systemBackupPriority
string dbusername
string dbpassword

Private Attributes

 log_CLASSID_m

Detailed Description

cfg_Server is derived from cfg_Base to handle configuration of the IVD Server.

See also:
parser
cfg_Base
val_Value
pf_File

Definition at line 35 of file cfg_server.h.


Constructor & Destructor Documentation

cfg_Server::cfg_Server (  ) 
cfg_Server::cfg_Server ( const pf_File a_parsedFile  ) 

Definition at line 58 of file cfg_server.cpp.

References log_FUNC_m, and Refresh().

                                                  {
    log_FUNC_m(cfg_Server);

    Refresh(a_parsedFile);
}

Here is the call graph for this function:

cfg_Server::~cfg_Server (  )  [virtual]

Definition at line 281 of file cfg_server.cpp.

                        {

/*empty*/

}


Member Function Documentation

void cfg_Server::Refresh ( const pf_File a_parsedFile  ) 

!!treshold will be obsoleted (SPELL CHECK) !use threshold instead

Definition at line 65 of file cfg_server.cpp.

References val_RuleVec::Add(), cfg_DEF_CRITICALWATERMARK, cfg_DEF_MAXNUMDRIVESADMIN, cfg_DEF_MAXNUMDRIVESMAINT, cfg_DEF_MAXNUMDRIVESMIGRATION, cfg_DEF_MAXNUMDRIVESRECALL, cfg_DEF_MAXNUMDRIVESRECOVERY, cfg_DEF_PHASEFACTOR, cfg_DEF_RESOURCEALLOCATIONTHRESHOLD, cfg_DEF_RESOURCEALLOCATIONTRESHOLD, cfg_DEF_SYSTEMADMINPRIORITY, cfg_DEF_SYSTEMBACKUPPRIORITY, cfg_DEF_TIMESTEP, cfg_MAX_CRITICALWATERMARK, cfg_MAX_MAXNUMDRIVESADMIN, cfg_MAX_MAXNUMDRIVESMAINT, cfg_MAX_MAXNUMDRIVESMIGRATION, cfg_MAX_MAXNUMDRIVESRECALL, cfg_MAX_MAXNUMDRIVESRECOVERY, cfg_MAX_PHASEFACTOR, cfg_MAX_RESOURCEALLOCATIONTHRESHOLD, cfg_MAX_RESOURCEALLOCATIONTRESHOLD, cfg_MAX_RMDBPASSWORD, cfg_MAX_RMDBUSERNAME, cfg_MAX_SYSTEMADMINPRIORITY, cfg_MAX_SYSTEMBACKUPPRIORITY, cfg_MAX_TIMESTEP, cfg_MIN_CRITICALWATERMARK, cfg_MIN_MAXNUMDRIVESADMIN, cfg_MIN_MAXNUMDRIVESMAINT, cfg_MIN_MAXNUMDRIVESMIGRATION, cfg_MIN_MAXNUMDRIVESRECALL, cfg_MIN_MAXNUMDRIVESRECOVERY, cfg_MIN_PHASEFACTOR, cfg_MIN_RESOURCEALLOCATIONTHRESHOLD, cfg_MIN_RESOURCEALLOCATIONTRESHOLD, cfg_MIN_RMDBPASSWORD, cfg_MIN_RMDBUSERNAME, cfg_MIN_SYSTEMADMINPRIORITY, cfg_MIN_SYSTEMBACKUPPRIORITY, cfg_MIN_TIMESTEP, cfg_Base::CheckMandatory(), cfg_Base::Convert(), cfg_Base::ConvertFileHeader(), criticalWaterMark, dbg_NORM, dbpassword, dbusername, log_DBG_m, log_FUNC_m, pf_File::m_common, pf_File::m_sections, pf_SectionList::m_vec, phaseFactor, resourceAllocationThreshold, resourceAllocationTreshold, val_RuleVec::rules, pf_SectionList::size(), systemAdminPriority, systemBackupPriority, systemMaxNumDrivesAdmin, systemMaxNumDrivesMaint, systemMaxNumDrivesMigration, systemMaxNumDrivesRecall, systemMaxNumDrivesRecovery, and timeStep.

Referenced by cfg_Server().

                                                   {
    log_FUNC_m(Refresh);

    static const string c_host
                            = "Host";
    static const string c_criticalWaterMark
                            = "criticalWaterMark";
    static const string c_configurationHistory
                            = "configurationHistory";
//[Allocation]
    static const string c_systemMaxNumDrivesRecall
                            = "systemMaxNumDrivesRecall";
    static const string c_systemMaxNumDrivesMigration
                            = "systemMaxNumDrivesMigration";
    static const string c_systemMaxNumDrivesAdmin
                            = "systemMaxNumDrivesAdmin";
    static const string c_systemMaxNumDrivesRecovery
                            = "systemMaxNumDrivesRecovery";
    static const string c_systemMaxNumDrivesMaint
                            = "systemMaxNumDrivesMaint";


    static const string c_resourceAllocationTreshold
                            = "resourceAllocationTreshold";
    static const string c_resourceAllocationThreshold
                            = "resourceAllocationThreshold";
    static const string c_timeStep
                            = "timeStep";
    static const string c_phaseFactor
                            = "phaseFactor";
//[Buffers]
    static const string c_systemMaxMemoryBufferSize
                            = "systemMaxMemoryBufferSize";
// [Jobs]
    static const string c_systemAdminPriority
                            = "systemAdminPriority";

    static const string c_systemBackupPriority
                            = "systemBackupPriority";
// [RMDB]
    static const string c_dBUsername
                            = "username";

    static const string c_dBPassword
                            = "password";

    ConvertFileHeader(a_parsedFile);
    val_RuleVec  rules;

        //common section
//
//     rules.Add(
//         new val_StrictString(c_host, val_Limit(cfg_MIN_PARTITION_NAME, cfg_MAX_PARTITION_NAME)),
//         this->host
//     );

    rules.Add(
        new val_Percentage(c_criticalWaterMark,
                           val_Limit(cfg_MIN_CRITICALWATERMARK, cfg_MAX_CRITICALWATERMARK),
                           0,
                           1,
                           cfg_DEF_CRITICALWATERMARK),
        this->criticalWaterMark
    );

//     rules.Add(
//         new val_Integer(    c_configurationHistory, val_Limit(cfg_MIN_CONFHISTORY, cfg_MAX_CONFHISTORY)),
//         this->configurationHistory
//     );

    rules.Add(
        new val_Integer(c_systemMaxNumDrivesRecall,
                        val_Limit(cfg_MIN_MAXNUMDRIVESRECALL, cfg_MAX_MAXNUMDRIVESRECALL),
                        0,
                        1,
                        cfg_DEF_MAXNUMDRIVESRECALL),
        this->systemMaxNumDrivesRecall
    );

    rules.Add(
        new val_Integer(c_systemMaxNumDrivesMigration,
                        val_Limit(cfg_MIN_MAXNUMDRIVESMIGRATION, cfg_MAX_MAXNUMDRIVESMIGRATION),
                        0,
                        1,
                        cfg_DEF_MAXNUMDRIVESMIGRATION),
        this->systemMaxNumDrivesMigration
    );

    rules.Add(
        new val_Integer(c_systemMaxNumDrivesAdmin,
                        val_Limit(cfg_MIN_MAXNUMDRIVESADMIN, cfg_MAX_MAXNUMDRIVESADMIN),
                        0,
                        1,
                        cfg_DEF_MAXNUMDRIVESADMIN),
        this->systemMaxNumDrivesAdmin
    );

    rules.Add(
        new val_Integer(c_systemMaxNumDrivesRecovery,
                        val_Limit(cfg_MIN_MAXNUMDRIVESRECOVERY, cfg_MAX_MAXNUMDRIVESRECOVERY),
                        0,
                        1,
                        cfg_DEF_MAXNUMDRIVESRECOVERY),
        this->systemMaxNumDrivesRecovery
    );

    rules.Add(
        new val_Integer(c_systemMaxNumDrivesMaint,
                        val_Limit(cfg_MIN_MAXNUMDRIVESMAINT, cfg_MAX_MAXNUMDRIVESMAINT),
                        0,
                        1,
                        cfg_DEF_MAXNUMDRIVESMAINT),
        this->systemMaxNumDrivesMaint
    );

    rules.Add(
        new val_Percentage( c_resourceAllocationTreshold,
                            val_Limit(cfg_MIN_RESOURCEALLOCATIONTRESHOLD, cfg_MAX_RESOURCEALLOCATIONTRESHOLD),
                            0,
                            1,
                            cfg_DEF_RESOURCEALLOCATIONTRESHOLD),
        this->resourceAllocationTreshold
    );

    rules.Add(
        new val_Percentage( c_resourceAllocationThreshold,
                            val_Limit(cfg_MIN_RESOURCEALLOCATIONTHRESHOLD, cfg_MAX_RESOURCEALLOCATIONTHRESHOLD),
                            0,
                            1,
                            cfg_DEF_RESOURCEALLOCATIONTHRESHOLD),
        this->resourceAllocationThreshold
    );

    rules.Add(
        new val_Integer(c_timeStep,
                        val_Limit(cfg_MIN_TIMESTEP, cfg_MAX_TIMESTEP),
                        0,
                        1,
                        cfg_DEF_TIMESTEP),
        this->timeStep
    );

    rules.Add(
        new val_Integer(c_phaseFactor,
                        val_Limit(cfg_MIN_PHASEFACTOR, cfg_MAX_PHASEFACTOR),
                        0,
                        1,
                        cfg_DEF_PHASEFACTOR),
        this->phaseFactor
    );

//     rules.Add(
//         new val_Integer(    c_systemMaxMemoryBufferSize,
//                             val_Limit(cfg_MIN_SYSTEMMAXMEMORYBUFFERSIZE, cfg_MAX_SYSTEMMAXMEMORYBUFFERSIZE)
//
//                             ),
//         this->systemMaxMemoryBufferSize
//     );

    rules.Add(
        new val_Integer(c_systemAdminPriority,
                        val_Limit(cfg_MIN_SYSTEMADMINPRIORITY, cfg_MAX_SYSTEMADMINPRIORITY),
                        0,
                        1,
                        cfg_DEF_SYSTEMADMINPRIORITY),
        this->systemAdminPriority
    );

    rules.Add(
        new val_Integer(c_systemBackupPriority,
                        val_Limit(cfg_MIN_SYSTEMBACKUPPRIORITY, cfg_MAX_SYSTEMBACKUPPRIORITY),
                        0,
                        1,
                        cfg_DEF_SYSTEMBACKUPPRIORITY),
        this->systemBackupPriority
    );

    rules.Add(
        new val_StrictString(c_dBUsername, val_Limit(cfg_MIN_RMDBUSERNAME, cfg_MAX_RMDBUSERNAME)),
        this->dbusername
    );
 
    rules.Add(
        new val_StrictString(c_dBPassword, val_Limit(cfg_MIN_RMDBPASSWORD, cfg_MAX_RMDBPASSWORD)),
        this->dbpassword
    );

    /* Add new rules here
    rules.Add(new val_????(c_?????, val_Limit(  cfg_MIN_????, cfg_MAX_???? ) ), this->????);
    */
    log_DBG_m(dbg_NORM, "Added " << rules.rules.size() << " rules for cfg_Server");

    //Validate and convert common section
   Convert(a_parsedFile.m_common, rules);

   for (unsigned int i = 0; i < a_parsedFile.m_sections.size(); i++) {
        // if section name is needed here it is: i->first
        Convert(a_parsedFile.m_sections.m_vec[i] , rules);
   };
   CheckMandatory(rules);

   //bug 2991
   for (UInt32_t i(0); i < rules.rules.size(); i++){
       if (rules.rules[i]->GetName().compare(c_resourceAllocationTreshold) == 0 ){
           if (rules.rules[i]->m_numParsed > 0){
               log_DBG_m(dbg_NORM, "treshold was parsed "
                                    << rules.rules[i]->GetName());
               resourceAllocationThreshold = resourceAllocationTreshold;
           }
       }
   }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 48 of file cfg_server.h.

Referenced by GeneratePFStructure(), ParseSystem(), and Refresh().

Definition at line 73 of file cfg_server.h.

Referenced by i_ResourceManager_i::i_ResourceManager_i(), and Refresh().

Definition at line 72 of file cfg_server.h.

Referenced by i_ResourceManager_i::i_ResourceManager_i(), and Refresh().

Reimplemented from cfg_Base.

Definition at line 78 of file cfg_server.h.

Definition at line 59 of file cfg_server.h.

Referenced by Refresh().


The documentation for this class was generated from the following files: