Java Code Examples for com.sun.jersey.api.client.Client#target()

The following examples show how to use com.sun.jersey.api.client.Client#target() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public Map<String, Object> generateFacebookPostDownloadLink(String code, Integer count)
		throws AidrException {
	
	try {
		Client client = ClientBuilder.newBuilder()
				.register(JacksonFeature.class).build();
		
		String url = null;
		Response clientResponse = null;
		url = persisterMainUrl + "/taggerPersister/downloadFacebookPosts?collectionCode=" + code
				+ "&exportLimit=" + count;
		WebTarget webResource = client.target(url);
		clientResponse = webResource.request(MediaType.APPLICATION_JSON).get(Response.class);
		Map<String, Object> jsonResponse = clientResponse.readEntity(Map.class);
		return jsonResponse;
	} catch (Exception e) {
		logger.info(
				"Error while generating json filtered download link in Persister for collection: "
						+ code, e);
		throw new AidrException(
				"[generateCSVFilteredLink] Error while generating json filtered download link in Persister for collection",
				e);
	}
}
 
Example 2
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public String getRetainingThreshold() throws AidrException {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();

	try {

		WebTarget webResource = client.target(taggerMainUrl
				+ "/train/samplecountthreshold");

		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();
		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).get();

		// String jsonResponse = clientResponse.getEntity(String.class);
		String jsonResponse = clientResponse.readEntity(String.class);

		return jsonResponse;
	} catch (Exception e) {
		logger.error("Exception while getting training sampleCountThreshold", e);
		throw new AidrException("getRetainingThreshold : ", e);

	}

}
 
Example 3
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public TaggerResponseWrapper getHumanLabeledDocumentsByCrisisID(
		Long crisisID, Integer count) throws AidrException {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	try {
		// Rest call to Tagger
		WebTarget webResource = client.target(taggerMainUrl
				+ "/misc/humanLabeled/crisisID/" + crisisID + "?count="
				+ count);

		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();
		objectMapper.configure(
				DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES,
				false);
		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).get();

		String jsonResponse = clientResponse.readEntity(String.class);

		TaggerResponseWrapper dtoList = objectMapper.readValue(
				jsonResponse, TaggerResponseWrapper.class);
		logger.info("Number of human labeled documents returned by Tagger: "
				+ (dtoList.getHumanLabeledItems() != null ? dtoList
						.getHumanLabeledItems().size() : 0));

		return dtoList;
	} catch (Exception e) {
		logger.error("Error while getting all human labeled documents for crisisID = "
						+ crisisID + " from Tagger", e);
		throw new AidrException(
				"Error while getting all human labeled documents for crisisID = "
						+ crisisID + " from Tagger", e);
	}
}
 
Example 4
Source File: RestClientTest.java    From SigFW with GNU Affero General Public License v3.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
 
     try {
         //Client client = Client.create();
         // Accept self-signed certificates
         Client client = createClient();

         String username = "user";
         String password = "password";
         //client.addFilter(new HTTPBasicAuthFilter(username, password));
         HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic(username, password);
         client.register(feature);
         
         WebTarget webResource = client.target("https://localhost:8443");
         WebTarget webResourceWithPath = webResource.path("ss7fw_api/1.0/eval_sccp_message_in_ids");
         WebTarget webResourceWithQueryParam = webResourceWithPath.matrixParam("sccp_raw", "12345");
         
         System.out.println(webResourceWithQueryParam);
         
         //ClientResponse response = webResourceWithQueryParam.accept("text/plain").get(ClientResponse.class);
         Response response = webResourceWithQueryParam.request("text/plain").get();
         
         if (response.getStatus() != 200) {
            throw new RuntimeException("Failed : HTTP error code : " + response.getStatus());
         }

         String output = response.readEntity(String.class);

         System.out.println("Output from Server .... \n");
         System.out.println(output);

} catch (Exception e) {
           e.printStackTrace();
}
     
 }
 
