cfg_PMCfg Class Reference
[Parser for config files; validation]

#include <cfg_pm.h>

Inheritance diagram for cfg_PMCfg:

Inheritance graph
[legend]
Collaboration diagram for cfg_PMCfg:

Collaboration graph
[legend]

List of all members.


Detailed Description

cfg_PMCfg is derived from val_Base to handle configuration of the IVD Partition Manager.

See also:
parser

cfg_Base

val_Value

pf_File

Definition at line 119 of file cfg_pm.h.


Public Member Functions

 cfg_PMCfg ()
 cfg_PMCfg (const pf_File &a_parsedFile)
virtual ~cfg_PMCfg ()
void Refresh (const pf_File &a_parsedFile)
virtual void ConvertGroup (const string &a_grpName, const pf_Group &a_group)

Public Attributes

string name
vector< cfg_PMClientclients
 Vector of groups of type client.
cfg_PMTree globalTreeOptions
vector< cfg_PMTreetrees
 vector of groups of type tree
UInt32_t minFileAge
Int32_t maxMigJobSize
Int32_t hashSize
UInt32_t fileHeaderSize
UInt32_t minWaitTime
Int32_t minNumMigFiles
UInt64_t minMigSize
UInt32_t maxWaitTime
Int32_t maxNumMigFiles
UInt64_t maxMigSize
UInt32_t highWaterMark
UInt32_t lowWaterMark
UInt32_t criticalWaterMark
UInt32_t releaseInterval
UInt32_t migRetentionTime
UInt32_t recallRetentionTime
UInt64_t minFileSize
vector< val_Element< string > > releaseExcludeFile
UInt32_t recallTimeOut
UInt32_t maxNumDrives
UInt32_t maxNumDrivesRecall
UInt32_t maxNumDrivesMigration
UInt32_t maxNumDrivesReorg
UInt32_t maxNumDrivesRecovery
UInt32_t maxNumDrivesMaint
UInt32_t reserveNumDrives
UInt32_t reserveNumDrivesRecall
UInt32_t reserveNumDrivesMigration
UInt32_t reserveNumDrivesReorg
UInt32_t reserveNumDrivesRecovery
UInt32_t reserveNumDrivesMaint
UInt32_t partitionPriority
UInt32_t recallPriority
UInt32_t migrationPriority
UInt32_t reorgPriority
UInt32_t recoveryPriority
UInt32_t maintPriority
UInt32_t fscMode
string alternateDataPath
vector< cfg_PMFileExpirationdeleteFile

Private Member Functions

void ValidateFileExpiration (const cfg_PMFileExpiration &a_group)

Private Attributes

 log_CLASSID_m

Constructor & Destructor Documentation

cfg_PMCfg::cfg_PMCfg (  )  [inline]

Definition at line 122 of file cfg_pm.h.

00122 {};

cfg_PMCfg::cfg_PMCfg ( const pf_File a_parsedFile  ) 

Definition at line 47 of file cfg_pm.cpp.

References log_FUNC_m, and Refresh().

00047                                                 {
00048     log_FUNC_m(cfg_PMCfg);
00049     Refresh(a_parsedFile);
00050 }

Here is the call graph for this function:

virtual cfg_PMCfg::~cfg_PMCfg (  )  [inline, virtual]

Definition at line 124 of file cfg_pm.h.

00124 {};


Member Function Documentation

void cfg_PMCfg::Refresh ( const pf_File a_parsedFile  ) 

Definition at line 52 of file cfg_pm.cpp.

