use of org.opentripplanner.api.model.alertpatch.AlertPatchResponse in project OpenTripPlanner by opentripplanner.
the class AlertPatcher method getRoutePatches.
/**
* Return a list of all patches that apply to a given route
*
* @return Returns either an XML or a JSON document, depending on the HTTP Accept header of the
* client making the request.
*/
@GET
@Path("/routePatches")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML + Q, MediaType.TEXT_XML + Q })
public AlertPatchResponse getRoutePatches(@QueryParam("agency") String agency, @QueryParam("id") String id) {
AlertPatchResponse response = new AlertPatchResponse();
Collection<AlertPatch> alertPatches = alertPatchService.getRoutePatches(new AgencyAndId(agency, id));
for (AlertPatch alertPatch : alertPatches) {
response.addAlertPatch(alertPatch);
}
return response;
}
use of org.opentripplanner.api.model.alertpatch.AlertPatchResponse in project OpenTripPlanner by opentripplanner.
the class AlertPatcher method getStopPatches.
/**
* Return a list of all patches that apply to a given stop
*
* @return Returns either an XML or a JSON document, depending on the HTTP Accept header of the
* client making the request.
*/
@GET
@Path("/stopPatches")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML + Q, MediaType.TEXT_XML + Q })
public AlertPatchResponse getStopPatches(@QueryParam("agency") String agency, @QueryParam("id") String id) {
AlertPatchResponse response = new AlertPatchResponse();
Collection<AlertPatch> alertPatches = alertPatchService.getStopPatches(new AgencyAndId(agency, id));
for (AlertPatch alertPatch : alertPatches) {
response.addAlertPatch(alertPatch);
}
return response;
}
Aggregations