}
private void logResponse(final long id, final ClientResponse response) {
assert response != null;
PrintBuffer buff = new PrintBuffer();
prefixId(buff, id).append(NOTIFICATION_PREFIX).println("Client in-bound response");
prefixId(buff, id).append(RESPONSE_PREFIX).println(response.getStatusCode());
for (Map.Entry<String, List<String>> e : response.getHeaders().entrySet()) {
String header = e.getKey();
for (String value : e.getValue()) {
prefixId(buff, id).append(RESPONSE_PREFIX).append(header).append(": ").println(value);
}
}
prefixId(buff, id).println(RESPONSE_PREFIX);
String entity = response.getEntity(String.class);
if (entity != null && entity.length() != 0) {
buff.println(entity);
}
log(buff);
}