return clientResponse.getEntity(String.class);
}
private String parseProcessInstanceResult(ClientResponse clientResponse) {
InstancesResult result = clientResponse
.getEntity(InstancesResult.class);
StringBuilder sb = new StringBuilder();
String toAppend;
sb.append("Consolidated Status: ").append(result.getStatus()).append("\n");
sb.append("\nInstances:\n");
sb.append("Instance\t\tCluster\t\tSourceCluster\t\tStatus\t\tStart\t\tEnd\t\tDetails\t\t\t\t\tLog\n");
sb.append("-----------------------------------------------------------------------------------------------\n");
if (result.getInstances() != null) {
for (InstancesResult.Instance instance : result.getInstances()) {
toAppend = instance.getInstance() != null ? instance.getInstance() : "-";
sb.append(toAppend).append("\t");
toAppend = instance.getCluster() != null ? instance.getCluster() : "-";
sb.append(toAppend).append("\t");
toAppend = instance.getSourceCluster() != null ? instance.getSourceCluster() : "-";
sb.append(toAppend).append("\t");
toAppend = (instance.getStatus() != null ? instance.getStatus().toString() : "-");
sb.append(toAppend).append("\t");
toAppend = instance.getStartTime() != null
? SchemaHelper.formatDateUTC(instance.getStartTime()) : "-";
sb.append(toAppend).append("\t");
toAppend = instance.getEndTime() != null
? SchemaHelper.formatDateUTC(instance.getEndTime()) : "-";
sb.append(toAppend).append("\t");
toAppend = (instance.getDetails() != null && !instance.getDetails().equals(""))
? instance.getDetails() : "-";
sb.append(toAppend).append("\t");
toAppend = instance.getLogFile() != null ? instance.getLogFile() : "-";
sb.append(toAppend).append("\n");
}
}
sb.append("\nAdditional Information:\n");
sb.append("Response: ").append(result.getMessage());
sb.append("Request Id: ").append(result.getRequestId());
return sb.toString();
}