Class Mapping

java.lang.Object
services.moleculer.web.router.Mapping
All Implemented Interfaces:
HttpConstants, RequestProcessor

public class Mapping extends Object implements RequestProcessor, HttpConstants
  • Field Details

    • httpMethod

      protected final String httpMethod
    • actionName

      protected final String actionName
    • config

      protected final io.datatree.Tree config
    • route

      protected final Route route
    • beforeCall

      protected final CallProcessor beforeCall
    • afterCall

      protected final CallProcessor afterCall
    • lastProcessor

      protected RequestProcessor lastProcessor
    • isStatic

      protected final boolean isStatic
    • pathPrefix

      protected final String pathPrefix
    • pathPattern

      protected final String pathPattern
    • hashCode

      protected final int hashCode
    • pattern

      protected final Pattern pattern
    • cache

      protected final io.datatree.dom.Cache<String,Matcher> cache
    • installedMiddlewares

      protected final Set<HttpMiddleware> installedMiddlewares
  • Constructor Details

  • Method Details

    • matches

      public boolean matches(String httpMethod, String path)
    • use

      public void use(Collection<HttpMiddleware> middlewares)
    • getActionConfig

      protected io.datatree.Tree getActionConfig(RequestProcessor parent)
    • service

      public void service(WebRequest req, WebResponse rsp) throws Exception
      Handles request of the HTTP client.
      Specified by:
      service in interface RequestProcessor
      Parameters:
      req - WebRequest object that contains the request the client made of the ApiGateway
      rsp - WebResponse object that contains the response the ApiGateway returns to the client
      Throws:
      Exception - if an input or output error occurs while the ApiGateway is handling the HTTP request
    • getParent

      public RequestProcessor getParent()
      Description copied from interface: RequestProcessor
      Returns the next RequestProcessor in the invocation chain.
      Specified by:
      getParent in interface RequestProcessor
      Returns:
      parent processor
    • isStatic

      public boolean isStatic()
    • getPathPrefix

      public String getPathPrefix()
    • getHttpMethod

      public String getHttpMethod()
    • getPathPattern

      public String getPathPattern()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object