References val_RuleVec::Add(), alternateDataPath, cfg_PMTree::c_pools, cfg_DEF_ADPATH, cfg_DEF_CRITICALWATERMARK, cfg_DEF_FSCMODE, cfg_DEF_HIGHWATERMARK, cfg_DEF_LOWWATERMARK, cfg_DEF_MAXMIGJOBSIZE, cfg_DEF_MAXMIGSIZE, cfg_DEF_MAXNUMDRIVES_P, cfg_DEF_MAXNUMDRIVESMAINT_P, cfg_DEF_MAXNUMDRIVESMIG_P, cfg_DEF_MAXNUMDRIVESRECALL_P, cfg_DEF_MAXNUMDRIVESRECOVERY_P, cfg_DEF_MAXNUMDRIVESREORG_P, cfg_DEF_MAXNUMMIGFILES, cfg_DEF_MAXWAITTIME, cfg_DEF_MIGRETENTIONTIME, cfg_DEF_MINFILEAGE, cfg_DEF_MINFILESIZE, cfg_DEF_MINMIGSIZE, cfg_DEF_MINNUMMIGFILES, cfg_DEF_MINWAITTIME, cfg_DEF_PARTMAINTPRIORITY, cfg_DEF_PARTMIGPRIORITY, cfg_DEF_PARTRECALLPRIORITY, cfg_DEF_PARTRECOVERYPRIORITY, cfg_DEF_PARTREORGPRIORITY, cfg_DEF_RECALL_TIMEOUT, cfg_DEF_RECALLRETENTIONTIME, cfg_DEF_RELEASE_INTERVAL, cfg_MAX_ADPATH, cfg_MAX_CRITICALWATERMARK, cfg_MAX_FILENAME, cfg_MAX_FSCMODE, cfg_MAX_HIGHWATERMARK, cfg_MAX_LOWWATERMARK, cfg_MAX_MAXMIGJOBSIZE, cfg_MAX_MAXMIGSIZE, cfg_MAX_MAXNUMDRIVES_P, cfg_MAX_MAXNUMDRIVESMAINT_P, cfg_MAX_MAXNUMDRIVESMIG_P, cfg_MAX_MAXNUMDRIVESRECALL_P, cfg_MAX_MAXNUMDRIVESRECOVERY_P, cfg_MAX_MAXNUMDRIVESREORG_P, cfg_MAX_MAXNUMMIGFILES, cfg_MAX_MAXWAITTIME, cfg_MAX_MIGRETENTIONTIME, cfg_MAX_MINFILEAGE, cfg_MAX_MINFILESIZE, cfg_MAX_MINMIGSIZE, cfg_MAX_MINNUMMIGFILES, cfg_MAX_MINWAITTIME, cfg_MAX_PARTITION_NAME, cfg_MAX_PARTMAINTPRIORITY, cfg_MAX_PARTMIGPRIORITY, cfg_MAX_PARTPRIORITY, cfg_MAX_PARTRECALLPRIORITY, cfg_MAX_PARTRECOVERYPRIORITY, cfg_MAX_PARTREORGPRIORITY, cfg_MAX_POOL_NAME, cfg_MAX_RECALL_TIMEOUT, cfg_MAX_RECALLRETENTIONTIME, cfg_MAX_RELEASE_INTERVAL, cfg_MIN_ADPATH, cfg_MIN_CRITICALWATERMARK, cfg_MIN_FSCMODE, cfg_MIN_HIGHWATERMARK, cfg_MIN_LOWWATERMARK, cfg_MIN_MAXMIGJOBSIZE, cfg_MIN_MAXMIGSIZE, cfg_MIN_MAXNUMDRIVES_P, cfg_MIN_MAXNUMDRIVESMAINT_P, cfg_MIN_MAXNUMDRIVESMIG_P, cfg_MIN_MAXNUMDRIVESRECALL_P, cfg_MIN_MAXNUMDRIVESRECOVERY_P, cfg_MIN_MAXNUMDRIVESREORG_P, cfg_MIN_MAXNUMMIGFILES, cfg_MIN_MAXWAITTIME, cfg_MIN_MIGRETENTIONTIME, cfg_MIN_MINFILEAGE, cfg_MIN_MINFILESIZE, cfg_MIN_MINMIGSIZE, cfg_MIN_MINNUMMIGFILES, cfg_MIN_MINWAITTIME, cfg_MIN_PARTITION_NAME, cfg_MIN_PARTMAINTPRIORITY, cfg_MIN_PARTMIGPRIORITY, cfg_MIN_PARTPRIORITY, cfg_MIN_PARTRECALLPRIORITY, cfg_MIN_PARTRECOVERYPRIORITY, cfg_MIN_PARTREORGPRIORITY, cfg_MIN_POOL_NAME, cfg_MIN_RECALL_TIMEOUT, cfg_MIN_RECALLRETENTIONTIME, cfg_MIN_RELEASE_INTERVAL, cfg_Base::CheckMandatory(), cfg_Base::Convert(), cfg_Base::ConvertFileHeader(), criticalWaterMark, deleteFile, fscMode, globalTreeOptions, highWaterMark, log_FUNC_m, lowWaterMark, pf_File::m_common, pf_File::m_sections, pf_SectionList::m_vec, maintPriority, maxMigJobSize, maxMigSize, maxNumDrives, maxNumDrivesMaint, maxNumDrivesMigration, maxNumDrivesRecall, maxNumDrivesRecovery, maxNumDrivesReorg, maxNumMigFiles, maxWaitTime, migrationPriority, migRetentionTime, minFileAge, minFileSize, minMigSize, minNumMigFiles, minWaitTime, name, partitionPriority, cfg_PMTree::pools, recallPriority, recallRetentionTime, recallTimeOut, recoveryPriority, releaseExcludeFile, releaseInterval, reorgPriority, and pf_SectionList::size().

