public abstract class PathBasedHolder extends Object implements Comparable<PathBasedHolder>
PathBasedHolder provides the basic abstraction for managing
authentication handler and authentication requirements in the
SlingAuthenticator with the following base functionality:
Comparable and
ordering according to the fullPath and the
ServiceReference of the provider serviceequals(Object) and hashCode() compatible with
the Comparable implementation.| Modifier and Type | Field and Description |
|---|---|
protected String |
fullPath
The full registration path of this instance.
|
| Modifier | Constructor and Description |
|---|---|
protected |
PathBasedHolder(String url,
org.osgi.framework.ServiceReference<?> serviceReference)
Sets up this instance with the given configuration URL provided by the
given
serviceReference. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(PathBasedHolder other)
Compares this instance to the
other PathBasedHolder
instance. |
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). |
int |
hashCode()
Returns the hash code of the full path.
|
protected final String fullPath
protected PathBasedHolder(String url, org.osgi.framework.ServiceReference<?> serviceReference)
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.
url - The configuration URL to setup this instance withserviceReference - The reference to the service providing the
configuration for this instance.public int compareTo(PathBasedHolder other)
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.
compareTo in interface Comparable<PathBasedHolder>public int hashCode()
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.