/** @return a response of status 200. */ @GET @Produces("application/json; qs=0.9") public Response listRulesAsJSON() { final ArrayList<RuleIdBean> rules = new ArrayList<RuleIdBean>(); store.forEach( new RuleOperation() { @Override public void run(final VismoRule rule) { rules.add(new RuleIdBean(rule.id(), rule.getClass().getSimpleName())); } }); return toCORS(Response.ok().entity(rules)); }
/** @return a response of status 200. */ @GET @Produces(MediaType.TEXT_PLAIN) public Response listRulesAsText() { final StringBuilder buf = new StringBuilder(); store.forEach( new RuleOperation() { @Override public void run(final VismoRule rule) { buf.append(rule.toString()); buf.append(": "); buf.append(rule.id()); buf.append("\n"); } }); return Response.ok(buf.toString()).build(); }