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; } }
String agencyId = agency.getId(); LOG.info("This Agency has the ID {}", agencyId);
public String getDefaultAgencyId() { if (_defaultAgencyId != null) return _defaultAgencyId; if (_agencies.size() > 0) return _agencies.get(0).getId(); throw new NoDefaultAgencyIdException(); }
public String getDefaultAgencyId() { if (_defaultAgencyId != null) return _defaultAgencyId; if (_agencies.size() > 0) return _agencies.get(0).getId(); throw new NoDefaultAgencyIdException(); }
private String getReferenceAgencyId(GtfsMutableRelationalDao dao) { if (_referenceAgencyId == null) { _referenceAgencyId = dao.getAllAgencies().iterator().next().getId(); } return _referenceAgencyId; }
private String getReferenceAgencyId(GtfsMutableRelationalDao dao) { if (_referenceAgencyId == null) { _referenceAgencyId = dao.getAllAgencies().iterator().next().getId(); } return _referenceAgencyId; } }
@Override protected void replaceDuplicateEntry(GtfsMergeContext context, Agency oldAgency, Agency newAgency) { GtfsRelationalDao source = context.getSource(); for (Route route : source.getRoutesForAgency(oldAgency)) { route.setAgency(newAgency); } if (!oldAgency.getId().equals(newAgency.getId())) { renameAgencyId(source, oldAgency.getId(), newAgency.getId()); } }
private String getDaoAgencyId(GtfsMutableRelationalDao dao) { if (_daoAgencyId == null) { _daoAgencyId = dao.getAllAgencies().iterator().next().getId(); } return _daoAgencyId; } }
private String getReferenceAgencyId(GtfsMutableRelationalDao dao) { if (_referenceAgencyId == null) { _referenceAgencyId = dao.getAllAgencies().iterator().next().getId(); } return _referenceAgencyId; } }
@Override protected void replaceDuplicateEntry(GtfsMergeContext context, Agency oldAgency, Agency newAgency) { GtfsRelationalDao source = context.getSource(); for (Route route : source.getRoutesForAgency(oldAgency)) { route.setAgency(newAgency); } if (!oldAgency.getId().equals(newAgency.getId())) { renameAgencyId(source, oldAgency.getId(), newAgency.getId()); } }
public void translateFromObjectToCSV(CsvEntityContext context, BeanWrapper object, Map<String, Object> csvValues) { Agency agency = (Agency) object.getPropertyValue(_objFieldName); if (isOptional() && agency == null) return; csvValues.put(_csvFieldName, agency.getId()); }
private Collection<Stop> getStopsForAgency(GtfsDao dao, Agency agency) { List<Stop> stops = new ArrayList<Stop>(); for (Stop stop : dao.getAllStops()) { if (agency.getId().equals(stop.getId().getAgencyId())) { stops.add(stop); } } return stops; }
public void translateFromObjectToCSV(CsvEntityContext context, BeanWrapper object, Map<String, Object> csvValues) { Agency agency = (Agency) object.getPropertyValue(_objFieldName); if (isOptional() && agency == null) return; csvValues.put(_csvFieldName, agency.getId()); }
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); } }
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); } }
private void generateAgencyNarratives(NarrativeProviderImpl provider) { for (Agency agency : _dao.getAllAgencies()) { String disclaimer = _modifications.getModificationForTypeAndId( AgencyNarrative.class, agency.getId(), "disclaimer"); AgencyNarrative.Builder narrative = AgencyNarrative.builder(); narrative.setDisclaimer(disclaimer); provider.setNarrativeForAgency(agency.getId(), narrative.create()); } }
@Override protected void rename(GtfsMergeContext context, IdentityBean<?> entity) { GtfsRelationalDao source = context.getSource(); String prefix = context.getPrefix(); Agency agency = (Agency) entity; String oldAgencyId = agency.getId(); String newAgencyId = prefix + oldAgencyId; agency.setId(newAgencyId); renameAgencyId(source, oldAgencyId, newAgencyId); }
@Override protected void rename(GtfsMergeContext context, IdentityBean<?> entity) { GtfsRelationalDao source = context.getSource(); String prefix = context.getPrefix(); Agency agency = (Agency) entity; String oldAgencyId = agency.getId(); String newAgencyId = prefix + oldAgencyId; agency.setId(newAgencyId); renameAgencyId(source, oldAgencyId, newAgencyId); }
public void processAgencies(TransitGraphImpl graph) { Collection<Agency> agencies = _gtfsDao.getAllAgencies(); for (Agency agency : agencies) { AgencyEntryImpl agencyEntry = new AgencyEntryImpl(); agencyEntry.setId(_uniqueService.unique(agency.getId())); graph.putAgencyEntry(agencyEntry); } graph.refreshAgencyMapping(); } }
public void processAgencies(TransitGraphImpl graph) { Collection<Agency> agencies = _gtfsDao.getAllAgencies(); for (Agency agency : agencies) { AgencyEntryImpl agencyEntry = new AgencyEntryImpl(); agencyEntry.setId(_uniqueService.unique(agency.getId())); graph.putAgencyEntry(agencyEntry); } graph.refreshAgencyMapping(); } }