Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Motp 477 ignore planned siri alerts and pass reason name and priority #2

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,21 @@ public class SiriToGtfsrtTransformer implements GtfsRealtimeTransformer<Siri> {

private GtfsRouteAdapter _gtfsRouteAdapter;

private boolean _ignorePlannedPtSituations;

public boolean getIgnorePlannedPtSituations() {
return _ignorePlannedPtSituations;
}

public void setIgnorePlannedPtSituations(boolean _ignorePlannedPtSituations) {
this._ignorePlannedPtSituations = _ignorePlannedPtSituations;
}


@Override
public FeedMessage transform(Siri siri) {
List<ServiceAlertBean> serviceAlerts = NycSiriUtil.getSiriAsServiceAlertBeans(siri);

List<ServiceAlertBean> serviceAlerts = NycSiriUtil.getSiriAsServiceAlertBeans(siri, _ignorePlannedPtSituations);

FeedMessage.Builder message = FeedMessage.newBuilder();
FeedHeader.Builder header = FeedHeader.newBuilder();
Expand All @@ -48,6 +60,8 @@ public FeedMessage transform(Siri siri) {
for (ServiceAlertBean serviceAlert : serviceAlerts) {
if (_gtfsRouteAdapter != null)
replaceRouteIds(serviceAlert);


FeedEntity.Builder fe = FeedEntity.newBuilder();
Alert.Builder alert = GtfsRealtimeLibrary.makeAlert(serviceAlert);
fe.setAlert(alert);
Expand Down