Class ConcreteNameComponentNormalizer

    • Field Detail

      • schemaManager

        private final SchemaManager schemaManager
        the schemaManager used to dynamically resolve Normalizers
    • Constructor Detail

      • ConcreteNameComponentNormalizer

        public ConcreteNameComponentNormalizer​(SchemaManager schemaManager)
        Creates a Dn Name component Normalizer which uses the bootstrap registries to find the appropriate normalizer for the attribute of the name component with which to normalize the name component value.
        Parameters:
        schemaManager - the schemaManager used to dynamically resolve Normalizers
    • Method Detail

      • normalizeByName

        public Object normalizeByName​(String name,
                                      String value)
                               throws LdapException
        Normalizes an attribute's value given the name of the attribute - short names like 'cn' as well as 'commonName' should work here.
        Specified by:
        normalizeByName in interface NameComponentNormalizer
        Parameters:
        name - the name of the attribute
        value - the value of the attribute to normalize
        Returns:
        the normalized value
        Throws:
        LdapException - if there is a recognition problem or a syntax issue
      • normalizeByName

        public Object normalizeByName​(AttributeType attributeType,
                                      String value)
                               throws LdapException
        Normalizes an attribute's value given the name of the attribute - short names like 'cn' as well as 'commonName' should work here.
        Specified by:
        normalizeByName in interface NameComponentNormalizer
        Parameters:
        attributeType - the attributeType
        value - the value of the attribute to normalize
        Returns:
        the normalized value
        Throws:
        LdapException - if there is a recognition problem or a syntax issue
      • normalizeByName

        public Object normalizeByName​(String name,
                                      byte[] value)
                               throws LdapException
        Normalizes an attribute's value given the name of the attribute - short names like 'cn' as well as 'commonName' should work here.
        Specified by:
        normalizeByName in interface NameComponentNormalizer
        Parameters:
        name - the name of the attribute
        value - the value of the attribute to normalize
        Returns:
        the normalized value
        Throws:
        LdapException - if there is a recognition problem or a syntax issue
      • normalizeByOid

        public Object normalizeByOid​(String oid,
                                     String value)
                              throws LdapException
        Normalizes an attribute's value given the OID of the attribute.
        Specified by:
        normalizeByOid in interface NameComponentNormalizer
        Parameters:
        oid - the OID of the attribute
        value - the value of the attribute to normalize
        Returns:
        the normalized value
        Throws:
        LdapException - if there is a recognition problem or a syntax issue
      • normalizeByOid

        public Object normalizeByOid​(String oid,
                                     byte[] value)
                              throws LdapException
        Normalizes an attribute's value given the OID of the attribute.
        Specified by:
        normalizeByOid in interface NameComponentNormalizer
        Parameters:
        oid - the OID of the attribute
        value - the value of the attribute to normalize
        Returns:
        the normalized value
        Throws:
        LdapException - if there is a recognition problem or a syntax issue
      • lookup

        private Normalizer lookup​(String id)
                           throws LdapException
        Looks up the Normalizer to use for a name component using the attributeId for the name component. First the attribute is resolved, then its equality matching rule is looked up. The normalizer of that matching rule is returned.
        Parameters:
        id - the name or oid of the attribute in the name component to normalize the value of
        Returns:
        the Normalizer to use for normalizing the value of the attribute
        Throws:
        LdapException - if there are failures resolving the Normalizer
      • normalizeName

        public String normalizeName​(String attributeName)
                             throws LdapException
        Normalizes the attribute name/alias to use the OID for it instead.
        Specified by:
        normalizeName in interface NameComponentNormalizer
        Parameters:
        attributeName - the name or OID of the attributeType
        Returns:
        the OID of the attributeType if it is recognized
        Throws:
        LdapException - if the attributeName is not recognized as a valid alias