/** * @param entityId * @return the agencyId from an "agencyId_entityId" string representation * @throws InvalidArgumentServiceException on a parse error */ public static String getAgencyIdFromEntityId(String entityId) throws InvalidArgumentServiceException { int index = entityId.indexOf('_'); if (index == -1) throw new InvalidArgumentServiceException("entityId", "badEntityId"); return entityId.substring(0, index); } }
/** * @param entityId * @return the agencyId from an "agencyId_entityId" string representation * @throws InvalidArgumentServiceException on a parse error */ public static String getAgencyIdFromEntityId(String entityId) throws InvalidArgumentServiceException { int index = entityId.indexOf('_'); if (index == -1) throw new InvalidArgumentServiceException("entityId", "badEntityId"); return entityId.substring(0, index); } }
private SearchResult<AgencyAndId> searchForRoutes(SearchQueryBean query) throws ServiceException, InvalidArgumentServiceException { try { return _searchService.searchForRoutesByShortName(query.getQuery(), query.getMaxCount() + 1, MIN_SEARCH_SCORE); } catch (IOException e) { throw new ServiceException(); } catch (ParseException e) { throw new InvalidArgumentServiceException("query", "queryParseError"); } }
private SearchResult<AgencyAndId> searchForRoutes(SearchQueryBean query) throws ServiceException, InvalidArgumentServiceException { try { return _searchService.searchForRoutesByName(query.getQuery(), query.getMaxCount() + 1, query.getMinScoreToKeep()); } catch (IOException e) { throw new ServiceException(); } catch (ParseException e) { throw new InvalidArgumentServiceException("query", "queryParseError"); } }
stops = _searchService.searchForStopsByCode(query, 10, MIN_SCORE); } catch (ParseException e) { throw new InvalidArgumentServiceException("query", "queryParseError"); } catch (IOException e) { _log.error("error executing stop search: query=" + query, e);
stops = _searchService.searchForStopsByCode(query, 10, MIN_SCORE); } catch (ParseException e) { throw new InvalidArgumentServiceException("query", "queryParseError"); } catch (IOException e) { _log.error("error executing stop search: query=" + query, e);