Cisco Prime Infrastructure API
Prime Infrastructure API Documentation

# Getting Started with Prime Infrastructure NBI Notifications

This section provides an overview of how to get started to consume Prime Infrastructure NBI notifications and also describes the notification message payload XML structure. In order to consume NBI notifications from Prime Infrastructure, the following points provide a high level summary of the necessary key steps.

- Implement a valid MessageListener class that implements "javax.jms.MessageListener" and has the necessary business logic to handle notification messages. This entails the creation of a valid onMessage() implementation which is capable of handling messages of type "javax.jms.ObjectMessage" that contain our NBI notification XML message payload, provided as an object of type "java.lang.String".
- To connect to our remote Prime Infrastructure JMS broker, you need to create a JMS Connection, by providing the appropriate broker URL.
- Using the JMS connection object, you create a JMS MessageConsumer for our Prime Infrastructure NBI Notification JMS Topic, and register your MessageListener to this consumer, so that it can handle any message that is published by Prime Infrastructure to that JMS topic.

## Configuration Details and Samples

JMS Connection and Topic Details

Prime Infrastructure NBI Notifications are published to a JMS Topic with name: "NBI_NOTIFICATIONS". You will have to use this value for the JMS topic name, when creating a consumer that subscribes to the Prime Infrastructure Notification messages.

The JMS Broker URL to be used to connect with the Prime Infrastructure JMS broker is as follows: "ssl://<ncs-server-host-ip-address>:<ncs-jms-broker-port>?wireFormat.maxInactivityDuration=0", where <ncs-server-host-ip-address> is the IP address of the Prime Infrastructure server, and <ncs-jms-broker-port> is the port to which JMS is configured in Prime Infrastructure. By default, the Prime Infrastructure installation will have the port specified as 61617. You may have to check with the exact configuration of the corresponding Prime Infrastructure server from which you are subscribing for NBI notifications.

The client will need an SSL keystore and truststore. The broker's certificate needs to be exported from the broker's keystore and imported to the client's truststore as described here: Using SSL with ActiveMQ

NBI Notification XML Payload Schema and Samples

## Parameters

Type | Attribute Name | Description
--- | --- | ---
NBINotificationType | notificationType | An enumeration type that provides the event type of all messages grouped in this NBI notification message. Allowed values: DEVICE_LIFECYCLE MODULE_LIFECYCLE CONFIG_OPERATION
Set<Notification> | notifications | A Set of associated notification objects.
Type | Attribute Name | Description
--- | --- | ---
String | id | A unique notification id.
String | className | The internal class name of the object that is modified.
String | instanceId | The instance Id of the object being changed.
String | businessKey | The business key of the object being changed.
String | operationType | The operation type pertaining to this notification message. Possible values: CREATE, DELETE, or UPDATE.
String | workflowId | The workflowId for the transaction that changed this object.
String | modifiedTime | The time when this change happened in the database.
String | message | A message that describes details regarding the notification.
Set<Property> | updatedProperties | A set of updated properties that were changed as part of the update operation.
Type | Attribute Name | Description
--- | --- | ---
String | name | The name of the property.
String | type | The type of the property.
String | oldValue | The old value of the property.
String | newValue | The updated new value of the property.
Set<AlarmData> | alarmDataProperties | A set of key value pairs with data pertaining to the Alarms notification.
Type | Attribute Name | Description
--- | --- | ---
String | key | The key field of the Alarms data.
String | value | The value field of the Alarms data.

