if (!generator.hasNext()) {
throw new WebApplicationException(Response.Status.NOT_FOUND);
}
KeyValue value = generator.next();
ResponseBuilder response = Response.ok(value.getValue());
response.cacheControl(cacheControl);
response.header("X-Timestamp", value.getTimestamp());
return response.build();
} catch (IOException e) {
throw new WebApplicationException(e,
Response.Status.SERVICE_UNAVAILABLE);