use of org.onebusaway.transit_data.model.trips.TripsForRouteQueryBean in project onebusaway-application-modules by camsys.
the class RealtimeServiceV2Impl method getAllTripsForRoute.
/**
* PRIVATE METHODS
*/
private ListBean<TripDetailsBean> getAllTripsForRoute(String routeId, long currentTime) {
TripsForRouteQueryBean tripRouteQueryBean = new TripsForRouteQueryBean();
tripRouteQueryBean.setRouteId(routeId);
tripRouteQueryBean.setTime(currentTime);
TripDetailsInclusionBean inclusionBean = new TripDetailsInclusionBean();
inclusionBean.setIncludeTripBean(true);
inclusionBean.setIncludeTripStatus(true);
tripRouteQueryBean.setInclusion(inclusionBean);
return _transitDataService.getTripsForRoute(tripRouteQueryBean);
}
use of org.onebusaway.transit_data.model.trips.TripsForRouteQueryBean in project onebusaway-application-modules by camsys.
the class TripsForRouteAction method show.
public DefaultHttpHeaders show() throws IOException, ServiceException {
if (!isVersion(V2))
return setUnknownVersionResponse();
if (hasErrors())
return setValidationErrorsResponse();
long time = SystemTime.currentTimeMillis();
if (_time != 0)
time = _time;
TripsForRouteQueryBean query = new TripsForRouteQueryBean();
query.setRouteId(_id);
query.setTime(time);
query.setMaxCount(_maxCount.getMaxCount());
TripDetailsInclusionBean inclusion = query.getInclusion();
inclusion.setIncludeTripBean(_includeTrip);
inclusion.setIncludeTripSchedule(_includeSchedule);
inclusion.setIncludeTripStatus(_includeStatus);
BeanFactoryV2 factory = getBeanFactoryV2();
try {
ListBean<TripDetailsBean> trips = _service.getTripsForRoute(query);
return setOkResponse(factory.getTripDetailsResponse(trips));
} catch (OutOfServiceAreaServiceException ex) {
return setOkResponse(factory.getEmptyList(TripDetailsV2Bean.class, true));
}
}
use of org.onebusaway.transit_data.model.trips.TripsForRouteQueryBean in project onebusaway-application-modules by camsys.
the class RealtimeServiceImpl method getAllTripsForRoute.
/**
* PRIVATE METHODS
*/
private ListBean<TripDetailsBean> getAllTripsForRoute(String routeId, long currentTime) {
TripsForRouteQueryBean tripRouteQueryBean = new TripsForRouteQueryBean();
tripRouteQueryBean.setRouteId(routeId);
tripRouteQueryBean.setTime(currentTime);
TripDetailsInclusionBean inclusionBean = new TripDetailsInclusionBean();
inclusionBean.setIncludeTripBean(true);
inclusionBean.setIncludeTripStatus(true);
tripRouteQueryBean.setInclusion(inclusionBean);
return _transitDataService.getTripsForRoute(tripRouteQueryBean);
}
use of org.onebusaway.transit_data.model.trips.TripsForRouteQueryBean in project onebusaway-application-modules by camsys.
the class VehicleLocationsAction method getAllTripsForRoute.
private ListBean<TripDetailsBean> getAllTripsForRoute(String routeId, long currentTime) {
TripsForRouteQueryBean query = new TripsForRouteQueryBean();
query.setRouteId(routeId);
query.setTime(currentTime);
TripDetailsInclusionBean inclusionBean = new TripDetailsInclusionBean();
inclusionBean.setIncludeTripBean(true);
inclusionBean.setIncludeTripStatus(true);
query.setInclusion(inclusionBean);
return _transitDataService.getTripsForRoute(query);
}
Aggregations