Package netscape.ldap.beans
Class LDAPGetEntries
- java.lang.Object
-
- netscape.ldap.beans.LDAPBasePropertySupport
-
- netscape.ldap.beans.LDAPGetEntries
-
- All Implemented Interfaces:
java.io.Serializable
public class LDAPGetEntries extends LDAPBasePropertySupport implements java.io.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:OK INVALID_PARAMETER CONNECT_ERROR AUTHENTICATION_ERROR PROPERTY_NOT_FOUND AMBIGUOUS_RESULTS
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class netscape.ldap.beans.LDAPBasePropertySupport
AMBIGUOUS_RESULTS, AUTHENTICATION_ERROR, CONNECT_ERROR, INVALID_PARAMETER, NO_SUCH_OBJECT, OK, PROPERTY_NOT_FOUND
-
-
Constructor Summary
Constructors Constructor Description LDAPGetEntries()
Constructor with no parametersLDAPGetEntries(java.lang.String theHost, int thePort, java.lang.String theBase)
Constructor with host, port, and base initializersLDAPGetEntries(java.lang.String theHost, int thePort, java.lang.String theBase, int theScope)
Constructor with host, port, base, and scope initializers
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAttribute()
Returns the name of the attribute to retrievejava.lang.String[]
getEntries()
Searches and returns values of a previously registered property, using previously set parametersvoid
getEntries(java.awt.event.ActionEvent x)
java.lang.String[]
getEntries(java.lang.String host, int port, java.lang.String base, int scope, java.lang.String filter)
Searches and returns values for a specified attributejava.lang.String[]
getEntries(java.lang.String host, int port, java.lang.String base, int scope, java.lang.String userid, java.lang.String userName)
Searches and returns values for a specified attributejava.lang.String
getResultString()
static void
main(java.lang.String[] args)
The main body if we run it as application instead of applet.void
setAttribute(java.lang.String attr)
Sets the attribute to retrievevoid
setResultString(java.lang.String sNewValue)
-
Methods inherited from class netscape.ldap.beans.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, setUserName
-
-
-
-
Constructor Detail
-
LDAPGetEntries
public LDAPGetEntries()
Constructor with no parameters
-
LDAPGetEntries
public LDAPGetEntries(java.lang.String theHost, int thePort, java.lang.String theBase)
Constructor with host, port, and base initializers- Parameters:
theHost
- host stringthePort
- port numbertheBase
- directory base string
-
LDAPGetEntries
public LDAPGetEntries(java.lang.String theHost, int thePort, java.lang.String theBase, int theScope)
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 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
-
setResultString
public void setResultString(java.lang.String sNewValue)
-
getResultString
public java.lang.String getResultString()
-
getEntries
public java.lang.String[] getEntries(java.lang.String host, int port, java.lang.String base, int scope, java.lang.String filter)
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 java.lang.String[] getEntries(java.lang.String host, int port, java.lang.String base, int scope, java.lang.String userid, java.lang.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_ONEuserName
- The user nameuserid
- The user id- Returns:
- Array of DNs
-
getEntries
public void getEntries(java.awt.event.ActionEvent x)
-
getEntries
public java.lang.String[] getEntries()
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
-
-