cfg_Server Class Reference
[Parser for config files; validation]

#include <cfg_server.h>

Inheritance diagram for cfg_Server:

Inheritance graph
[legend]
Collaboration diagram for cfg_Server:

Collaboration graph
[legend]

List of all members.


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 21 of file cfg_server.h.


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

Private Attributes

 log_CLASSID_m

Constructor & Destructor Documentation

cfg_Server::cfg_Server (  ) 

cfg_Server::cfg_Server ( const pf_File a_parsedFile  ) 

Definition at line 44 of file cfg_server.cpp.

References log_FUNC_m, and Refresh().

00044                                                   {
00045     log_FUNC_m(cfg_Server);
00046 
00047     Refresh(a_parsedFile);
00048 }

Here is the call graph for this function:

cfg_Server::~cfg_Server (  )  [virtual]

Definition at line 254 of file cfg_server.cpp.

00254                         {
00255 
00256 /*empty*/
00257 
00258 }


Member Function Documentation

void cfg_Server::Refresh ( const pf_File a_parsedFile  ) 

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

Definition at line 51 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_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_SYSTEMADMINPRIORITY, cfg_MIN_SYSTEMBACKUPPRIORITY, cfg_MIN_TIMESTEP, cfg_Base::CheckMandatory(), cfg_Base::Convert(), cfg_Base::ConvertFileHeader(), criticalWaterMark, dbg_NORM, 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().

