private void handleStopGroupBean(String stopIdString, SituationQueryBean query, RouteBean route, StopGroupBean stopGroup) { List<StopGroupBean> subGroups = stopGroup.getSubGroups(); if (subGroups != null && !subGroups.isEmpty()) { for (StopGroupBean stopSubGroup : subGroups) { handleStopGroupBean(stopIdString, query, route, stopSubGroup); } } String direction = stopGroup.getId(); for (String groupStopId : stopGroup.getStopIds()) { if (groupStopId.equals(stopIdString)) { SituationQueryBean.AffectsBean affects = new SituationQueryBean.AffectsBean(); query.getAffects().add(affects); affects.setRouteId(route.getId()); affects.setDirectionId(direction); } } }
SituationQueryBean.AffectsBean affects = new SituationQueryBean.AffectsBean(); query.getAffects().add(affects); affects.setRouteId(routeId.toString());
/** * SERVICE ALERTS METHODS */ @Override public List<ServiceAlertBean> getServiceAlertsForAgency(String agencyId) { SituationQueryBean query = new SituationQueryBean(); SituationQueryBean.AffectsBean affects = new SituationQueryBean.AffectsBean(); query.getAffects().add(affects); affects.setAgencyId(agencyId); ListBean<ServiceAlertBean> serviceAlerts = _transitDataService.getServiceAlerts(query); return serviceAlerts.getList(); }
List<String> stopIdStrings = new ArrayList<String>(); stopIdStrings.add(stopIdString); SituationQueryBean.AffectsBean affects = new SituationQueryBean.AffectsBean(); query.getAffects().add(affects); affects.setStopId(stopIdString);
@Override public List<ServiceAlertBean> getServiceAlertsForRouteAndDirection( String routeId, String directionId) { SituationQueryBean query = new SituationQueryBean(); SituationQueryBean.AffectsBean affects = new SituationQueryBean.AffectsBean(); query.getAffects().add(affects); affects.setRouteId(routeId); if (directionId != null) { affects.setDirectionId(directionId); } else { /* * TODO * The route index is not currently being populated correctly; query by route and direction, * and supply both directions if not present */ SituationQueryBean.AffectsBean affects1 = new SituationQueryBean.AffectsBean(); query.getAffects().add(affects1); affects1.setRouteId(routeId); affects1.setDirectionId("0"); SituationQueryBean.AffectsBean affects2 = new SituationQueryBean.AffectsBean(); query.getAffects().add(affects2); affects2.setRouteId(routeId); affects2.setDirectionId("1"); } ListBean<ServiceAlertBean> serviceAlerts = _transitDataService.getServiceAlerts(query); return serviceAlerts.getList(); }
@Override public List<ServiceAlertBean> getServiceAlertsGlobal() { SituationQueryBean query = new SituationQueryBean(); SituationQueryBean.AffectsBean affects = new SituationQueryBean.AffectsBean(); affects.setAgencyId("__ALL_OPERATORS__"); query.getAffects().add(affects); ListBean<ServiceAlertBean> serviceAlerts = _transitDataService.getServiceAlerts(query); return serviceAlerts.getList(); }