All Downloads are FREE. Search and download functionalities are using the official Maven repository.

works.lmz.jobs.periodic.ScheduledJobEvent.groovy Maven / Gradle / Ivy

The newest version!
package works.lmz.jobs.periodic

import java.text.SimpleDateFormat


class ScheduledJobEvent {
	static SimpleDateFormat df = new SimpleDateFormat('yyyy-MM-dd HH:mm:ss')

	Date start
	Date finish
	Throwable error
	String getLogMessage(){
		if (error){
			return "${df.format(start)} - job has resulted in ${error.class.simpleName}: ${error.getMessage()} at ${df.format(finish)}"
		}else if (finish == null){
			return "${df.format(start)} - job is still running..."
		}else{
			return "${df.format(start)} - ${df.format(finish)}"
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy