Package org.onebusaway.api.model.transit

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


    long time = System.currentTimeMillis();
    if (_time != 0)
      time = _time;

    BeanFactoryV2 factory = getBeanFactoryV2();

    try {
      VehicleStatusBean vehicle = _service.getVehicleForAgency(_id, time);

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

      return setOkResponse(factory.getVehicleStatusResponse(vehicle));

    } catch (OutOfServiceAreaServiceException ex) {
      return setOkResponse(factory.getEmptyList(VehicleStatusV2Bean.class, true));
    }
  }
View Full Code Here


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

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

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

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

    PlanTripAction.parseSelectedItinerary(itineraryFactory,
        _includeSelectedItinerary, _constraints);
View Full Code Here

    TripDetailsInclusionBean inclusion = query.getInclusion();
    inclusion.setIncludeTripBean(_includeTrip);
    inclusion.setIncludeTripSchedule(_includeSchedule);
    inclusion.setIncludeTripStatus(_includeStatus);

    BeanFactoryV2 factory = getBeanFactoryV2();

    try {
      ListBean<TripDetailsBean> trips = _service.getTripsForBounds(query);
      return setOkResponse(factory.getTripDetailsResponse(trips));
    } catch (OutOfServiceAreaServiceException ex) {
      return setOkResponse(factory.getEmptyList(TripDetailsV2Bean.class, true));
    }
  }
View Full Code Here

    List<AgencyWithCoverageBean> beans = _service.getAgenciesWithCoverage();

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

      return setUnknownVersionResponse();

    if (hasErrors())
      return setValidationErrorsResponse();

    BeanFactoryV2 factory = getBeanFactoryV2();

    VehicleLocationRecordBean record = _service.getVehicleLocationRecordForVehicleId(
        _id, _time);
    if (record == null)
      return setResourceNotFoundResponse();
    return setOkResponse(factory.entry(factory.getVehicleLocationRecord(record)));
  }
View Full Code Here

        _serviceDate);

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

    BeanFactoryV2 factory = getBeanFactoryV2();
    BlockInstanceV2Bean bean = factory.getBlockInstance(blockInstance);
    EntryWithReferencesBean<BlockInstanceV2Bean> response = factory.entry(bean);
    return setOkResponse(response);
  }
View Full Code Here

    else
      return version == _version;
  }

  protected BeanFactoryV2 getBeanFactoryV2() {
    BeanFactoryV2 factory = new BeanFactoryV2(_includeReferences);
    factory.setApplicationKey(_key);
    return factory;
  }
View Full Code Here

    factory.setApplicationKey(_key);
    return factory;
  }

  protected BeanFactoryV2 getBeanFactoryV2(MaxCountSupport maxCount) {
    BeanFactoryV2 factory = getBeanFactoryV2();
    factory.setMaxCount(maxCount);
    return factory;
  }
View Full Code Here

    TimeBean bean = new TimeBean(date, readableTime);

    if (isVersion(V1)) {
      return setOkResponse(bean);
    } else if (isVersion(V2)) {
      BeanFactoryV2 factory = getBeanFactoryV2();
      EntryWithReferencesBean<TimeBean> response = factory.entry(bean);
      return setOkResponse(response);
    } else {
      return setUnknownVersionResponse();
    }
  }
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.