Search in sources :

Example 1 with ExecutionInfo

use of com.emc.vipr.model.catalog.ExecutionInfo in project coprhd-controller by CoprHD.

the class ApiMapperUtils method newExecutionInfo.

public static ExecutionInfo newExecutionInfo(ExecutionStateRestRep state, List<OrderLogRestRep> logs, List<ExecutionLogRestRep> taskLogs) {
    ExecutionInfo it = new ExecutionInfo();
    it.setStartDate(state.getStartDate());
    it.setEndDate(state.getEndDate());
    it.setExecutionStatus(state.getExecutionStatus());
    it.setCurrentTask(state.getCurrentTask());
    it.getAffectedResources().addAll(state.getAffectedResources());
    for (OrderLogRestRep log : logs) {
        ExecutionLogInfo info = new ExecutionLogInfo();
        info.setDate(log.getDate());
        info.setLevel(log.getLevel());
        info.setMessage(log.getMessage());
        info.setPhase(log.getPhase());
        info.setStackTrace(log.getStackTrace());
        it.getExecutionLogs().add(info);
    }
    for (ExecutionLogRestRep log : taskLogs) {
        ExecutionTaskInfo info = new ExecutionTaskInfo();
        info.setDate(log.getDate());
        info.setLevel(log.getLevel());
        info.setMessage(log.getMessage());
        info.setPhase(log.getPhase());
        info.setStackTrace(log.getStackTrace());
        info.setDetail(log.getDetail());
        info.setElapsed(log.getElapsed());
        it.getExecutionTasks().add(info);
    }
    return it;
}
Also used : ExecutionTaskInfo(com.emc.vipr.model.catalog.ExecutionTaskInfo) OrderLogRestRep(com.emc.vipr.model.catalog.OrderLogRestRep) ExecutionInfo(com.emc.vipr.model.catalog.ExecutionInfo) ExecutionLogInfo(com.emc.vipr.model.catalog.ExecutionLogInfo) ExecutionLogRestRep(com.emc.vipr.model.catalog.ExecutionLogRestRep)

Aggregations

ExecutionInfo (com.emc.vipr.model.catalog.ExecutionInfo)1 ExecutionLogInfo (com.emc.vipr.model.catalog.ExecutionLogInfo)1 ExecutionLogRestRep (com.emc.vipr.model.catalog.ExecutionLogRestRep)1 ExecutionTaskInfo (com.emc.vipr.model.catalog.ExecutionTaskInfo)1 OrderLogRestRep (com.emc.vipr.model.catalog.OrderLogRestRep)1