private Agency doMap(org.onebusaway.gtfs.model.Agency rhs) { Agency lhs = new Agency(); lhs.setId(rhs.getId()); lhs.setName(rhs.getName()); lhs.setUrl(rhs.getUrl()); lhs.setTimezone(rhs.getTimezone()); lhs.setLang(rhs.getLang()); lhs.setPhone(rhs.getPhone()); lhs.setFareUrl(rhs.getFareUrl()); lhs.setBrandingUrl(rhs.getBrandingUrl()); return lhs; } }
Agency a = new Agency("Potters Talent Agency ... EN6 2: UK, " + "Megan Speegle:Daron ... 2598052, All");
public void generateAgencyNarratives(NarrativeProviderImpl provider) { for (Agency agency : _gtfsDao.getAllAgencies()) { AgencyNarrative.Builder narrative = AgencyNarrative.builder(); narrative.setLang(deduplicate(agency.getLang())); narrative.setName(deduplicate(agency.getName())); narrative.setPhone(deduplicate(agency.getPhone())); narrative.setTimezone(deduplicate(agency.getTimezone())); narrative.setUrl(deduplicate(agency.getUrl())); narrative.setEmail(agency.getEmail()); narrative.setFareUrl(agency.getFareUrl()); String disclaimer = _modifications.getModificationForTypeAndId( AgencyNarrative.class, agency.getId(), "disclaimer"); if (disclaimer != null) narrative.setDisclaimer(disclaimer); Boolean privateService = _modifications.getModificationForTypeAndId( AgencyNarrative.class, agency.getId(), "privatService"); if (privateService != null) narrative.setPrivateService(privateService); provider.setNarrativeForAgency(agency.getId(), narrative.create()); } }
public String getDefaultAgencyId() { if (_defaultAgencyId != null) return _defaultAgencyId; if (_agencies.size() > 0) return _agencies.get(0).getId(); throw new NoDefaultAgencyIdException(); }
@Cacheable public AgencyBean getAgencyForId(String id) { Agency agency = _gtfsDao.getAgencyForId(id); if (agency == null) return null; AgencyBean bean = new AgencyBean(); bean.setId(agency.getId()); bean.setLang(agency.getLang()); bean.setName(agency.getName()); bean.setPhone(agency.getPhone()); bean.setTimezone(agency.getTimezone()); bean.setUrl(agency.getUrl()); AgencyNarrative narrative = _narrativeService.getAgencyForId(agency.getId()); if (narrative != null) { bean.setDisclaimer(narrative.getDisclaimer()); } return bean; } }
private void setTimeZonesForAgencies(CalendarServiceData data) { for (Agency agency : _dao.getAllAgencies()) { TimeZone timeZone = TimeZone.getTimeZone(agency.getTimezone()); if (timeZone.getID().equals("GMT") && !agency.getTimezone().toUpperCase().equals("GMT")) { throw new UnknownAgencyTimezoneException(agency.getName(), agency.getTimezone()); } data.putTimeZoneForAgencyId(agency.getId(), timeZone); } }
@Override public void run(TransformContext context, GtfsMutableRelationalDao dao) { for (Agency agency : dao.getAllAgencies()) { if (agency.getId().equals(agencyId)) { FeedInfo info = new FeedInfo(); info.setId(agencyId); info.setPublisherName(agency.getName()); info.setPublisherUrl(agency.getUrl()); if (agency.getLang() == null || agency.getLang().isEmpty()) { info.setLang(defaultLang); } else { info.setLang(agency.getLang()); } dao.saveEntity(info); } } }
_log.info("processing stats for agency: " + agency.getId() + " (" + agency.getName() + ")"); csvLogger.logStat(agency.getId(), service.getStatistic(agency.getId())); Agency allAgency = new Agency(); allAgency.setId(ALL_AGENCIES); all.setAgencyId(ALL_AGENCIES); all.setRouteCount(service.getRouteCount()); all.setCalendarEndDate(service.getCalendarServiceRangeEnd()); csvLogger.logStat(allAgency.getId(), all);
@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 void run(TransformContext context, GtfsMutableRelationalDao dao) { _dao = dao; Agency agency = dao.getAllAgencies().iterator().next(); _agencyId = agency.getId(); _agencyTimeZone = TimeZone.getTimeZone(agency.getTimezone()); _tripResolutionService = new WSFTripResolutionService(_dao, _agencyId, _agencyTimeZone); try { _scheduleService = new WSFScheduleService(apiAccessCode); setAllBlockIds(); } catch (Exception e) { _log.error("Error initializing WSFBlockResolutionStrategy: " + e); return; } }
public void generateAgencyNarratives(NarrativeProviderImpl provider) { for (Agency agency : _gtfsDao.getAllAgencies()) { AgencyNarrative.Builder narrative = AgencyNarrative.builder(); narrative.setLang(deduplicate(agency.getLang())); narrative.setName(deduplicate(agency.getName())); narrative.setPhone(deduplicate(agency.getPhone())); narrative.setEmail(deduplicate(agency.getEmail())); narrative.setTimezone(deduplicate(agency.getTimezone())); narrative.setUrl(deduplicate(agency.getUrl())); narrative.setEmail(agency.getEmail()); narrative.setFareUrl(agency.getFareUrl()); String disclaimer = _modifications.getModificationForTypeAndId( AgencyNarrative.class, agency.getId(), "disclaimer"); if (disclaimer != null) narrative.setDisclaimer(disclaimer); Boolean privateService = _modifications.getModificationForTypeAndId( AgencyNarrative.class, agency.getId(), "privatService"); if (privateService != null) narrative.setPrivateService(privateService); provider.setNarrativeForAgency(agency.getId(), narrative.create()); } }
if(!entrancesFile.exists()) { es.publishMessage(getTopic(), "For Agency: " + dao.getAllAgencies().iterator().next().getId() + " " + dao.getAllAgencies().iterator().next().getName() + " Entrances file does not exist: " + entrancesFile.getName()); if(!elevatorsFile.exists()) { es.publishMessage(getTopic(), "For Agency: " + dao.getAllAgencies().iterator().next().getId() + " " + dao.getAllAgencies().iterator().next().getName() + " Elevators file does not exist: " + elevatorsFile.getName()); agencyId = dao.getAllAgencies().iterator().next().getId();
private String getReferenceAgencyId(GtfsMutableRelationalDao dao) { if (_referenceAgencyId == null) { _referenceAgencyId = dao.getAllAgencies().iterator().next().getId(); } return _referenceAgencyId; } }
private void setTimeZonesForAgencies(CalendarServiceData data) { for (Agency agency : _dao.getAllAgencies()) { TimeZone timeZone = TimeZone.getTimeZone(agency.getTimezone()); if (timeZone.getID().equals("GMT") && !agency.getTimezone().toUpperCase().equals("GMT")) { throw new UnknownAgencyTimezoneException(agency.getName(), agency.getTimezone()); } data.putTimeZoneForAgencyId(agency.getId(), timeZone); } }
timeZoneText = agency.getTimezone(); break;