log.debug("Loading all " + entity.getName());
QueriedGetRequest request = new QueriedGetRequest();
request.setEntity(resolveApitraryEntity(entity));
QueriedGetResponse response = resolveApitraryClient().send(request);
if (HttpStatus.OK.ordinal() == response.getStatusCode()) {
return (List<T>) new QueriedGetResponseUnmarshaller(this).unMarshall(response, entity);
} else {
/*
* happens more often than expected...
*/
// if(HttpStatus.Internal_Server_Error.ordinal() ==
// response.getStatusCode()){
// throw new
// CommunicationErrorException(HttpStatus.Internal_Server_Error);
// }
throw new CommunicationErrorException(HttpStatus.getStatus(response.getStatusCode()), response.getResult());
}
}