Class RemoteCIDRValve

All Implemented Interfaces:
MBeanRegistration, Contained, JmxEnabled, Lifecycle, Valve

public final class RemoteCIDRValve extends RequestFilterValve
  • Constructor Details

    • RemoteCIDRValve

      public RemoteCIDRValve()
  • Method Details

    • getAllow

      public String getAllow()
      Return a string representation of the NetMask list in #allow.
      Overrides:
      getAllow in class RequestFilterValve
      Returns:
      the #allow list as a string, without the leading '[' and trailing ']'
    • setAllow

      public void setAllow(String input)
      Fill the #allow list with the list of netmasks provided as an argument, if any. Calls #fillFromInput.
      Overrides:
      setAllow in class RequestFilterValve
      Parameters:
      input - The list of netmasks, as a comma separated string
      Throws:
      IllegalArgumentException - One or more netmasks are invalid
    • getDeny

      public String getDeny()
      Return a string representation of the NetMask list in #deny.
      Overrides:
      getDeny in class RequestFilterValve
      Returns:
      the #deny list as a string, without the leading '[' and trailing ']'
    • setDeny

      public void setDeny(String input)
      Fill the #deny list with the list of netmasks provided as an argument, if any. Calls #fillFromInput.
      Overrides:
      setDeny in class RequestFilterValve
      Parameters:
      input - The list of netmasks, as a comma separated string
      Throws:
      IllegalArgumentException - One or more netmasks are invalid
    • invoke

      public void invoke(Request request, Response response) throws IOException, ServletException
      Description copied from class: RequestFilterValve
      Extract the desired request property, and pass it (along with the specified request and response objects) to the protected process() method to perform the actual filtering. This method must be implemented by a concrete subclass.
      Specified by:
      invoke in interface Valve
      Specified by:
      invoke in class RequestFilterValve
      Parameters:
      request - The servlet request to be processed
      response - The servlet response to be created
      Throws:
      IOException - if an input/output error occurs
      ServletException - if a servlet error occurs
    • isAllowed

      public boolean isAllowed(String property)
      Description copied from class: RequestFilterValve
      Perform the test implemented by this Valve, matching against the specified request property value. This method is public so that it can be called through JMX, e.g. to test whether certain IP address is allowed or denied by the valve configuration.
      Overrides:
      isAllowed in class RequestFilterValve
      Parameters:
      property - The request property value on which to filter
      Returns:
      true if the request is allowed
    • getLog

      protected Log getLog()
      Specified by:
      getLog in class RequestFilterValve