Class DefaultServiceComparator

  • All Implemented Interfaces:
    Comparator<String>

    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 Detail

      • log

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

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

      • 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).
        Parameters:
        parameterNames - List of path parameter names to ignore.
    • Method Detail

      • stripPathParameters

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