class SchedulerAdapter {

	public XmlBuilder getJobMessages(JobDef jobdef) {
		XmlBuilder jobMessages = new XmlBuilder("jobMessages");
		if (jobdef!=null) {
			MessageKeeper jobMessageKeeper = jobdef.getMessageKeeper();
			if (jobMessageKeeper!=null) {
				for (int t=0; t<jobMessageKeeper.size(); t++) {
					XmlBuilder jobMessage=new XmlBuilder("jobMessage");
					jobMessage.setValue(jobMessageKeeper.getMessage(t).getMessageText(),true);
					jobMessage.addAttribute("date", DateUtils.format(jobMessageKeeper.getMessage(t).getMessageDate(), DateUtils.FORMAT_FULL_GENERIC));
					jobMessage.addAttribute("level", jobMessageKeeper.getMessage(t).getMessageLevel());
					jobMessages.addSubElement(jobMessage);
				}
			}
		}
		return jobMessages;
	}

}