Search in sources :

Example 1 with CalendarServiceDataFactoryImpl

use of org.onebusaway.gtfs.impl.calendar.CalendarServiceDataFactoryImpl in project onebusaway-application-modules by camsys.

the class CalendarServiceDataTask method run.

public void run() {
    CalendarServiceDataFactoryImpl factory = new CalendarServiceDataFactoryImpl();
    factory.setGtfsDao(_dao);
    factory.setExcludeFutureServiceDatesInDays(_excludeFutureServiceDatesInDays);
    CalendarServiceData data = factory.createData();
    data.makeReadOnly();
    try {
        ObjectSerializationLibrary.writeObject(_bundle.getCalendarServiceDataPath(), data);
        _refreshService.refresh(RefreshableResources.CALENDAR_DATA);
    } catch (IOException e) {
        throw new IllegalStateException("error serializing service calendar data", e);
    }
}
Also used : CalendarServiceData(org.onebusaway.gtfs.model.calendar.CalendarServiceData) IOException(java.io.IOException) CalendarServiceDataFactoryImpl(org.onebusaway.gtfs.impl.calendar.CalendarServiceDataFactoryImpl)

Example 2 with CalendarServiceDataFactoryImpl

use of org.onebusaway.gtfs.impl.calendar.CalendarServiceDataFactoryImpl in project OpenTripPlanner by opentripplanner.

the class GtfsLibrary method createCalendarServiceData.

public static CalendarServiceData createCalendarServiceData(GtfsRelationalDao dao) {
    CalendarServiceDataFactoryImpl factory = new CalendarServiceDataFactoryImpl();
    factory.setGtfsDao(dao);
    CalendarServiceData data = factory.createData();
    return data;
}
Also used : CalendarServiceData(org.onebusaway.gtfs.model.calendar.CalendarServiceData) CalendarServiceDataFactoryImpl(org.onebusaway.gtfs.impl.calendar.CalendarServiceDataFactoryImpl)

Example 3 with CalendarServiceDataFactoryImpl

use of org.onebusaway.gtfs.impl.calendar.CalendarServiceDataFactoryImpl in project onebusaway-gtfs-modules by OneBusAway.

the class ServiceCalendarMergeStrategy method getServiceDatesForServiceId.

/**
 * @param dao
 * @param key
 * @return the set of active service dates for the specified service_id
 */
private Set<ServiceDate> getServiceDatesForServiceId(GtfsRelationalDao dao, AgencyAndId key) {
    CalendarServiceDataFactoryImpl factory = new CalendarServiceDataFactoryImpl();
    factory.setGtfsDao(dao);
    return factory.getServiceDatesForServiceId(key, TimeZone.getDefault());
}
Also used : CalendarServiceDataFactoryImpl(org.onebusaway.gtfs.impl.calendar.CalendarServiceDataFactoryImpl)

Example 4 with CalendarServiceDataFactoryImpl

use of org.onebusaway.gtfs.impl.calendar.CalendarServiceDataFactoryImpl in project onebusaway-gtfs-modules by OneBusAway.

the class GtfsDataServiceImpl method setGtfsDao.

public void setGtfsDao(GtfsRelationalDao dao) {
    CalendarServiceImpl calendarService = new CalendarServiceImpl();
    CalendarServiceDataFactoryImpl factory = new CalendarServiceDataFactoryImpl();
    factory.setGtfsDao(dao);
    calendarService.setDataFactory(factory);
    _calendarService = calendarService;
    _dao = dao;
}
Also used : CalendarServiceImpl(org.onebusaway.gtfs.impl.calendar.CalendarServiceImpl) CalendarServiceDataFactoryImpl(org.onebusaway.gtfs.impl.calendar.CalendarServiceDataFactoryImpl)

Aggregations

CalendarServiceDataFactoryImpl (org.onebusaway.gtfs.impl.calendar.CalendarServiceDataFactoryImpl)4 CalendarServiceData (org.onebusaway.gtfs.model.calendar.CalendarServiceData)2 IOException (java.io.IOException)1 CalendarServiceImpl (org.onebusaway.gtfs.impl.calendar.CalendarServiceImpl)1