Contains parameters from the cron
section of mascot.dat
.
More...
#include <ms_cronoptions.hpp>
Public Member Functions | |
ms_cronoptions () | |
Default constructor. | |
ms_cronoptions (const ms_cronoptions &src) | |
Copying constructor. | |
~ms_cronoptions () | |
Destructor. | |
void | appendCronJob (const ms_cronjob *job) |
Add a new job entry at the end of the list. | |
void | clearCronJobs () |
Delete all cron-job entries. | |
void | copyFrom (const ms_cronoptions *right) |
Can be used to create a copy of another object. | |
void | defaultValues () |
Initialises the instance with default values. | |
bool | deleteCronJob (const int idx) |
Delete a single cron job. | |
const ms_cronjob | getCronJob (const int idx) const |
Returns an object describing a single cron job by its number. | |
std::string | getLogFileName () const |
Returns the path to the log file. | |
int | getLoggingLevel () const |
Returns the current logging level. | |
int | getNumberOfCronJobs () const |
Returns the total number of cron-jobs configured. | |
std::string | getPreceedingComments () const |
Returns any comments preceeding the section. | |
bool | isCronEnabled () const |
Returns true if parameter CronEnabled is set to 1 and false otherwise. | |
bool | isSectionAvailable () const |
Returns TRUE if the section was actually read from a file. | |
ms_cronoptions & | operator= (const ms_cronoptions &right) |
Assignment operator for C++ client applications. | |
void | setCronEnabled (const bool value) |
Change CronEnabled. | |
bool | setCronJob (const int idx, const ms_cronjob job) |
Replace the current definition of a cron job. | |
bool | setLogFileName (const std::string &fileName) |
Sets the path to the log file. | |
bool | setLoggingLevel (const int level) |
Sets a new logging level. | |
void | setPreceedingComments (const std::string &comments) |
Sets any comments preceeding the section. | |
void | setSectionAvailable (const bool value) |
Changes availability of the section, meaning whether it should be stored in a file. |
Contains parameters from the cron
section of mascot.dat
.
On Unix systems, cron
can be used to automate routine procedures such as the overnight updating of sequence database files. Windows 2000 and later include an equivalent utility called Scheduled Tasks
. The Mascot ms-monitor.exe service/daemon runs the cron jobs listed in mascot.dat
In Mascot 2.4 and later, the Database Manager uses the cron job to download and update fasta database files.
For detailed information on any of the cron parameters please consult the Mascot manual.
See ms_datfile::getCronOptions() and ms_datfile::setCronOptions()
The base class ms_customproperty can be used to facilitate the following tasks:
More functionality is described in the documentation for ms_customproperty.
ms_cronoptions | ( | ) |
Default constructor.
The ms_cronoptions object will normally be created using ms_datfile::getCronOptions().
ms_cronoptions | ( | const ms_cronoptions & | src ) |
Copying constructor.
src | is a reference to the object to copy from. |
~ms_cronoptions | ( | ) |
Destructor.
Frees all memory. Pointers returned by getCronJob() are no longer valid.
void appendCronJob | ( | const ms_cronjob * | job ) |
Add a new job entry at the end of the list.
job | is a pointer to the new job |
void clearCronJobs | ( | ) |
Delete all cron-job entries.
This does not change the log file settings or the 'enabled' value.
void defaultValues | ( | ) |
Initialises the instance with default values.
Clears the list of cron jobs, sets the 'enabled' flag to false.
Reimplemented from ms_customproperty.
bool deleteCronJob | ( | const int | idx ) |
Delete a single cron job.
idx | a number from 0 to (getNumberOfCronJobs()-1). |
const ms_cronjob getCronJob | ( | const int | idx ) | const |
Returns an object describing a single cron job by its number.
All cron jobs are assigned consecutive ID numbers (0 based).
To make changes to the returned ms_cronjob permanent, call setCronJob() followed by ms_datfile::setCronOptions
idx | a number from 0 to (getNumberOfCronJobs()-1) |
std::string getLogFileName | ( | ) | const |
Returns the path to the log file.
The filename can be a relative or absolute path.
Parameter | Logfile |
---|---|
Permitted values | A non empty string |
Default (if no parameter in mascot.dat) | "../logs/cron.log" |
Value in mascot.dat | "../logs/cron.log" |
int getLoggingLevel | ( | ) | const |
Returns the current logging level.
The value specifies the level of logging. Messages are put into the file specified by getLogFileName()
Parameter | Logging |
---|---|
Permitted values | 0..3 where:
|
Default (if no parameter in mascot.dat) | 3 |
Value in mascot.dat | 3 |
int getNumberOfCronJobs | ( | ) | const |
Returns the total number of cron-jobs configured.
Every line (except the first one) in the cron
section represents a cron-job. This function returns a number of such lines (except commented out).
std::string getPreceedingComments | ( | ) | const [inherited] |
Returns any comments preceeding the section.
Sections in the mascot.dat file may have comments preceeding them. In most cases, these comments need to stay 'attached' to the section.
Multiple line comments are supported by having a single string with newline characters
bool isCronEnabled | ( | ) | const |
Returns true if parameter CronEnabled is set to 1 and false otherwise.
The first parameter in the cron
section of mascot.dat
is always CronEnabled parameter. The rest is a list of cron-jobs. See getNumberOfCronJobs() for more information about them.
CronEnable should be set to 1 to enable cron functionality, 0 to disable. By default it is disabled.
void setCronEnabled | ( | const bool | value ) |
Change CronEnabled.
See isCronEnabled() for more information.
value | should be true or false |
bool setCronJob | ( | const int | idx, |
const ms_cronjob | job | ||
) |
Replace the current definition of a cron job.
idx | a number from 0 to (getNumberOfCronJobs()-1). |
job | is the new definition for the job. |
bool setLogFileName | ( | const std::string & | fileName ) |
Sets the path to the log file.
The filename can be a relative or absolute path.
Parameter | Logfile |
---|---|
Permitted values | A non empty string |
Default (if no parameter in mascot.dat) | "../logs/cron.log" |
Value in mascot.dat | "../logs/cron.log" |
fileName | is the logging file name. |
bool setLoggingLevel | ( | const int | level ) |
Sets a new logging level.
The value specifies the level of logging. Messages are put into the file specified by getLogFileName()
Parameter | Logging |
---|---|
Permitted values | 0..3 where:
|
Default (if no parameter in mascot.dat) | 3 |
Value in mascot.dat | 3 |
level | is the new logging level, a value 0..3. |
void setPreceedingComments | ( | const std::string & | comments ) | [inherited] |
Sets any comments preceeding the section.
Sections in the mascot.dat file may have comments preceeding them. In most cases, these comments need to stay 'attached' to the section.
Multiple line comments are supported by having a single string with newline characters
comments | any comments preceeding the section |
Copyright © 2022 Matrix Science Ltd. All Rights Reserved. Generated on Thu Mar 31 2022 01:12:31 |