OneBusAway/onebusaway-application-modules — pull request #81 by kurtraschke (2014-02-02 22:52:42+00:00)
Title: Implement API for introspection

This PR implements an introspection framework to supply version and instance details, as initially described by @barbeau in onebusaway/onebusaway-application-modules#47.

The end-user-visible changes are as follows:

* new `instance-versions` API method (sample [JSON](https://gist.github.com/kurtraschke/8776180#file-instance-versions-json), [XML](https://gist.github.com/kurtraschke/8776180#file-instance-versions-xml)), which returns full version details for the API server itself as well as the one-or-more TDS instances backing it (note that these could all be different versions)
* new `instance-details` API method (sample [JSON](https://gist.github.com/kurtraschke/8776180#file-instance-details-json), [XML](https://gist.github.com/kurtraschke/8776180#file-instance-details-xml)), which returns a list of TDS instances backing the API server, and, for each TDS instance:
* Instance name
* Language
* Contact email
* Twitter URL (optional)
* Facebook URL (optional)

The intent here is to mimic the data model of the multi-region directory, with an eye towards automating registration of instances/eliminating the need for server operators to manually collect data from their instances and copy-paste it into the multi-region directory.

Behind the scenes, there are additional changes:

* a new `IntrospectionService` in `onebusaway-transit-data-federation` which returns the instance details and version information
* two new Web pages served from the TDS, to return the instance state and version, for debugging/setup
* a new `InstanceDetails` class which can be instantiated as a bean in `data-sources.xml` or filled with data from a properties file to specify the instance's details.

I am not entirely satisfied with the XML serialization for these methods, but that's entirely dependent on XStream; we are using an older version which does not offer the same options for serializing `Map` instances.

In addition, we will need to bump the version of `maven-resources-plugin` in the parent POM; onebusaway/onebusaway#3 has been opened for that.