use of org.onebusaway.exceptions.NoSuchAgencyServiceException in project onebusaway-application-modules by camsys.
the class RoutesBeanServiceImpl method getRoutesForAgencyId.
@Cacheable
@Override
public ListBean<RouteBean> getRoutesForAgencyId(String agencyId) {
AgencyEntry agency = _graphDao.getAgencyForId(agencyId);
if (agency == null)
throw new NoSuchAgencyServiceException(agencyId);
List<RouteBean> routes = new ArrayList<RouteBean>();
for (RouteCollectionEntry routeCollection : agency.getRouteCollections()) {
AgencyAndId routeId = routeCollection.getId();
RouteBean route = _routeBeanService.getRouteForId(routeId);
routes.add(route);
}
return new ListBean<RouteBean>(routes, false);
}
use of org.onebusaway.exceptions.NoSuchAgencyServiceException in project onebusaway-application-modules by camsys.
the class FederatedServiceCollectionImpl method getServiceForAgencyIds.
@Override
public FederatedService getServiceForAgencyIds(Iterable<String> agencyIds) throws ServiceAreaServiceException {
Set<FederatedService> providers = new HashSet<FederatedService>();
for (String id : agencyIds) {
FederatedService provider = getServiceForAgencyId(id);
if (provider == null)
throw new NoSuchAgencyServiceException(id);
providers.add(provider);
}
return getProviderFromProviders(providers);
}
use of org.onebusaway.exceptions.NoSuchAgencyServiceException in project onebusaway-application-modules by camsys.
the class StopsBeanServiceImpl method getStopsIdsForAgencyId.
@Override
public ListBean<String> getStopsIdsForAgencyId(String agencyId) {
AgencyEntry agency = _transitGraphDao.getAgencyForId(agencyId);
if (agency == null)
throw new NoSuchAgencyServiceException(agencyId);
List<String> ids = new ArrayList<String>();
for (StopEntry stop : agency.getStops()) {
AgencyAndId id = stop.getId();
ids.add(AgencyAndIdLibrary.convertToString(id));
}
return new ListBean<String>(ids, false);
}
use of org.onebusaway.exceptions.NoSuchAgencyServiceException in project onebusaway-application-modules by camsys.
the class RoutesBeanServiceImpl method getRouteIdsForAgencyId.
@Cacheable
@Override
public ListBean<String> getRouteIdsForAgencyId(String agencyId) {
AgencyEntry agency = _graphDao.getAgencyForId(agencyId);
if (agency == null)
throw new NoSuchAgencyServiceException(agencyId);
List<String> ids = new ArrayList<String>();
for (RouteCollectionEntry routeCollection : agency.getRouteCollections()) {
AgencyAndId id = routeCollection.getId();
ids.add(AgencyAndIdLibrary.convertToString(id));
}
return new ListBean<String>(ids, false);
}
Aggregations