Examples of StopWithArrivalsAndDeparturesBean


Examples of org.onebusaway.transit_data.model.StopWithArrivalsAndDeparturesBean

      nearbyStops.add(_stopBeanService.getStopForId(nearbyStopId));

    List<ServiceAlertBean> situations = _serviceAlertsBeanService.getServiceAlertsForStopId(
        query.getTime(), id);

    return new StopWithArrivalsAndDeparturesBean(stop, arrivalsAndDepartures,
        nearbyStops, situations);
  }
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopWithArrivalsAndDeparturesBean

      return setValidationErrorsResponse();

    if( _query.getTime() == 0)
      _query.setTime(System.currentTimeMillis());

    StopWithArrivalsAndDeparturesBean result = _service.getStopWithArrivalsAndDepartures(
        _id, _query);

    if (result == null)
      return setResourceNotFoundResponse();

    if (isVersion(V1)) {
      // Convert data to v1 form
      List<ArrivalAndDepartureBeanV1> arrivals = getArrivalsAsV1(result);
      StopWithArrivalsAndDeparturesBeanV1 v1 = new StopWithArrivalsAndDeparturesBeanV1(
          result.getStop(), arrivals, result.getNearbyStops());
      return setOkResponse(v1);
    } else if (isVersion(V2)) {
      BeanFactoryV2 factory = getBeanFactoryV2();
      return setOkResponse(factory.getResponse(result));
    } else {
View Full Code Here

Examples of org.onebusaway.transit_data.model.StopWithArrivalsAndDeparturesBean

    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;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.