}
private void applyTripUpdatesToRecord(MonitoredResult result, BlockDescriptor blockDescriptor,
List<TripUpdate> tripUpdates, VehicleLocationRecord record) {
BlockEntry block = blockDescriptor.getBlockEntry();
long t = currentTime();
long timeFrom = t - 30 * 60 * 1000;
long timeTo = t + 30 * 60 * 1000;
List<BlockInstance> instances = _blockCalendarService.getActiveBlocks(
block.getId(), timeFrom, timeTo);
if (instances.isEmpty()) {
instances = _blockCalendarService.getClosestActiveBlocks(block.getId(), t);
}
if (instances.isEmpty()) {
if (result != null) {
result.addUnmatchedBlockId(block.getId());
}
_log.warn("could not find any active schedules instance for the specified block="
+ block.getId() + " tripUpdates=" + tripUpdates);
return;
}
/**
* TODO: Eventually, use startDate and startTime to distinguish between