@Override public FederatedService getServiceForAgencyId(String agencyId) throws ServiceAreaServiceException { FederatedService provider = _servicesByAgencyId.get(agencyId); if (provider == null) throw new NoSuchAgencyServiceException(agencyId); return provider; }
@Override public FederatedService getServiceForAgencyId(String agencyId) throws ServiceAreaServiceException { FederatedService provider = _servicesByAgencyId.get(agencyId); if (provider == null) throw new NoSuchAgencyServiceException(agencyId); return provider; }
@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); }
@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); }
@Cacheable public TimeZone getTimeZoneForAgencyId(String agencyId) { AgencyNarrative narrative = _narrativeService.getAgencyForId(agencyId); if (narrative == null) throw new NoSuchAgencyServiceException(agencyId); return TimeZone.getTimeZone(narrative.getTimezone()); }
@Cacheable public TimeZone getTimeZoneForAgencyId(String agencyId) { Agency agency = _dao.getAgencyForId(agencyId); if (agency == null) throw new NoSuchAgencyServiceException(agencyId); return TimeZone.getTimeZone(agency.getTimezone()); }
@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); }
@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); }
@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); }