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);
}
}
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;
}
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());
}
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;
}
Aggregations