Referenced by cfg_PMCfg(), i_PartitionManager_i::ParseConfig(), and i_ResourceManager_i::ParsePMConfig().

00052                                                    {
00053     log_FUNC_m(Refresh);
00054 
00055     static const string c_name                  ("Name");
00056 
00057     //static const string c_fileChangeTrigger     ("FileChangeTrigger");
00058     static const string c_minFileAge            ("MinFileAge");
00059     static const string c_maxMigJobSize         ("MaxMigJobSize");
00060 
00061     static const string c_migrationWindow       ("MigrationWindow");
00062     static const string c_minWaitTime           ("MinWaitTime");
00063     static const string c_minNumMigFiles        ("MinNumMigFiles");
00064     static const string c_minMigSize            ("MinMigSize");
00065     static const string c_maxWaitTime           ("MaxWaitTime");
00066     static const string c_maxNumMigFiles        ("MaxNumMigFiles");
00067     static const string c_maxMigSize            ("MaxMigSize");
00068 
00069     //static const string c_forcedMigWaterMark    ("ForcedMigWaterMark");
00070 
00071     static const string c_migExcludeFile        ("MigExcludeFile");
00072     static const string c_migExcludePath        ("MigExcludePath");
00073 
00074     static const string c_highWaterMark         ("HighWaterMark");
00075     static const string c_lowWaterMark          ("LowWaterMark");
00076     static const string c_criticalWaterMark     ("CriticalWaterMark");
00077     static const string c_releaseInterval       ("ReleaseInterval");
00078     static const string c_startReleaseEarly     ("StartReleaseEarly");
00079     static const string c_startReleaseNumF      ("StartReleaseNumFiles");
00080     static const string c_startReleaseTime      ("StartReleaseTime");
00081 
00082     static const string c_migRetentionTime      ("MigRetentionTime");
00083     static const string c_recallRetentionTime   ("RecallRetentionTime");
00084     static const string c_minFileSize           ("MinFileSize");
00085     static const string c_releaseExcludeFile    ("ExcludeFromRelease");
00086     //static const string c_releaseExcludePath    ("ReleaseExcludePath");
00087 
00088     static const string c_recallTimeOut         ("RecallTimeOut");
00089 
00090     static const string c_maxNumDrives          ("MaxNumDrives");
00091     static const string c_maxNumDrivesRecall    ("MaxNumDrivesRecall");
00092     static const string c_maxNumDrivesMigration ("MaxNumDrivesMigration");
00093     static const string c_maxNumDrivesReorg     ("MaxNumDrivesReorg");
00094     static const string c_maxNumDrivesRecovery  ("MaxNumDrivesRecovery");
00095     static const string c_maxNumDrivesMaint     ("MaxNumDrivesMaint");
00096 
00097     static const string c_reserveNumDrives          ("ReserveNumDrives");
00098     static const string c_reserveNumDrivesRecall    ("ReserveNumDrivesRecall");
00099     static const string c_reserveNumDrivesMigration ("ReserveNumDrivesMigration");
00100     static const string c_reserveNumDrivesReorg     ("ReserveNumDrivesReorg");
00101     static const string c_reserveNumDrivesRecovery  ("ReserveNumDrivesRecovery");
00102     static const string c_reserveNumDrivesMaint  ("ReserveNumDrivesMaint");
00103 
00104     static const string c_partitionPriority     ("PartitionPriority");
00105     static const string c_recallPriority        ("RecallPriority");
00106     static const string c_migrationPriority     ("MigrationPriority");
00107     static const string c_reorgPriority         ("ReorgPriority");
00108     static const string c_recoveryPriority      ("RecoveryPriority");
00109     static const string c_maintPriority         ("MaintPriority");
00110 
00111     static const string c_fscMode               ("FscMode");
00112 
00113     static const string c_alternateDataPath     ("AlternateDataPath");
00114 
00115 
00116     ConvertFileHeader(a_parsedFile);
00117     val_RuleVec  rules;
00118 
00119 // common section
00120     rules.Add(
00121         new val_ObjectName( c_name,
00122                         val_Limit(cfg_MIN_PARTITION_NAME, cfg_MAX_PARTITION_NAME),
00123                         1,
00124                         1 ),
00125         this->name
00126     );
00127 //     rules.Add(
00128 //         new val_Integer(    cfg_PMTree::c_copies,
00129 //                             val_Limit(cfg_MIN_NUM_COPIES, cfg_MAX_NUM_COPIES)),
00130 //         this->globalTreeOptions.noOfCopies
00131 //     );
00132     rules.Add(
00133         new val_StrictStringList(cfg_PMTree::c_pools,
00134                            val_Limit(cfg_MIN_POOL_NAME, cfg_MAX_POOL_NAME),
00135                            1,
00136                            1),
00137         this->globalTreeOptions.pools
00138     );
00139 
00140     rules.Add(
00141         new val_Duration(c_minFileAge,
00142                          val_Limit(cfg_MIN_MINFILEAGE, cfg_MAX_MINFILEAGE),
00143                          0,
00144                          1,
00145                          cfg_DEF_MINFILEAGE ),
00146         this->minFileAge
00147     );
00148     rules.Add(
00149         new val_Size(c_maxMigJobSize,
00150                      val_Limit(cfg_MIN_MAXMIGJOBSIZE, cfg_MAX_MAXMIGJOBSIZE),
00151                      0,
00152                      1,
00153                      cfg_DEF_MAXMIGJOBSIZE ),
00154         this->maxMigJobSize
00155     );
00156 
00157 //Regular Migration
00158 
00159     rules.Add(
00160         new val_Duration(c_minWaitTime,
00161                          val_Limit(cfg_MIN_MINWAITTIME, cfg_MAX_MINWAITTIME),
00162                          0,
00163                          1,
00164                          cfg_DEF_MINWAITTIME ),
00165         this->minWaitTime
00166     );
00167     rules.Add(
00168         new val_Integer(c_minNumMigFiles,
00169                         val_Limit(cfg_MIN_MINNUMMIGFILES, cfg_MAX_MINNUMMIGFILES),
00170                         0,
00171                         1,
00172                         cfg_DEF_MINNUMMIGFILES ),
00173         this->minNumMigFiles
00174     );
00175     rules.Add(
00176         new val_Size(c_minMigSize,
00177                      val_Limit(cfg_MIN_MINMIGSIZE, cfg_MAX_MINMIGSIZE),
00178                      0,
00179                      1,
00180                      cfg_DEF_MINMIGSIZE ),
00181         this->minMigSize
00182     );
00183     rules.Add(
00184         new val_Duration(c_maxWaitTime,
00185                          val_Limit(cfg_MIN_MAXWAITTIME, cfg_MAX_MAXWAITTIME),
00186                          0,
00187                          1,
00188                          cfg_DEF_MAXWAITTIME),
00189         this->maxWaitTime
00190     );
00191     rules.Add(
00192         new val_Integer(c_maxNumMigFiles,
00193                         val_Limit(cfg_MIN_MAXNUMMIGFILES, cfg_MAX_MAXNUMMIGFILES ),
00194                         0,
00195                         1,
00196                         cfg_DEF_MAXNUMMIGFILES),
00197         this->maxNumMigFiles
00198     );
00199 
00200     rules.Add(
00201         new val_Size(c_maxMigSize,
00202                      val_Limit(cfg_MIN_MAXMIGSIZE, cfg_MAX_MAXMIGSIZE ),
00203                      0,
00204                      1,
00205                      cfg_DEF_MAXMIGSIZE),
00206         this->maxMigSize
00207     );
00208 
00209 // not used by anybody
00210 // ForcedMigration
00211 //     rules.Add(
00212 //         new val_Percentage(c_forcedMigWaterMark, val_Limit(  cfg_MIN_FORCEDMIGWATERMARK, cfg_MAX_FORCEDMIGWATERMARK ) ),
00213 //         this->forcedMigWaterMark
00214 //     );
00215 
00216 // MigrationFiles
00217 
00218 //     rules.Add(
00219 //         new val_StrictStringList(c_migExcludeFile,    val_Limit(1, cfg_MAX_FILENAME_d)),
00220 //         this->migExcludeFile
00221 //     );
00222 //     rules.Add(
00223 //         new val_StrictStringList(c_migExcludePath,    val_Limit(1, cfg_MAX_PATHNAME_d)),
00224 //         this->migExcludePath
00225 //     );
00226 
00227 // Release
00228     rules.Add(
00229         new val_Percentage(c_highWaterMark,
00230                            val_Limit(  cfg_MIN_HIGHWATERMARK, cfg_MAX_HIGHWATERMARK ),
00231                            0,
00232                            1,
00233                            cfg_DEF_HIGHWATERMARK ),
00234         this->highWaterMark
00235     );
00236     rules.Add(
00237         new val_Percentage(c_lowWaterMark,
00238                            val_Limit(  cfg_MIN_LOWWATERMARK, cfg_MAX_LOWWATERMARK ),
00239                            0,
00240                            1,
00241                            cfg_DEF_LOWWATERMARK ),
00242         this->lowWaterMark
00243     );
00244     rules.Add(
00245         new val_Percentage(c_criticalWaterMark,
00246                            val_Limit(  cfg_MIN_CRITICALWATERMARK, cfg_MAX_CRITICALWATERMARK ),
00247                            0,
00248                            1,
00249                            cfg_DEF_CRITICALWATERMARK),
00250         this->criticalWaterMark
00251     );
00252 
00253     rules.Add(
00254         new val_Duration(c_releaseInterval,
00255                          val_Limit(  cfg_MIN_RELEASE_INTERVAL, cfg_MAX_RELEASE_INTERVAL ),
00256                          0,
00257                          1,
00258                          cfg_DEF_RELEASE_INTERVAL),
00259         this->releaseInterval
00260     );
00261 //
00262 //     rules.Add(
00263 //         new val_Integer(    c_startReleaseEarly,
00264 //                             val_Limit(cfg_DEF_START_RELEASE_EARLY, cfg_MAX_START_RELEASE_EARLY),
00265 //                             0,
00266 //                             1,
00267 //                             cfg_DEF_START_RELEASE_EARLY),
00268 //         this->startReleaseEarly
00269 //     );
00270 //
00271 //     rules.Add(
00272 //         new val_Integer(    c_startReleaseNumF,
00273 //                             val_Limit(cfg_MIN_START_RELEASE_NUMF, cfg_MAX_START_RELEASE_NUMF),
00274 //                             0,
00275 //                             1,
00276 //                             cfg_DEF_START_RELEASE_NUMF),
00277 //         this->startReleaseNumFiles
00278 //     );
00279 //
00280 //     rules.Add(
00281 //         new val_Duration(   c_startReleaseTime,
00282 //                             val_Limit(cfg_MIN_START_RELEASE_TIME, cfg_MAX_START_RELEASE_TIME),
00283 //                             0,
00284 //                             1,
00285 //                             cfg_DEF_START_RELEASE_TIME),
00286 //         this->startReleaseTime
00287 //     );
00288 
00289 
00290 
00291 // ReleaseFiles
00292 
00293     rules.Add(
00294         new val_Duration(c_migRetentionTime,
00295                          val_Limit(  cfg_MIN_MIGRETENTIONTIME, cfg_MAX_MIGRETENTIONTIME ),
00296                          0,
00297                          1,
00298                          cfg_DEF_MIGRETENTIONTIME ),
00299         this->migRetentionTime
00300     );
00301 
00302     rules.Add(
00303         new val_Duration(c_recallRetentionTime,
00304                          val_Limit(  cfg_MIN_RECALLRETENTIONTIME, cfg_MAX_RECALLRETENTIONTIME ),
00305                          0,
00306                          1,
00307                          cfg_DEF_RECALLRETENTIONTIME ),
00308         this->recallRetentionTime
00309     );
00310 
00311     rules.Add(
00312         new val_Size(c_minFileSize,
00313                      val_Limit(  cfg_MIN_MINFILESIZE, cfg_MAX_MINFILESIZE ) ,
00314                      0,
00315                      1,
00316                      cfg_DEF_MINFILESIZE),
00317         this->minFileSize
00318     );
00319 
00320     rules.Add(
00321         new val_FileNamePatternList(c_releaseExcludeFile,
00322                                     val_Limit(  1, cfg_MAX_FILENAME ),
00323                                     0),
00324         this->releaseExcludeFile
00325     );
00326 //
00327 //     rules.Add(
00328 //         new val_StrictStringList(c_releaseExcludePath,  val_Limit(  1, cfg_MAX_PATHNAME_d ) ),
00329 //         this->releaseExcludePath
00330 //     );
00331 
00332 
00333     rules.Add(
00334         new val_Duration(c_recallTimeOut,
00335                          val_Limit(  cfg_MIN_RECALL_TIMEOUT, cfg_MAX_RECALL_TIMEOUT ),
00336                          0,
00337                          1,
00338                          cfg_DEF_RECALL_TIMEOUT ),
00339         this->recallTimeOut
00340     );
00341 
00342     //Allocation
00343     rules.Add(
00344         new val_Integer(c_maxNumDrives,
00345                         val_Limit(cfg_MIN_MAXNUMDRIVES_P, cfg_MAX_MAXNUMDRIVES_P ),
00346                         0,
00347                         1,
00348                         cfg_DEF_MAXNUMDRIVES_P),
00349         this->maxNumDrives
00350     );
00351 
00352     rules.Add(
00353         new val_Integer(c_maxNumDrivesRecall,
00354                         val_Limit(cfg_MIN_MAXNUMDRIVESRECALL_P, cfg_MAX_MAXNUMDRIVESRECALL_P ),
00355                         0,
00356                         1,
00357                         cfg_DEF_MAXNUMDRIVESRECALL_P),
00358         this->maxNumDrivesRecall
00359     );
00360 
00361     rules.Add(
00362         new val_Integer(c_maxNumDrivesMigration,
00363                         val_Limit(cfg_MIN_MAXNUMDRIVESMIG_P, cfg_MAX_MAXNUMDRIVESMIG_P ),
00364                         0,
00365                         1,
00366                         cfg_DEF_MAXNUMDRIVESMIG_P),
00367         this->maxNumDrivesMigration
00368     );
00369 
00370     rules.Add(
00371         new val_Integer(c_maxNumDrivesReorg,
00372                         val_Limit(cfg_MIN_MAXNUMDRIVESREORG_P, cfg_MAX_MAXNUMDRIVESREORG_P ),
00373                         0,
00374                         1,
00375                         cfg_DEF_MAXNUMDRIVESREORG_P),
00376         this->maxNumDrivesReorg
00377     );
00378 
00379     rules.Add(
00380         new val_Integer(c_maxNumDrivesRecovery,
00381                         val_Limit(cfg_MIN_MAXNUMDRIVESRECOVERY_P, cfg_MAX_MAXNUMDRIVESRECOVERY_P ),
00382                         0,
00383                         1,
00384                         cfg_DEF_MAXNUMDRIVESRECOVERY_P),
00385         this->maxNumDrivesRecovery
00386     );
00387 
00388 
00389     rules.Add(
00390         new val_Integer(c_maxNumDrivesMaint,
00391                         val_Limit(cfg_MIN_MAXNUMDRIVESMAINT_P, cfg_MAX_MAXNUMDRIVESMAINT_P ),
00392                         0,
00393                         1,
00394                         cfg_DEF_MAXNUMDRIVESMAINT_P),
00395         this->maxNumDrivesMaint
00396     );
00397 
00398 //     rules.Add(
00399 //         new val_Integer(    c_reserveNumDrives,
00400 //                             val_Limit(cfg_MIN_RESNUMDRIVES, cfg_MAX_RESNUMDRIVES ),
00401 //                             0,
00402 //                             1,
00403 //                             cfg_DEF_MAXNUMDRIVESREORG_P),
00404 //         this->reserveNumDrives
00405 //     );
00406 //
00407 //     rules.Add(
00408 //         new val_Integer(    c_reserveNumDrivesRecall,
00409 //                             val_Limit(cfg_MIN_RESNUMDRIVESRECALL, cfg_MAX_RESNUMDRIVESRECALL ),
00410 //                             0,
00411 //                             1,
00412 //                             cfg_DEF_MAXNUMDRIVESREORG_P),
00413 //         this->reserveNumDrivesRecall
00414 //     );
00415 //
00416 //     rules.Add(
00417 //         new val_Integer(    c_reserveNumDrivesMigration,
00418 //                             val_Limit(cfg_MIN_RESNUMDRIVESMIG, cfg_MAX_RESNUMDRIVESMIG ),
00419 //                             0,
00420 //                             1,
00421 //                             cfg_DEF_MAXNUMDRIVESREORG_P),
00422 //         this->reserveNumDrivesMigration
00423 //     );
00424 //
00425 //     rules.Add(
00426 //         new val_Integer(    c_reserveNumDrivesReorg,
00427 //                             val_Limit(cfg_MIN_RESNUMDRIVESREORG, cfg_MAX_RESNUMDRIVESREORG ),
00428 //                             0,
00429 //                             1,
00430 //                             cfg_DEF_MAXNUMDRIVESREORG_P),
00431 //         this->reserveNumDrivesReorg
00432 //     );
00433 
00434     rules.Add(
00435         new val_Integer(c_partitionPriority,
00436                         val_Limit(cfg_MIN_PARTPRIORITY, cfg_MAX_PARTPRIORITY ),
00437                         0,
00438                         1,
00439                         cfg_DEF_MAXNUMDRIVESREORG_P),
00440         this->partitionPriority
00441     );
00442 
00443     rules.Add(
00444         new val_Integer(c_recallPriority,
00445                         val_Limit(cfg_MIN_PARTRECALLPRIORITY, cfg_MAX_PARTRECALLPRIORITY ),
00446                         0,
00447                         1,
00448                         cfg_DEF_PARTRECALLPRIORITY),
00449         this->recallPriority
00450     );
00451 
00452     rules.Add(
00453         new val_Integer(c_migrationPriority,
00454                         val_Limit(cfg_MIN_PARTMIGPRIORITY, cfg_MAX_PARTMIGPRIORITY ),
00455                         0,
00456                         1,
00457                         cfg_DEF_PARTMIGPRIORITY),
00458         this->migrationPriority
00459     );
00460 
00461     rules.Add(
00462         new val_Integer(c_reorgPriority,
00463                         val_Limit(cfg_MIN_PARTREORGPRIORITY, cfg_MAX_PARTREORGPRIORITY ),
00464                         0,
00465                         1,
00466                         cfg_DEF_PARTREORGPRIORITY),
00467         this->reorgPriority
00468     );
00469 
00470     rules.Add(
00471         new val_Integer(c_recoveryPriority,
00472                         val_Limit(cfg_MIN_PARTRECOVERYPRIORITY, cfg_MAX_PARTRECOVERYPRIORITY ),
00473                         0,
00474                         1,
00475                         cfg_DEF_PARTRECOVERYPRIORITY),
00476         this->recoveryPriority
00477     );
00478 
00479     rules.Add(
00480         new val_Integer(c_maintPriority,
00481                         val_Limit(cfg_MIN_PARTMAINTPRIORITY, cfg_MAX_PARTMAINTPRIORITY ),
00482                         0,
00483                         1,
00484                         cfg_DEF_PARTMAINTPRIORITY),
00485         this->maintPriority
00486     );
00487 
00488     rules.Add(
00489         new val_Path( c_alternateDataPath,
00490                         val_Limit(cfg_MIN_ADPATH, cfg_MAX_ADPATH),
00491                         0,
00492                         1,
00493                         cfg_DEF_ADPATH),
00494         this->alternateDataPath
00495     );
00496 
00497 #if IVD_POSIX_OS
00498     #warning ""Is an enum conversion needed here?
00499 #elif TGT_OS_windows
00500     #pragma message ("WARNING: Is an enum conversion needed here?")
00501 #endif
00502     rules.Add(
00503         new val_Integer(c_fscMode,
00504                         val_Limit(cfg_MIN_FSCMODE, cfg_MAX_FSCMODE),
00505                         0,
00506                         1,
00507                         cfg_DEF_FSCMODE),
00508         this->fscMode
00509     );
00510 
00511 
00512     /* Add new rules here
00513     rules.Add(new val_????(c_?????, val_Limit(  cfg_MIN_????, cfg_MAX_???? ) ), this->????);
00514     */
00515     deleteFile.clear();
00516 
00517     //Validate and convert common section
00518     Convert(a_parsedFile.m_common, rules);
00519 
00520     //Validate and convert other sections
00521 
00522     for (unsigned int i = 0; i < a_parsedFile.m_sections.size(); i++) {
00523         // if section name is needed here it is: i->first
00524 
00525         Convert(a_parsedFile.m_sections.m_vec[i] , rules);
00526 
00527     };
00528 
00529     CheckMandatory(rules);
00530 }

