use of org.onebusaway.exceptions.OutOfServiceAreaServiceException in project onebusaway-application-modules by camsys.
the class VehiclesForAgencyAction 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;
BeanFactoryV2 factory = getBeanFactoryV2();
try {
ListBean<VehicleStatusBean> vehicles = _service.getAllVehiclesForAgency(_id, time);
return setOkResponse(factory.getVehicleStatusResponse(vehicles));
} catch (OutOfServiceAreaServiceException ex) {
return setOkResponse(factory.getEmptyList(VehicleStatusV2Bean.class, true));
}
}
Aggregations