Using LDAP with Java CAPS

Specifying an Application Configuration Property Dynamically

To specify application configuration properties, you can use the static approach or the dynamic approach.

Using the static approach, you specify a property value at design time in the NetBeans IDE. The property value is included in the application file. If the value needs to be changed after deployment, then you must change the value in the NetBeans IDE, rebuild the application file, and redeploy the application file.

Using the dynamic approach, you specify an LDAP URL at design time. The URL must point to an attribute in an LDAP server. When you deploy the application file, the actual value is retrieved from the LDAP server. You can change the value in the LDAP server after deployment without performing the steps of the static approach. However, you do need to disable and then reenable the application file in order for the change to take effect.

You can use this feature for properties that accept string values (including passwords), numeric values, or boolean values.


Note –

Another approach to updating property values does not require the use of LDAP. In the asadmin tool, run the extract-caps-application-configuration command. The configuration properties of the specified application file are extracted to a properties file. Update the value of one or more properties, and then run the import-caps-configuration command. Restart the application.


Enabling the Application Server to Access the LDAP Server

In this task, you edit properties that specify how the application server can access the LDAP server.

ProcedureTo Enable the Application Server to Access the LDAP Server

  1. Start the asadmin tool included with Sun Java System Application Server.

  2. Run the export-caps-ldap-configuration command. You must specify the directory where you want to store the LDAP.properties file.


    asadmin> export-caps-ldap-configuration --capsconfigdir c:\temp

    The LDAP.properties file is generated.

  3. Using a text editor, open the LDAP.properties file.

  4. Set values for the following properties, which specify how to access the LDAP server.

    • host

    • port

    • sslport

    • password

    • loginDN

    The ldapVersion property is optional. You can set this property to any numeric value.

  5. Save the LDAP.properties file.

  6. Run the import-caps-configuration command. You must specify the directory that contains the LDAP.properties file.


    asadmin> import-caps-configuration c:\temp
  7. Start the Admin Console included with Sun Java System Application Server.

  8. In the left pane, expand the CAPS node, the Environment and CM Overrides node, and the Environment Overrides node. Select the capsenv/LDAP node.

    The property fields appear in the right pane. You can now update the properties from the Admin Console. Or you can update the LDAP.properties file and run the import-caps-configuration command again.

    Screen capture of LDAP properties in the Admin Console.

Specifying an LDAP URL for a Property

Here are two examples of LDAP URLs that might be used in Java CAPS:


ldap://uid=BatchFTP_TargetFileName,ou=Batch_Adapter,dc=Adapters,dc=sun,dc=com?cn
ldap://uid=BatchFTP_Password,ou=Batch_Adapter,dc=Adapters,dc=sun,dc=com?cn

The correct path to the property value in the LDAP server depends on the directory structure.

Do not include the backslash character (\) in an LDAP URL.

RFC 2255 defines the format of LDAP URLs. You can view the RFC at http://www.ietf.org/rfc.html.

ProcedureTo Specify an LDAP URL for a Property

  1. In the NetBeans IDE, access the Properties dialog box that includes the property.

  2. Enter an LDAP URL that points to the corresponding attribute in the LDAP server.

    In the following screen capture, the Input File Name property is set to an LDAP URL.

    Screen capture of the Properties dialog box.
  3. Go to the LDAP server and enter the actual value.

  4. When you deploy the application file, ensure that the LDAP server is running. If the LDAP server is not running, then the deployment will not succeed.