Class LDAPIsMember
java.lang.Object
netscape.ldap.beans.LDAPBasePropertySupport
netscape.ldap.beans.LDAPIsMember
- All Implemented Interfaces:
Serializable
Invisible Bean that just takes a host and port, optional
authentication name and password, and DN of a group and another DN
which might be a member of the group, and returns true or
false, depending on whether the second DN is a member of the first.
Also handles the case of dynamic groups by derefencing the URL and searching for membership based on the url search.
It doesn't handle nested groups.
A false result means the member could not be identified as belonging to the group. The exact reason is available through getErrorCode(), which returns one of the following:
Also handles the case of dynamic groups by derefencing the URL and searching for membership based on the url search.
It doesn't handle nested groups.
A false result means the member could not be identified as belonging to the group. The exact reason is available through getErrorCode(), which returns one of the following:
OK
INVALID_PARAMETER
CONNECT_ERROR
AUTHENTICATION_ERROR
PROPERTY_NOT_FOUND
AMBIGUOUS_RESULTS
NO_SUCH_OBJECT
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionConstructor with no parametersLDAPIsMember(String host, int port, String group) Constructor with host, port, and group DN initializersLDAPIsMember(String host, int port, String dn, String password, String theGroup) Constructor with host, port, authentication DN and password and group DN initializers -
Method Summary
Modifier and TypeMethodDescriptiongetGroup()Returns the distinguished name of the groupReturns the distinguished name of the memberbooleanisMember()Checks if an entity (specified by distinguished name) is a member of a particular group (specified by distinguished name)voidChecks if an entity (specified by distinguished name) is a member of a particular group (specified by distinguished name)booleanChecks if an entity (specified by distinguished name) is a member of a particular group (specified by distinguished name)static voidThe main body if we run it as application instead of applet.voidSets the distinguished name of the groupvoidSets the distinguished name of the memberMethods 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.
-
Field Details
-
OK
public static final int OK- See Also:
-
INVALID_PARAMETER
public static final int INVALID_PARAMETER- See Also:
-
CONNECT_ERROR
public static final int CONNECT_ERROR- See Also:
-
AUTHENTICATION_ERROR
public static final int AUTHENTICATION_ERROR- See Also:
-
PROPERTY_NOT_FOUND
public static final int PROPERTY_NOT_FOUND- See Also:
-
AMBIGUOUS_RESULTS
public static final int AMBIGUOUS_RESULTS- See Also:
-
NO_SUCH_OBJECT
public static final int NO_SUCH_OBJECT- See Also:
-
-
Constructor Details
-
LDAPIsMember
public LDAPIsMember()Constructor with no parameters -
LDAPIsMember
-
LDAPIsMember
Constructor with host, port, authentication DN and password and group DN initializers- Parameters:
host- host stringport- port numberdn- fully qualified distinguished name to authenticatepassword- password for authenticating the dntheGroup- distinguished name of the group
-
-
Method Details
-
isMember
public boolean isMember()Checks if an entity (specified by distinguished name) is a member of a particular group (specified by distinguished name)- Returns:
- true if the specified member belongs to the group
-
isMember
public boolean isMember(String host, int port, String dn, String password, String group, String member) Checks if an entity (specified by distinguished name) is a member of a particular group (specified by distinguished name)- Parameters:
host- host stringport- port numberdn- fully qualified distinguished name to authenticate; can be null or ""password- password for authenticating the dn; can be null or ""group- distinguished name of the groupmember- distinguished name of member to be checked- Returns:
- true if the specified member belongs to the group
-
isMember
Checks if an entity (specified by distinguished name) is a member of a particular group (specified by distinguished name) -
getGroup
-
setGroup
Sets the distinguished name of the group- Parameters:
group- group name
-
getMember
-
setMember
Sets the distinguished name of the member- Parameters:
member- member name
-
main
The main body if we run it as application instead of applet.- Parameters:
args- list of arguments
-