@Path(value="/key/{key}/agency/{agency}")
public class TransitimeApi
extends java.lang.Object
The data output can be in either JSON or XML. The output format is specified by the accept header or by using the query string parameter "format=json" or "format=xml".
Modifier and Type | Class and Description |
---|---|
static class |
TransitimeApi.UiMode |
Constructor and Description |
---|
TransitimeApi() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
getActiveBlocks(StandardParameters stdParameters,
java.util.List<java.lang.String> routesIdOrShortNames,
int allowableBeforeTimeSecs)
Gets which blocks are active.
|
javax.ws.rs.core.Response |
getActiveBlocksByRoute(StandardParameters stdParameters,
java.util.List<java.lang.String> routesIdOrShortNames,
int allowableBeforeTimeSecs) |
javax.ws.rs.core.Response |
getAgencyGroup(StandardParameters stdParameters)
For getting Agency data for a specific agencyId.
|
javax.ws.rs.core.Response |
getAllCalendars(StandardParameters stdParameters)
For getting all calendars.
|
javax.ws.rs.core.Response |
getBlock(StandardParameters stdParameters,
java.lang.String blockId,
java.lang.String serviceId)
Handles the "block" command which outputs configuration data for the
specified block ID and service ID.
|
javax.ws.rs.core.Response |
getBlockIds(StandardParameters stdParameters,
java.lang.String serviceId)
Handles the "blockIds" command.
|
javax.ws.rs.core.Response |
getBlocks(StandardParameters stdParameters,
java.lang.String blockId)
Handles the "blocks" command which outputs configuration data for the
specified block ID.
|
javax.ws.rs.core.Response |
getBlocksTerse(StandardParameters stdParameters,
java.lang.String blockId)
Handles the "blocksTerse" command which outputs configuration data for the
specified block ID.
|
javax.ws.rs.core.Response |
getCurrentCalendars(StandardParameters stdParameters)
For getting calendars that are currently active.
|
javax.ws.rs.core.Response |
getCurrentServiceIds(StandardParameters stdParameters)
Handles the currentServiceIds command.
|
javax.ws.rs.core.Response |
getPredictions(StandardParameters stdParameters,
java.lang.Double lat,
java.lang.Double lon,
double maxDistance,
int numberPredictions)
Handles "predictionsByLoc" command.
|
javax.ws.rs.core.Response |
getPredictions(StandardParameters stdParameters,
java.util.List<java.lang.String> routeStopStrs,
int numberPredictions)
Handles "predictions" command.
|
javax.ws.rs.core.Response |
getRmiStatus(StandardParameters stdParameters)
Returns info for this particular web server for each agency on how many
outstanding RMI calls there are.
|
javax.ws.rs.core.Response |
getRoute(StandardParameters stdParameters,
java.lang.String routeIdOrShortName,
java.lang.String directionId,
java.lang.String stopId,
java.lang.String tripPatternId)
Handles the "route" command.
|
javax.ws.rs.core.Response |
getRoutes(StandardParameters stdParameters)
Handles the "routes" command.
|
javax.ws.rs.core.Response |
getScheduleHorizStops(StandardParameters stdParameters,
java.lang.String routesIdOrShortNames)
Handles the "scheduleHorizStops" command which outputs schedule for the
specified route.
|
javax.ws.rs.core.Response |
getScheduleVertStops(StandardParameters stdParameters,
java.lang.String routesIdOrShortNames)
Handles the "scheduleVertStops" command which outputs schedule for the
specified route.
|
javax.ws.rs.core.Response |
getServerStatus(StandardParameters stdParameters)
Returns status about the specified agency server.
|
javax.ws.rs.core.Response |
getServiceIds(StandardParameters stdParameters)
Handles the "serviceIds" command.
|
javax.ws.rs.core.Response |
getStops(StandardParameters stdParameters,
java.lang.String routesIdOrShortNames)
Handles the "stops" command.
|
javax.ws.rs.core.Response |
getTrip(StandardParameters stdParameters,
java.lang.String tripId)
Handles the "trip" command which outputs configuration data for the
specified trip.
|
javax.ws.rs.core.Response |
getTripIds(StandardParameters stdParameters)
Handles the tripIds command.
|
javax.ws.rs.core.Response |
getTripPatterns(StandardParameters stdParameters,
java.lang.String routesIdOrShortNames)
Handles the "tripPattern" command which outputs trip pattern
configuration data for the specified route.
|
javax.ws.rs.core.Response |
getTripWithTravelTimes(StandardParameters stdParameters,
java.lang.String tripId)
Handles the "tripWithTravelTimes" command which outputs configuration
data for the specified trip.
|
javax.ws.rs.core.Response |
getVehicleConfigs(StandardParameters stdParameters)
Gets information including vehicle IDs for all vehicles that have been
configured.
|
javax.ws.rs.core.Response |
getVehicleIds(StandardParameters stdParameters)
Handles the vehicleIds command.
|
javax.ws.rs.core.Response |
getVehicles(StandardParameters stdParameters,
java.util.List<java.lang.String> vehicleIds,
java.util.List<java.lang.String> routesIdOrShortNames,
java.lang.String stopId,
int numberPredictions)
Handles the "vehicles" command.
|
javax.ws.rs.core.Response |
getVehiclesDetails(StandardParameters stdParameters,
java.util.List<java.lang.String> vehicleIds,
java.util.List<java.lang.String> routesIdOrShortNames,
java.lang.String stopId,
int numberPredictions)
Handles the "vehiclesDetails" command.
|
@Path(value="/command/vehicles") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getVehicles(@BeanParam StandardParameters stdParameters, @QueryParam(value="v") java.util.List<java.lang.String> vehicleIds, @QueryParam(value="r") java.util.List<java.lang.String> routesIdOrShortNames, @QueryParam(value="s") java.lang.String stopId, @QueryParam(value="numPreds") @DefaultValue(value="2") int numberPredictions) throws javax.ws.rs.WebApplicationException
A Response object is returned instead of a regular object so that can have one method for the both XML and JSON yet always return the proper media type even if it is configured via the query string "format" parameter as opposed to the accept header.
stdParameters
- StdParametersBean that gets the standard parameters from the
URI, query string, and headers.vehicleIds
- Optional way of specifying which vehicles to get data forroutesIdOrShortNames
- Optional way of specifying which routes to get data forstopId
- Optional way of specifying a stop so can get predictions for
routes and determine which vehicles are the ones generating
the predictions. The other vehicles are labeled as minor so
they can be drawn specially in the UI.numberPredictions
- For when determining which vehicles are generating the
predictions so can label minor vehiclesjavax.ws.rs.WebApplicationException
@Path(value="/command/vehicleIds") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getVehicleIds(@BeanParam StandardParameters stdParameters) throws javax.ws.rs.WebApplicationException
stdParameters
- javax.ws.rs.WebApplicationException
@Path(value="/command/vehiclesDetails") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getVehiclesDetails(@BeanParam StandardParameters stdParameters, @QueryParam(value="v") java.util.List<java.lang.String> vehicleIds, @QueryParam(value="r") java.util.List<java.lang.String> routesIdOrShortNames, @QueryParam(value="s") java.lang.String stopId, @QueryParam(value="numPreds") @DefaultValue(value="3") int numberPredictions) throws javax.ws.rs.WebApplicationException
A Response object is returned instead of a regular object so that can have one method for the both XML and JSON yet always return the proper media type even if it is configured via the query string "format" parameter as opposed to the accept header.
stdParameters
- StdParametersBean that gets the standard parameters from the
URI, query string, and headers.vehicleIds
- Optional way of specifying which vehicles to get data forroutesIdOrShortNames
- Optional way of specifying which routes to get data forstopId
- Optional way of specifying a stop so can get predictions for
routes and determine which vehicles are the ones generating
the predictions. The other vehicles are labeled as minor so
they can be drawn specially in the UI.numberPredictions
- For when determining which vehicles are generating the
predictions so can label minor vehiclesjavax.ws.rs.WebApplicationException
@Path(value="/command/vehicleConfigs") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getVehicleConfigs(@BeanParam StandardParameters stdParameters) throws javax.ws.rs.WebApplicationException
stdParameters
- javax.ws.rs.WebApplicationException
@Path(value="/command/predictions") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getPredictions(@BeanParam StandardParameters stdParameters, @QueryParam(value="rs") java.util.List<java.lang.String> routeStopStrs, @QueryParam(value="numPreds") @DefaultValue(value="3") int numberPredictions) throws javax.ws.rs.WebApplicationException
A Response object is returned instead of a regular object so that can have one method for the both XML and JSON yet always return the proper media type even if it is configured via the query string "format" parameter as opposed to the accept header.
stdParameters
- StdParametersBean that gets the standard parameters from the
URI, query string, and headers.routeStopStrs
- List of route/stops. The route specifier is the route id or
the route short name. It is often best to use route short name
for consistency across configuration changes (route ID is not
consistent for many agencies). Each route/stop is separated by
the "|" character so for example the query string could have
"rs=43|2029&rs=43|3029"numberPredictions
- Maximum number of predictions to return. Default value is 3.javax.ws.rs.WebApplicationException
@Path(value="/command/predictionsByLoc") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getPredictions(@BeanParam StandardParameters stdParameters, @QueryParam(value="lat") java.lang.Double lat, @QueryParam(value="lon") java.lang.Double lon, @QueryParam(value="maxDistance") @DefaultValue(value="1500.0") double maxDistance, @QueryParam(value="numPreds") @DefaultValue(value="3") int numberPredictions) throws javax.ws.rs.WebApplicationException
A Response object is returned instead of a regular object so that can have one method for the both XML and JSON yet always return the proper media type even if it is configured via the query string "format" parameter as opposed to the accept header.
stdParameters
- StdParametersBean that gets the standard parameters from the
URI, query string, and headers.lat
- latitude in decimal degreeslon
- longitude in decimal degreesmaxDistance
- How far away a stop can be from the lat/lon. Default is 1,500
m.numberPredictions
- Maximum number of predictions to return. Default value is 3.javax.ws.rs.WebApplicationException
@Path(value="/command/routes") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getRoutes(@BeanParam StandardParameters stdParameters) throws javax.ws.rs.WebApplicationException
stdParameters
- javax.ws.rs.WebApplicationException
@Path(value="/command/route") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getRoute(@BeanParam StandardParameters stdParameters, @QueryParam(value="r") java.lang.String routeIdOrShortName, @QueryParam(value="d") java.lang.String directionId, @QueryParam(value="s") java.lang.String stopId, @QueryParam(value="tripPattern") java.lang.String tripPatternId) throws javax.ws.rs.WebApplicationException
stdParameters
- routeIdOrShortName
- stopId
- optional. If set then only this stop and the remaining ones on
the trip pattern are marked as being for the UI and can be
highlighted. Useful for when want to emphasize in the UI only
the stops that are of interest to the user.direction
- optional. If set then only the shape for specified direction
is marked as being for the UI. Needed for situations where a
single stop is used for both directions of a route and want to
highlight in the UI only the stops and the shapes that the
user is actually interested in.tripPatternId
- optional. If set then only the specified trip pattern is
marked as being for the UI.javax.ws.rs.WebApplicationException
@Path(value="/command/stops") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getStops(@BeanParam StandardParameters stdParameters, @QueryParam(value="r") java.lang.String routesIdOrShortNames) throws javax.ws.rs.WebApplicationException
stdParameters
- routeShortName
- javax.ws.rs.WebApplicationException
@Path(value="/command/block") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getBlock(@BeanParam StandardParameters stdParameters, @QueryParam(value="blockId") java.lang.String blockId, @QueryParam(value="serviceId") java.lang.String serviceId) throws javax.ws.rs.WebApplicationException
stdParameters
- blockId
- serviceId
- javax.ws.rs.WebApplicationException
@Path(value="/command/blocksTerse") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getBlocksTerse(@BeanParam StandardParameters stdParameters, @QueryParam(value="blockId") java.lang.String blockId) throws javax.ws.rs.WebApplicationException
stdParameters
- blockId
- javax.ws.rs.WebApplicationException
@Path(value="/command/blocks") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getBlocks(@BeanParam StandardParameters stdParameters, @QueryParam(value="blockId") java.lang.String blockId) throws javax.ws.rs.WebApplicationException
stdParameters
- blockId
- javax.ws.rs.WebApplicationException
@Path(value="/command/blockIds") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getBlockIds(@BeanParam StandardParameters stdParameters, @QueryParam(value="serviceId") java.lang.String serviceId) throws javax.ws.rs.WebApplicationException
stdParameters
- javax.ws.rs.WebApplicationException
@Path(value="/command/activeBlocks") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getActiveBlocks(@BeanParam StandardParameters stdParameters, @QueryParam(value="r") java.util.List<java.lang.String> routesIdOrShortNames, @QueryParam(value="t") @DefaultValue(value="0") int allowableBeforeTimeSecs) throws javax.ws.rs.WebApplicationException
stdParameters
- StdParametersBean that gets the standard parameters from the
URI, query string, and headers.routesIdOrShortNames
- Optional parameter for specifying which routes want data for.allowableBeforeTimeSecs
- Optional parameter. A block will be active if the time is
between the block start time minus allowableBeforeTimeSecs and
the block end time. Default value for allowableBeforeTimeSecs
is 0.javax.ws.rs.WebApplicationException
@Path(value="/command/activeBlocksByRoute") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getActiveBlocksByRoute(@BeanParam StandardParameters stdParameters, @QueryParam(value="r") java.util.List<java.lang.String> routesIdOrShortNames, @QueryParam(value="t") @DefaultValue(value="0") int allowableBeforeTimeSecs) throws javax.ws.rs.WebApplicationException
javax.ws.rs.WebApplicationException
@Path(value="/command/trip") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getTrip(@BeanParam StandardParameters stdParameters, @QueryParam(value="tripId") java.lang.String tripId) throws javax.ws.rs.WebApplicationException
stdParameters
- tripId
- javax.ws.rs.WebApplicationException
@Path(value="/command/tripWithTravelTimes") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getTripWithTravelTimes(@BeanParam StandardParameters stdParameters, @QueryParam(value="tripId") java.lang.String tripId) throws javax.ws.rs.WebApplicationException
stdParameters
- tripId
- javax.ws.rs.WebApplicationException
@Path(value="/command/tripIds") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getTripIds(@BeanParam StandardParameters stdParameters) throws javax.ws.rs.WebApplicationException
stdParameters
- javax.ws.rs.WebApplicationException
@Path(value="/command/tripPatterns") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getTripPatterns(@BeanParam StandardParameters stdParameters, @QueryParam(value="r") java.lang.String routesIdOrShortNames) throws javax.ws.rs.WebApplicationException
stdParameters
- routesIdOrShortNames
- javax.ws.rs.WebApplicationException
@Path(value="/command/scheduleVertStops") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getScheduleVertStops(@BeanParam StandardParameters stdParameters, @QueryParam(value="r") java.lang.String routesIdOrShortNames) throws javax.ws.rs.WebApplicationException
stdParameters
- routesIdOrShortNames
- javax.ws.rs.WebApplicationException
@Path(value="/command/scheduleHorizStops") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getScheduleHorizStops(@BeanParam StandardParameters stdParameters, @QueryParam(value="r") java.lang.String routesIdOrShortNames) throws javax.ws.rs.WebApplicationException
stdParameters
- routesIdOrShortNames
- javax.ws.rs.WebApplicationException
@Path(value="/command/agencyGroup") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getAgencyGroup(@BeanParam StandardParameters stdParameters) throws javax.ws.rs.WebApplicationException
stdParameters
- javax.ws.rs.WebApplicationException
@Path(value="/command/currentCalendars") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getCurrentCalendars(@BeanParam StandardParameters stdParameters) throws javax.ws.rs.WebApplicationException
stdParameters
- javax.ws.rs.WebApplicationException
@Path(value="/command/allCalendars") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getAllCalendars(@BeanParam StandardParameters stdParameters) throws javax.ws.rs.WebApplicationException
stdParameters
- javax.ws.rs.WebApplicationException
@Path(value="/command/serviceIds") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getServiceIds(@BeanParam StandardParameters stdParameters) throws javax.ws.rs.WebApplicationException
stdParameters
- javax.ws.rs.WebApplicationException
@Path(value="/command/currentServiceIds") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getCurrentServiceIds(@BeanParam StandardParameters stdParameters) throws javax.ws.rs.WebApplicationException
stdParameters
- javax.ws.rs.WebApplicationException
@Path(value="/command/serverStatus") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getServerStatus(@BeanParam StandardParameters stdParameters) throws javax.ws.rs.WebApplicationException
stdParameters
- javax.ws.rs.WebApplicationException
@Path(value="/command/rmiStatus") @GET @Produces(value={"application/json","application/xml"}) public javax.ws.rs.core.Response getRmiStatus(@BeanParam StandardParameters stdParameters) throws javax.ws.rs.WebApplicationException
stdParameters
- javax.ws.rs.WebApplicationException