Search in sources :

Example 1 with HalfOpenTimestampOutputRangeStructure

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

the class ServiceAlertsHelperV2 method handleOtherFields.

private void handleOtherFields(ServiceAlertBean serviceAlert, PtSituationElementStructure ptSituation) {
    if (serviceAlert == null || serviceAlert.getPublicationWindows() == null)
        return;
    // TODO Not handling severity yet.
    ptSituation.setSeverity(SeverityEnumeration.UNDEFINED);
    // TODO - LCARABALLO - Changed from HalfOpenTimestampRangeStructure to HalfOpenTimestampOutputRangeStructure
    HalfOpenTimestampOutputRangeStructure timestampRangeStructure = new HalfOpenTimestampOutputRangeStructure();
    if (serviceAlert.getPublicationWindows() != null && !serviceAlert.getPublicationWindows().isEmpty()) {
        timestampRangeStructure.setStartTime(DateUtil.toXmlGregorianCalendar(serviceAlert.getPublicationWindows().get(0).getFrom()));
        timestampRangeStructure.setEndTime(DateUtil.toXmlGregorianCalendar(serviceAlert.getPublicationWindows().get(0).getTo()));
        ptSituation.setPublicationWindow(timestampRangeStructure);
    }
}
Also used : HalfOpenTimestampOutputRangeStructure(uk.org.siri.siri_2.HalfOpenTimestampOutputRangeStructure)

Aggregations

HalfOpenTimestampOutputRangeStructure (uk.org.siri.siri_2.HalfOpenTimestampOutputRangeStructure)1