255 | | |
| 255 | == ProfileConnectionFactory |
| 256 | Parties receive a ProfileReference which is an URI from which they can fetch the profile. |
| 257 | In a server configuration this usually will be a websocket, in testing conditions this usually will be a file. |
| 258 | The ProfileConnectionFactory handles the burden of decyphering the URI, connecting in the right way, waiting for the response, parsing the JSON code to an object etc. The typical use is |
| 259 | {{{ |
| 260 | profileint = ProfileConnectionFactory.create(URI, reporter); |
| 261 | }}} |
| 262 | |
| 263 | This returns a ProfileInterface for further use. |
| 264 | |
| 265 | You can now use this profileint in two ways |
| 266 | 1. Listen for updates: {{{profileint.addListener(yourListener) }}}. yourListener will be called every time a new profile is available |
| 267 | 2. Use the latest version of the profile whenever you need it, and wait for it if there is no version available yet. {{{currentProfile=profileint.getProfile()}}}. |
| 268 | |
| 269 | There is a limitation on the ProfileConnectionFactory that might become relevant if you handle very large profiles: the websocket handler is currently limited to profiles of at most 200kB in size. This is because websockets use fixed buffer sizes. Let us know if this is an issue, we can change this limit. |