Package org.onebusaway.exceptions

Examples of org.onebusaway.exceptions.ServiceException


  @Override
  public Object invoke(FederatedServiceCollection collection, Method method,
      Object[] args) throws ServiceException, IllegalArgumentException,
      IllegalAccessException, InvocationTargetException {
    if (args.length == 0) {
      throw new ServiceException("unexpected number of arguments");
    }
    SituationQueryBean query = (SituationQueryBean) args[0];
    Set<String> agencyIds = new HashSet<String>();
    if (query.getAffects() != null) {
      for (SituationQueryBean.AffectsBean affects : query.getAffects()) {
View Full Code Here


    List<StopBean> stopBeans = new ArrayList<StopBean>();

    for (AgencyAndId stopId : stopIds) {
      StopBean stopBean = _stopBeanService.getStopForId(stopId);
      if (stopBean == null)
        throw new ServiceException();

      /**
       * If the stop doesn't have any routes actively serving it, don't include
       * it in the results
       */
 
View Full Code Here

    } catch (ParseException e) {
      throw new InvalidArgumentServiceException("query", "queryParseError");
    } catch (IOException e) {
      _log.error("error executing stop search: query=" + query, e);
      e.printStackTrace();
      throw new ServiceException();
    }

    Min<StopBean> closest = new Min<StopBean>();
    List<StopBean> stopBeans = new ArrayList<StopBean>();
View Full Code Here

  public ItinerariesBean getItinerariesBetween(TransitLocationBean from,
      TransitLocationBean to, long targetTime, ConstraintsBean constraints)
      throws ServiceException {

    if (!_enabled)
      throw new ServiceException("service disabled");

    OBATraverseOptions options = createTraverseOptions();
    applyConstraintsToOptions(constraints, options);

    List<GraphPath> paths = _itinerariesService.getItinerariesBetween(from, to,
View Full Code Here

  @Override
  public ListBean<VertexBean> getStreetGraphForRegion(double latFrom,
      double lonFrom, double latTo, double lonTo) {

    if (!_enabled)
      throw new ServiceException("service disabled");

    double x1 = Math.min(lonFrom, lonTo);
    double x2 = Math.max(lonFrom, lonTo);
    double y1 = Math.min(latFrom, latTo);
    double y2 = Math.max(latFrom, latTo);
View Full Code Here

  public MinTravelTimeToStopsBean getMinTravelTimeToStopsFrom(
      CoordinatePoint location, long time,
      TransitShedConstraintsBean constraints) {

    if (!_enabled)
      throw new ServiceException("service disabled");

    OBATraverseOptions options = createTraverseOptions();
    applyConstraintsToOptions(constraints.getConstraints(), options);

    Coordinate c = new Coordinate(location.getLon(), location.getLat());
View Full Code Here

  public List<TimedPlaceBean> getLocalPaths(ConstraintsBean constraints,
      MinTravelTimeToStopsBean travelTimes, List<LocalSearchResult> localResults)
      throws ServiceException {

    if (!_enabled)
      throw new ServiceException("service disabled");

    long maxTripLength = constraints.getMaxTripDuration() * 1000;

    List<TimedPlaceBean> beans = new ArrayList<TimedPlaceBean>();

View Full Code Here

      ArrivalAndDepartureQuery query, RegisterAlarmQueryBean alarmBean) {

    ArrivalAndDepartureInstance instance = _arrivalAndDepartureService.getArrivalAndDepartureForStop(query);

    if (instance == null)
      throw new ServiceException("no arrival-departure found");

    /**
     * We group alarms by block instance
     */
    BlockInstance blockInstance = instance.getBlockInstance();
View Full Code Here

      String agencyId = entry.getKey();
      CoordinateBounds bounds = entry.getValue();

      AgencyBean agencyBean = _agencyBeanService.getAgencyForId(agencyId);
      if (agencyBean == null)
        throw new ServiceException("agency not found: " + agencyId);

      AgencyWithCoverageBean bean = new AgencyWithCoverageBean();
      bean.setAgency(agencyBean);
      bean.setLat((bounds.getMaxLat() + bounds.getMinLat()) / 2);
      bean.setLon((bounds.getMaxLon() + bounds.getMinLon()) / 2);
View Full Code Here

    try {
      return _searchService.searchForRoutesByName(query.getQuery(),
          query.getMaxCount() + 1, query.getMinScoreToKeep());
    } catch (IOException e) {
      throw new ServiceException();
    } catch (ParseException e) {
      throw new InvalidArgumentServiceException("query", "queryParseError");
    }
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.exceptions.ServiceException

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.