private void loadStifBlocks(StifTripLoader loader) { Map<Trip, RawRunData> rawData = loader.getRawRunDataByTrip(); for (Map.Entry<Trip, RawRunData> entry : rawData.entrySet()) { Trip trip = entry.getKey(); if (trip.getBlockId() == null || trip.getBlockId().length() == 0) { RawRunData data = entry.getValue(); trip.setBlockId(trip.getServiceId().getId() + "_STIF_" + data.getDepotCode() + "_" + data.getBlock()); _gtfsMutableRelationalDao.updateEntity(trip); } } }
private void setBlockIdsFromSchedResponse(SchedResponse resp) { List<SchedTerminalCombo> combos = resp.getTerminalCombos().getValue().getSchedTerminalCombo(); for (SchedTerminalCombo stc : combos) { String depart = stc.getDepartingTerminalID().toString(); String arrive = stc.getArrivingTerminalID().toString(); for (SchedTime sched : schedTime(stc)) { long time = ts(sched.getDepartingTime()); Trip trip = _tripResolutionService.resolve(depart, time, arrive); if (trip != null) { trip.setBlockId(sched.getVesselID().toString()); } else { _log.warn("Skipping schedTime due to no matching trip {}", sched.toString()); } } } }
trip.setBlockId(blockId); dao.updateEntity(trip); _tripsWithBlockCount++; if (StifTripLoaderSupport.scheduleIdForGtfsDayCode(dayCode1) == serviceCode) { filtered.add(trip); trip.setBlockId(blockId); dao.updateEntity(trip); _tripsWithBlockCount++;
gtfsTrip.setBlockId(blockId); _gtfsMutableRelationalDao.updateEntity(gtfsTrip); gtfsTrip.setBlockId(blockId); dumpBlockDataForTrip(trip, gtfsTrip.getServiceId().getId(), gtfsTrip.getId().getId(), blockId, gtfsTrip.getRoute().getId().getId());