Example 5
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public boolean saveTaskAnswer(List<TaskAnswer> taskAnswer)
		throws AidrException {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	try {
		WebTarget webResource = client.target(crowdsourcingAPIMainUrl
				+ "/taskanswer/save");
		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();

		logger.info("saveTaskAnswer - postData : "
				+ objectMapper.writeValueAsString(taskAnswer));

		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).post(
				Entity.json(objectMapper.writeValueAsString(taskAnswer)),
				Response.class);
		//logger.info("saveTaskAnswer - response status : "
			//	+ clientResponse.getStatus());

		return clientResponse.getStatus() == 200 
				|| clientResponse.getStatus() == 204;
	} catch (Exception e) {
		logger.error("Error while saving TaskAnswer in AIDRCrowdsourcing", e);
		return true;
	}
}
 
Example 6
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public boolean deleteTrainingExample(Integer id) throws AidrException {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	try {
		/**
		 * Rest call to Tagger
		 */
		WebTarget webResource = client.target(taggerMainUrl
				+ "/document/removeTrainingExample/" + new Long(id));

		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();
		objectMapper
				.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).delete();

		String jsonResponse = clientResponse.readEntity(String.class);

		TaggerStatusResponse response = objectMapper.readValue(
				jsonResponse, TaggerStatusResponse.class);
		if (response != null && response.getStatusCode() != null) {
			if ("SUCCESS".equals(response.getStatusCode())) {
				logger.info("Document with ID " + id
						+ " was deleted in Tagger");
				return true;
			} else {
				return false;
			}
		}
		return false;
	} catch (Exception e) {
		logger.error("Error while deleting document", e);
		throw new AidrException("Error while deleting document in Tagger",
				e);
	}
}
 
Example 7
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public String importTrainingData(Long targetCollectionId,
		String sourceCollectionCode, Long attributeId) {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	Response clientResponse = null;
	String jsonResponse = null;
	try {
		Collection collection = collectionService.findByCode(sourceCollectionCode);
		if (collection != null) {
			WebTarget webResource = client.target(crowdsourcingAPIMainUrl
					+ "/document/import/training-set");
			/*Map<String, Object> attributeMap = new HashMap<>();
			attributeMap.put("targetCollectionId", targetCollectionId);
			attributeMap.put("sourceCollectionId", collection.getId());
			attributeMap.put("attributeId", attributeId);
			clientResponse = webResource
					.request(MediaType.APPLICATION_JSON).post(Entity.json(attributeMap),
							Response.class);*/
			
			Form form = new Form();
			form.param("targetCollectionId", targetCollectionId.toString());
			form.param("sourceCollectionId", collection.getId().toString());
			form.param("attributeId", attributeId.toString());
			
			clientResponse = webResource.request().post(
					Entity.entity(form,MediaType.APPLICATION_FORM_URLENCODED),Response.class);

			jsonResponse = clientResponse.readEntity(String.class);
		}
	} catch (Exception e) {
		logger.error(
				"Error in contacting AIDRTrainerAPI: " + clientResponse, e);
	}
	return jsonResponse;
}
 
Example 8
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public Long getTaggedImageCount(Integer crisisID) {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	
	Long count = 0L;
	try {
		// Rest call to Tagger
		WebTarget webResource = client.target(crowdsourcingAPIMainUrl
				+ "/taggedImage/getCount/" + crisisID);

		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();
		objectMapper.configure(
				DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES,
				false);
		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).get();

		String jsonResponse = clientResponse.readEntity(String.class);

		count = objectMapper.readValue(
				jsonResponse, Long.class);

	} catch (Exception e) {
		logger.error("Error while getting image count for collection = "
						+ crisisID, e);
	}
	
	return count;
}
 
