use of org.onebusaway.transit_data.model.service_alerts.ServiceAlertBean in project onebusaway-application-modules by camsys.
the class SituationsPresentation method getReadSituations.
public List<ServiceAlertBean> getReadSituations() {
List<ServiceAlertBean> situations = new ArrayList<ServiceAlertBean>();
Map<String, Long> readServiceAlerts = _user.getReadServiceAlerts();
for (ServiceAlertBean situation : _situations) {
if (readServiceAlerts.containsKey(situation.getId()))
situations.add(situation);
}
Collections.sort(situations, _comparator);
return situations;
}
use of org.onebusaway.transit_data.model.service_alerts.ServiceAlertBean in project onebusaway-application-modules by camsys.
the class SituationsPresentation method getUnreadSituations.
public List<ServiceAlertBean> getUnreadSituations() {
List<ServiceAlertBean> situations = new ArrayList<ServiceAlertBean>();
Map<String, Long> readServiceAlerts = _user.getReadServiceAlerts();
for (ServiceAlertBean situation : _situations) {
if (isSituationUnread(readServiceAlerts, situation))
situations.add(situation);
}
Collections.sort(situations, _comparator);
return situations;
}
use of org.onebusaway.transit_data.model.service_alerts.ServiceAlertBean in project onebusaway-application-modules by camsys.
the class RealtimeServiceImpl method getServiceAlertsGlobal.
@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();
}
use of org.onebusaway.transit_data.model.service_alerts.ServiceAlertBean in project onebusaway-application-modules by camsys.
the class ArrivalsAndDeparturesAction method getServiceAlertsForStopRoute.
private List<ServiceAlertBean> getServiceAlertsForStopRoute(String stopId, String routeId) {
SituationQueryBean query = new SituationQueryBean();
SituationQueryBean.AffectsBean affects = new SituationQueryBean.AffectsBean();
query.getAffects().add(affects);
affects.setStopId(stopId);
affects.setRouteId(routeId);
ListBean<ServiceAlertBean> alerts = _transitDataService.getServiceAlerts(query);
if (alerts != null) {
return alerts.getList();
}
return Collections.emptyList();
}
use of org.onebusaway.transit_data.model.service_alerts.ServiceAlertBean in project onebusaway-application-modules by camsys.
the class ArrivalsAndDeparturesAction method getServiceAlertsForStop.
private List<ServiceAlertBean> getServiceAlertsForStop(String stopId) {
SituationQueryBean query = new SituationQueryBean();
SituationQueryBean.AffectsBean affects = new SituationQueryBean.AffectsBean();
query.getAffects().add(affects);
affects.setStopId(stopId);
ListBean<ServiceAlertBean> alerts = _transitDataService.getServiceAlerts(query);
if (alerts != null) {
return alerts.getList();
}
return Collections.emptyList();
}
Aggregations