use of uk.org.siri.siri_2.SituationRefStructure in project onebusaway-application-modules by camsys.
the class ServiceAlertsHelperV2 method addSituationElement.
/*
public void addSituationExchangeToServiceDelivery(ServiceDelivery serviceDelivery,
Map<String, ServiceAlertBean> currentServiceAlerts) {
addSituationExchangeToServiceDelivery(serviceDelivery, currentServiceAlerts.values());
}
public void addClosedSituationExchangesToSiri(
ServiceDelivery serviceDelivery, Collection<String> deletedIds) {
Map<String, PtSituationElementStructure> ptSituationElements = new HashMap<String, PtSituationElementStructure>();
for (String id : deletedIds) {
PtSituationElementStructure ptSit = new PtSituationElementStructure();
EntryQualifierStructure value = new EntryQualifierStructure();
value.setValue(id);
ptSit.setSituationNumber(value);
ptSit.setProgress(WorkflowStatusEnumeration.CLOSED);
ptSituationElements.put(id, ptSit);
}
addPtSituationElementsToServiceDelivery(serviceDelivery,
ptSituationElements);
}
*/
private void addSituationElement(TransitDataService transitDataService, Map<String, PtSituationElementStructure> ptSituationElements, List<SituationRefStructure> situationRefs) {
if (situationRefs == null)
return;
for (SituationRefStructure situationRef : situationRefs) {
String situationId = situationRef.getSituationSimpleRef().getValue();
ServiceAlertBean serviceAlert = transitDataService.getServiceAlertForId(situationId);
PtSituationElementStructure e = getServiceAlertBeanAsPtSituationElementStructure(serviceAlert);
ptSituationElements.put(situationId, e);
}
}
use of uk.org.siri.siri_2.SituationRefStructure in project onebusaway-application-modules by camsys.
the class SiriSupportV2 method fillSituations.
private static void fillSituations(MonitoredVehicleJourneyStructure monitoredVehicleJourney, TripStatusBean tripStatus) {
if (tripStatus == null || tripStatus.getSituations() == null || tripStatus.getSituations().isEmpty()) {
return;
}
List<SituationRefStructure> situationRef = monitoredVehicleJourney.getSituationRef();
for (ServiceAlertBean situation : tripStatus.getSituations()) {
SituationRefStructure sitRef = new SituationRefStructure();
SituationSimpleRefStructure sitSimpleRef = new SituationSimpleRefStructure();
sitSimpleRef.setValue(situation.getId());
sitRef.setSituationSimpleRef(sitSimpleRef);
situationRef.add(sitRef);
}
}
Aggregations