Notify Changes Related to LDAP Realm Configurations

To listen to changes made on the LDAP configurations on the TIBCO Enterprise Administrator server, the agent must implement the com.tibco.tea.agent.api.TeaLdapConfigurationListener interface. On implementing the interface, the agent gets a notification when there is an addition, modification, or deletion of an LDAP configuration on the TIBCO Enterprise Administrator server.

The following steps ensure that changes to the LDAP realm configurations on the TIBCO Enterprise Administrator server are notified to the agent:
  1. The TIBCO Enterprise Administrator server is running.
  2. At least one LDAP realm configuration is created on the TIBCO Enterprise Administrator server.
  3. The agent has implemented the com.tibco.tea.agent.api.TeaLdapConfigurationListener interface.
  4. The agent is registered with the TIBCO Enterprise Administrator server.
Note: In the steps mentioned earlier, if the TIBCO Enterprise Administrator server is not running, whenever the server starts, every agent in the Running mode receives the LDAP realm configurations.

When an agent is reconnected to the server or when the agent is in the Running mode, the agent receives notifications about the updates on the LDAP realm configurations.

The TeaLdapConfigurationListener Interface

The interface implementation must be registered with com.tibco.tea.agent.server.TeaAgentServer using the addEventListener() method. This is usually included as a part of the agent setup code block. The following is a snippet from TeaLdapConfigurationListener.java:
public interface TeaLdapConfigurationListener extends java.util.EventListener {
 
    public void onRealmAdded(final TeaLdapConfigurationEvent 
    ldapConfigurationEvent);
 
    public void onRealmUpdated(final TeaLdapConfigurationEvent 
    ldapConfigurationEvent);
 
    public void onRealmDeleted(final TeaLdapConfigurationEvent 
    ldapConfigurationEvent);
 
}
As a consumer of such an event, you can examine the com.tibco.tea.agent.api.TeaLdapConfigurationEvent.TYPE to retrieve the com.tibco.tea.agent.api.LdapRealmConfig instance from the event object.
Note: com.tibco.tea.agent.api.LdapRealmConfig is available only for com.tibco.tea.agent.api.TeaLdapConfigurationEvent.TYPE.ADD and com.tibco.tea.agent.api.TeaLdapConfigurationEvent.TYPE.UPDATE types and not for the com.tibco.tea.agent.api.TeaLdapConfigurationEvent.TYPE.DELETE type of event. Refer to API documents of these classes for additional details.
The sample Tomcat Agent shipped with TIBCO Enterprise Administrator server contains a sample implementation of the interface in TomcatAgentLdapConfigListener and its registration using the addEventListener() method in TomcatAgentLauncher.