See wam Menu

Enabling the WAM Text Notifier Service Example

Because the WAM Text Notifier Service example requires a valid SMTP mail server specific to your environment, it is disabled by default.

To configure it for use, navigate to the examples security domain configuration files and open security-domain.xml in a text editor, and proceed as follows.

  • For Linux/UNIX, run:

    cd $CAMS_HOME/conf/domains/examples
    vi security-domain.xml
  • For Windows, run:

    CD %CAMS_HOME%\conf\domains\examples
    notepad security-domain.xml

You’ll need to edit the security-domain.xml file in two distinct XML blocks as shown in Example 1 and described below.

<session-manager-service>
...

   <!-- Example of a session-event-handler that sends an email notification
       when user "manager" logs in. You must also enable and configure the 
       TextNotifierService for this example to work. 
   -->
   <session-event-handler className="examples.service.ManagerLoginNotifier">
      <param-list>
         <param name="fromAddress" value="ManagerLoginNotifier@mycompany.com"/>
         <param name="msgSubject" value="Manager Login Notification"/>
      </param-list>
   </session-event-handler>

...

</session-manager-service>

...

<service-manager>

...

   <!-- Register a text notifier service -->
   <service id="email-text-notifier-service" enabled="true" debug="false">
      <service-type>examples.service.TextNotifierService</service-type>
      <service-class>examples.service.SmtpTextNotifierService</service-class>
      <param-list>
         <param name="smtp.host" value="mycompany.com"/>
         <param name="smtp.to" value="admin@mycompany.com"/>
     </param-list>
  </service> 

...

</service-manager>

Example 1 - Enabling the WAM Text Notifier Service example in security-domain.xml

  1. Uncomment the ManagerLoginNotifier session-event-handler found in the session-manager-service enclosing elements.

    To do this, simply move the end comment --> from its default position after the ManagerLoginNotifier session-event-handler element to preceding it as shown in Example 1.

    You may optionally change the email fromAddress and msgSubject if you like.

  2. Navigate to the service-manager element and find the email-text-notifier-service.

    You must enable the service by setting the enabled flag to true as show in Example 1.

    You MUST also configure the stmp.host and stmp.to parameters with values specific to your environment.

    The smtp.host is the IP or DNS name of the SMTP mail server and the stmp.to is the email address to which you’ll send the message.

For the service to be loaded, you must restart the WAM policy server if it is currently running.

You should use the shutdown.bat/shutdown.sh command in the bin directory of WAM to shutdown the server. Then, use runcams.bat/runcams.sh to start it.


Have a Question?

Have a how-to question? Seeing a weird error? Contact us.

Found a bug? Submit a support ticket.

Have a product idea or request? Share it with us in our Ideas Portal.