Package org.onebusaway.api.model.transit

Examples of org.onebusaway.api.model.transit.BeanFactoryV2


    if (_time == 0)
      _time = System.currentTimeMillis();
    if (_constraints.getCurrentTime() == -1)
      _constraints.setCurrentTime(System.currentTimeMillis());

    BeanFactoryV2 factory = getBeanFactoryV2();
    ItineraryV2BeanFactory itineraryFactory = new ItineraryV2BeanFactory(
        factory);

    parseSelectedItinerary(itineraryFactory, _includeSelectedItinerary,
        _constraints);

    ItinerariesBean itineraries = _transitDataService.getItinerariesBetween(
        _from, _to, _time, _constraints);

    ItinerariesV2Bean bean = itineraryFactory.getItineraries(itineraries);
    return setOkResponse(factory.entry(bean));
  }
View Full Code Here


    if (!isVersion(V2))
      return setUnknownVersionResponse();

    ListBean<String> routeIds = _service.getRouteIdsForAgencyId(_id);

    BeanFactoryV2 factory = getBeanFactoryV2();
    return setOkResponse(factory.getEntityIdsResponse(routeIds));
  }
View Full Code Here

      return setResourceNotFoundResponse();

    if (isVersion(V1)) {
      return setOkResponse(agency);
    } else if (isVersion(V2)) {
      BeanFactoryV2 factory = getBeanFactoryV2();
      return setOkResponse(factory.getResponse(agency));
    } else {
      return setUnknownVersionResponse();
    }
  }
View Full Code Here

    if (hasErrors())
      return setValidationErrorsResponse();

    StopScheduleBean stopSchedule = _service.getScheduleForStop(_id, _date);

    BeanFactoryV2 factory = getBeanFactoryV2();
    return setOkResponse(factory.getResponse(stopSchedule));
  }
View Full Code Here

    if( ! isVersion(V2))
      return setUnknownVersionResponse();
   
    ListBean<String> stopIds = _service.getShapeIdsForAgencyId(_id);
    BeanFactoryV2 factory = getBeanFactoryV2();
    return setOkResponse(factory.getEntityIdsResponse(stopIds));
  }
View Full Code Here

  private DefaultHttpHeaders transformResult(RoutesBean result) {
    if (isVersion(V1)) {
      return setOkResponse(result);
    } else if (isVersion(V2)) {
      BeanFactoryV2 factory = getBeanFactoryV2();
      return setOkResponse(factory.getResponse(result));
    } else {
      return setUnknownVersionResponse();
    }
  }
View Full Code Here

  private DefaultHttpHeaders transformOutOfRangeResult() {
    if (isVersion(V1)) {
      return setOkResponse(new RoutesBean());
    } else if (isVersion(V2)) {
      BeanFactoryV2 factory = getBeanFactoryV2();
      return setOkResponse(factory.getEmptyList(RouteV2Bean.class, true));
    } else {
      return setUnknownVersionResponse();
    }
  }
View Full Code Here

    TripDetailsBean trip = _service.getSingleTripDetails(query);

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

    BeanFactoryV2 factory = getBeanFactoryV2();
    EntryWithReferencesBean<TripDetailsV2Bean> response = factory.getResponse(trip);
    return setOkResponse(response);
  }
View Full Code Here

    }

    if (isVersion(V2)) {
      RegisteredAlarmV2Bean bean = new RegisteredAlarmV2Bean();
      bean.setAlarmId(alarmId);
      BeanFactoryV2 factory = getBeanFactoryV2();
      return setOkResponse(factory.entry(bean));
    } else {
      return setUnknownVersionResponse();
    }
  }
View Full Code Here

    fillInQuery();

    if (hasErrors())
      return setValidationErrorsResponse();

    BeanFactoryV2 factory = getBeanFactoryV2();

    ListBean<CurrentVehicleEstimateBean> estimates = _service.getCurrentVehicleEstimates(_query);
    return setOkResponse(factory.getCurrentVehicleEstimates(estimates));
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.api.model.transit.BeanFactoryV2

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.