public String getScheduledJobParameter(String jobName, String paramName){
final String logp = CN + " :: getScheduleJobParameter - ";
LOGGER.debug(logp + "START");
SchedulerService schedulerService = null;
String value = "";
try{
//get scheduler service
schedulerService = Platform.getService(SchedulerService.class);
JobDetails jbDetails = schedulerService.getJobDetail(jobName);
value = (String)jbDetails.getParams().get(paramName).getValue();
LOGGER.info(logp + "Successfully obtained parameter value <" + value + ">" + "for job parameter <" + paramName + ">");
} catch(Exception e){
LOGGER.error(logp + "Exceptioin occurred while reading job parameter - " + paramName + " for job - " + jobName);
}
LOGGER.debug(logp + "END");
return value;
}
Happy Learning!!!
final String logp = CN + " :: getScheduleJobParameter - ";
LOGGER.debug(logp + "START");
SchedulerService schedulerService = null;
String value = "";
try{
//get scheduler service
schedulerService = Platform.getService(SchedulerService.class);
JobDetails jbDetails = schedulerService.getJobDetail(jobName);
value = (String)jbDetails.getParams().get(paramName).getValue();
LOGGER.info(logp + "Successfully obtained parameter value <" + value + ">" + "for job parameter <" + paramName + ">");
} catch(Exception e){
LOGGER.error(logp + "Exceptioin occurred while reading job parameter - " + paramName + " for job - " + jobName);
}
LOGGER.debug(logp + "END");
return value;
}
Happy Learning!!!
I have to get the parameter value for the past run. Say 7 days back when the scheduler was executed, what was the value of a particular parameter.
ReplyDelete