Read Configuration Parameters
All of the fetch action methods you can override in ConnectorBase
are passed a task object that has a taskConfig()
that returns the configuration for the task.
NOTE: The task configuration returned by the methods of the TaskConfig
The following lines demonstrate how to read string, integer and
std::string param = task.taskConfig().get("Param", "DefaultValue"); int numeric = task.taskConfig().getInt("Numeric", 6); bool boolean = task.taskConfig().getBool("Boolean", true);
Each of the methods called above takes the name of the parameter to read and the default value to return if the parameter is not specified. Values for these parameters might be specified in a configuration file like this:
Param=MyValue Numeric=4 Boolean=False
You can read encrypted values (such as passwords that were encrypted with autpassword.exe
) using the getEncrypted
function:
std::string password = task.taskConfig().getEncrypted("Password");