* @throws ClientServicesException
*/
public Response retrieveData(String url, Map<String, String> parameters, Map<String, String> headers, String nameParameterId)
throws ClientServicesException {
Object data = null;
Response dataHolder = null;
String uniqueId = "";
if (nameParameterId != null) {
uniqueId = parameters.get(nameParameterId);
data = findInCache(uniqueId);
dataHolder = new Response(data);
}
if (data == null) {
dataHolder = getClientService().get(url, parameters, headers, getDataFormat());
//in case of 401 errors client service returns null
if (dataHolder == null) return null;
data = dataHolder.getData();
if (cacheSize > 0 && nameParameterId != null) {
addDataToCache(uniqueId, data);
}
}
return dataHolder;