Class PathHandler2

java.lang.Object
jadex.publishservice.publish.PathHandler2
All Implemented Interfaces:
IPathHandler, IRequestHandler

public class PathHandler2 extends Object implements IPathHandler
Main handler dealing with incoming request.
  • Field Details

  • Constructor Details

    • PathHandler2

      public PathHandler2()
      Create the handler.
  • Method Details

    • handleRequest

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

      public void addSubhandler(String vhost, 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(String vhost, 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(String vhost, 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.
    • getSubhandlers

      public Map<jadex.common.Tuple2<String,String>,jadex.common.Tuple2<String,IRequestHandler>> getSubhandlers()
      Get the subhandlers.
      Specified by:
      getSubhandlers in interface IPathHandler
      Returns:
      The subhandlers
    • findSubhandler

      protected PathHandler2.SubHandler findSubhandler(String host, 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.