use of org.onebusaway.admin.service.bundle.task.model.GtfsBundleInfo in project onebusaway-application-modules by camsys.
the class GtfsArchiveDaoImpl method getBuildNamesForDataset.
/**
* Accesses the database to get the list of build names for the
* specified dataset..
*
* @return a SortedSet of the dataset names.
*/
@Override
public SortedSet<String> getBuildNamesForDataset(String dataset) {
SortedSet<String> buildNames = new TreeSet<>();
Session session = _template.getSessionFactory().getCurrentSession();
Transaction tx = session.beginTransaction();
List<GtfsBundleInfo> archivedBundles = session.createCriteria(GtfsBundleInfo.class).list();
tx.commit();
for (GtfsBundleInfo archivedBundle : archivedBundles) {
if (archivedBundle.getDirectory().equals(dataset)) {
buildNames.add(archivedBundle.getName());
}
}
return buildNames;
}
use of org.onebusaway.admin.service.bundle.task.model.GtfsBundleInfo in project onebusaway-application-modules by camsys.
the class GtfsArchiveServiceImpl method getBundleStartDate.
@Override
public Date getBundleStartDate(int buildId) {
GtfsBundleInfo bundleInfo = _gtfsArchiveDao.getBundleInfoForId(buildId);
Date startDate = bundleInfo == null ? null : bundleInfo.getStartDate();
return startDate;
}
use of org.onebusaway.admin.service.bundle.task.model.GtfsBundleInfo in project onebusaway-application-modules by camsys.
the class GtfsArchiveDaoImpl method getBundleInfoForId.
@Override
public GtfsBundleInfo getBundleInfoForId(int buildId) {
Session session = _template.getSessionFactory().getCurrentSession();
Transaction tx = session.beginTransaction();
List<GtfsBundleInfo> responses = _template.findByNamedParam("from GtfsBundleInfo where gid=:id", "id", buildId);
tx.commit();
GtfsBundleInfo bundleInfo = responses.get(0);
return bundleInfo;
}
use of org.onebusaway.admin.service.bundle.task.model.GtfsBundleInfo in project onebusaway-application-modules by camsys.
the class GtfsArchiveDaoImpl method getAllDatasets.
/**
* Accesses the database to get the names of all the archived datasets.
*
* @return a SortedSet of the dataset names.
*/
@Override
public SortedSet<String> getAllDatasets() {
SortedSet<String> datasets = new TreeSet<>();
Session session = _template.getSessionFactory().getCurrentSession();
Transaction tx = session.beginTransaction();
List<GtfsBundleInfo> archivedBundles = session.createCriteria(GtfsBundleInfo.class).list();
tx.commit();
for (GtfsBundleInfo archivedBundle : archivedBundles) {
datasets.add(archivedBundle.getDirectory());
}
return datasets;
}
use of org.onebusaway.admin.service.bundle.task.model.GtfsBundleInfo in project onebusaway-application-modules by camsys.
the class GtfsArchiveDaoImpl method getBuildNameMapForDataset.
@Override
public SortedMap<String, String> getBuildNameMapForDataset(String dataset) {
SortedMap<String, String> buildNameMap = new TreeMap<>();
Session session = _template.getSessionFactory().getCurrentSession();
Transaction tx = session.beginTransaction();
List<GtfsBundleInfo> archivedBundles = session.createCriteria(GtfsBundleInfo.class).list();
tx.commit();
for (GtfsBundleInfo archivedBundle : archivedBundles) {
if (archivedBundle.getDirectory().equals(dataset)) {
buildNameMap.put(archivedBundle.getName(), "" + archivedBundle.getId());
}
}
return buildNameMap;
}
Aggregations