Search in sources :

Example 1 with EntryQualifierStructure

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

the class ServiceAlertsHelper method getServiceAlertBeanAsPtSituationElementStructure.

public PtSituationElementStructure getServiceAlertBeanAsPtSituationElementStructure(ServiceAlertBean serviceAlert) {
    PtSituationElementStructure ptSit = new PtSituationElementStructure();
    EntryQualifierStructure value = new EntryQualifierStructure();
    if (serviceAlert != null) {
        value.setValue(serviceAlert.getId());
        ptSit.setSituationNumber(value);
    } else {
        // nothing to do
        return ptSit;
    }
    if (serviceAlert.getCreationTime() != 0)
        ptSit.setCreationTime(new Date(serviceAlert.getCreationTime()));
    handleDescriptions(serviceAlert, ptSit);
    handleOtherFields(serviceAlert, ptSit);
    handleAffects(serviceAlert, ptSit);
    handleConsequences(serviceAlert, ptSit);
    return ptSit;
}
Also used : PtSituationElementStructure(uk.org.siri.siri.PtSituationElementStructure) EntryQualifierStructure(uk.org.siri.siri.EntryQualifierStructure) Date(java.util.Date)

Example 2 with EntryQualifierStructure

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

the class ServiceAlertsHelper method addClosedSituationExchangesToSiri.

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);
}
Also used : HashMap(java.util.HashMap) PtSituationElementStructure(uk.org.siri.siri.PtSituationElementStructure) EntryQualifierStructure(uk.org.siri.siri.EntryQualifierStructure)

Aggregations

EntryQualifierStructure (uk.org.siri.siri.EntryQualifierStructure)2 PtSituationElementStructure (uk.org.siri.siri.PtSituationElementStructure)2 Date (java.util.Date)1 HashMap (java.util.HashMap)1