}
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;
}
}