public TripEntry getTrip(String tripId) { for (String agencyId : _agencyIds) { AgencyAndId id = new AgencyAndId(agencyId, tripId); TripEntry trip = _transitGraphDao.getTripEntryForId(id); if (trip != null) return trip; } try { AgencyAndId id = AgencyAndId.convertFromString(tripId); TripEntry trip = _transitGraphDao.getTripEntryForId(id); if (trip != null) return trip; } catch (IllegalArgumentException ex) { } return null; }
public Id getStopId(String stopId) { for (String agencyId : _agencyIds) { AgencyAndId id = new AgencyAndId(agencyId, stopId); StopEntry stop = _transitGraphDao.getStopEntryForId(id); if (stop != null) return ServiceAlertLibrary.id(id); } try { AgencyAndId id = AgencyAndId.convertFromString(stopId); StopEntry stop = _transitGraphDao.getStopEntryForId(id); if (stop != null) return ServiceAlertLibrary.id(id); } catch (IllegalArgumentException ex) { } _log.warn("stop not found with id \"{}\"", stopId); AgencyAndId id = new AgencyAndId(_agencyIds.get(0), stopId); return ServiceAlertLibrary.id(id); } }
AgencyAndId id = AgencyAndId.convertFromString(routeId); RouteEntry route = _transitGraphDao.getRouteForId(id); if (route != null)
private TripEntry getTripForMonitoredVehicleJourney( MonitoredVehicleJourney mvj, SiriEndpointDetails endpointDetails) { FramedVehicleJourneyRefStructure fvjRef = mvj.getFramedVehicleJourneyRef(); if (fvjRef == null || fvjRef.getDatedVehicleJourneyRef() == null) return null; for (String agencyId : endpointDetails.getDefaultAgencyIds()) { AgencyAndId tripId = new AgencyAndId(agencyId, fvjRef.getDatedVehicleJourneyRef()); TripEntry tripEntry = _transitGraphDao.getTripEntryForId(tripId); if (tripEntry != null) return tripEntry; } /** * Try parsing the id itself */ try { AgencyAndId tripId = AgencyAndId.convertFromString(fvjRef.getDatedVehicleJourneyRef()); return _transitGraphDao.getTripEntryForId(tripId); } catch (IllegalArgumentException ex) { return null; } }
private BlockEntry getBlockForMonitoredVehicleJourney( MonitoredVehicleJourney mvj, SiriEndpointDetails endpointDetails) { BlockRefStructure blockRef = mvj.getBlockRef(); if (blockRef == null || blockRef.getValue() == null) return null; for (String agencyId : endpointDetails.getDefaultAgencyIds()) { AgencyAndId blockId = new AgencyAndId(agencyId, blockRef.getValue()); BlockEntry blockEntry = _transitGraphDao.getBlockEntryForId(blockId); if (blockEntry != null) return blockEntry; } /** * Try parsing the id itself */ try { AgencyAndId blockId = AgencyAndId.convertFromString(blockRef.getValue()); return _transitGraphDao.getBlockEntryForId(blockId); } catch (IllegalArgumentException ex) { return null; } }
timePredictionRecords = _transitDataService.getPredictionRecordsForTrip(AgencyAndId.convertFromString(routeId).getAgencyId(), tripDetails.getStatus());
for (SituationQueryBean.AffectsBean affects : query.getAffects()) { AgencyAndId routeId = AgencyAndId.convertFromString(affects.getRouteId()); AgencyAndId tripId = AgencyAndId.convertFromString(affects.getTripId()); AgencyAndId stopId = AgencyAndId.convertFromString(affects.getStopId());
timePredictionRecords = _transitDataService.getPredictionRecordsForTrip(AgencyAndId.convertFromString(vehicleId).getAgencyId(), tripDetailsForCurrentTrip.getStatus());