Oracle® Communications Services Gatekeeper Platform Development Studio Developer's Guide Release 5.1 E37535-01 |
|
|
PDF · Mobi · ePub |
This chapter describes how to create an external event data record (EDR) listener in Oracle Communications Services Gatekeeper (Services Gatekeeper).
External EDR listeners are Java Message Service (JMS) topic subscribers.
The diagram below illustrates three different ways of listening for EDRs as a JMS listener.
Figure 15-1 Flow for external EDR, alarm, and CDR listeners
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:
Alternative 1: Using a pure JMS listener. Implement the javax.jms.MessageListener interface. It is up to the implementation class to implement any filtering mechanism needed.
Alternative 2: Using a subclass of JMSListener with no filter specified. In that case, the JMSListener class will use a tag, if available in the EDR, to filter the EDR into a specific category: EDR, alarm or CDR.
Alternative 3: Using a subclass of JMSListener with a specified filter. This filter is used to perform the filtering. If a default filter is used to perform the same filtering as Oracle Communications Services Gatekeeper, all classes used in the xml configuration files must be present in the current class loader. Otherwise, some EDRs will not be correctly filtered.
Example 15-2 Using a subclass of JMSListener with no filter specified
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 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 } } }
Example 15-3 Using a subclass of JMSListener with a specified filter
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 Oracle Communications Services 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:
Middleware_Home/ocsg_pds_5.1/lib/wlng/edrjmslistener.jar.
Method | Description |
---|---|
public void register(String url) |
Registers the JMS listener to the EDR topic using no filter. The filtering will be done using the tagging mechanism. The parameter url specifies the URL of a Network Tier server. |
public void register(String url, EdrFilter filter) |
Registers the JMS listener to the EDR topic using the specified filter. |
public void onEdr(EdrData edr, ConfigDescriptor descriptor) |
Method that the subclass can override to get notified each time an EDR is received. The descriptor will be a subclass of ConfigDescriptor that will identify the type of EDR: either EdrConfigDescriptor, AlarmConfigDescriptor or CdrConfigDescriptor. |
Method | Description |
---|---|
public static EdrFilter createDefaultFilterForEdr() |
Creates the default filter using in Oracle Communications Services Gatekeeper to filter the EDRs using the edr.xml file embedded in the edrjmslistener.jar file. |
public static EdrFilter createDefaultFilterForAlarm() |
Creates the default filter using in Oracle Communications Services Gatekeeper to filter the alarms using the alarm.xml file embedded in the edrjmslistener.jar file. |
public static EdrFilter createDefaultFilterForCdr() |
Creates the default filter using in Oracle Communications Services Gatekeeper to filter the CDRs using the cdr.xml file embedded in the edrjmslistener.jar file. |
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 Oracle Communications Services 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 Apache Ant task mibgenerator defined in com.bea.wlcp.wlng.ant.MIBGeneratorTask.
The Ant task is packaged in Middleware_Home/ocsg_pds_5.1/wlng/lib/ant-mib-generator.jar.
There is an example build file that uses the an task in Middleware_Home/ocsg_pds_5.1/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.