public class LDAPBasePropertySupport
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
AMBIGUOUS_RESULTS |
static int |
AUTHENTICATION_ERROR |
static int |
CONNECT_ERROR |
static int |
INVALID_PARAMETER |
static int |
NO_SUCH_OBJECT |
static int |
OK |
static int |
PROPERTY_NOT_FOUND |
Constructor and Description |
---|
LDAPBasePropertySupport()
Constructor with no parameters
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a client to be notified when an authentication result is in
|
protected void |
connect(LDAPConnection conn,
java.lang.String host,
int port)
Sets up basic connection privileges for Communicator if necessary,
and connects
|
java.lang.String |
convertToString(java.lang.String[] aResult)
Utility method to convert an array of Strings to a single String
with line feeds between elements.
|
void |
firePropertyChange(java.lang.String propName,
java.lang.Object oldValue,
java.lang.Object newValue)
Support for bound property notification
|
java.lang.String |
getAuthDN()
Returns the DN to authenticate as; null or empty for anonymous.
|
java.lang.String |
getAuthPassword()
Returns the password for the DN to authenticate as
|
java.lang.String |
getBase()
Returns the directory base to search at.
|
boolean |
getDebug()
Returns true if debug output is on
|
int |
getErrorCode()
Returns the latest error code
|
java.lang.String |
getFilter()
Returns the search filter
|
java.lang.String |
getHost()
Returns the host to search at.
|
int |
getPort()
Returns the port to search at.
|
int |
getScope()
Get the current search scope
|
java.lang.String |
getUserID()
Return the user ID.
|
java.lang.String |
getUserName()
Returns the user name
|
protected void |
printDebug(java.lang.String s) |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a client which had requested notification on authentication
|
void |
setAuthDN(java.lang.String authDN)
Sets the DN to authenticate as; null or empty for anonymous.
|
void |
setAuthPassword(java.lang.String authPassword)
Sets the password for the DN to authenticate as
|
void |
setBase(java.lang.String theBase)
Sets the starting base
|
void |
setDebug(boolean on)
Turns debug output on or off
|
protected void |
setDefaultReferralCredentials(LDAPConnection conn) |
void |
setErrorCode(int code)
Sets an error code for retrieval by a client
|
void |
setFilter(java.lang.String filter)
Sets the search filter
|
void |
setHost(java.lang.String theHost)
Sets host string.
|
void |
setPort(int thePort)
Sets port number.
|
void |
setScope(int scope)
Set the search scope using an integer
|
void |
setUserID(java.lang.String name)
Set the user ID.
|
void |
setUserName(java.lang.String name)
Set the user name.
|
public static final int OK
public static final int INVALID_PARAMETER
public static final int CONNECT_ERROR
public static final int AUTHENTICATION_ERROR
public static final int PROPERTY_NOT_FOUND
public static final int AMBIGUOUS_RESULTS
public static final int NO_SUCH_OBJECT
public LDAPBasePropertySupport()
public java.lang.String getHost()
public void setHost(java.lang.String theHost)
theHost
- host namepublic int getPort()
public void setPort(int thePort)
thePort
- portpublic java.lang.String getBase()
public void setBase(java.lang.String theBase)
theBase
- starting basepublic java.lang.String getAuthDN()
public void setAuthDN(java.lang.String authDN)
authDN
- the DN to authenticate aspublic java.lang.String getAuthPassword()
public void setAuthPassword(java.lang.String authPassword)
authPassword
- the password to use in authenticationpublic java.lang.String getUserName()
public void setUserName(java.lang.String name)
name
- The user namepublic java.lang.String getUserID()
public void setUserID(java.lang.String name)
name
- the value of the user idpublic int getScope()
public void setScope(int scope)
scope
- one of LDAPConnection.SCOPE_BASE,
LDAPConnection.SCOPE_SUB, LDAPConnection.SCOPE_ONEpublic java.lang.String getFilter()
public void setFilter(java.lang.String filter)
filter
- search filterpublic boolean getDebug()
public void setDebug(boolean on)
on
- true for debug outputpublic int getErrorCode()
public void setErrorCode(int code)
code
- An error codepublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- a client to be notified of changespublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- a client to not be notified of changespublic void firePropertyChange(java.lang.String propName, java.lang.Object oldValue, java.lang.Object newValue)
propName
- Name of changed propertyoldValue
- Previous value of propertynewValue
- New value of propertyprotected void printDebug(java.lang.String s)
protected void connect(LDAPConnection conn, java.lang.String host, int port) throws LDAPException
host
- Host to connect to.port
- Port number.LDAPException
- from connect()protected void setDefaultReferralCredentials(LDAPConnection conn)
public java.lang.String convertToString(java.lang.String[] aResult)
aResult
- The array of Strings to convert