The XML schema for the NBI notification XML payload is provided below for reference:

    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <xs:element name="alarmData" type="AlarmData"/>
        <xs:element name="nbiNotification" type="NBINotification"/>
        <xs:element name="notification" type="Notification"/>
        <xs:element name="property" type="Property"/>
        <xs:complexType name="NBINotification">
            <xs:sequence>
                <xs:element minOccurs="0" name="notificationType" type="NBINotificationType"/>
                <xs:element minOccurs="0" name="notifications">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element maxOccurs="unbounded" minOccurs="0" ref="notification"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="Notification">
            <xs:sequence>
                <xs:element minOccurs="0" name="id" type="xs:string"/>
                <xs:element minOccurs="0" name="className" type="xs:string"/>
                <xs:element minOccurs="0" name="instanceId" type="xs:string"/>
                <xs:element minOccurs="0" name="businessKey" type="xs:string"/>
                <xs:element minOccurs="0" name="operationType" type="xs:string"/>
                <xs:element minOccurs="0" name="workflowId" type="xs:string"/>
                <xs:element minOccurs="0" name="modifiedTime" type="xs:string"/>
                <xs:element minOccurs="0" name="message" type="xs:string"/>
                <xs:element minOccurs="0" name="updatedProperties">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element maxOccurs="unbounded" minOccurs="0" ref="property"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element minOccurs="0" name="alarmDataProperties">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element maxOccurs="unbounded" minOccurs="0" ref="alarmData"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="Property">
            <xs:sequence>
                <xs:element minOccurs="0" name="name" type="xs:string"/>
                <xs:element minOccurs="0" name="type" type="xs:string"/>
                <xs:element minOccurs="0" name="oldValue" type="xs:string"/>
                <xs:element minOccurs="0" name="newValue" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="AlarmData">
            <xs:sequence>
                <xs:element minOccurs="0" name="key" type="xs:string"/>
                <xs:element minOccurs="0" name="value" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
        <xs:simpleType name="NBINotificationType">
            <xs:restriction base="xs:string">
                <xs:enumeration value="DEVICE_LIFECYCLE"/>
                <xs:enumeration value="MODULE_LIFECYCLE"/>
                <xs:enumeration value="CONFIG_OPERATION"/>
                <xs:enumeration value="CREDENTIALS"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:schema>

Three sample XML NBI Notification message payloads are provided here for reference:

    <nbiNotification>
        <notificationType>DEVICE_LIFECYCLE</notificationType>
        <notifications>
            <notification>
                <id>6632</id>
                <className>com.cisco.xmp.model.foundation.resourceManager.ManagementAccessInformation</className>
                <instanceId>128132</instanceId>
                <operationType>DELETE</operationType>
                <workflowId>835</workflowId>
                <modifiedTime>2012-04-02 14:29:12.11</modifiedTime>
                <message>DEVICE_LIFECYCLE Notification: DELETE of DEVICE: 128132</message>
            </notification>
            <notification>
                <id>6633</id>
                <className>com.cisco.xmp.model.foundation.resourceManager.ManagementAccessInformation</className>
                <instanceId>137138</instanceId>
                <operationType>CREATE</operationType>
                <workflowId>843</workflowId>
                <modifiedTime>2012-04-02 14:29:15.089</modifiedTime>
                <message>DEVICE_LIFECYCLE Notification: CREATE of DEVICE: 137138</message>
            </notification>
            <notification>
                <id>6640</id>
                <className>com.cisco.xmp.model.foundation.resourceManager.ManagementAccessInformation</className>
                <instanceId>137139</instanceId>
                <operationType>CREATE</operationType>
                <workflowId>860</workflowId>
                <modifiedTime>2012-04-02 14:29:21.33</modifiedTime>
                <message>DEVICE_LIFECYCLE Notification: CREATE of DEVICE: 137139</message>
            </notification>
        </notifications>
    </nbiNotification>

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <nbiNotification>
        <notificationType>CONFIG_OPERATION</notificationType>
        <notifications>
            <notification>
                <id>21462</id>
                <className>com.cisco.xmp.model.foundation.resourceManager.ManagementAccessInformation</className>
                <instanceId>210210</instanceId>
                <operationType>UPDATE</operationType>
                <workflowId>852</workflowId>
                <modifiedTime>2012-04-11 11:22:35.05</modifiedTime>
                <message>CONFIG_OPERATION Notification: UPDATE of com.cisco.xmp.model.foundation.resourceManager.ManagementAccessInformation: 210210</message>
                <updatedProperties>
                    <property>
                        <name>entityId</name>
                        <type>string</type>
                        <oldValue></oldValue>
                        <newValue>210210</newValue>
                    </property>
                </updatedProperties>
            </notification>
    	</notifications>
    </nbiNotification>

- ← Home
- Getting Started with Prime Infrastructure NBI Notifications
- NBI Notifications →