response = builder.type(MediaType.APPLICATION_FORM_URLENCODED).accept(
MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
status = response.getStatus();
if (status == ClientConstant.HTTP_BAD_REQUEST){
logger.debug("Workflow already exists...");
throw new UserWorkflowAlreadyExistsException(workflowName + " already exists !!!");
}
else if (status != ClientConstant.HTTP_OK) {
logger.error(response.getEntity(String.class));
throw new RuntimeException("Failed : HTTP error code : "
+ status);
} else {
if (response.getCookies().size() > 0) {
cookie = response.getCookies().get(0).toCookie();
CookieManager.setCookie(cookie);
}
}
} else if (status == ClientConstant.HTTP_BAD_REQUEST){
logger.debug("Descriptor already exists...");
throw new UserWorkflowAlreadyExistsException(workflowName + " already exists !!!");
} else {
logger.error(response.getEntity(String.class));
throw new RuntimeException("Failed : HTTP error code : "
+ status);
}