9 | | To download a profile in your agent, check the examples in [browser]. |
| 9 | To download a profile in your agent, check the examples in [https://tracinsy.ewi.tudelft.nl/trac/Genius2ProfilesServer/browser/src/test/java/genius2/examples]. Basically you just open a websocket and read the incoming profile like this |
| 10 | {{{ |
| 11 | WebSocketFactory factory = new WebSocketFactory().setConnectionTimeout(5000); |
| 12 | WebSocket ws = factory.createSocket("ws://localhost:8080/profilesserver/websocket/get/jobs/jobs1"); |
| 13 | ws.addListener(this); |
| 14 | |
| 15 | and |
| 16 | |
| 17 | @Override |
| 18 | public void onTextMessage(WebSocket websocket, String json) throws Exception { |
| 19 | System.out.println("received profile: " + new ObjectMapper().readValue(json, Profile.class)); |
| 20 | } |