@ SuppressWarnings ( "UseOfObsoleteCollectionType" ) public Hashtable < String , String > getConnectionProperties ( ) { StringBuilder url = new StringBuilder ( "ldap://" ) ; url . append ( host ) . append ( ":" ) . append ( String . valueOf ( port ) ) . append ( "/" ) ; Hashtable < String , String > props = new Hashtable < String , String > ( 11 ) ; props . put ( LdapContext . INITIAL_CONTEXT_FACTORY , "com.sun.jndi.ldap.LdapCtxFactory" ) ; props . put ( LdapContext . PROVIDER_URL , url . toString ( ) ) ; props . put ( LdapContext . SECURITY_AUTHENTICATION , "simple" ) ; props . put ( LdapContext . SECURITY_PRINCIPAL , additionalBindDN ) ; props . put ( LdapContext . SECURITY_CREDENTIALS , additionalBindPassword ) ; return props ; }
Returns jndi properties for the in memory directory server .