Example 9
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public TaggerAttribute getAttributeInfo(Integer id) throws AidrException {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	try {
		// Rest call to Tagger
		logger.info("received request for nominal attribute id: " + id);
		WebTarget webResource = client.target(taggerMainUrl + "/attribute/"
				+ new Long(id));

		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();
		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).get();
		String jsonResponse = clientResponse.readEntity(String.class);
		NominalAttributeDTO dto = objectMapper.readValue(jsonResponse,
				NominalAttributeDTO.class);
		TaggerAttribute response = dto != null ? new TaggerAttribute(dto)
				: null;
		logger.info("Received response: " + response != null ? response
				.getName() : "no attribute for id = " + id);
		if (response != null) {
			logger.info("Attribute with ID "
					+ response.getNominalAttributeID()
					+ " was retrieved from Tagger");
		}
		return response;
	} catch (Exception e) {
		logger.error("Error while getting attribute info for attribute: "+id, e);
		throw new AidrException(
				"Error while getting attribute from Tagger", e);
	}
}
 
Example 10
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public String getAssignableTask(Integer id, String userName)
		throws AidrException {

	Integer taggerUserId = isUserExistsByUsername(userName);

	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	try {
		// taskBufferNumber currently always 1
		int taskBufferNumber = 1;
		// WebResource webResource = client.resource(crowdsourcingAPIMainUrl
		// + "/taskbuffer/getassignabletask/" + userName + "/" + id + "/" +
		// taskBufferNumber);
		WebTarget webResource = client.target(crowdsourcingAPIMainUrl
				+ "/document/getassignabletask/" + userName + "/" + id
				+ "/" + taskBufferNumber);

		// ClientResponse clientResponse =
		// webResource.type(MediaType.APPLICATION_JSON)
		// .accept(MediaType.APPLICATION_JSON)
		// .get(ClientResponse.class);
		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).get();
		logger.info("getAssignableTask - clientResponse : "
				+ clientResponse);

		// String jsonResponse = clientResponse.getEntity(String.class);
		String jsonResponse = clientResponse.readEntity(String.class);

		return jsonResponse;
	} catch (Exception e) {
		logger.error("Error while getting Assignable Task in Tagger for user: "+userName, e);
		throw new AidrException(
				"Error while getting Assignable Task in Tagger", e);
	}
}
 
Example 11
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public boolean pingPersister() throws AidrException {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	try {
		WebTarget webResource = client.target(persisterMainUrl
				+ "/persister/ping");

		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();
		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).get();

		String jsonResponse = clientResponse.readEntity(String.class);

		PingResponse pingResponse = objectMapper.readValue(jsonResponse,
				PingResponse.class);
		if (pingResponse != null
				&& "RUNNING".equals(pingResponse.getStatus())) {
			return true;
		} else {
			return false;
		}
	} catch (Exception e) {
		logger.error("Error while pinging persister", e);
		throw new AidrException(
				"Error while pinging persister",e);
	}
}
 
Example 12
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public List<TaggerModelNominalLabel> getAllLabelsForModel(Integer modelID,
		String crisisCode) throws AidrException {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	try {
		/**
		 * Rest call to Tagger
		 */
		//logger.info("received request for modelID = " + modelID);
		WebTarget webResource = client.target(taggerMainUrl
				+ "/modelNominalLabel/" + modelID + "/" + crisisCode);

		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();
		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).get();
		String jsonResponse = clientResponse.readEntity(String.class);

		TaggerModelLabelsResponse modelLabelsResponse = objectMapper
				.readValue(jsonResponse, TaggerModelLabelsResponse.class);

		if (modelLabelsResponse.getModelNominalLabelsDTO() != null) {
			logger.info("Tagger returned "
					+ modelLabelsResponse.getModelNominalLabelsDTO().size()
					+ " labels for model with ID " + modelID);
			for (TaggerModelNominalLabel dto : modelLabelsResponse
					.getModelNominalLabelsDTO()) {
				logger.info("Training count for crisis = " + crisisCode
						+ ", label: " + dto.getNominalLabel().getName()
						+ " is = " + dto.getTrainingDocuments());
			}
		}

		return modelLabelsResponse.getModelNominalLabelsDTO();
	} catch (Exception e) {
		logger.error("Error while getting all labels for model from Tagger for the crisis: "+crisisCode, e);
		throw new AidrException(
				"Error while getting all labels for model from Tagger", e);
	}
}
 
