[[PageOutline]] = Genius2 ProfilesServer This is the home page of the genius2 profiles server. This server serves domain and profile files to interested parties, and can inform them of changes. The profilesserver only **serves** profiles, it does not define them. To define profiles, check the genius2 core pages. The Genius2 core/main page is [https://tracinsy.ewi.tudelft.nl/trac/Genius2 here]. == Installation == * Install your apache-tomcat 8 installation ​https://tomcat.apache.org/download-80.cgi. You can re-use an existing installation. * Download the parties server war file from [http://artifactory.ewi.tudelft.nl/artifactory/webapp/#/artifacts/browse/tree/General/libs-release-local/genius2/profilesserver the artifactory]. Go into the latest version of the partiesserver and download (right click) the war file. NOTICE: your browser must have cookies enabled to access the artifactory. * Copy the downloaded war file into the tomcat webapps directory * (Re)start tomcat Now your local profilesserver should be up and running. After installing and starting, go to [http://localhost:8080/profilesserver-XXX] (replace XXX with the version you installed) to see if it works. = Communication protocol This section describes the communication protocols with the profilesserver. Other implementations of a profilesserver should adhere to the same communication protocols to ensure compatibility with genius2. == List of available profiles Clients can receive the list of available profiles as follows * create a websocket to the server at {{{ws:...profilesserver/websocket/liststream}}} * The server sends the clients a JSON map, with the keys being the URI of the element containing a GeneralPartyInfo object. = Downloading a profile programatically To download a profile in your agent, create a websocket and fetch the profile. There are java examples available [https://tracinsy.ewi.tudelft.nl/trac/Genius2ProfilesServer/browser/src/test/java/genius2/examples here]. Basically you just open a websocket and read the incoming profile like this {{{ WebSocketFactory factory = new WebSocketFactory().setConnectionTimeout(5000); WebSocket ws = factory.createSocket("ws://localhost:8080/profilesserver/websocket/get/jobs/jobs1"); ws.addListener(this); ... @Override public void onTextMessage(WebSocket websocket, String json) throws Exception { System.out.println("received profile: " + new ObjectMapper().readValue(json, Profile.class)); } }}} == Using the source code == You can download the source repository. Note that you don't need this if you just want to use the profiles server. {{{ svn checkout https://tracinsy.ewi.tudelft.nl/svn/Genius2ProfilesServer/ }}} Since this is a tomcat web application, you need Eclipse Enterprise edition if you want to run this from Eclipse. Also, to checkout from Eclipse, you need to prepare Eclipse for this. Check https://tracinsy.ewi.tudelft.nl/trac/Genius2/wiki/WikiStart It is maven based so you only need maven to compile the code.