Skip Headers
Oracle® Communications Network Integrity Developer's Guide
Release 7.1

E23701-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

27 Working with Scan Run Complete Notification

This chapter describes an Oracle Communications Network Integrity Event Notification, Scan Complete Notification, which allows external components to receive asynchronous event notification messages about the completion of scans.

You can develop a client to monitor event notifications, to and trigger follow-on actions.

About Clients for Monitoring Scan Run Complete Notification Messages

You can develop a message-driven bean (MDB) or Java messaging system (JMS) client that listens to the Network Integrity Event Notification JMS topic (oracle/communications/integrity/EventNotificationTopic) for scan-complete notification messages. For example, you can write post-processing logic that listens for messages that trigger other scans or send emails or SMS messages using the MDB/JMS client.

Develop the MDB/JMS client to listen to the Network Integrity application server for the JMS topic. The client must belong to the NetworkIntegrityRole group to access the JMS topic. See Network Integrity System Administrator's Guide for more information on the NetworkIntegrityRole group.

Table 27-1 lists the properties used by EventNotificationTopic for client filtering.

Table 27-1 EventNotificationTopic Properties for Client Filtering

Property Description

Status

Indicates the final scan run state:

  • COMPLETED

  • STOPPED

  • FAILED

Scan Action Name

Indicates the name of the scan action.

Scan Action Type

Indicates the type of the scan action:

  • NETWORK_DISCOVERY

  • INVENTORY_IMPORT

  • ASSIMILATION

Discrepancy Detection

A Boolean that indicates whether discrepancy detection was enabled on the scan action:

  • 1: discrepancy detection enabled.

  • 0: discrepancy detection not disabled.


Notification Messages also contain other properties which may be useful to you. For example, the ScanRunId can be obtained from the message body, which is used to retrieve additional information about the scan run.

The following example is a sample MDB/JMS client implementation model:

package model;
 
import javax.annotation.Resource;
import javax.annotation.security.RunAs;
 
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
 
import javax.jms.JMSException;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
 
import weblogic.javaee.MessageDestinationConfiguration;
 
@MessageDriven(activationConfig =
    { @ActivationConfigProperty(propertyName = "connectionFactoryJndiName",
        propertyValue = "oracle/communications/integrity/NIXATCF"),
        @ActivationConfigProperty(propertyName = "destinationName", propertyValue = "oracle/communications/integrity/EventNotificationTopic"),
            @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic")
    } , mappedName = "oracle/communications/integrity/EventNotificationTopic")
 
@MessageDestinationConfiguration(connectionFactoryJNDIName = "oracle/communications/integrity/NIXATCF")
@RunAs("NetworkIntegrityRole") 
public class MyEjbTestBean implements MessageListener {
    @Resource
    javax.ejb.MessageDrivenContext context;
    public void onMessage(javax.jms.Message message) {
        TextMessage text = (TextMessage)message;
        try {
            // write post-processing logic here
            // like trigger other scans, or send e-mails or SMS messages
                System.out.println("entered mdb.... ");
                System.out.println("received the following message: " );
                System.out.println("Status : "+text.getStringProperty("Status"));
                System.out.println("Scan_Action_Name : "+text.getStringProperty("Scan_Action_Name"));
                System.out.println("Scan_Action_Type : "+text.getStringProperty("Scan_Action_Type"));
                System.out.println("Discrepancy_Detection : "+text.getBooleanProperty("Discrepancy_Detection"));
                System.out.println("scan txt : "+text.getText());
 
        } catch (JMSException e) {
            //Add log statements here
        }
    }
}