Class LDAPGetEntries
java.lang.Object
netscape.ldap.beans.LDAPBasePropertySupport
netscape.ldap.beans.LDAPGetEntries
- All Implemented Interfaces:
Serializable
Invisible Bean that just takes a host, port, directory base,
search string, and optional authentication name and password,
and returns a list of all matching DNs. The search has the scope
"SUB", which means that it will find an entry anywhere at or
below the directory base, unless a different scope is specified.
Optionally, a client can register as a PropertyChangeListener and will be notified when the values are available.
A null result means no matching DNs were found. The reason is available through getErrorCode(), which returns one of the following:
Optionally, a client can register as a PropertyChangeListener and will be notified when the values are available.
A null result means no matching DNs were found. 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:
-
Field Summary
Fields inherited from class LDAPBasePropertySupport
AMBIGUOUS_RESULTS, AUTHENTICATION_ERROR, CONNECT_ERROR, INVALID_PARAMETER, NO_SUCH_OBJECT, OK, PROPERTY_NOT_FOUNDModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionConstructor with no parametersLDAPGetEntries(String theHost, int thePort, String theBase) Constructor with host, port, and base initializersLDAPGetEntries(String theHost, int thePort, String theBase, int theScope) Constructor with host, port, base, and scope initializers -
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the attribute to retrieveString[]Searches and returns values of a previously registered property, using previously set parametersvoidString[]getEntries(String host, int port, String base, int scope, String filter) Searches and returns values for a specified attributeString[]getEntries(String host, int port, String base, int scope, String userid, String userName) Searches and returns values for a specified attributestatic voidThe main body if we run it as application instead of applet.voidsetAttribute(String attr) Sets the attribute to retrievevoidsetResultString(String sNewValue) Methods inherited from class LDAPBasePropertySupport
addPropertyChangeListener, connect, convertToString, firePropertyChange, getAuthDN, getAuthPassword, getBase, getDebug, getErrorCode, getFilter, getHost, getPort, getScope, getUserID, getUserName, printDebug, removePropertyChangeListener, setAuthDN, setAuthPassword, setBase, setDebug, setDefaultReferralCredentials, setErrorCode, setFilter, setHost, setPort, setScope, setUserID, setUserNameModifier and TypeMethodDescriptionvoidAdd a client to be notified when an authentication result is inprotected voidconnect(LDAPConnection conn, String host, int port) Sets up basic connection privileges for Communicator if necessary, and connectsconvertToString(String[] aResult) Utility method to convert an array of Strings to a single String with line feeds between elements.voidfirePropertyChange(String propName, Object oldValue, Object newValue) Support for bound property notificationReturns the DN to authenticate as; null or empty for anonymous.Returns the password for the DN to authenticate asgetBase()Returns the directory base to search at.booleangetDebug()Returns true if debug output is onintReturns the latest error codeReturns the search filtergetHost()Returns the host to search at.intgetPort()Returns the port to search at.intgetScope()Get the current search scopeReturn the user ID.Returns the user nameprotected voidprintDebug(String s) voidRemove a client which had requested notification on authenticationvoidSets the DN to authenticate as; null or empty for anonymous.voidsetAuthPassword(String authPassword) Sets the password for the DN to authenticate asvoidSets the starting basevoidsetDebug(boolean on) Turns debug output on or offprotected voidvoidsetErrorCode(int code) Sets an error code for retrieval by a clientvoidSets the search filtervoidSets host string.voidsetPort(int thePort) Sets port number.voidsetScope(int scope) Set the search scope using an integervoidSet the user ID.voidsetUserName(String name) Set the user name.
-
Constructor Details
-
LDAPGetEntries
public LDAPGetEntries()Constructor with no parameters -
LDAPGetEntries
-
LDAPGetEntries
Constructor with host, port, base, and scope initializers- Parameters:
theHost- host stringthePort- port numbertheBase- directory base stringtheScope- one of LDAPConnection.SCOPE_BASE, LDAPConnection.SCOPE_SUB, LDAPConnection.SCOPE_ONE
-
-
Method Details
-
getAttribute
Returns the name of the attribute to retrieve- Returns:
- attribute name to retrieve
-
setAttribute
Sets the attribute to retrieve -
setResultString
-
getResultString
-
getEntries
Searches and returns values for a specified attribute- Parameters:
host- host stringport- port numberbase- directory base stringscope- one of LDAPConnection.SCOPE_BASE, LDAPConnection.SCOPE_SUB, LDAPConnection.SCOPE_ONEfilter- search filter- Returns:
- Array of values for the property
-
getEntries
public String[] getEntries(String host, int port, String base, int scope, String userid, String userName) Searches and returns values for a specified attribute- Parameters:
host- host stringport- port numberbase- directory base stringscope- one of LDAPConnection.SCOPE_BASE, LDAPConnection.SCOPE_SUB, LDAPConnection.SCOPE_ONEuserid- The user iduserName- The user name- Returns:
- Array of DNs
-
getEntries
-
getEntries
Searches and returns values of a previously registered property, using previously set parameters- Returns:
- Array of values for the property
-
main
The main body if we run it as application instead of applet.- Parameters:
args- list of arguments
-