Class DefaultIncrementalAttributesMapper

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String[] getAttributesForLookup()
      Get properly formatted attributes for use in the next query.
      javax.naming.directory.Attributes getCollectedAttributes()
      Get all collected values for all managed attributes as an Attributes instance.
      java.util.List<java.lang.Object> getValues​(java.lang.String attributeName)
      Get all of the collected values for the specified attribute.
      boolean hasMore()
      Check whether another query iteration is required to get all values for all attributes.
      static javax.naming.directory.Attributes lookupAttributes​(LdapOperations ldapOperations, java.lang.String dn, java.lang.String attribute)
      Lookup all values for the specified attribute, looping through the results incrementally if necessary.
      static javax.naming.directory.Attributes lookupAttributes​(LdapOperations ldapOperations, java.lang.String dn, java.lang.String[] attributes)
      Lookup all values for the specified attributes, looping through the results incrementally if necessary.
      static javax.naming.directory.Attributes lookupAttributes​(LdapOperations ldapOperations, javax.naming.Name dn, java.lang.String attribute)
      Lookup all values for the specified attribute, looping through the results incrementally if necessary.
      static javax.naming.directory.Attributes lookupAttributes​(LdapOperations ldapOperations, javax.naming.Name dn, java.lang.String[] attributes)
      Lookup all values for the specified attributes, looping through the results incrementally if necessary.
      static java.util.List<java.lang.Object> lookupAttributeValues​(LdapOperations ldapOperations, java.lang.String dn, java.lang.String attribute)
      Lookup all values for the specified attribute, looping through the results incrementally if necessary.
      static java.util.List<java.lang.Object> lookupAttributeValues​(LdapOperations ldapOperations, javax.naming.Name dn, java.lang.String attribute)
      Lookup all values for the specified attribute, looping through the results incrementally if necessary.
      DefaultIncrementalAttributesMapper mapFromAttributes​(javax.naming.directory.Attributes attributes)
      Goes through all of the attributes to record their values and figure out whether a new query iteration is needed to get more values.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultIncrementalAttributesMapper

        public DefaultIncrementalAttributesMapper​(java.lang.String attributeName)
        Create an instance for the requested attribute.
        Parameters:
        attributeName - the name of the attribute that this instance handles. This is the attribute name that will be requested, and whose values are managed.
      • DefaultIncrementalAttributesMapper

        public DefaultIncrementalAttributesMapper​(java.lang.String[] attributeNames)
        Create an instance for the requested attributes.
        Parameters:
        attributeNames - the name of the attributes that this instance handles. These are the attribute names that will be requested, and whose values are managed.
      • DefaultIncrementalAttributesMapper

        public DefaultIncrementalAttributesMapper​(int pageSize,
                                                  java.lang.String attributeName)
        Create an instance for the requested attribute with a specific page size.
        Parameters:
        pageSize - the requested page size that will be included in range query attribute names.
        attributeName - the name of the attribute that this instance handles. This is the attribute name that will be requested, and whose values are managed.
      • DefaultIncrementalAttributesMapper

        public DefaultIncrementalAttributesMapper​(int pageSize,
                                                  java.lang.String[] attributeNames)
        Create an instance for the requested attributes with a specific page size.
        Parameters:
        pageSize - the requested page size that will be included in range query attribute names.
        attributeNames - the name of the attributes that this instance handles. These are the attribute names that will be requested, and whose values are managed.
    • Method Detail

      • getValues

        public final java.util.List<java.lang.Object> getValues​(java.lang.String attributeName)
        Description copied from interface: IncrementalAttributesMapper
        Get all of the collected values for the specified attribute.
        Specified by:
        getValues in interface IncrementalAttributesMapper<DefaultIncrementalAttributesMapper>
        Parameters:
        attributeName - the attribute to get values for.
        Returns:
        the collected values for the specified attribute. Will be null if the requested attribute has not been returned by the server (attribute did not exist).
      • lookupAttributes

        public static javax.naming.directory.Attributes lookupAttributes​(LdapOperations ldapOperations,
                                                                         java.lang.String dn,
                                                                         java.lang.String attribute)
        Lookup all values for the specified attribute, looping through the results incrementally if necessary.
        Parameters:
        ldapOperations - The instance to use for performing the actual lookup.
        dn - The distinguished name of the object to find.
        attribute - name of the attribute to request.
        Returns:
        an Attributes instance, populated with all found values for the requested attribute. Never null, though the actual attribute may not be set if it was not set on the requested object.
      • lookupAttributes

        public static javax.naming.directory.Attributes lookupAttributes​(LdapOperations ldapOperations,
                                                                         java.lang.String dn,
                                                                         java.lang.String[] attributes)
        Lookup all values for the specified attributes, looping through the results incrementally if necessary.
        Parameters:
        ldapOperations - The instance to use for performing the actual lookup.
        dn - The distinguished name of the object to find.
        attributes - names of the attributes to request.
        Returns:
        an Attributes instance, populated with all found values for the requested attributes. Never null, though the actual attributes may not be set if they was not set on the requested object.
      • lookupAttributes

        public static javax.naming.directory.Attributes lookupAttributes​(LdapOperations ldapOperations,
                                                                         javax.naming.Name dn,
                                                                         java.lang.String attribute)
        Lookup all values for the specified attribute, looping through the results incrementally if necessary.
        Parameters:
        ldapOperations - The instance to use for performing the actual lookup.
        dn - The distinguished name of the object to find.
        attribute - name of the attribute to request.
        Returns:
        an Attributes instance, populated with all found values for the requested attribute. Never null, though the actual attribute may not be set if it was not set on the requested object.
      • lookupAttributes

        public static javax.naming.directory.Attributes lookupAttributes​(LdapOperations ldapOperations,
                                                                         javax.naming.Name dn,
                                                                         java.lang.String[] attributes)
        Lookup all values for the specified attributes, looping through the results incrementally if necessary.
        Parameters:
        ldapOperations - The instance to use for performing the actual lookup.
        dn - The distinguished name of the object to find.
        attributes - names of the attributes to request.
        Returns:
        an Attributes instance, populated with all found values for the requested attributes. Never null, though the actual attributes may not be set if they was not set on the requested object.
      • lookupAttributeValues

        public static java.util.List<java.lang.Object> lookupAttributeValues​(LdapOperations ldapOperations,
                                                                             java.lang.String dn,
                                                                             java.lang.String attribute)
        Lookup all values for the specified attribute, looping through the results incrementally if necessary.
        Parameters:
        ldapOperations - The instance to use for performing the actual lookup.
        dn - The distinguished name of the object to find.
        attribute - name of the attribute to request.
        Returns:
        a list with all attribute values found for the requested attribute. Never null, an empty list indicates that the attribute was not set or empty.
      • lookupAttributeValues

        public static java.util.List<java.lang.Object> lookupAttributeValues​(LdapOperations ldapOperations,
                                                                             javax.naming.Name dn,
                                                                             java.lang.String attribute)
        Lookup all values for the specified attribute, looping through the results incrementally if necessary.
        Parameters:
        ldapOperations - The instance to use for performing the actual lookup.
        dn - The distinguished name of the object to find.
        attribute - name of the attribute to request.
        Returns:
        a list with all attribute values found for the requested attribute. Never null, an empty list indicates that the attribute was not set or empty.