Class AbstractRuleKey

java.lang.Object
com.predic8.membrane.core.rules.AbstractRuleKey
All Implemented Interfaces:
RuleKey
Direct Known Subclasses:
ProxyRuleKey, ServiceProxyKey

public abstract class AbstractRuleKey extends Object implements RuleKey
  • Field Details

    • port

      protected int port
      -1 is used as a wildcard. It is used by HttpServletHandler, since its port is determined by the webserver and not by the proxies.xml
    • pathPattern

      protected volatile Pattern pathPattern
    • pathRegExp

      protected boolean pathRegExp
    • usePathPattern

      protected boolean usePathPattern
    • ip

      protected String ip
  • Constructor Details

    • AbstractRuleKey

      public AbstractRuleKey(int port, String ip)
    • AbstractRuleKey

      public AbstractRuleKey(RuleKey key)
  • Method Details

    • getHost

      public String getHost()
      Specified by:
      getHost in interface RuleKey
      Returns:
      the value of the HTTP Host header field
    • getMethod

      public String getMethod()
      Description copied from interface: RuleKey
      Returns the name of the HTTP method
      Specified by:
      getMethod in interface RuleKey
      Returns:
      a String specifying the name of the HTTP method
    • getPort

      public int getPort()
      Description copied from interface: RuleKey
      Returns the TCP port that receives the messages
      Specified by:
      getPort in interface RuleKey
      Returns:
      an integer value which corresponds to TCP port
    • isHostWildcard

      public boolean isHostWildcard()
    • isMethodWildcard

      public boolean isMethodWildcard()
      Description copied from interface: RuleKey
      When isMethodWildcard is set to true any value of the HTTP Host header will match
      Specified by:
      isMethodWildcard in interface RuleKey
      Returns:
      true if HTTP method wildcard is set to true false otherwise
    • setPort

      public void setPort(int port)
    • isPathRegExp

      public boolean isPathRegExp()
      Description copied from interface: RuleKey
      If isPathRegExp is true, than the path will be treated as a regexp pattern. The path of the incoming request will be match against this regexp.

      return true if a path is an regexp expression false otherwise

      Specified by:
      isPathRegExp in interface RuleKey
    • getPathRegExp

      public boolean getPathRegExp()
    • setPathRegExp

      public void setPathRegExp(boolean pathRegExp)
      Specified by:
      setPathRegExp in interface RuleKey
    • isUsePathPattern

      public boolean isUsePathPattern()
      Specified by:
      isUsePathPattern in interface RuleKey
    • setUsePathPattern

      public void setUsePathPattern(boolean usePathPattern)
      Specified by:
      setUsePathPattern in interface RuleKey
    • setPath

      public void setPath(String path)
      Specified by:
      setPath in interface RuleKey
    • getPath

      public String getPath()
      Description copied from interface: RuleKey
      Returns the request URI. For the request GET index.html it is index.html
      Specified by:
      getPath in interface RuleKey
      Returns:
      a String specifying the request URI
    • matchesPath

      public boolean matchesPath(String path)
      Specified by:
      matchesPath in interface RuleKey
    • getIp

      public String getIp()
      Description copied from interface: RuleKey
      IP address to bind to, or null to bind to 0.0.0.0 (=any local address).
      Specified by:
      getIp in interface RuleKey
    • setIp

      public void setIp(String ip)
      Specified by:
      setIp in interface RuleKey
    • matchesHostHeader

      public boolean matchesHostHeader(String hostHeader)
      Specified by:
      matchesHostHeader in interface RuleKey
    • matchesVersion

      public boolean matchesVersion(String version)
      Specified by:
      matchesVersion in interface RuleKey
    • complexMatch

      public boolean complexMatch(Exchange exc)
      Specified by:
      complexMatch in interface RuleKey