Example 13
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
private void deletePybossaApp(Integer modelFamilyID) {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	try {

		//System.out.print("removeAttributeFromCrises: starting ......................................");
		WebTarget webResource = client.target(taggerMainUrl
				+ "/modelfamily/" + modelFamilyID);

		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();
		objectMapper
				.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);

		Response resp = webResource.request(MediaType.APPLICATION_JSON)
				.get();
		String jsonResp = resp.readEntity(String.class);
		TaggerModelFamily tm = objectMapper.readValue(jsonResp,
				TaggerModelFamily.class);
		if (tm != null && tm.getCrisis() != null
				&& tm.getNominalAttribute() != null) {
			String crisisCode = tm.getCrisis().getCode();
			String attributeCode = tm.getNominalAttribute().getCode();

			logger.info("crisisCode: " + crisisCode + " attributeCode: " + attributeCode);

			WebTarget webResp = client.target(crowdsourcingAPIMainUrl
					+ "/clientapp/delete/" + crisisCode + "/"
					+ attributeCode);

			Response clientResp = webResource.request(
					MediaType.APPLICATION_JSON).get();
			//logger.info("deactivated - clientResponse : " + clientResp);
		} else {
			logger.info("No modelfamily found for id = " + modelFamilyID);
		}
	} catch (Exception e) {
		logger.error("deactivated - deletePybossaApp : " + e);
	}
}
 
Example 14
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public Integer isUserExistsByUsername(String userName) throws AidrException {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	try {
		/**
		 * Rest call to Tagger
		 */
		WebTarget webResource = client.target(taggerMainUrl + "/user/"
				+ userName);

		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();
		objectMapper.configure(
				DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES,
				false);

		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).get();
		String jsonResponse = clientResponse.readEntity(String.class);

		UsersDTO user = objectMapper
				.readValue(jsonResponse, UsersDTO.class);

		TaggerUser taggerUser = new TaggerUser(user);

		if (taggerUser != null && taggerUser.getUserID() != null) {
			logger.info("User with the user name " + userName
					+ " already exist in Tagger and has ID: "
					+ taggerUser.getUserID());
			return taggerUser.getUserID();
		} else {
			return null;
		}
	} catch (Exception e) {
		logger.error("Error while checking if user: "+userName +"exist", e);
		throw new AidrException(
				"Error while checking if user exist in Tagger", e);
	}
}
 
Example 15
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public boolean pingTagger() throws AidrException {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	try {
		WebTarget webResource = client.target(taggerMainUrl + "/misc/ping");

		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();
		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).get();

		String jsonResponse = clientResponse.readEntity(String.class);

		PingResponse pingResponse = objectMapper.readValue(jsonResponse,
				PingResponse.class);
		if (pingResponse != null
				&& "RUNNING".equals(pingResponse.getStatus())) {
			return true;
		} else {
			return false;
		}
	} catch (Exception e) {
		logger.error("Error while pinging tagger", e);
		throw new AidrException(
				"Error while pinging tagger.",e);
	}
}
 
Example 16
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public boolean pingTrainer() throws AidrException {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	try {
		WebTarget webResource = client.target(crowdsourcingAPIMainUrl
				+ "/util/ping/heartbeat");

		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();
		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).get();

		String jsonResponse = clientResponse.readEntity(String.class);

		PingResponse pingResponse = objectMapper.readValue(jsonResponse,
				PingResponse.class);
		if (pingResponse != null && "200".equals(pingResponse.getStatus())) {
			return true;
		} else {
			return false;
		}
	} catch (Exception e) {
		logger.error("Error while pinging trainer", e);
		throw new AidrException(
				"Error while pinging trainer.",e);
	}
}
 
