throws ServiceException {
if (!_enabled)
throw new ServiceException("service disabled");
OBATraverseOptions options = createTraverseOptions();
applyConstraintsToOptions(constraints, options);
List<GraphPath> paths = _itinerariesService.getItinerariesBetween(from, to,
targetTime, options);
LocationBean fromBean = getPointAsLocation(from);
LocationBean toBean = getPointAsLocation(to);
ItinerariesBean itineraries = getPathsAsItineraries(paths, fromBean,
toBean, options);
ensureSelectedItineraryIsIncluded(from, to, targetTime, itineraries,
constraints.getSelectedItinerary(), options);
if (options.isArriveBy())
Collections.sort(itineraries.getItineraries(), new SortByArrival());
else
Collections.sort(itineraries.getItineraries(), new SortByDeparture());
return itineraries;