Class LdapClient
java.lang.Object
org.apache.jmeter.protocol.ldap.sampler.LdapClient
Ldap Client class is main class to create, modify, search and delete all the
LDAP functionality available.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConnect to server.voidcreateTest(BasicAttributes basicattributes, String string) Create the attribute in the ldap directory for the given string.voiddeleteTest(String string) Delete the attribute from the ldap directory.voidDisconnect from the server.voidmodifyTest(ModificationItem[] mods, String string) Modify the attribute in the ldap directory for the given string.booleansearchTest(String searchBase, String searchFilter) Filter the data in the ldap directory for the given search base.
-
Constructor Details
-
LdapClient
public LdapClient()Constructor for the LdapClient object.
-
-
Method Details
-
connect
public void connect(String host, String port, String rootdn, String username, String password) throws NamingException Connect to server.- Parameters:
host- name of the ldap serverport- port of the ldap serverrootdn- base dn to start ldap operations fromusername- user name to use for bindingpassword- password to use for binding- Throws:
NamingException- ifInitialDirContextcan not be build using the above parameters
-
disconnect
public void disconnect()Disconnect from the server. -
searchTest
Filter the data in the ldap directory for the given search base.- Parameters:
searchBase- where the search should startsearchFilter- filter this value from the base- Returns:
truewhen the search yields results,falseotherwise- Throws:
NamingException- when searching fails
-
modifyTest
Modify the attribute in the ldap directory for the given string.- Parameters:
mods- list of allModificationItems to applystring- dn of the object to modify- Throws:
NamingException- when modification fails
-
createTest
Create the attribute in the ldap directory for the given string.- Parameters:
basicattributes- add all the entry in to the basicattributestring- the string (dn) value- Throws:
NamingException- when creating subcontext fails
-
deleteTest
Delete the attribute from the ldap directory.- Parameters:
string- the string (dn) value- Throws:
NamingException- when destroying sub context fails
-