Here is the call graph for this function:

Here is the caller graph for this function:

void cfg_PMCfg::ConvertGroup ( const string &  a_grpName,
const pf_Group a_group 
) [virtual]

Reimplemented from cfg_Base.

Definition at line 540 of file cfg_pm.cpp.

References cfg_FindGroupByName(), clients, dbg_DETAIL, deleteFile, pf_Group::grpType, log_DBG_m, log_FUNC_A_m, log_WRN_m, cfg_PMFileExpiration::m_pathList, strcasecmp, trees, and ValidateFileExpiration().

00540                                                                              {
00541     log_FUNC_A_m(ConvertGroup, "a_grpName " << a_grpName);
00542     log_DBG_m(dbg_DETAIL,"Converting Group Type: " << a_group.grpType );
00543     log_DBG_m(dbg_DETAIL,"Converting Group Name: " << a_grpName );
00544 
00545     static const string c_tree ("Tree"); //grpType Tree
00546     static const string c_client ("Client");
00547     static const string c_fileExpiration ("FileExpiration");
00548 
00549     if ( strcasecmp(a_group.grpType.c_str(), c_tree.c_str()) == 0 ) {
00550 
00551         Int32_t i = cfg_FindGroupByName(this->trees, a_grpName);
00552         cfg_PMTree tree(a_grpName, a_group);
00553         if (i == -1) {
00554             this->trees.push_back(tree);        //add new group of type Tree
00555         } else {
00556             this->trees[i] = tree;              //update group
00557         };
00558     }
00559     else if ( strcasecmp(a_group.grpType.c_str(), c_client.c_str()) == 0 ) {
00560         cfg_PMClient client(a_grpName, a_group);
00561         Int32_t i = cfg_FindGroupByName(this->clients, a_grpName);
00562 
00563         if (i == -1) {
00564             this->clients.push_back(client);    //add new group of type Client
00565         } else {
00566             this->clients[i] = client;          //update group
00567         };
00568     }
00569     else if ( strcasecmp(a_group.grpType.c_str(), c_fileExpiration.c_str()) == 0 ) {
00570         cfg_PMFileExpiration fileAge(a_grpName, a_group);
00571         Int32_t i = cfg_FindGroupByName(this->deleteFile, a_grpName);
00572         if (i == -1) {
00573             ValidateFileExpiration(fileAge);
00574             this->deleteFile.push_back(fileAge);  //add new group of type FileExpiration
00575         } else {
00576             for (UInt32_t j = 0; j < fileAge.m_pathList.size(); j++) {
00577                 bool pathExists = false;
00578                 for (UInt32_t k = 0; k < deleteFile[i].m_pathList.size(); k++) {
00579                     if (fileAge.m_pathList[j].Val() == deleteFile[i].m_pathList[k].Val()) {
00580                         pathExists = true;
00581                         break;
00582                     }
00583                 }
00584                 if (pathExists != true) {
00585                     this->deleteFile[i].m_pathList.push_back(fileAge.m_pathList[j].Val()); //append to group
00586                 }
00587             }
00588         };
00589     }
00590     else {
00591         log_WRN_m("Unknown group type: " << a_grpName);
00592     }
00593 }

