@@ -0,0 +1,1452 @@
+package com.google.research.bleth.servlets;%0A%0Aimport com.google.appengine.repackaged.com.google.gson.Gson;%0Aimport com.google.appengine.repackaged.com.google.gson.JsonArray;%0Aimport com.google.research.bleth.simulator.StrategiesMapper;%0A%0Aimport java.io.IOException;%0Aimport java.util.HashMap;%0Aimport javax.servlet.annotation.WebServlet;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0A@WebServlet(%22/list-strategies%22)%0Apublic class ListStrategiesServlet extends HttpServlet %7B%0A%0A    @Override%0A    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException %7B%0A        Gson gson = new Gson(); // Used for json serialization.%0A%0A        // Construct a hash map storing 'movement' or 'awakeness' as key,%0A        // and list of strings representing available strategies as value.%0A        HashMap%3CString, JsonArray%3E strategies = new HashMap%3C%3E();%0A        JsonArray movementStrategies = (JsonArray) gson.toJsonTree(StrategiesMapper.listMovementStrategies());%0A        JsonArray awakenessStrategies = (JsonArray) gson.toJsonTree(StrategiesMapper.listAwakenessStrategies());%0A        strategies.put(%22movement%22, movementStrategies);%0A        strategies.put(%22awakeness%22, awakenessStrategies);%0A%0A        // Write hash map to response.%0A        response.setContentType(%22application/json;%22);%0A        response.getWriter().println(gson.toJson(strategies));%0A    %7D%0A%7D%0A

add servlet for listing all existing strategies' string representations.