Search in sources :

Example 6 with GtfsBundleInfo

use of org.onebusaway.admin.service.bundle.task.model.GtfsBundleInfo in project onebusaway-application-modules by camsys.

the class GtfsArchiveTask method createMetaData.

private Integer createMetaData(Session session, BundleRequestResponse requestResponse) {
    GtfsBundleInfo info = new GtfsBundleInfo();
    BundleBuildRequest request = requestResponse.getRequest();
    BundleBuildResponse response = requestResponse.getResponse();
    info.setBundleId(response.getBundleId());
    info.setName(request.getBundleName());
    info.setDirectory(request.getBundleDirectory());
    info.setStartDate(request.getBundleStartDate().toDate());
    info.setEndDate(request.getBundleEndDate().toDate());
    info.setTimestamp(new Date());
    return (Integer) session.save(info);
}
Also used : BundleBuildRequest(org.onebusaway.admin.model.BundleBuildRequest) GtfsBundleInfo(org.onebusaway.admin.service.bundle.task.model.GtfsBundleInfo) BundleBuildResponse(org.onebusaway.admin.model.BundleBuildResponse) Date(java.util.Date)

Aggregations

GtfsBundleInfo (org.onebusaway.admin.service.bundle.task.model.GtfsBundleInfo)6 Transaction (org.hibernate.Transaction)4 Session (org.hibernate.classic.Session)4 Date (java.util.Date)2 TreeSet (java.util.TreeSet)2 TreeMap (java.util.TreeMap)1 BundleBuildRequest (org.onebusaway.admin.model.BundleBuildRequest)1 BundleBuildResponse (org.onebusaway.admin.model.BundleBuildResponse)1