Package netscape.ldap.beans
Class LDAPIsMember
- java.lang.Object
-
- netscape.ldap.beans.LDAPBasePropertySupport
-
- netscape.ldap.beans.LDAPIsMember
-
- All Implemented Interfaces:
java.io.Serializable
public class LDAPIsMember extends LDAPBasePropertySupport implements java.io.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:OK INVALID_PARAMETER CONNECT_ERROR AUTHENTICATION_ERROR PROPERTY_NOT_FOUND AMBIGUOUS_RESULTS NO_SUCH_OBJECT
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description LDAPIsMember()
Constructor with no parametersLDAPIsMember(java.lang.String host, int port, java.lang.String group)
Constructor with host, port, and group DN initializersLDAPIsMember(java.lang.String host, int port, java.lang.String dn, java.lang.String password, java.lang.String theGroup)
Constructor with host, port, authentication DN and password and group DN initializers
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getGroup()
Returns the distinguished name of the groupjava.lang.String
getMember()
Returns the distinguished name of the memberboolean
isMember()
Checks if an entity (specified by distinguished name) is a member of a particular group (specified by distinguished name)void
isMember(java.awt.event.ActionEvent e)
Checks if an entity (specified by distinguished name) is a member of a particular group (specified by distinguished name)boolean
isMember(java.lang.String host, int port, java.lang.String dn, java.lang.String password, java.lang.String group, java.lang.String member)
Checks if an entity (specified by distinguished name) is a member of a particular group (specified by distinguished name)static void
main(java.lang.String[] args)
The main body if we run it as application instead of applet.void
setGroup(java.lang.String group)
Sets the distinguished name of the groupvoid
setMember(java.lang.String member)
Sets the distinguished name of the member-
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
-
-
-
-
Field Detail
-
OK
public static final int OK
- See Also:
- Constant Field Values
-
INVALID_PARAMETER
public static final int INVALID_PARAMETER
- See Also:
- Constant Field Values
-
CONNECT_ERROR
public static final int CONNECT_ERROR
- See Also:
- Constant Field Values
-
AUTHENTICATION_ERROR
public static final int AUTHENTICATION_ERROR
- See Also:
- Constant Field Values
-
PROPERTY_NOT_FOUND
public static final int PROPERTY_NOT_FOUND
- See Also:
- Constant Field Values
-
AMBIGUOUS_RESULTS
public static final int AMBIGUOUS_RESULTS
- See Also:
- Constant Field Values
-
NO_SUCH_OBJECT
public static final int NO_SUCH_OBJECT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LDAPIsMember
public LDAPIsMember()
Constructor with no parameters
-
LDAPIsMember
public LDAPIsMember(java.lang.String host, int port, java.lang.String group)
Constructor with host, port, and group DN initializers- Parameters:
host
- host stringport
- port numbergroup
- distinguished name of the group
-
LDAPIsMember
public LDAPIsMember(java.lang.String host, int port, java.lang.String dn, java.lang.String password, java.lang.String theGroup)
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 Detail
-
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(java.lang.String host, int port, java.lang.String dn, java.lang.String password, java.lang.String group, java.lang.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
public void isMember(java.awt.event.ActionEvent e)
Checks if an entity (specified by distinguished name) is a member of a particular group (specified by distinguished name)
-
getGroup
public java.lang.String getGroup()
Returns the distinguished name of the group- Returns:
- group name
-
setGroup
public void setGroup(java.lang.String group)
Sets the distinguished name of the group- Parameters:
group
- group name
-
getMember
public java.lang.String getMember()
Returns the distinguished name of the member- Returns:
- member name
-
setMember
public void setMember(java.lang.String member)
Sets the distinguished name of the member- Parameters:
member
- member name
-
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
-
-