Search in sources :

Example 1 with EntryQualifierStructure

use of uk.org.siri.siri_2.EntryQualifierStructure 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);
    }
}
Also used : SituationRefStructure(uk.org.siri.siri_2.SituationRefStructure) PtSituationElementStructure(uk.org.siri.siri_2.PtSituationElementStructure) ServiceAlertBean(org.onebusaway.transit_data.model.service_alerts.ServiceAlertBean)

Example 2 with EntryQualifierStructure

use of uk.org.siri.siri_2.EntryQualifierStructure in project onebusaway-application-modules by camsys.

the class ServiceAlertsHelperV2 method getServiceAlertBeanAsPtSituationElementStructure.

public PtSituationElementStructure getServiceAlertBeanAsPtSituationElementStructure(ServiceAlertBean serviceAlert) {
    PtSituationElementStructure ptSit = new PtSituationElementStructure();
    EntryQualifierStructure value = new EntryQualifierStructure();
    value.setValue(serviceAlert.getId());
    ptSit.setSituationNumber(value);
    if (serviceAlert.getCreationTime() != 0)
        ptSit.setCreationTime(DateUtil.toXmlGregorianCalendar(serviceAlert.getCreationTime()));
    handleDescriptions(serviceAlert, ptSit);
    handleOtherFields(serviceAlert, ptSit);
    handleAffects(serviceAlert, ptSit);
    handleConsequences(serviceAlert, ptSit);
    return ptSit;
}
Also used : PtSituationElementStructure(uk.org.siri.siri_2.PtSituationElementStructure) EntryQualifierStructure(uk.org.siri.siri_2.EntryQualifierStructure)

Aggregations

PtSituationElementStructure (uk.org.siri.siri_2.PtSituationElementStructure)2 ServiceAlertBean (org.onebusaway.transit_data.model.service_alerts.ServiceAlertBean)1 EntryQualifierStructure (uk.org.siri.siri_2.EntryQualifierStructure)1 SituationRefStructure (uk.org.siri.siri_2.SituationRefStructure)1