}
if (trip.getStatus().isPredicted() == false) {
/* only show trips with realtime info */
continue;
}
VehicleActivity activity = createActivity(trip, onwardCalls);
if (activity != null) {
activities.add(activity);
}
}
_response = generateSiriResponse(_time, activities);
return new DefaultHttpHeaders();
}
String routeId = _request.getParameter("LineRef");
// multiple trips by route
if (routeId != null) {
TripsForRouteQueryBean query = new TripsForRouteQueryBean();
query.setRouteId(agencyId + "_" + routeId);
query.setTime(_time.getTime());
ListBean<TripDetailsBean> trips = _transitDataService.getTripsForRoute(query);
ArrayList<VehicleActivity> activities = new ArrayList<VehicleActivity>();
for (TripDetailsBean trip : trips.getList()) {
if (directionId != null
&& !trip.getTrip().getDirectionId().equals(directionId)) {
continue;
}
if (trip.getStatus().isPredicted() == false) {
/* only show trips with realtime info */
continue;
}
VehicleActivity activity = createActivity(trip, onwardCalls);
if (activity != null) {
activities.add(activity);
}
}
_response = generateSiriResponse(_time, activities);
return new DefaultHttpHeaders();
}
/* All vehicles */
ListBean<VehicleStatusBean> vehicles = _transitDataService.getAllVehiclesForAgency(
agencyId, _time.getTime());
ArrayList<VehicleActivity> activities = new ArrayList<VehicleActivity>();
for (VehicleStatusBean v : vehicles.getList()) {
VehicleActivity activity = createActivity(v, onwardCalls);
if (activity != null) {
activities.add(activity);
}
}
_response = generateSiriResponse(_time, activities);