From cdc503a435e0ca2b009e4b568e5f791c02a7e1e6 Mon Sep 17 00:00:00 2001 From: Alexander Schlemmer <alexander.schlemmer@ds.mpg.de> Date: Thu, 2 May 2019 16:02:47 +0200 Subject: [PATCH] DOC: Documentation for CaosDBServer --- src/main/java/caosdb/server/CaosDBServer.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/caosdb/server/CaosDBServer.java b/src/main/java/caosdb/server/CaosDBServer.java index 96d7c0d7..a4e1932b 100644 --- a/src/main/java/caosdb/server/CaosDBServer.java +++ b/src/main/java/caosdb/server/CaosDBServer.java @@ -574,6 +574,7 @@ public class CaosDBServer extends Application { } }; + // -- Section only for debug mode -- if (isDebugMode()) { baseRouter.attach("/TestCase/", DefaultResource.class); @@ -603,6 +604,9 @@ public class CaosDBServer extends Application { baseRouter.attach("/TestCase/Entity/", TestCaseResource.class); baseRouter.attach("/TestCase/Entity/{specifier}", TestCaseResource.class); } + // -- End of debug section -- + + // These routes can be used without logging in: baseRouter .attach("/webinterface/{path}", Webinterface.class) .getTemplate() @@ -842,6 +846,18 @@ class CaosDBComponent extends Component { setOwner(CaosDBServer.getServerProperty(ServerProperties.KEY_SERVER_OWNER)); } + /** + * This function is doing the actual work as soon as a request arrives. + * In this case this consists in: + * - Logging the request, the response and the current time + * - The response gets updated with server info + * - The request gets updated with an SRID (server request ID) + * + * Apart from that super.handle will be called. + * + * The main purpose of the SRID is to allow efficient debugging by checking the error log + * for the request causing the error. + */ @Override public void handle(final Request request, final Response response) { long t1 = System.currentTimeMillis(); -- GitLab