Search in sources :

Example 21 with ConfigurationValue

use of org.finra.herd.model.dto.ConfigurationValue in project herd by FINRAOS.

the class AbstractSystemJob method getJobDataMap.

/**
 * Returns a job data map that contains a single hash map that is loaded with name-value pairs as per specified list of configuration values. The parameter
 * names are loaded/stored in lowercase.
 *
 * @param configurationValues the list of configuration values
 *
 * @return the job data map that contains a single hash map loaded with job parameters
 */
protected JobDataMap getJobDataMap(ConfigurationValue... configurationValues) {
    // Create a hash map and load it with the specified configuration values.
    Map<String, String> jobParameters = new HashMap<>();
    for (ConfigurationValue configurationValue : configurationValues) {
        String parameterValue = configurationHelper.getProperty(configurationValue);
        jobParameters.put(configurationValue.getKey().toLowerCase(), parameterValue);
    }
    // Create a job data map and populate it with the parameters.
    JobDataMap jobDataMap = new JobDataMap();
    jobDataMap.put(SYSTEM_JOB_PARAMETERS, jobParameters);
    return jobDataMap;
}
Also used : ConfigurationValue(org.finra.herd.model.dto.ConfigurationValue) JobDataMap(org.quartz.JobDataMap) HashMap(java.util.HashMap)

Aggregations

ConfigurationValue (org.finra.herd.model.dto.ConfigurationValue)21 AbstractCoreTest (org.finra.herd.core.AbstractCoreTest)19 Test (org.junit.Test)19 MockEnvironment (org.springframework.mock.env.MockEnvironment)16 BigDecimal (java.math.BigDecimal)3 S3Actions (com.amazonaws.auth.policy.actions.S3Actions)1 Credentials (com.amazonaws.services.securitytoken.model.Credentials)1 HashMap (java.util.HashMap)1 AwsCredential (org.finra.herd.model.api.xml.AwsCredential)1 S3KeyPrefixInformation (org.finra.herd.model.api.xml.S3KeyPrefixInformation)1 StorageEntity (org.finra.herd.model.jpa.StorageEntity)1 AwsPolicyBuilder (org.finra.herd.service.helper.AwsPolicyBuilder)1 KmsActions (org.finra.herd.service.helper.KmsActions)1 JobDataMap (org.quartz.JobDataMap)1