This section contains instructions for compiling and running the two sample programs:
Set your CLASSPATH to include the following:
ens.jar file - ens.jar
(For Messaging Server, the ens.jar is located in the msg-server-base/java/jars/ directory.)
Java Message Service - full-path/jms1.0.2/jms.jar
Change to the msg-server-base/examples/enssdk/java directory.
Run the following command:
javac com/iplanet/ens/samples/JmsSample.java |
Change to the msg-server-base/examples/enssdk/java directory.
Run the following command:
java com.iplanet.ens.samples.JmsSample |
You are prompted for three items:
ENS event reference (for example, for Messaging Server: enp://127.0.0.1/store)
ENS hostname
ENS port (typically 7997)
Publish events.
For Messaging Server, the two ways to publish events are:
You can use the apub C sample program for ENS. See Sample Code
If you have enabled ENS, configure iBiff to publish Messaging Server related events.
For Calendar Server, events are published by the Calendar Server.
Set your CLASSPATH to include the following:
ens.jar file - ens.jar
(For Messaging Server, the ens.jar is located in the msg-server-base/java/jars/ directory.)
Java Message Service - full-path/jms1.0.2/jms.jar
JavaMail - full-path/javamail-1.2/mail.jar
Java Activation Framework - full-path/jaf-1.0.1/activation.jar
Change to the msg-server-base/examples/enssdk/java directory.
Run the following command:
javac com/iplanet/ens/samples/JBiff.java |
To run the JBiff sample program, you need to load the ENS (iBiff) plug-in.See Appendix B, Administering Event Notification Service in Messaging Server, in Sun Java System Messaging Server 6.3 Administration Guide for instructions.
The demo is currently hardcoded to use the ENS event reference enp://127.0.0.1/store. This is the default event reference used by the iBiff notification plug-in.
Change to the msg-svr-base/examples/enssdk/java directory.
Run the following:
java com.iplanet.ens.samples.JBiff |
The program prompts for your userid, hostname, and password.
The code assumes that the ENS server and the IMAP server are running on hostname. The userid and password are the IMAP username and password to access the IMAP account.
The two test programs are ENS subscribers. You receive events from iBiff when email messages flow through Messaging Server. Alternately you can use the apub C sample program to generate events. See Sample Code for more information.