Overview#

We do a lot of custom toolsTo for organizations mostly regarding LDAP.

Often we may create the same or similar tools for different clients but as we typically do several different tools for each client. We often find that we need to change the files based on the different environment.

Our Java LDAP Controller is our attempt so we only need to change the configuration file for the same code to be used at different clients or environments.

The controller reads the passed in XML configuration file and uses the parameters specified within the file.

XML File Layout#

  • configuration would be the name of the configuration XML file, if saved.
  • com - com or org or edu etc
  • short company name - as used on web or elsewhere. (willeke used in the example file below)
  • environment - The environment within the organization (prod used in the example file below)
  • service - One of the possibly multiple services that this configuration file is configured. (idv and auth are used in the example file below)

Within the file their maybe multiple services within the application. The Example file shows:

  • <idv>
  • <auth>
Although these are both LDAP, similar configurations could be done for smtp, pop, imap etc.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<configuration>
  <com>
    <willeke>
      <prod>
        <idv>
          <VERSION>2010-12-27 09:59:25</VERSION>
          <LDAP_HOST>ldap.willeke.com</LDAP_HOST>
          <LDAP_HOST>iam-prodidm02.willeke.com</LDAP_HOST>
          <LDAP_PORT>389</LDAP_PORT>
          <LDAP_PORT>389</LDAP_PORT>
          <SERVER_SET>SINGLE_SERVER_SET</SERVER_SET>
          <BASE_DN>ou=Users,o=willeke</BASE_DN>
          <BIND_DN>cn=admin,ou=Services,o=willeke</BIND_DN>
          <BINDPASSWORD>secret</BINDPASSWORD>
          <TLS>false</TLS>
          <SSL>false</SSL>
          <SAVE_PASSWORD>true</SAVE_PASSWORD>
          <SEARCH_FILTER>(objectClass=inetorgperson)</SEARCH_FILTER>
          <RESPONSE_TIMEOUT_MILLIS>3000</RESPONSE_TIMEOUT_MILLIS>
          <MAX_MESSAGE_SIZE>1400</MAX_MESSAGE_SIZE>
          <RECEIVE_BUFFER_SIZE>0</RECEIVE_BUFFER_SIZE>
          <REFERRAL_FOLLOWING>false</REFERRAL_FOLLOWING>
          <REFERRAL_HOP_LIMIT>0</REFERRAL_HOP_LIMIT>
          <CONNECT_TIMEOUT_MILLIS>3000</CONNECT_TIMEOUT_MILLIS>
          <USE_TCP_NO_DELAY>true</USE_TCP_NO_DELAY>
          <USE_SYNCHRONOUS_MODE>false</USE_SYNCHRONOUS_MODE>
          <AUTO_RECONNECT>false</AUTO_RECONNECT>
          <SEARCH_TIME_LIMIT>90000</SEARCH_TIME_LIMIT>
          <SEARCH_MAX_SIZE>100000</SEARCH_MAX_SIZE>
          <BIND_WITH_DN_REQUIRES_PASSWORD>true</BIND_WITH_DN_REQUIRES_PASSWORD>
          <USE_KEEP_ALIVE>true</USE_KEEP_ALIVE>
          <USE_LINGER>false</USE_LINGER>
        </idv>
        <auth>
          <VERSION>2010-12-27 09:59:25</VERSION>
          <LDAP_HOST>iam-prodldap01.willeke.com</LDAP_HOST>
          <LDAP_HOST>iam-prodldap02.willeke.com </LDAP_HOST>
          <LDAP_PORT>389</LDAP_PORT>
          <LDAP_PORT>389</LDAP_PORT>
          <SERVER_SET>SINGLE_SERVER_SET</SERVER_SET>
          <BASE_DN>ou=People,ou=Users,o=willeke</BASE_DN>
          <BIND_DN>cn=admin,ou=Services,o=willeke</BIND_DN>
          <BINDPASSWORD>secret</BINDPASSWORD>
          <TLS>false</TLS>
          <SSL>false</SSL>
          <SAVE_PASSWORD>true</SAVE_PASSWORD>
          <SEARCH_FILTER>(objectClass=inetorgperson)</SEARCH_FILTER>
          <RESPONSE_TIMEOUT_MILLIS>3000</RESPONSE_TIMEOUT_MILLIS>
          <MAX_MESSAGE_SIZE>1400</MAX_MESSAGE_SIZE>
          <RECEIVE_BUFFER_SIZE>0</RECEIVE_BUFFER_SIZE>
          <REFERRAL_FOLLOWING>false</REFERRAL_FOLLOWING>
          <REFERRAL_HOP_LIMIT>0</REFERRAL_HOP_LIMIT>
          <CONNECT_TIMEOUT_MILLIS>3000</CONNECT_TIMEOUT_MILLIS>
          <USE_TCP_NO_DELAY>true</USE_TCP_NO_DELAY>
          <USE_SYNCHRONOUS_MODE>false</USE_SYNCHRONOUS_MODE>
          <AUTO_RECONNECT>false</AUTO_RECONNECT>
          <SEARCH_TIME_LIMIT>3000</SEARCH_TIME_LIMIT>
          <BIND_WITH_DN_REQUIRES_PASSWORD>true</BIND_WITH_DN_REQUIRES_PASSWORD>
          <USE_KEEP_ALIVE>true</USE_KEEP_ALIVE>
          <USE_LINGER>false</USE_LINGER>
        </auth>
      </prod>
    </willeke>
  </com>
</configuration>

More Information#

There might be more information for this subject on one of the following:

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-8) was last changed on 07-Jun-2013 12:03 by jim