arrivalsQuery.setTime(_time.getTime());
arrivalsQuery.setMinutesBefore(60);
arrivalsQuery.setMinutesAfter(90);
arrivalsQuery.setFrequencyMinutesBefore(60);
arrivalsQuery.setFrequencyMinutesAfter(90);
StopWithArrivalsAndDeparturesBean stopWithArrivalsAndDepartures = _transitDataService.getStopWithArrivalsAndDepartures(
stopId, arrivalsQuery);
if (stopWithArrivalsAndDepartures == null) {
throw new IllegalArgumentException("Bogus stop parameter");
}
GregorianCalendar now = new GregorianCalendar();
now.setTime(_time);
Siri siri = new Siri();
siri.ServiceDelivery = new ServiceDelivery();
siri.ServiceDelivery.ResponseTimestamp = now;
siri.ServiceDelivery.stopMonitoringDeliveries = new ArrayList<StopMonitoringDelivery>();
StopMonitoringDelivery delivery = new StopMonitoringDelivery();
siri.ServiceDelivery.stopMonitoringDeliveries.add(delivery);
delivery.ResponseTimestamp = now;
delivery.ValidUntil = (Calendar) now.clone();
delivery.ValidUntil.add(Calendar.MINUTE, 1);
delivery.visits = new ArrayList<MonitoredStopVisit>();
for (ArrivalAndDepartureBean adbean : stopWithArrivalsAndDepartures.getArrivalsAndDepartures()) {
double distanceFromStop = adbean.getDistanceFromStop();
if (distanceFromStop < 0) {
/* passed this stop */
continue;
}