if (tripId != null) {
TripBean tripBean = _transitDataService.getTrip(agencyId + "_" + tripId);
if (tripBean == null) {
throw new IllegalArgumentException("No such trip: " + tripId);
}
TripDetailsQueryBean query = new TripDetailsQueryBean();
query.setTripId(tripId);
ListBean<TripDetailsBean> trips = _transitDataService.getTripDetails(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();
}
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)) {