Class PathHandler2

    • Constructor Summary

      Constructors 
      Constructor Description
      PathHandler2()
      Create the handler.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSubhandler​(java.lang.String vhost, java.lang.String path, IRequestHandler subhandler)
      Adds a new subhandler.
      boolean containsSubhandlerForExactUri​(java.lang.String vhost, java.lang.String path)
      Tests if a handler for the exact URI is currently published.
      protected PathHandler2.SubHandler findSubhandler​(java.lang.String host, java.lang.String path)
      Locates an appropriate subhandler that matches the requested resource closely.
      java.util.Map<Tuple2<java.lang.String,​java.lang.String>,​Tuple2<java.lang.String,​IRequestHandler>> getSubhandlers()
      Get the subhandlers.
      void handleRequest​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object args)
      Handle the request.
      boolean isEmpty()
      Tests if the handler contains no subhandlers.
      void removeSubhandler​(java.lang.String vhost, java.lang.String path)
      Remove a subhandler.
      • Methods inherited from class java.lang.Object

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

      • subhandlersold

        protected java.util.Map<Tuple2<java.lang.String,​java.lang.String>,​Tuple2<java.lang.String,​IRequestHandler>> subhandlersold
      • subhandlers

        protected java.util.List<java.util.Map<java.lang.String,​java.util.Collection<PathHandler2.SubHandler>>> subhandlers
    • Constructor Detail

      • PathHandler2

        public PathHandler2()
        Create the handler.
    • Method Detail

      • handleRequest

        public void handleRequest​(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response,
                                  java.lang.Object args)
                           throws java.lang.Exception
        Handle the request.
        Specified by:
        handleRequest in interface IRequestHandler
        Parameters:
        request - The request.
        response - The response.
        args - Container specific args.
        Throws:
        java.lang.Exception
      • addSubhandler

        public void addSubhandler​(java.lang.String vhost,
                                  java.lang.String path,
                                  IRequestHandler subhandler)
        Adds a new subhandler.
        Specified by:
        addSubhandler in interface IPathHandler
        Parameters:
        vhost - Virtual host specification.
        path - Path being handled.
        subhandler - The subhandler.
      • containsSubhandlerForExactUri

        public boolean containsSubhandlerForExactUri​(java.lang.String vhost,
                                                     java.lang.String path)
        Tests if a handler for the exact URI is currently published.
        Specified by:
        containsSubhandlerForExactUri in interface IPathHandler
        Parameters:
        vhost - Virtual host specification.
        path - Path being handled.
        Returns:
        True, if a handler was found.
      • isEmpty

        public boolean isEmpty()
        Tests if the handler contains no subhandlers.
        Returns:
        True, if no subhandlers remain.
      • removeSubhandler

        public void removeSubhandler​(java.lang.String vhost,
                                     java.lang.String path)
        Description copied from interface: IPathHandler
        Remove a subhandler.
        Specified by:
        removeSubhandler in interface IPathHandler
        Parameters:
        vhost - Virtual host specification.
        path - Path being handled.
      • findSubhandler

        protected PathHandler2.SubHandler findSubhandler​(java.lang.String host,
                                                         java.lang.String path)
        Locates an appropriate subhandler that matches the requested resource closely.
        Parameters:
        host - The requested virtual host.
        path - The requested path
        Returns:
        The subhandler or null if none is found for the host.