source: src/main/java/geniusweb/runserver/Info.java@ 33

Last change on this file since 33 was 33, checked in by bart, 3 years ago

LEARN algorithm now also available. Fixed small issues.

File size: 1.3 KB
Line 
1package geniusweb.runserver;
2
3import java.io.IOException;
4import java.util.HashMap;
5import java.util.Map;
6
7import javax.servlet.ServletException;
8import javax.servlet.http.HttpServlet;
9import javax.servlet.http.HttpServletRequest;
10import javax.servlet.http.HttpServletResponse;
11
12import geniusweb.protocol.NegoSettings;
13
14/**
15 * Contains incoming connection to run a Nego. runserver/runsession with the
16 * JSON {@link NegoSettings} in the request header. After the session is
17 * started, the new Nego ID is returned. This can be used to find back the log
18 * files..
19 */
20@SuppressWarnings("serial")
21public class Info extends HttpServlet {
22
23 /**
24 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
25 * response).
26 *
27 * @return the ID of the new started run. Or SC_BAD_REQUEST if the request
28 * can not be processed.
29 */
30 @Override
31 protected void doGet(HttpServletRequest request,
32 HttpServletResponse response) throws ServletException, IOException {
33 response.setContentType("text/plain");
34 // HACK but should be generizable easy in the future.
35 Map<String, Object> info = new HashMap<>();
36 info.put("version", getClass().getPackage().getImplementationVersion());
37 response.getWriter()
38 .append(Jackson.instance().writeValueAsString(info));
39 }
40
41}
Note: See TracBrowser for help on using the repository browser.