Class IPRangePredicate

java.lang.Object
org.opensaml.profile.logic.IPRangePredicate
All Implemented Interfaces:
Predicate<BaseContext>, Predicate<BaseContext>

public class IPRangePredicate
extends Object
implements Predicate<BaseContext>
A Predicate that checks if a request is from a set of one or more IPRanges.
  • Field Details

    • httpRequest

      @Nullable private javax.servlet.http.HttpServletRequest httpRequest
      Servlet request to evaluate.
    • addressRanges

      @Nonnull @NonnullElements private Collection<IPRange> addressRanges
      IP ranges to match against.
  • Constructor Details

    • IPRangePredicate

      IPRangePredicate()
      Constructor.
  • Method Details

    • setRanges

      public void setRanges​(@Nonnull @NonnullElements Collection<IPRange> ranges)
      Set the address ranges to check against.
      Parameters:
      ranges - address ranges to check against
      Since:
      3.3.0
    • setHttpServletRequest

      public void setHttpServletRequest​(@Nonnull javax.servlet.http.HttpServletRequest request)
      Set the servlet request to evaluate.
      Parameters:
      request - servlet request to evaluate
    • test

      public boolean test​(@Nullable BaseContext input)
      Specified by:
      test in interface Predicate<BaseContext>