Class AbstractRestServlet

  • All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
    Direct Known Subclasses:
    AsyncRestServlet, SerialRestServlet

    public class AbstractRestServlet
    extends javax.servlet.http.HttpServlet
    Abstract Servlet implementation class AsyncRESTServlet. Enquires ebay REST service for auctions by key word. May be configured with init parameters:
    appid
    The eBay application ID to use
    Each request examines the following request parameters:
    items
    The keyword to search for
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String __DEFAULT_APPID  
      protected java.lang.String _appid  
      protected static java.lang.String APPID_PARAM  
      protected static java.lang.String ITEMS_PARAM  
      protected static java.lang.String STYLE  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doPost​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      protected java.lang.String generateThumbs​(java.util.Queue<java.util.Map<java.lang.String,​java.lang.String>> results)  
      void init​(javax.servlet.ServletConfig servletConfig)  
      protected java.lang.String ms​(long nano)  
      protected java.lang.String restURL​(java.lang.String item)  
      static java.lang.String sanitize​(java.lang.String str)  
      protected int width​(long nano)  
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
      • Methods inherited from class javax.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractRestServlet

        public AbstractRestServlet()
    • Method Detail

      • init

        public void init​(javax.servlet.ServletConfig servletConfig)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Servlet
        Overrides:
        init in class javax.servlet.GenericServlet
        Throws:
        javax.servlet.ServletException
      • sanitize

        public static java.lang.String sanitize​(java.lang.String str)
      • restURL

        protected java.lang.String restURL​(java.lang.String item)
      • generateThumbs

        protected java.lang.String generateThumbs​(java.util.Queue<java.util.Map<java.lang.String,​java.lang.String>> results)
      • ms

        protected java.lang.String ms​(long nano)
      • width

        protected int width​(long nano)
      • doPost

        protected void doPost​(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                       throws javax.servlet.ServletException,
                              java.io.IOException
        Overrides:
        doPost in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        java.io.IOException