Class LDAPGetProperty

  • All Implemented Interfaces:
    java.io.Serializable

    public class LDAPGetProperty
    extends LDAPBasePropertySupport
    implements java.io.Serializable
    Invisible Bean that just takes a name and password, host and port, and directory base and attribute name, and returns an attribute's values from a Directory Server. The values are assumed to be strings, and are returned as an array. The search has the scope "SUB", which means that it will find an entry anywhere at or below the directory base.

    Optionally, a client can register as a PropertyChangeListener and will be notified when the values are available.

    A null result means the property fetch failed. The reason is available through getErrorCode(), which returns one of the following:
         OK
         INVALID_PARAMETER
         CONNECT_ERROR
         AUTHENTICATION_ERROR
         PROPERTY_NOT_FOUND
         AMBIGUOUS_RESULTS
    
    See Also:
    Serialized Form
    • Constructor Detail

      • LDAPGetProperty

        public LDAPGetProperty()
        Constructor with no parameters
      • LDAPGetProperty

        public LDAPGetProperty​(java.lang.String theHost,
                               int thePort,
                               java.lang.String theBase)
        Constructor with host, port, and base initializers
        Parameters:
        theHost - host string
        thePort - port number
        theBase - directory base string
    • Method Detail

      • getAttribute

        public java.lang.String getAttribute()
        Returns the name of the attribute to retrieve
        Returns:
        attribute name to retrieve
      • setAttribute

        public void setAttribute​(java.lang.String attr)
        Sets the attribute to retrieve
      • setDNs

        public void setDNs​(java.beans.PropertyChangeEvent evt)
      • getProperty

        public java.lang.String[] getProperty​(java.lang.String host,
                                              int port,
                                              java.lang.String base,
                                              java.lang.String filter,
                                              java.lang.String attribute)
        Searches and returns values for a specified attribute
        Parameters:
        host - host string
        port - port number
        base - directory base string
        filter - search filter
        attribute - name of property to return values for
        Returns:
        Array of values for the property
      • getProperty

        public void getProperty​(java.awt.event.ActionEvent x)
      • getProperty

        public java.lang.String[] getProperty()
        Searches and returns values of a previously registered property, using previously set parameters
        Returns:
        Array of values for the property
      • main

        public static void main​(java.lang.String[] args)
        The main body if we run it as application instead of applet.
        Parameters:
        args - list of arguments