String url = getRuleURL();
if (url == null) {
return;
}
FullResponseHolder response = httpClient.get(new URL(url))
.go(responseHandler)
.get();
if (response.getStatus().equals(HttpResponseStatus.FOUND)) {
url = response.getResponse().getHeader("Location");
log.info("Redirecting rule request to [%s]", url);
response = httpClient.get(new URL(url))
.go(responseHandler)
.get();
}
ConcurrentHashMap<String, List<Rule>> newRules = new ConcurrentHashMap<>(
(Map<String, List<Rule>>) jsonMapper.readValue(
response.getContent(), new TypeReference<Map<String, List<Rule>>>()
{
}
)
);