Class DefaultServiceComparator

All Implemented Interfaces:
Direct Known Subclasses:

public class DefaultServiceComparator extends Object implements Comparator<String>
Default comparator implementation for comparing CAS service URLs. URL comparison is case-insensitive and supports ignoring predefined URL path parameters. The common session marker ;jessionid=value is ignored by default.
  • Field Details

    • log

      private final org.slf4j.Logger log
      Class logger.
    • ignoredPatterns

      private final Pattern[] ignoredPatterns
      Ignored patterns in path part of URL.
  • Constructor Details

    • DefaultServiceComparator

      public DefaultServiceComparator()
      Creates a new instance that ignores ;jsessionid=value.
    • DefaultServiceComparator

      public DefaultServiceComparator(@Nonnull String... parameterNames)
      Creates a new instance that ignores the given path parameter names (and any associated values).
      parameterNames - List of path parameter names to ignore.
  • Method Details

    • compare

      public int compare(String a, String b)
      Specified by:
      compare in interface Comparator<String>
    • stripPathParameters

      private String stripPathParameters(String uriString)
      Strips any of the named path parameters (and any associated values) from the given URI.
      uriString - String form of URI from which to strip named path parameters.
      URI with named path parameters and any associated values removed.