Step step = new Step(); step.setId(job.getId()); step.setDescription(job.getDescription()); step.setCorrelationId(job.getCorrelationId()); step.setStartTime(job.getStartTime());
public TaskWidget(Job job, String correlationId, TaskListModel taskListModel) { this.correlationId = correlationId; this.model = taskListModel; initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); jobProgressBar.setType(getProgressBarType(job.getStatus())); if (JobExecutionStatus.FINISHED.equals(job.getStatus()) || JobExecutionStatus.FAILED.equals(job.getStatus())) { markJobFinished(job); } if (JobExecutionStatus.STARTED.equals(job.getStatus())) { markJobStarted(job, correlationId); } label.getElement().setInnerSafeHtml(SafeHtmlUtils.fromString(job.getDescription())); }
@Override protected MapSqlParameterSource createFullParametersMapper(Job entity) { return createIdParameterMapper(entity.getId()) .addValue("action_type", EnumUtils.nameOrNull(entity.getActionType())) .addValue("description", entity.getDescription()) .addValue("status", EnumUtils.nameOrNull(entity.getStatus())) .addValue("owner_id", entity.getOwnerId()) .addValue("engine_session_seq_id", entity.getEngineSessionSeqId()) .addValue("visible", entity.isVisible()) .addValue("start_time", entity.getStartTime()) .addValue("end_time", entity.getEndTime()) .addValue("last_update_time", entity.getLastUpdateTime()) .addValue("correlation_id", entity.getCorrelationId()) .addValue("is_external", entity.isExternal()) .addValue("is_auto_cleared", entity.isAutoCleared()); }
@Mapping(from = org.ovirt.engine.core.common.job.Job.class, to = Job.class) public static Job map(org.ovirt.engine.core.common.job.Job entity, Job job) { Job model = job != null ? job : new Job(); model.setId(entity.getId().toString()); model.setDescription(entity.getDescription()); model.setStatus(mapJobStatus(entity.getStatus())); if (entity.getOwnerId() != null) { User user = new User(); user.setId(entity.getOwnerId().toString()); model.setOwner(user); } model.setStartTime(DateMapper.map(entity.getStartTime(), null)); if (entity.getEndTime() != null) { model.setEndTime(DateMapper.map(entity.getEndTime(), null)); } if (entity.getLastUpdateTime() != null) { model.setLastUpdated(DateMapper.map(entity.getLastUpdateTime(), null)); } model.setExternal(entity.isExternal()); model.setAutoCleared(entity.isAutoCleared()); return model; }