The code provided in this Github page is an Annotation Server prototype built in Java language.
The Dummy Server is designed to help researchers and developers to build a simply system in order to listen and respond BeCalm requests as quickly as possible, during the TIPS task in the BioCreative V.5 competition. This example is done using only Java Sockets, so it is recommended the implementation of a more complete and specific solution like HTTPServer, NanoHTTPD or Jetty.
Clone the repository and make a JAR (select the main class Server) or simply download the most recent release. Then, open a terminal and execute the following command to start the Server:
java [-Xmx2G] [-Xms256M] -server -jar dummyserver.jar
Note that, the parameters between brackets are optional. However, it may be interesting to modify the maximum memory allocation and the initial memory allocation pool when starting the JVM (-Xmx
and -Xms
, respectively).
Once the Annotation Server is running, it will be possible to make requests! At this point, you have two options to test the dummy server:
- If you clone the code and open it in a IDE, you will see a JUnit test to make this requests automatically. To do this, you must execute the Server class first. This JUnit test will send random requests to test the
getState
andgetAnnotations
methods. - You can send POST requests to
127.0.0.1:8088
to test thegetState
method. The requests must be in JSON format and it is mandatory to use the correctbecalm_key
. See the following example:curl -H "Content-Type: application/json" -X POST http://127.0.0.1:8088 -d "{\"name\": \"BeCalm\",\"method\": \"getState\",\"becalm_key\": \"b907e0df6bbc124844ae97dea98d3d0fc059c133\",\"custom_parameters\": {\"example\": true},\"parameters\": {}}"
Copyright © 2019, Aitor Blanco Míguez. Released under the Unlicense license.