Skip to content
Snippets Groups Projects
Select Git revision
  • 6817792dd0640ccf9129557567f02d97fcbcf51d
  • main default protected
  • 1.6.11
  • 1.6.4
  • 1.6.3
  • 1.6.2
  • 1.6.1
  • 1.6.0
  • 1.5.14
  • 1.5.13
  • 1.5.12
  • 1.5.11
  • 1.5.10
  • 1.5.9
  • 1.5.8
15 results

SearchServlet.java

Blame
  • SearchServlet.java 3.69 KiB
    
    import java.util.logging.Logger;
    import java.util.Map;
    import java.util.List;
    import java.util.ArrayList;
    
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.nio.charset.Charset;
    
    import java.io.UnsupportedEncodingException;
    import java.net.URLDecoder;
    
    import java.security.Principal;
    
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    
    public class SearchServlet extends javax.servlet.http.HttpServlet
    {
       private static final Logger         LOGGER   = Logger.getLogger("PSearch");
       private static final SearchSettings settings = SearchSettings.getInstance("discovery.properties");
    
    
       public void init() throws ServletException
       {
          super.init();
    
          LOGGER.info("URLs : " + settings.serviceUrls.toString());
          LOGGER.info("DB   : " + settings.dbConn.toString());
       }
    
    
       protected void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException, UnsupportedEncodingException
       {
          LOGGER.info("trace");
    
          long startTime_msec = System.currentTimeMillis();
    
          legacyLogEntry(request);
    
          Map<String, String[]> params = request.getParameterMap();
          String           queryString = request.getQueryString();
    
          try
          {
             Coord       coord           = new Coord(params);
             SubsurveyId subsurveyId     = new SubsurveyId(params);
    
             /* query Obscore table */
    
             DbPSearch dbps;
             synchronized(DbPSearch.class)
             {
                dbps = new DbPSearch();
             }
             String[] pubdidArr = dbps.queryOverlapingPubdid(coord, subsurveyId);
    
    
    
             final String RESPONSE_ENCODING = "UTF-8";
    
             /* if filters installed response will be wrapped */
    
             if(response instanceof FormatResponseWrapper)
             {
                LOGGER.info("response-type is FormatResponseWrapper");