Example 17
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public Long getImageCountForCollection(String collectionCode) {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	
	Long count = null;
	try {
		// Rest call to Tagger
		WebTarget webResource = client.target(crowdsourcingAPIMainUrl
				+ "/" + collectionCode + "/image/count");

		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();
		objectMapper.configure(
				DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES,
				false);
		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).get();

		String jsonResponse = clientResponse.readEntity(String.class);

		count = objectMapper.readValue(
				jsonResponse, Long.class);

	} catch (Exception e) {
		logger.error("Error while getting image count for collection = "
						+ collectionCode, e);
	}
	
	return count;
}
 
Example 18
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public TaggerAttribute attributeExists(String code) throws AidrException {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	try {
		WebTarget webResource = client.target(taggerMainUrl
				+ "/attribute/code/" + code);

		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();
		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).get();

		String jsonResponse = clientResponse.readEntity(String.class);

		TaggerAttribute attribute = objectMapper.readValue(jsonResponse,
				TaggerAttribute.class);
		if (attribute != null) {
			logger.info("Attribute with the code " + code
					+ " already exist in Tagger.");
			return attribute;
		} else {
			return null;
		}
	} catch (Exception e) {
		logger.error("Error while checking if attribute: "+code+" exist", e);
		throw new AidrException(
				"Error while checking if attribute exist in Tagger", e);
	}
}
 
Example 19
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public TaggerResponseWrapper getHumanLabeledDocumentsByCrisisIDUserName(
		Long crisisID, String userName, Integer count) throws AidrException {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	try {
		// Rest call to Tagger
		WebTarget webResource = client.target(taggerMainUrl
				+ "/misc/humanLabeled/crisisID/" + crisisID + "/userName/"
				+ userName + "?count=" + count);

		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();
		objectMapper.configure(
				DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES,
				false);
		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).get();

		String jsonResponse = clientResponse.readEntity(String.class);

		TaggerResponseWrapper dtoList = objectMapper.readValue(
				jsonResponse, TaggerResponseWrapper.class);
		logger.info("Number of human labeled documents returned by Tagger: "
				+ (dtoList.getHumanLabeledItems() != null ? dtoList
						.getHumanLabeledItems().size() : 0));

		return dtoList;
	} catch (Exception e) {
		logger.error("Error while getting all human labeled documents for crisisID = "
						+ crisisID + ", user name = " + userName
						+ " from Tagger", e);
		throw new AidrException(
				"Error while getting all human labeled documents for crisisID = "
						+ crisisID + ", user name = " + userName
						+ " from Tagger", e);
	}
}
 
Example 20
Source File: TaggerServiceImpl.java    From AIDR with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public java.util.Collection<TaggerAttribute> getAttributesForCrises(Integer crisisID,
		Integer userId) throws AidrException {
	Client client = ClientBuilder.newBuilder()
			.register(JacksonFeature.class).build();
	try {
		// Rest call to Tagger
		WebTarget webResource = client.target(taggerMainUrl
				+ "/attribute/crisis/all?exceptCrisis=" + crisisID);

		ObjectMapper objectMapper = JacksonWrapper.getObjectMapper();
		objectMapper.configure(
				DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES,
				false);
		Response clientResponse = webResource.request(
				MediaType.APPLICATION_JSON).get();

		String jsonResponse = clientResponse.readEntity(String.class);

		TaggerCrisisAttributesResponse crisisAttributesResponse = objectMapper
				.readValue(jsonResponse,
						TaggerCrisisAttributesResponse.class);

		if (crisisAttributesResponse.getCrisisAttributes() != null) {
			logger.info("Tagger returned "
					+ crisisAttributesResponse.getCrisisAttributes().size()
					+ " attributes available for crises with ID "
					+ crisisID);
		} else {
			return Collections.emptyList();
		}

		return convertTaggerCrisesAttributeToDTO(
				crisisAttributesResponse.getCrisisAttributes(), userId);
	} catch (Exception e) {
		logger.error("Error while getting all attributes for crisis from Tagger for crisisID: "+crisisID, e);
		throw new AidrException(
				"Error while getting all attributes for crisis from Tagger",
				e);
	}
}