class JobAccumulatorsHandler extends AbstractExecutionGraphRequestHandler {

	public static String createJobAccumulatorsJson(AccessExecutionGraph graph) throws IOException {
		StringWriter writer = new StringWriter();
		JsonGenerator gen = JsonFactory.JACKSON_FACTORY.createGenerator(writer);

		StringifiedAccumulatorResult[] allAccumulators = graph.getAccumulatorResultsStringified();

		gen.writeStartObject();

		gen.writeArrayFieldStart("job-accumulators");
		// empty for now
		gen.writeEndArray();

		gen.writeArrayFieldStart("user-task-accumulators");
		for (StringifiedAccumulatorResult acc : allAccumulators) {
			gen.writeStartObject();
			gen.writeStringField("name", acc.getName());
			gen.writeStringField("type", acc.getType());
			gen.writeStringField("value", acc.getValue());
			gen.writeEndObject();
		}
		gen.writeEndArray();
		gen.writeEndObject();

		gen.close();
		return writer.toString();
	}

	public  JobAccumulatorsHandler(ExecutionGraphCache executionGraphHolder, Executor executor);

}