Here is the call graph for this function:

void cfg_PMCfg::ValidateFileExpiration ( const cfg_PMFileExpiration a_group  )  [private]

Definition at line 595 of file cfg_pm.cpp.

References deleteFile, ie_NOT_VALID, ivd_Error, and cfg_PMFileExpiration::m_pathList.

Referenced by ConvertGroup().

00595                                                                           {
00596 
00597     vector<cfg_PMFileExpiration>::iterator iter = deleteFile.begin();
00598     while (iter != deleteFile.end()){
00599         for (UInt32_t i = 0; i < (*iter).m_pathList.size(); i++) {
00600             for (UInt32_t j = 0; j < a_group.m_pathList.size(); j++) {
00601                 if (a_group.m_pathList[j].Val() == (*iter).m_pathList[i].Val()) {
00602                     ostringstream oss;
00603                     oss << "Path \"" << a_group.m_pathList[j].Val()
00604                         << "\" has expiration age already set to " << (*iter).name;
00605                     throw ivd_Error(ie_NOT_VALID, oss.str());
00606                 }
00607             }
00608         }
00609         iter++;
00610     }
00611 }

Here is the caller graph for this function:


Member Data Documentation

vector of groups of type tree

Definition at line 140 of file cfg_pm.h.

Referenced by ConvertGroup().

