package org.gluu.ldap;

import java.util.Properties;

import org.apache.log4j.Logger;
import org.gluu.persist.ldap.impl.LdapEntryManager;
import org.gluu.persist.ldap.impl.LdapEntryManagerFactory;

/**
 * @author Yuriy Movchan
 * Date: 01/13/2017
 */
public class LdapSampleEntryManager {

	private static final Logger log = Logger.getLogger(LdapSampleEntryManager.class);

	private Properties getSampleConnectionProperties() {
		Properties connectionProperties = new Properties();

		connectionProperties.put("bindDN", "cn=Directory Manager,o=gluu");
		connectionProperties.put("bindPassword", "secret");
		connectionProperties.put("servers", "localhost:389");
		connectionProperties.put("useSSL", "false");
		connectionProperties.put("maxconnections", "3");

		return connectionProperties;
	}

	public LdapEntryManager createLdapEntryManager() {
		LdapEntryManagerFactory ldapEntryManagerFactory = new LdapEntryManagerFactory();
		Properties connectionProperties = getSampleConnectionProperties();

		LdapEntryManager ldapEntryManager = ldapEntryManagerFactory.createEntryManager(connectionProperties);
		log.debug("Created LdapEntryManager: " + ldapEntryManager);

		return ldapEntryManager;
	}

}

@@ -538,15 +538,8 @@
 ager
-,o=gluu
 %22);%0A
@@ -586,13 +586,11 @@
 %22, %22
-secre
+tes
 t%22);
@@ -643,11 +643,12 @@
 ost:
-389
+1636
 %22);%0A
@@ -689,12 +689,11 @@
 %22, %22
-fals
+tru
 e%22);

Update LDAP sample