}
MessageTraceLog traceLog = new MessageTraceLog(record.getId());
List<StatisticsLog> logs = record.getAllStatisticsLogs();
StatisticsLog startLog = null;
StatisticsLog endLog = null;
for (StatisticsLog log : logs) {
if (log == null) {
continue;
}
if (startLog == null && log.getComponentType() != ComponentType.ANY) {
startLog = log;
} else if (startLog != null) {
endLog = log;
break;
}
}
if (startLog == null || endLog == null) {
continue;
}
traceLog.setType(startLog.getComponentType());
traceLog.setResourceId(startLog.getId());
switch (startLog.getComponentType()) {
case PROXYSERVICE:
traceLog.setRequestFaultStatus(startLog.isFault() ?
MessageTraceLog.FAULT_STATUS_TRUE : MessageTraceLog.FAULT_STATUS_FALSE);
if (!endLog.isEndAnyLog()) {
StatisticsLog lastLog = logs.get(logs.size() - 1);
traceLog.setResponseFaultStatus(lastLog.isFault() ?
MessageTraceLog.FAULT_STATUS_TRUE : MessageTraceLog.FAULT_STATUS_FALSE);
}
break;
case SEQUENCE: