Package org.onebusaway.transit_data.model

Examples of org.onebusaway.transit_data.model.AgencyBean


    for (Iterator<ServiceIdActivation> it = allServiceIds.iterator(); it.hasNext();) {
      ServiceIdActivation activation = it.next();
      LocalizedServiceId lsid = activation.getActiveServiceIds().get(0);
      String agencyId = lsid.getId().getAgencyId();
      AgencyBean bean = _agencyBeanService.getAgencyForId(agencyId);
      if (bean.isPrivateService() && !includePrivateService)
        it.remove();
    }

    return allServiceIds;
  }
View Full Code Here


    AgencyNarrative agency = _narrativeService.getAgencyForId(id);

    if (agency == null)
      return null;

    AgencyBean bean = new AgencyBean();
    bean.setId(id);
    bean.setLang(agency.getLang());
    bean.setName(agency.getName());
    bean.setPhone(agency.getPhone());
    bean.setTimezone(agency.getTimezone());
    bean.setUrl(agency.getUrl());
    bean.setDisclaimer(agency.getDisclaimer());
    bean.setPrivateService(agency.isPrivateService());

    return bean;
  }
View Full Code Here

    routeBuilder.setTextColor("red");
    routeBuilder.setType(3);
    routeBuilder.setUrl("http://wwww.route.com");
    RouteCollectionNarrative route = routeBuilder.create();

    AgencyBean agency = new AgencyBean();
    Mockito.when(_agencyBeanService.getAgencyForId("1")).thenReturn(agency);

    Mockito.when(_narrativeService.getRouteCollectionForId(routeId)).thenReturn(
        route);
    RouteBean bean = _service.getRouteForId(routeId);
View Full Code Here

    bean.setDescription(rc.getDescription());
    bean.setTextColor(rc.getTextColor());
    bean.setType(rc.getType());
    bean.setUrl(rc.getUrl());

    AgencyBean agency = _agencyBeanService.getAgencyForId(id.getAgencyId());
    bean.setAgency(agency);

    return bean.create();
  }
View Full Code Here

  }

  @PostConstruct
  public void setup() {
    for (String agencyId : _agencyService.getAllAgencyIds()) {
      AgencyBean bean = _agencyBeanService.getAgencyForId(agencyId);
      if (bean.isPrivateService())
        _privateAgencyIds.add(agencyId);
    }
  }
View Full Code Here

    for (Map.Entry<String, CoordinateBounds> entry : agencyIdsAndCoverageAreas.entrySet()) {

      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);
View Full Code Here

    try {
      List<AgencyWithCoverageBean> agenciesWithCoverage = _service.getAgenciesWithCoverage();

      for (AgencyWithCoverageBean agencyWithCoverage : agenciesWithCoverage) {

        AgencyBean agency = agencyWithCoverage.getAgency();
        System.out.println("agency=" + agency.getId());

        ListBean<String> stopIds = _service.getStopIdsForAgencyId(agency.getId());
        for (String stopId : stopIds.getList()) {
          System.out.println("  stop=" + stopId);
          _service.getStop(stopId);
        }

        ListBean<String> routeIds = _service.getRouteIdsForAgencyId(agency.getId());
        for (String routeId : routeIds.getList()) {
          System.out.println("  route=" + routeId);
          _service.getStopsForRoute(routeId);
        }
      }
View Full Code Here

  public DefaultHttpHeaders show() throws ServiceException {

    if (hasErrors())
      return setValidationErrorsResponse();

    AgencyBean agency = _service.getAgency(_id);

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

    if (isVersion(V1)) {
View Full Code Here

    String agencyId = _request.getParameter("OperatorRef");
    if (agencyId == null) {
      throw new IllegalArgumentException("Expected parameter OperatorRef");
    }

    AgencyBean agency = _transitDataService.getAgency(agencyId);
    if (agency == null) {
      throw new IllegalArgumentException("No such agency: " + agencyId);
    }

    String routeId = _request.getParameter("LineRef");
View Full Code Here

  public static List<AgencyBean> getAgenciesForArrivalAndDepartures(
      List<ArrivalAndDepartureBean> arrivalsAndDepartures) {

    Map<String, AgencyBean> agenciesById = new HashMap<String, AgencyBean>();
    for (ArrivalAndDepartureBean aad : arrivalsAndDepartures) {
      AgencyBean agency = aad.getTrip().getRoute().getAgency();
      agenciesById.put(agency.getId(), agency);
    }

    List<AgencyBean> agencies = new ArrayList<AgencyBean>();
    agencies.addAll(agenciesById.values());
    Collections.sort(agencies, _agencyNameComparator);
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data.model.AgencyBean

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.