return clientResponse.getEntity(String.class);
}
private String parseProcessInstanceResult(ClientResponse clientResponse) {
InstancesResult result = clientResponse
.getEntity(InstancesResult.class);
StringBuffer sb = new StringBuffer();
String toAppend = null;
sb.append("Consolidated Status: " + result.getStatus() + "\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 + "\t");
toAppend = instance.getCluster() != null ? instance.getCluster() : "-";
sb.append(toAppend + "\t");
toAppend = instance.getSourceCluster() != null ? instance.getSourceCluster() : "-";
sb.append(toAppend + "\t");
toAppend = (instance.getStatus() != null ? instance.getStatus().toString() : "-");
sb.append(toAppend + "\t");
toAppend = instance.getStartTime() != null ? SchemaHelper.formatDateUTC(instance.getStartTime()) : "-";
sb.append(toAppend + "\t");
toAppend = instance.getEndTime() != null ? SchemaHelper.formatDateUTC(instance.getEndTime()) : "-";
sb.append(toAppend + "\t");
toAppend = (instance.getDetails() != null && !instance.getDetails().equals("")) ? instance.getDetails() : "-";
sb.append(toAppend + "\t");
toAppend = instance.getLogFile() != null ? instance.getLogFile() : "-";
sb.append(toAppend + "\n");
}
}
sb.append("\nAdditional Information:\n");
sb.append("Response: " + result.getMessage());
sb.append("Request Id: " + result.getRequestId() );
return sb.toString();
}