00051                                                    {
00052     log_FUNC_m(Refresh);
00053 
00054     static const string c_host
00055                             = "Host";
00056     static const string c_criticalWaterMark
00057                             = "criticalWaterMark";
00058     static const string c_configurationHistory
00059                             = "configurationHistory";
00060 //[Allocation]
00061     static const string c_systemMaxNumDrivesRecall
00062                             = "systemMaxNumDrivesRecall";
00063     static const string c_systemMaxNumDrivesMigration
00064                             = "systemMaxNumDrivesMigration";
00065     static const string c_systemMaxNumDrivesAdmin
00066                             = "systemMaxNumDrivesAdmin";
00067     static const string c_systemMaxNumDrivesRecovery
00068                             = "systemMaxNumDrivesRecovery";
00069     static const string c_systemMaxNumDrivesMaint
00070                             = "systemMaxNumDrivesMaint";
00071 
00072 
00073     static const string c_resourceAllocationTreshold
00074                             = "resourceAllocationTreshold";
00075     static const string c_resourceAllocationThreshold
00076                             = "resourceAllocationThreshold";
00077     static const string c_timeStep
00078                             = "timeStep";
00079     static const string c_phaseFactor
00080                             = "phaseFactor";
00081 //[Buffers]
00082     static const string c_systemMaxMemoryBufferSize
00083                             = "systemMaxMemoryBufferSize";
00084 // [Jobs]
00085     static const string c_systemAdminPriority
00086                             = "systemAdminPriority";
00087 
00088     static const string c_systemBackupPriority
00089                             = "systemBackupPriority";
00090 
00091 
00092     ConvertFileHeader(a_parsedFile);
00093     val_RuleVec  rules;
00094 
00095         //common section
00096 //
00097 //     rules.Add(
00098 //         new val_StrictString(c_host, val_Limit(cfg_MIN_PARTITION_NAME, cfg_MAX_PARTITION_NAME)),
00099 //         this->host
00100 //     );
00101 
00102     rules.Add(
00103         new val_Percentage(c_criticalWaterMark,
00104                            val_Limit(cfg_MIN_CRITICALWATERMARK, cfg_MAX_CRITICALWATERMARK),
00105                            0,
00106                            1,
00107                            cfg_DEF_CRITICALWATERMARK),
00108         this->criticalWaterMark
00109     );
00110 
00111 //     rules.Add(
00112 //         new val_Integer(    c_configurationHistory, val_Limit(cfg_MIN_CONFHISTORY, cfg_MAX_CONFHISTORY)),
00113 //         this->configurationHistory
00114 //     );
00115 
00116     rules.Add(
00117         new val_Integer(c_systemMaxNumDrivesRecall,
00118                         val_Limit(cfg_MIN_MAXNUMDRIVESRECALL, cfg_MAX_MAXNUMDRIVESRECALL),
00119                         0,
00120                         1,
00121                         cfg_DEF_MAXNUMDRIVESRECALL),
00122         this->systemMaxNumDrivesRecall
00123     );
00124 
00125     rules.Add(
00126         new val_Integer(c_systemMaxNumDrivesMigration,
00127                         val_Limit(cfg_MIN_MAXNUMDRIVESMIGRATION, cfg_MAX_MAXNUMDRIVESMIGRATION),
00128                         0,
00129                         1,
00130                         cfg_DEF_MAXNUMDRIVESMIGRATION),
00131         this->systemMaxNumDrivesMigration
00132     );
00133 
00134     rules.Add(
00135         new val_Integer(c_systemMaxNumDrivesAdmin,
00136                         val_Limit(cfg_MIN_MAXNUMDRIVESADMIN, cfg_MAX_MAXNUMDRIVESADMIN),
00137                         0,
00138                         1,
00139                         cfg_DEF_MAXNUMDRIVESADMIN),
00140         this->systemMaxNumDrivesAdmin
00141     );
00142 
00143     rules.Add(
00144         new val_Integer(c_systemMaxNumDrivesRecovery,
00145                         val_Limit(cfg_MIN_MAXNUMDRIVESRECOVERY, cfg_MAX_MAXNUMDRIVESRECOVERY),
00146                         0,
00147                         1,
00148                         cfg_DEF_MAXNUMDRIVESRECOVERY),
00149         this->systemMaxNumDrivesRecovery
00150     );
00151 
00152     rules.Add(
00153         new val_Integer(c_systemMaxNumDrivesMaint,
00154                         val_Limit(cfg_MIN_MAXNUMDRIVESMAINT, cfg_MAX_MAXNUMDRIVESMAINT),
00155                         0,
00156                         1,
00157                         cfg_DEF_MAXNUMDRIVESMAINT),
00158         this->systemMaxNumDrivesMaint
00159     );
00160 
00161     rules.Add(
00162         new val_Percentage( c_resourceAllocationTreshold,
00163                             val_Limit(cfg_MIN_RESOURCEALLOCATIONTRESHOLD, cfg_MAX_RESOURCEALLOCATIONTRESHOLD),
00164                             0,
00165                             1,
00166                             cfg_DEF_RESOURCEALLOCATIONTRESHOLD),
00167         this->resourceAllocationTreshold
00168     );
00169 
00170     rules.Add(
00171         new val_Percentage( c_resourceAllocationThreshold,
00172                             val_Limit(cfg_MIN_RESOURCEALLOCATIONTHRESHOLD, cfg_MAX_RESOURCEALLOCATIONTHRESHOLD),
00173                             0,
00174                             1,
00175                             cfg_DEF_RESOURCEALLOCATIONTHRESHOLD),
00176         this->resourceAllocationThreshold
00177     );
00178 
00179     rules.Add(
00180         new val_Integer(c_timeStep,
00181                         val_Limit(cfg_MIN_TIMESTEP, cfg_MAX_TIMESTEP),
00182                         0,
00183                         1,
00184                         cfg_DEF_TIMESTEP),
00185         this->timeStep
00186     );
00187 
00188     rules.Add(
00189         new val_Integer(c_phaseFactor,
00190                         val_Limit(cfg_MIN_PHASEFACTOR, cfg_MAX_PHASEFACTOR),
00191                         0,
00192                         1,
00193                         cfg_DEF_PHASEFACTOR),
00194         this->phaseFactor
00195     );
00196 
00197 //     rules.Add(
00198 //         new val_Integer(    c_systemMaxMemoryBufferSize,
00199 //                             val_Limit(cfg_MIN_SYSTEMMAXMEMORYBUFFERSIZE, cfg_MAX_SYSTEMMAXMEMORYBUFFERSIZE)
00200 //
00201 //                             ),
00202 //         this->systemMaxMemoryBufferSize
00203 //     );
00204 
00205     rules.Add(
00206         new val_Integer(c_systemAdminPriority,
00207                         val_Limit(cfg_MIN_SYSTEMADMINPRIORITY, cfg_MAX_SYSTEMADMINPRIORITY),
00208                         0,
00209                         1,
00210                         cfg_DEF_SYSTEMADMINPRIORITY),
00211         this->systemAdminPriority
00212     );
00213 
00214     rules.Add(
00215         new val_Integer(c_systemBackupPriority,
00216                         val_Limit(cfg_MIN_SYSTEMBACKUPPRIORITY, cfg_MAX_SYSTEMBACKUPPRIORITY),
00217                         0,
00218                         1,
00219                         cfg_DEF_SYSTEMBACKUPPRIORITY),
00220         this->systemBackupPriority
00221     );
00222 
00223 
00224 
00225     /* Add new rules here
00226     rules.Add(new val_????(c_?????, val_Limit(  cfg_MIN_????, cfg_MAX_???? ) ), this->????);
00227     */
00228     log_DBG_m(dbg_NORM, "Added " << rules.rules.size() << " rules for cfg_Server");
00229 
00230     //Validate and convert common section
00231    Convert(a_parsedFile.m_common, rules);
00232 
00233    for (unsigned int i = 0; i < a_parsedFile.m_sections.size(); i++) {
00234         // if section name is needed here it is: i->first
00235         Convert(a_parsedFile.m_sections.m_vec[i] , rules);
00236    };
00237    CheckMandatory(rules);
00238 
00239    //bug 2991
00242    for (UInt32_t i(0); i < rules.rules.size(); i++){
00243        if (rules.rules[i]->GetName().compare(c_resourceAllocationTreshold) == 0 ){
00244            if (rules.rules[i]->m_numParsed > 0){
00245                log_DBG_m(dbg_NORM, "treshold was parsed "
00246                                     << rules.rules[i]->GetName());
00247                resourceAllocationThreshold = resourceAllocationTreshold;
00248            }
00249        }
00250    }
00251 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 34 of file cfg_server.h.

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

Definition at line 45 of file cfg_server.h.

Referenced by Refresh().

Reimplemented from cfg_Base.

Definition at line 60 of file cfg_server.h.


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

Generated on Mon Feb 27 19:04:13 2012 for OPENARCHIVE by  doxygen 1.5.6