Skip to content

Commit

Permalink
Add the connection pooling related configurations if only the connect…
Browse files Browse the repository at this point in the history
…ion pooling enabled
  • Loading branch information
sameeragunarathne committed Jun 13, 2019
1 parent 12ba893 commit a9be126
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/main/java/org/wso2/carbon/connector/ldap/LDAPUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,16 @@ protected static DirContext getDirectoryContext(MessageContext messageContext)
LDAPConstants.ORG_WSO2_CARBON_CONNECTOR_SECURITY_MYSSLSOCKETFACTORY);
}
env.put(LDAPConstants.COM_SUN_JNDI_LDAP_CONNECT_POOL, String.valueOf(connectionPoolingEnabled));
if (StringUtils.isNotEmpty(connectionPoolingProtocol)) {
env.put(LDAPConstants.COM_SUN_JNDI_LDAP_CONNECT_POOL_PROTOCOL, connectionPoolingProtocol);
}
if (StringUtils.isNotEmpty(connectionPoolingInitSize)) {
env.put(LDAPConstants.COM_SUN_JNDI_LDAP_CONNECT_POOL_INITSIZE, connectionPoolingInitSize);
}
if (StringUtils.isNotEmpty(connectionPoolingMaxSize)) {
env.put(LDAPConstants.COM_SUN_JNDI_LDAP_CONNECT_POOL_MAXSIZE, connectionPoolingMaxSize);
if (connectionPoolingEnabled) {
if (StringUtils.isNotEmpty(connectionPoolingProtocol)) {
env.put(LDAPConstants.COM_SUN_JNDI_LDAP_CONNECT_POOL_PROTOCOL, connectionPoolingProtocol);
}
if (StringUtils.isNotEmpty(connectionPoolingInitSize)) {
env.put(LDAPConstants.COM_SUN_JNDI_LDAP_CONNECT_POOL_INITSIZE, connectionPoolingInitSize);
}
if (StringUtils.isNotEmpty(connectionPoolingMaxSize)) {
env.put(LDAPConstants.COM_SUN_JNDI_LDAP_CONNECT_POOL_MAXSIZE, connectionPoolingMaxSize);
}
}

DirContext ctx = null;
Expand Down

0 comments on commit a9be126

Please sign in to comment.