Package org.onebusaway.transit_data.model.trips

Examples of org.onebusaway.transit_data.model.trips.TripDetailsQueryBean


      }

      /*
       * gather data about trip, route, and stops
       */
      TripDetailsQueryBean query = new TripDetailsQueryBean();
      query.setTripId(trip.getId());
      query.setServiceDate(adbean.getServiceDate());
      query.setTime(now.getTime().getTime());
      query.setVehicleId(adbean.getVehicleId());

      ListBean<TripDetailsBean> trips = _transitDataService.getTripDetails(query);
      for (TripDetailsBean specificTripDetails : trips.getList()) {
        MonitoredStopVisit MonitoredStopVisit = new MonitoredStopVisit();

View Full Code Here


      return setUnknownVersionResponse();

    if (hasErrors())
      return setValidationErrorsResponse();
   
    TripDetailsQueryBean query = new TripDetailsQueryBean();
    query.setTripId(_id);
    if( _serviceDate != null)
      query.setServiceDate(_serviceDate.getTime());
    query.setTime(_time.getTime());
    query.setVehicleId(_vehicleId);
   
    TripDetailsInclusionBean inclusion = query.getInclusion();
    inclusion.setIncludeTripBean(_includeTrip);
    inclusion.setIncludeTripSchedule(_includeSchedule);
    inclusion.setIncludeTripStatus(_includeStatus);

    TripDetailsBean trip = _service.getSingleTripDetails(query);
View Full Code Here

    if (tripId != null) {
      TripBean tripBean = _transitDataService.getTrip(agencyId + "_" + tripId);
      if (tripBean == null) {
        throw new IllegalArgumentException("No such trip: " + tripId);
      }
      TripDetailsQueryBean query = new TripDetailsQueryBean();
      query.setTripId(tripId);
      ListBean<TripDetailsBean> trips = _transitDataService.getTripDetails(query);
      ArrayList<VehicleActivity> activities = new ArrayList<VehicleActivity>();
      for (TripDetailsBean trip : trips.getList()) {
        if (directionId != null
            && !trip.getTrip().getDirectionId().equals(directionId)) {
          continue;
        }
        if (trip.getStatus().isPredicted() == false) {
          /* only show trips with realtime info */
          continue;
        }
        VehicleActivity activity = createActivity(trip, onwardCalls);
        if (activity != null) {
          activities.add(activity);
        }
      }
      _response = generateSiriResponse(_time, activities);
      return new DefaultHttpHeaders();
    }

    String routeId = _request.getParameter("LineRef");
    // multiple trips by route
    if (routeId != null) {
      TripsForRouteQueryBean query = new TripsForRouteQueryBean();
      query.setRouteId(agencyId + "_" + routeId);
      query.setTime(_time.getTime());
      ListBean<TripDetailsBean> trips = _transitDataService.getTripsForRoute(query);
      ArrayList<VehicleActivity> activities = new ArrayList<VehicleActivity>();
      for (TripDetailsBean trip : trips.getList()) {
        if (directionId != null
            && !trip.getTrip().getDirectionId().equals(directionId)) {
View Full Code Here

    time.setTime(new Date(vehicleStatus.getLastUpdateTime()));

    activity.RecordedAtTime = time;
    TripBean tripBean = vehicleStatus.getTrip();
    if (tripBean != null) {
      TripDetailsQueryBean query = new TripDetailsQueryBean();
      query.setTime(time.getTimeInMillis());
      query.setTripId(tripBean.getId());
      query.setVehicleId(vehicleStatus.getVehicleId());
      query.getInclusion().setIncludeTripStatus(true);
      TripStatusBean tripStatus = vehicleStatus.getTripStatus();
      query.setServiceDate(tripStatus.getServiceDate());
      TripDetailsBean tripDetails = _transitDataService.getSingleTripDetails(query);
      activity.MonitoredVehicleJourney = SiriUtils.getMonitoredVehicleJourney(
          tripDetails, new Date(tripStatus.getServiceDate()),
          vehicleStatus.getVehicleId());
View Full Code Here

      return INPUT;

    if (_time == null)
      _time = new Date();

    TripDetailsQueryBean query = new TripDetailsQueryBean();
    query.setTripId(_id);
    if (_serviceDate != null)
      query.setServiceDate(_serviceDate.getTime());
    query.setVehicleId(_vehicleId);

    query.setTime(_time.getTime());

    _tripDetails = _service.getSingleTripDetails(query);

    if (_tripDetails == null)
      throw new NoSuchTripServiceException(_id);
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data.model.trips.TripDetailsQueryBean

Copyright © 2018 www.massapicom. 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.