Definition at line 142 of file cfg_pm.h.

Referenced by i_PartitionManager_i::FillClientCfg(), and Refresh().

Definition at line 143 of file cfg_pm.h.

Referenced by Refresh().

Definition at line 146 of file cfg_pm.h.

Referenced by i_PartitionManager_i::FillClientCfg().

Definition at line 147 of file cfg_pm.h.

Referenced by i_PartitionManager_i::FillClientCfg().

Definition at line 169 of file cfg_pm.h.

Referenced by i_PartitionManager_i::FillClientCfg(), and Refresh().

Definition at line 175 of file cfg_pm.h.

Referenced by i_PartitionManager_i::FillClientCfg(), and Refresh().

Definition at line 176 of file cfg_pm.h.

Referenced by i_PartitionManager_i::FillClientCfg(), and Refresh().

Definition at line 177 of file cfg_pm.h.

Referenced by i_PartitionManager_i::FillClientCfg(), and Refresh().

Definition at line 178 of file cfg_pm.h.

Referenced by i_PartitionManager_i::FillClientCfg(), and Refresh().

Definition at line 182 of file cfg_pm.h.

Referenced by i_PartitionManager_i::FillClientCfg(), and Refresh().

Definition at line 196 of file cfg_pm.h.

Referenced by i_ResourceManager_i::SetRMPartStatus().

Definition at line 197 of file cfg_pm.h.

Referenced by i_ResourceManager_i::SetRMPartStatus().

Definition at line 203 of file cfg_pm.h.

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

Definition at line 209 of file cfg_pm.h.

Referenced by Refresh().

Definition at line 212 of file cfg_pm.h.

Referenced by i_PartitionManager_i::FillClientCfg(), and Refresh().

Reimplemented from cfg_Base.

Definition at line 221 of file cfg_pm.h.


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

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