Package org.onebusaway.api.model.transit

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


      return setUnknownVersionResponse();

    if (hasErrors())
      return setValidationErrorsResponse();

    BeanFactoryV2 factory = getBeanFactoryV2();

    try {
      ListBean<VehicleLocationRecordBean> vehicles = _service.getVehicleLocationRecords(_query);
      return setOkResponse(factory.getVehicleLocationRecordResponse(vehicles));
    } catch (OutOfServiceAreaServiceException ex) {
      return setOkResponse(factory.getEmptyList(VehicleStatusV2Bean.class, true));
    }
  }
View Full Code Here


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

    BeanFactoryV2 factory = getBeanFactoryV2();

    try {
      ListBean<VehicleStatusBean> vehicles = _service.getAllVehiclesForAgency(
          _id, time);
      return setOkResponse(factory.getVehicleStatusResponse(vehicles));
    } catch (OutOfServiceAreaServiceException ex) {
      return setOkResponse(factory.getEmptyList(VehicleStatusV2Bean.class, true));
    }
  }
View Full Code Here

      return setResourceNotFoundResponse();

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

      return setResourceNotFoundResponse();

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

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

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

    EncodedPolylineBean shape = _service.getShapeForId(_id);

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

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

    BlockBean block = _service.getBlockForId(_id);

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

    BeanFactoryV2 factory = getBeanFactoryV2();
    EntryWithReferencesBean<BlockV2Bean> response = factory.getBlockResponse(block);
    return setOkResponse(response);
  }
View Full Code Here

    TripBean trip = _service.getTrip(_id);

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

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

    TripDetailsBean trip = _service.getTripDetailsForVehicleAndTime(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))
      return setUnknownVersionResponse();

    ListBean<RouteBean> routes = _service.getRoutesForAgencyId(_id);

    BeanFactoryV2 factory = getBeanFactoryV2();
    List<RouteV2Bean> beans = new ArrayList<RouteV2Bean>();
    for (RouteBean route : routes.getList())
      beans.add(factory.getRoute(route));

    return setOkResponse(factory.list(beans, false));
  }
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.