Class LdapEntryIdentification


  • public class LdapEntryIdentification
    extends java.lang.Object
    Wrapper class to handle the full identification of an LDAP entry. An LDAP entry is identified by its Distinguished Name, in Spring LDAP represented by the DistinguishedName class. A Distinguished Name can be absolute - i.e. complete including the very root (base) of the LDAP tree - or relative - i.e relative to the base LDAP path of the current LDAP connection (specified as base to the ContextSource).

    The different representations are needed on different occasions, e.g. the relative DN is typically what is needed to perform lookups and searches in the LDAP tree, whereas the absolute DN is needed when authenticating and when an LDAP entry is referred to in e.g. a group. This wrapper class contains both of these representations.

    • Constructor Detail

      • LdapEntryIdentification

        public LdapEntryIdentification​(javax.naming.ldap.LdapName absoluteDn,
                                       javax.naming.ldap.LdapName relativeDn)
        Construct an LdapEntryIdentification instance.
        Parameters:
        absoluteDn - the absolute DN of the identified entry, e.g. as returned by Context.getNameInNamespace().
        relativeDn - the DN of the identified entry relative to the base LDAP path, e.g. as returned by LdapDataEntry.getDn().
        Since:
        2.0
    • Method Detail

      • getAbsoluteName

        public javax.naming.ldap.LdapName getAbsoluteName()
        Get the DN of the identified entry relative to the base LDAP path, e.g. as returned by LdapDataEntry.getDn().
        Returns:
        the relative DN.
        Since:
        2.0
      • getRelativeName

        public javax.naming.ldap.LdapName getRelativeName()
        Get the absolute DN of the identified entry, e.g. as returned by Context.getNameInNamespace().
        Returns:
        the absolute DN.
        Since:
        2.0
      • getAbsoluteDn

        public DistinguishedName getAbsoluteDn()
        Deprecated.
        DistinguishedName and associated classes and methods are deprecated as of 2.0. use getAbsoluteName() instead.
        Get the absolute DN of the identified entry, e.g. as returned by Context.getNameInNamespace().
        Returns:
        the absolute DN.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object