Class WrsServlet

  • All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class WrsServlet
    extends javax.servlet.http.HttpServlet
    Servlet for calling Wrs services GET: It turns a WrsRequest into SQL and returns a Wrs document with wrs:R rows POST: It turns a Wrs into updates of the database based on wrs:M wrs:D rows
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int maxRowsDefault  
    • Constructor Summary

      Constructors 
      Constructor Description
      WrsServlet()
      WrsServlet
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected IDataWriter createDataWriter​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, IRequestOptions options)
      create data writer
      protected void doGet​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      protected void doPost​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      static java.util.Map<java.lang.String,​java.lang.Long> getLastModifiedResourceMap()  
      void init​(javax.servlet.ServletConfig config)  
      protected void tagUpdate​(java.lang.String resourceUri)
      tags a resource (which is set by pathInfo) with current millis, which is considered as a lastModified tag on that resource
      static boolean wasResourceModified​(java.lang.String resourceUri, java.lang.Long lastReadStamp)
      convenience method
      static boolean wasResourceModified​(java.lang.String resourceUri, java.util.Date lastReadDate)
      convenience method to check if given resource has been modified
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, 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
    • Field Detail

      • maxRowsDefault

        protected int maxRowsDefault
    • Constructor Detail

      • WrsServlet

        public WrsServlet()
        WrsServlet
    • Method Detail

      • getLastModifiedResourceMap

        public static java.util.Map<java.lang.String,​java.lang.Long> getLastModifiedResourceMap()
        Returns:
        the IMMUTABLE map containing lastModified resources with their timestamps
      • wasResourceModified

        public static boolean wasResourceModified​(java.lang.String resourceUri,
                                                  java.util.Date lastReadDate)
        convenience method to check if given resource has been modified
        Parameters:
        resourceUri - Resource to be checked
        lastReadDate - if this parameter is NULL the method returns TRUE as is assumes the resource has never been read
        Returns:
        true if the given resource has been modified
      • wasResourceModified

        public static boolean wasResourceModified​(java.lang.String resourceUri,
                                                  java.lang.Long lastReadStamp)
        convenience method
        Parameters:
        resourceUri - Resource to be checked
        lastReadStamp - if this parameter is NULL the method returns TRUE as is assumes the resource has never been read
        Returns:
        true if the given resource has been modified
      • init

        public void init​(javax.servlet.ServletConfig config)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Servlet
        Overrides:
        init in class javax.servlet.GenericServlet
        Throws:
        javax.servlet.ServletException
        See Also:
        GenericServlet.init(javax.servlet.ServletConfig)
      • doGet

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

        protected IDataWriter createDataWriter​(javax.servlet.http.HttpServletRequest request,
                                               javax.servlet.http.HttpServletResponse response,
                                               IRequestOptions options)
        create data writer
        Parameters:
        request -
        response -
        options -
        Returns:
      • 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
        See Also:
        HttpServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
      • tagUpdate

        protected void tagUpdate​(java.lang.String resourceUri)
        tags a resource (which is set by pathInfo) with current millis, which is considered as a lastModified tag on that resource
        Parameters:
        resourceUri -