EventCategory.ASYNC_JOB_CHANGE_EVENT.getName(),
jobEvent,
( job.getInstanceType() != null ? job.getInstanceType().toString() : "unknown" ), null);
User userJobOwner = _accountMgr.getUserIncludingRemoved(job.getUserId());
Account jobOwner = _accountMgr.getAccount(userJobOwner.getAccountId());
Map<String, String> eventDescription = new HashMap<String, String>();
eventDescription.put("command", job.getCmd());
eventDescription.put("user", userJobOwner.getUuid());
eventDescription.put("account", jobOwner.getUuid());
eventDescription.put("processStatus", "" + job.getProcessStatus());
eventDescription.put("resultCode", "" + job.getResultCode());
eventDescription.put("instanceUuid", ApiDBUtils.findJobInstanceUuid(job));
eventDescription.put("instanceType", ( job.getInstanceType() != null ? job.getInstanceType().toString() : "unknown" ) );
eventDescription.put("commandEventType", cmdEventType);
eventDescription.put("jobId", job.getUuid());
// If the event.accountinfo boolean value is set, get the human readable value for the username / domainname
Map<String, String> configs = _configDao.getConfiguration("management-server", new HashMap<String, String>());
if ( Boolean.valueOf(configs.get("event.accountinfo")) ) {
DomainVO domain = _domainDao.findById(jobOwner.getDomainId());
eventDescription.put("username", userJobOwner.getUsername());
eventDescription.put("domainname", domain.getName());
}
event.setDescription(eventDescription);