Class PathBasedHolder

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected String fullPath
      The full registration path of this instance.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected PathBasedHolder​(String url, org.osgi.framework.ServiceReference<?> serviceReference)
      Sets up this instance with the given configuration URL provided by the given serviceReference.
    • Field Detail

      • fullPath

        protected final String fullPath
        The full registration path of this instance. This is the actual URL with which this instance has been created.
    • Constructor Detail

      • PathBasedHolder

        protected PathBasedHolder​(String url,
                                  org.osgi.framework.ServiceReference<?> serviceReference)
        Sets up this instance with the given configuration URL provided by the given serviceReference.

        The serviceReference may be null which means the configuration is created by the SlingAuthenticator itself. Instances whose service reference is null are always ordered behind instances with non-null service references (provided their path is equal.

        Parameters:
        url - The configuration URL to setup this instance with
        serviceReference - The reference to the service providing the configuration for this instance.
    • Method Detail

      • compareTo

        public int compareTo​(PathBasedHolder other)
        Compares this instance to the other PathBasedHolder instance. Comparison takes into account the path first. If they are not equal the result is returned: If the other path is lexicographically sorted behind this path a value larger than zero is returned; otherwise a value smaller than zero is returned.

        If the paths are the same, a positive number is returned if the other service reference is ordered after this service reference. If the service reference is the same, zero is returned.

        As a special case, zero is returned if other is the same object as this.

        If this service reference is null, -1 is always returned; if the other service reference is null, +1 is returned.

        Specified by:
        compareTo in interface Comparable<PathBasedHolder>
      • hashCode

        public int hashCode()
        Returns the hash code of the full path.
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object obj)
        Returns true if the other object is the same as this or if it is an instance of the same class with the same full path and the same provider (ServiceReference).
        Overrides:
        equals in class Object