// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.sps.servlets;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/")
public class EmptyServlet extends HttpServlet {

    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
    }

    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
    }
}
@@ -853,22 +853,92 @@
 e;%0A%0A
-@WebServlet(%22/
+// returns all of the keyword campaigns in datastore%0A@WebServlet(%22/keyword-campaigns
 %22)%0Ap
@@ -1021,11 +1021,10 @@
 d do
-Pos
+Ge
 t(Ht
@@ -1108,125 +1108,746 @@
     
-%7D%0A%0A
     
-@Override%0A    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException %7B
+DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();%0A        Query query = new Query(%22keyword-campaign%22).addSort(%22keywordCampaignId%22, SortDirection.DESCENDING);%0A    %09PreparedQuery results = datastore.prepare(query);%0A%0A        ArrayList%3CkeywordCampaign%3E keywordCampaigns = new ArrayList%3CkeywordCampaign%3E();%0A        for(Entity entity : results.asIterable()) %7B%0A            // TODO%0A            // keywordCampaign keywordCampaignObject = new keywordCampaign();%0A            keywordCampaigns.add(keywordCampaignObject);%0A        %7D%0A%0A        Gson gson = new Gson();%0A        String json = gson.toJson(keywordCampaigns);%0A        response.setContentType(%22application/json;%22);%0A        response.getWriter().println(json);%0A    %7D
 %0A   

Create framework for the servlet that will obtain the keyword campaigns from datastore.