local_runtime_shared_jetty9/src/main/java/com/google/apphosting/utils/servlet/SearchServlet.java [221:271]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private void doGetIndexesList(HttpServletRequest req, HttpServletResponse resp)
      throws IOException {
    int start = getIntParam(req, START, 0);
    int numPerPage = getIntParam(req, NUM_PER_PAGE, 10);
    String requestedNamespace = req.getParameter(NAMESPACE);
    List<Index> indexes = null;

    // Empty namespace parameter equals to no namespace specified.
    String namespace = requestedNamespace != null ? requestedNamespace : "";
    boolean hasMore = false;

    try {
      SearchService search = SearchServiceFactory.getSearchService(namespace);
      GetIndexesRequest.Builder searchRequest = GetIndexesRequest.newBuilder();
      searchRequest.setIncludeStartIndex(true);
      searchRequest.setLimit(numPerPage + 1);
      searchRequest.setOffset(start);
      GetResponse<Index> searchResponse = search.getIndexes(searchRequest.build());
      indexes = searchResponse.getResults();

      // Check if we have more indexes and remove extra one if needed.
      if (indexes.size() > numPerPage) {
        hasMore = true;
        indexes = new ArrayList<Index>(indexes);
        indexes.remove(numPerPage - 1);
      }

      // Fill in paging parameters.
      int currentPage = start / numPerPage;
      req.setAttribute(END, start + indexes.size());
      req.setAttribute(PREV_START, currentPage > 0 ? (currentPage - 1) * numPerPage : -1);
      req.setAttribute(NEXT_START, hasMore ? (currentPage + 1) * numPerPage : -1);
      req.setAttribute(INDEXES, indexes);
    } catch (RuntimeException e) {
      logger.log(Level.SEVERE, "failed to retrieve indexes list", e);
      req.setAttribute(ERROR_MESSAGE, makeErrorMessage(e.getMessage()));
    }

    // Set common parameters.
    setCommonAttributes(req, namespace);
    req.setAttribute(CURRENT_LINK, urlencode(
        filterURL(req, NAMESPACE, START, NUM_PER_PAGE)));
    req.setAttribute(START_BASE_URL, filterURL(req, NAMESPACE, NUM_PER_PAGE));

    try {
      getServletContext().getRequestDispatcher(
          "/_ah/adminConsole?subsection=" + Subsection.searchIndexesList.name()).forward(req, resp);
    } catch (ServletException e) {
      throw new RuntimeException("Could not forward request", e);
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



local_runtime_shared_jetty12/src/main/java/com/google/apphosting/utils/servlet/SearchServlet.java [221:271]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private void doGetIndexesList(HttpServletRequest req, HttpServletResponse resp)
      throws IOException {
    int start = getIntParam(req, START, 0);
    int numPerPage = getIntParam(req, NUM_PER_PAGE, 10);
    String requestedNamespace = req.getParameter(NAMESPACE);
    List<Index> indexes = null;

    // Empty namespace parameter equals to no namespace specified.
    String namespace = requestedNamespace != null ? requestedNamespace : "";
    boolean hasMore = false;

    try {
      SearchService search = SearchServiceFactory.getSearchService(namespace);
      GetIndexesRequest.Builder searchRequest = GetIndexesRequest.newBuilder();
      searchRequest.setIncludeStartIndex(true);
      searchRequest.setLimit(numPerPage + 1);
      searchRequest.setOffset(start);
      GetResponse<Index> searchResponse = search.getIndexes(searchRequest.build());
      indexes = searchResponse.getResults();

      // Check if we have more indexes and remove extra one if needed.
      if (indexes.size() > numPerPage) {
        hasMore = true;
        indexes = new ArrayList<Index>(indexes);
        indexes.remove(numPerPage - 1);
      }

      // Fill in paging parameters.
      int currentPage = start / numPerPage;
      req.setAttribute(END, start + indexes.size());
      req.setAttribute(PREV_START, currentPage > 0 ? (currentPage - 1) * numPerPage : -1);
      req.setAttribute(NEXT_START, hasMore ? (currentPage + 1) * numPerPage : -1);
      req.setAttribute(INDEXES, indexes);
    } catch (RuntimeException e) {
      logger.log(Level.SEVERE, "failed to retrieve indexes list", e);
      req.setAttribute(ERROR_MESSAGE, makeErrorMessage(e.getMessage()));
    }

    // Set common parameters.
    setCommonAttributes(req, namespace);
    req.setAttribute(CURRENT_LINK, urlencode(
        filterURL(req, NAMESPACE, START, NUM_PER_PAGE)));
    req.setAttribute(START_BASE_URL, filterURL(req, NAMESPACE, NUM_PER_PAGE));

    try {
      getServletContext().getRequestDispatcher(
          "/_ah/adminConsole?subsection=" + Subsection.searchIndexesList.name()).forward(req, resp);
    } catch (ServletException e) {
      throw new RuntimeException("Could not forward request", e);
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



local_runtime_shared_jetty12/src/main/java/com/google/apphosting/utils/servlet/ee10/SearchServlet.java [221:271]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private void doGetIndexesList(HttpServletRequest req, HttpServletResponse resp)
      throws IOException {
    int start = getIntParam(req, START, 0);
    int numPerPage = getIntParam(req, NUM_PER_PAGE, 10);
    String requestedNamespace = req.getParameter(NAMESPACE);
    List<Index> indexes = null;

    // Empty namespace parameter equals to no namespace specified.
    String namespace = requestedNamespace != null ? requestedNamespace : "";
    boolean hasMore = false;

    try {
      SearchService search = SearchServiceFactory.getSearchService(namespace);
      GetIndexesRequest.Builder searchRequest = GetIndexesRequest.newBuilder();
      searchRequest.setIncludeStartIndex(true);
      searchRequest.setLimit(numPerPage + 1);
      searchRequest.setOffset(start);
      GetResponse<Index> searchResponse = search.getIndexes(searchRequest.build());
      indexes = searchResponse.getResults();

      // Check if we have more indexes and remove extra one if needed.
      if (indexes.size() > numPerPage) {
        hasMore = true;
        indexes = new ArrayList<Index>(indexes);
        indexes.remove(numPerPage - 1);
      }

      // Fill in paging parameters.
      int currentPage = start / numPerPage;
      req.setAttribute(END, start + indexes.size());
      req.setAttribute(PREV_START, currentPage > 0 ? (currentPage - 1) * numPerPage : -1);
      req.setAttribute(NEXT_START, hasMore ? (currentPage + 1) * numPerPage : -1);
      req.setAttribute(INDEXES, indexes);
    } catch (RuntimeException e) {
      logger.log(Level.SEVERE, "failed to retrieve indexes list", e);
      req.setAttribute(ERROR_MESSAGE, makeErrorMessage(e.getMessage()));
    }

    // Set common parameters.
    setCommonAttributes(req, namespace);
    req.setAttribute(CURRENT_LINK, urlencode(
        filterURL(req, NAMESPACE, START, NUM_PER_PAGE)));
    req.setAttribute(START_BASE_URL, filterURL(req, NAMESPACE, NUM_PER_PAGE));

    try {
      getServletContext().getRequestDispatcher(
          "/_ah/adminConsole?subsection=" + Subsection.searchIndexesList.name()).forward(req, resp);
    } catch (ServletException e) {
      throw new RuntimeException("Could not forward request", e);
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



