use of org.opentripplanner.api.mapping.AlertMapper in project OpenTripPlanner by opentripplanner.
the class IndexAPI method getAlertsForTrip.
/**
* Return all alerts for a trip
*/
@GET
@Path("/trips/{tripId}/alerts")
public Collection<ApiAlert> getAlertsForTrip(@PathParam("tripId") String tripId) {
RoutingService routingService = createRoutingService();
// TODO: Add locale
AlertMapper alertMapper = new AlertMapper(null);
FeedScopedId id = createId("tripId", tripId);
return alertMapper.mapToApi(routingService.getTransitAlertService().getTripAlerts(id));
}
use of org.opentripplanner.api.mapping.AlertMapper in project OpenTripPlanner by opentripplanner.
the class IndexAPI method getAlertsForRoute.
/**
* Return all alerts for a route
*/
@GET
@Path("/routes/{routeId}/alerts")
public Collection<ApiAlert> getAlertsForRoute(@PathParam("routeId") String routeId) {
RoutingService routingService = createRoutingService();
// TODO: Add locale
AlertMapper alertMapper = new AlertMapper(null);
FeedScopedId id = createId("routeId", routeId);
return alertMapper.mapToApi(routingService.getTransitAlertService().getRouteAlerts(id));
}
use of org.opentripplanner.api.mapping.AlertMapper in project OpenTripPlanner by opentripplanner.
the class IndexAPI method getAlertsForStop.
/**
* Return all alerts for a stop
*/
@GET
@Path("/stops/{stopId}/alerts")
public Collection<ApiAlert> getAlertsForStop(@PathParam("stopId") String stopId) {
RoutingService routingService = createRoutingService();
// TODO: Add locale
AlertMapper alertMapper = new AlertMapper(null);
FeedScopedId id = createId("stopId", stopId);
return alertMapper.mapToApi(routingService.getTransitAlertService().getStopAlerts(id));
}
use of org.opentripplanner.api.mapping.AlertMapper in project OpenTripPlanner by opentripplanner.
the class IndexAPI method getAlertsForPattern.
/**
* Return all alerts for a pattern
*/
@GET
@Path("/patterns/{patternId}/alerts")
public Collection<ApiAlert> getAlertsForPattern(@PathParam("patternId") String patternId) {
RoutingService routingService = createRoutingService();
// TODO: Add locale
AlertMapper alertMapper = new AlertMapper(null);
FeedScopedId id = createId("patternId", patternId);
return alertMapper.mapToApi(routingService.getTransitAlertService().getTripPatternAlerts(id));
}
Aggregations