The following section describes how to create an external EDR listener.
External EDR listeners are JMS topic subscribers.
The diagram below illustrates three different ways of listening for EDRs as a JMS listener.
EDRs are published externally using a JMS topic. This makes it possible to implement language-independent listeners anywhere on the network in a standard way. It is possible to implement an EDR listener in several ways:
public class ClientJMSListener implements MessageListener {
public void onMessage(Message msg) {
// Extract the EdrData object or array
if(o instanceof EdrData[]) {
for(EdrData edr : (EdrData[])o) {
//do something with each EDR
}
}
}
}
public class SampleEdrJMSListener extends JMSListener {
public SampleEdrJMSListener(String url) throws Exception {
// Register in the JMS topic. No filter is specified so
// the "tag" filtering mechanism will be used.
register(url);
}
@Override
public void onEdr(EdrData edr, ConfigDescriptor descriptor) {
// The "tag" mechanism will filter the stream of EDRs according
// to the internal WLNG filtering. To know which type of EDR is
// actually provided in this method, we have to determine the
// instance of the ConfigDescriptor as follow:
if(descriptor instanceof EdrConfigDescriptor) {
// do something with this EDR
} else if(descriptor instanceof AlarmConfigDescriptor) {
// do something with this alarm
} else if(descriptor instanceof CdrConfigDescriptor) {
// do something with this CDR
}
}
}
public class SampleEdrJMSListener extends JMSListener {
public SampleEdrJMSListener(String url) throws Exception {
// Register in the JMS topic. Use the default alarm filter.
// Note that in this case all classes needed by the alarm.xml file
// must be in the current class loader in order for the filtering
// to work correctly.
register(url, EdrFilterFactory.createDefaultFilterForAlarm());
}
@Override
public void onEdr(EdrData edr, ConfigDescriptor descriptor) {
// Only AlarmConfigDescriptor should be received here.
// Just check before casting.
if(descriptor instanceof AlarmConfigDescriptor) {
... do something with this alarm
}
}
}
Note: | When using the JMSListener class, make sure that any modification to an EDR, CDR. or alarms descriptor in network Gatekeeper is also updated in the edrjmslistener.jar file. |
The EDR listener utility contains a set of classes to use when creating an external JMS listener using the JMSListener.
The helper classes are found in the domain home directory in Network Gatekeeper, in:
$ET_Home/lib/edrjmslistener.jar
This class contains all the values that an EDR (alarm and CDR) have.
This class is the parent class of EdrConfigDescriptor, AlarmConfigDescriptor and CdrConfigDescriptor.
This class contains the data that is specified in the descriptors in the edr.xml configuration file: the identifier and the description.
This class contains the data that is specified in the descriptors in the alarm.xml configuration file: the identifier, the severity and the description.
This class identifies a CDR. This descriptor does not contain any additional data.
If you are using external EDR listeners, and the alarm, CDR, or EDR descriptors have been updated in Network Gatekeeper, the corresponding files need to be updated in edrjmslistener.jar
. Update the corresponding xml file with the updated entries in the edr directory in edrjmslistener.jar
.
Alarms can be forwarded as SNMP traps, see Managing and Configuring the SNMP service in System Administrator’s Guide.
The MIB file that corresponds to the alarms can be generated using the ant task mibgenerator
defined in com.bea.wlcp.wlng.ant.MIBGeneratorTask
.
The ant task is packaged in $PDS_HOME/wlng/lib/ant-mib-generator.jar
There is an example build file that uses the an task in $PDS_HOME/integration
When the alarms descriptor is changed, a new MIB should be generated and distributed to the SNMP clients. Copy the contents of the alarm descriptor and paste it into an xml file. Use this xml file when generating the MIB file.