Search in sources :

Example 6 with JobExecutionFailure

use of cz.mzk.recordmanager.server.facade.exception.JobExecutionFailure in project RecordManager2 by moravianlibrary.

the class ZakonyProLidiFacadeImpl method runZakonyProLidiFulltextJob.

@Override
public void runZakonyProLidiFulltextJob() {
    Map<String, JobParameter> parameters = new HashMap<>();
    parameters.put(Constants.JOB_PARAM_CONF_ID, new JobParameter(Constants.IMPORT_CONF_ID_ZAKONY));
    parameters.put(Constants.JOB_PARAM_REPEAT, new JobParameter(Constants.JOB_PARAM_ONE_VALUE));
    JobParameters params = new JobParameters(parameters);
    JobExecution exec = jobExecutor.execute(Constants.JOB_ID_FULLTEXT_ZAKONYPROLIDI, params);
    if (!ExitStatus.COMPLETED.equals(exec.getExitStatus())) {
        throw new JobExecutionFailure("ZakonyProLidi fulltext failed", exec);
    }
}
Also used : JobExecution(org.springframework.batch.core.JobExecution) HashMap(java.util.HashMap) JobParameters(org.springframework.batch.core.JobParameters) JobParameter(org.springframework.batch.core.JobParameter) JobExecutionFailure(cz.mzk.recordmanager.server.facade.exception.JobExecutionFailure)

Aggregations

JobExecutionFailure (cz.mzk.recordmanager.server.facade.exception.JobExecutionFailure)6 HashMap (java.util.HashMap)6 JobExecution (org.springframework.batch.core.JobExecution)6 JobParameter (org.springframework.batch.core.JobParameter)6 JobParameters (org.springframework.batch.core.JobParameters)6 LocalDateTime (java.time.LocalDateTime)1 Date (java.util.Date)1