-
Notifications
You must be signed in to change notification settings - Fork 0
Sicsthsense Engine
The Engine is a Java implementation of a RESTful HTTP server representing the SicsthSense cloud presence.
It uses DropWizard, which is a distribution of popular Java frameworks (Jetty,Jersey, Jackson, JDBI, slf4j, etc.). Other external libraries used include: Atmosphere (for websockets). A MySQL server is required for the data storage.
The build system is Maven, allowing automatic dependency management for all of the included 3rd party libraries.
To build the engine from the /engine directory simply:
$ mvn package
This will create the server in a self-contained .jar file /engine/target/engine-1.0-SNAPSHOT-shaded.jar
To run this server:
$ ./runJar.sh
This Wiki also contains a breakdown of the codebase
There should now be an HTTP server running on port 8080. Visiting this with a web browser should confirm it. From here you may authenticate using OpenID or a username/password combination.
All entities in the SicsthSense system follow a RESTful resource orientated architecture. For example user 1 may be accessed from the URL:
http://HOSTNAME:8080/users/1
The engine will then return a JSON representation of the user.
Similarly, that users resources can be listed via the the URL:
http://HOSTNAME:8080/users/1/resources
or individual resources by appending their resource ID:
http://HOSTNAME:8080/users/1/resources/999
If the resource is owned by you, it is possible to modify the representation stored on the server by PUTing a new JSON representation of that resource. Alternatively a new resource may be created by POSTing a JSON representation of the new resource.
