Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV NEXT | FRAMES NO FRAMES

##

#

# JAIN(tm) OAM API

### Standard Java(tm) Interface to the Operations, Administration and Maintenance (OAM)

#### Release 1.2a

The JAIN(tm) SS7 OAM API defines the attributes and operations required by a Management Application to provision and manage a JAIN OAM compliant SS7 Stack including the capability to collect statistics and handle alarms emitted by the Stack.

See:
Description

Packages
jain.protocol.ss7 | This package contains the JAIN SS7 Factory, which is the central creation point for all high level proprietary JAIN SS7 objects, for example JainTcapStack Objects.
jain.protocol.ss7.oam | This package contains the main interfaces and classes of the JAIN Operations, Administration and Maintenance API.
jain.protocol.ss7.oam.mtp2 | This package contains all of the classes and interfaces that are required to provision and maintain an SS7 stack at the MTP Level 2 layer.
jain.protocol.ss7.oam.mtp3 | This package contains all of the classes and interfaces that are required to provision and maintain an SS7 stack at the MTP Level 3 layer.
jain.protocol.ss7.oam.sccp | This package contains all of the classes and interfaces that are required to provision and maintain an SS7 stack at the SCCP layer.
jain.protocol.ss7.oam.tcap | This package contains all of the classes and interfaces that are required to provision and maintain an SS7 stack at the TCAP layer.

The JAIN(tm) SS7 OAM API defines the attributes and operations required by a Management Application to provision and manage a JAIN OAM compliant SS7 Stack including the capability to collect statistics and handle alarms emitted by the Stack.

Copyrights

Copyright - 1999 Sun Microsystems, Inc. All rights reserved.
901 San Antonio Road, Palo Alto, California 94043, U.S.A.

This product and related documentation are protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or related documentation may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any.

RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the United States Government is subject to the restrictions set forth in DFARS 252.227-7013 (c)(1)(ii) and FAR 52.227-19.

The product described in this manual may be protected by one or more U.S. patents, foreign patents, or pending applications.

TRADEMARKS

Sun, the Sun logo, Sun Microsystems, Java, Java Compatible, JavaBeans, Solaris,Write Once, Run Anywhere, JDK, Java Development Kit, and JavaStation are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and certain other countries. UNIX is a registered trademark in the United States and other countries, exclusively licensed through X/Open Company, Ltd. All other product names mentioned herein are the trademarks of their respective owners.

THIS PUBLICATION IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.

THIS PUBLICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THE PUBLICATION. SUN MICROSYSTEMS, INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS PUBLICATION AT ANY TIME.

In order to operate, administrate and manage the components of an SS7 network, a network operator needs the ability to set and inspect certain values that characterize the configuration of the network components. Each SS7 stack vendor provides their own proprietary method for setting and inspecting the characteristics of network components. As a result the management of an SS7 node is tied to a vendor's implementation, and so is not portable across all SS7 Stacks.

By defining a standard JavaTM API for managing an SS7 Stack (JAIN OAM), each SS7 stack vendor can map from the JavaTM methods defined in this API to their own proprietary management interface (usually a series of C functions). Assuming that all SS7 stack vendors implement this mapping, any SS7 management application that uses the JAIN OAM API specification will have the ability to manage any JAIN compliant SS7 stack. Figure 1 illustrates how the JAIN OAM API specification allows the development of portable management applications.

Figure 1 - Application portability provided by the JAIN OAM API specification

To effectively manage the resources provided by an SS7 network, it is necessary to monitor and measure the present, and estimate the future performance, utilization and availability of these resources. Proprietary management interfaces typically employ a combination of measurements and alarms to monitor the current status of the SS7 Network. From these results an operator can derive the expected future performance. Measurements (or statistics) are network characteristics that are occasionally or periodically polled by management applications. Alarms, on the other hand, are used to inform management applications that an unexpected change in state has occurred within a network element. While measurement requests are explicitly initiated by management applications, the sending of alarms to management applications is automatically triggered when a particular condition becomes true.

A complete list of the potential fault, real-time, performance, network administration, accounting and configuration measurements that potentially can be invoked by a manager application are listed for MTP-L3, SCCP, ISUP and TCAP protocol layers in the ITU recommendation for monitoring and measuring SS7 networks (ITU Q.752). These measurements are the raw, primitive data that potentially can be extracted from an SS7 network and utilized by a manager application. This is not an exhaustive list of measurements but rather a collection of what may be considered the measurements most desirable to collect from a monitoring, control and maintenance point of view. Recommendations are given for measurements regarding the categorization, unit of measurement, when and how often collection should be made, and whether or not it is defined as obligatory from a management point of view to present these measurements. Although this clearly defined set of statistics is contained in an international recommendation, most proprietary management interfaces only support a subset of the obligatory measurements listed.

The JAIN OAM API specification will use the Managed Bean (MBean) paradigm for managing the components of an SS7 network. A more detailed explanation of the managed object model can be found in the JavaTM Management Extensions Instrumentation and Agent Specification, v1.0 An MBean is an external representation of a functional and physical domain of a system. A set of attributes and valid operations are defined for each MBean. The attribute values define an instance of an MBean while the operations may be performed on the MBean. By representing each component in an SS7 network as a managed object it will be possible to inspect the attributes of that component and modify the component through the operations it's associated MBean supplies.

Figure 2 - Relationship between the Componenets of the JMX Architecture

The JAIN OAM API specification conforms to the java Instrumentation Level design patterns of the JavaTM Management Extensions (JMX) Instrumentation and Agent Specification, v1.0. JMX defines an architecture, design patterns, APIs and services for application and network management. There are three levels defined in the JMX architecture:

- Instrumentation Level
- Agent Level
- Manager Level.

The Instrumentation Level provides a specification for implementing JMX manageable resources. A JMX manageable resource can be an application, an implementation of a service, a device, a user and so forth. The instrumentation of a given resource is provided by one or more Managed Beans (MBeans).
The Agent Level provides a specification for implementing agents. Management agents directly control the resources and make them available to remote management applications. The JMX agent consists of a an MBean server, a set of services for handling MBeans and at least one communications adaptor or connector.
The Manager Level provides a specification for implementing JMX managers. This level defines management interfaces and components that can operate on agents or hierarchies of agents.

All JAIN OAM Managed Objects are defined as JMX MBeans. This means that for a class Xxx implementing the JAIN OAM interface XxxMBean, all methods defined in that interface can be exposed through a JMX agent.

Figure 3 - JAIN TCAP and JAIN OAM MBeans and their relationship with an SS7 stack

Figure3 depicts the relationship between JAIN OAM MBeans, JAIN TCAP objects and an SS7 stack. Each stack vendor shall be responsible for implementing the interaction between the JAIN MBeans and their SS7 stack. Whether or not two physical stacks are used for high availability shall be hidden from a JAIN application by the stack vendor's implementation.

Each Protocol layer supported has a discreet set of MBeans defined. For each MBean a set of attributes, allowable operations and possible alarms and statistics (notifications) that may be emitted by the MBean shall be defined.

For each protocol layer a particular MBean, hereafter known as a 'Protocol Layer MBean', shall be used to create instances of any MBeans belonging to that layer. Once an instance of a MBean has been created an application may directly modify or inspect the characteristics of the MBean using the operations the MBean supplies. These operations can be exposed through a JMX agent.

OAM Notifications

JAIN OAM adheres to the Notification model specified by JMX. Each JAIN OAM MBean implements the javax.management.Notificationbroadcaster interface and can emit the following Notifications:

- Alarm Notifications
- Error Notifications
- Statistic Notifications.

For the purposes of the JAIN OAM API specification Release 1.0, the scope of the MBeans supported will be limited to the MBeans belonging to the MTP-2, MTP-3, SCCP and TCAP layers.All MBeans can be categorised into one of the following four types:

> 1. Mtp2ManagedObjectMBean
> 2. Mtp3ManagedObjectMBean
> 3. SccpManagedObjectMBean
> 4. TcapManagedObjectMBean

The complete set of Notifications that can be emitted by a Mtp2ManagedObjectMBean are:

> Mtp2AlarmNotification
> Mtp2ErrorNotification
> Mtp2StatisticNotification

The complete set of Notifications that can be emitted by a Mtp3ManagedObjectMBean are:

> Mtp3AlarmNotification
> Mtp3ErrorNotification
> Mtp3StatisticNotification

The complete set of Notifications that can be emitted by a SccpManagedObjectMBean are:

> SccpAlarmNotification
> SccpErrorNotification
> SccpStatisticNotification

The complete set of Notifications that can be emitted by a TcapManagedObjectMBean are:

> TcapAlarmNotification
> TcapErrorNotification
> TcapStatisticNotification

Each JAIN OAM MBean (extending jain.protocol.ss7.oam.OamManagedObjectMBean) must implement the following two methods inherited from javax.management.NotificationBroadcaster

1. addNotificationListener registers a consumer’s interest in notifications sent by this MBean. This method takes a reference to a NotificationListener object, a reference to a NotificationFilter object, and a hand-back object. The same listener object may be registered more than once, each time with a different hand-back object. This means that the handleNotification method of this listener will be invoked several times, with different hand-back objects. The MBean has to maintain a table of listener, filter and hand-back triplets. When the MBean emits a notification, it invokes the handleNotification method of all the registered NotificationListener objects, with their respective hand-back object.

If the consumer has specified a NotificationFilter when registering as a NotificationListener object, the MBean will invoke the filter’s isNotificationEnabled method first. Only if the filter returns a positive (true) response will the source then call the notification handler.

2. removeNotificationListener allows a consumer to unregister itself from a notification source. This method takes a reference to a NotificationListener object, as well as a hand-back object.

If the hand-back object is provided, only the entry corresponding to this listener and hand-back pair will be removed. The same listener object may still be registered with other hand-back objects. Otherwise, if the hand-back is not provided, all entries corresponding to the listener will be removed.

An object implementing javax.management.NotificationListener can register as a notification listener with any of the JAIN OAM MBeans. The object indicates which notifications it is interested in, by using the Notification Filter supplied to the MBean when invoking addNotificationListener().
Rather than call the addNotificationListener() method for each MBean in a protocol layer, a notification listener can call the addNotificationListenerToAllMBeans() method on the OamLayerManager. This has the effect of adding the notification listener as a listener of all MBeans created through that Layer Manager.

Object Names

Gets the ObjectName of this OamManagedBean. An Object Name uniquely identifies an MBean within an MBean server.
Management applications use this object name to identify the MBean on which to perform management operations. An
object name is used in the same way as an object reference. Therefore all JAIN OAM methods accept an Object Name to
identify an MBean instance rather than an object reference.

The class ObjectName represents an object name which consists of two parts.

- Domain Name
- Key property list

[domainName]:property=value[,property=value]*

For all JAIN OAM MBeans, the domain name should be the package name of the implemenation class from which the
object was instantiated.
e.g. com.aepona.jain.protocol.ss7.oam.sccp

The key property list for all JAIN OAM MBeans should consist of the two properties:

- object type. This is given by the getObjectType() method on the OamManagedObjectMBean interface.
- an object id generated by the implementation layer manager which is unique for that object type within the JVM. e.g.

type="OBJECT_TYPE_SCCP_SAP",id=1234

Therefore the complete objectName for an instance of
com.aepona.jain.protocol.ss7.oam.sccp.SccpSap
implementing the JAIN OAM MBean interface
com.aepona.jain.protocol.ss7.oam.sccp.SccpSapMBean
will be

"com.aepona.jain.protocol.ss7.oam.sccp:type="OBJECT_TYPE_SCCP_SAP",id=1234"

Note that the object id's do not need to be persistent, although an implementation may choose to make them so. The only restriction imposed is that the object id is unique for that object type within the Java Virtual Machine.

JAIN OAM and JMX

A JAIN OAM implementation can operate with or without a JMX agent implementation. An implementation should be designed in such a way that it could be deployed within a JMX agent, or standalone, so that all methods execute in a consistent manner. That is, a management application should be able to manage a JAIN OAM implementation either through a JMX agent, or directly and expect the same results.

NOTE: When operating with a JMX agent, the interfaces in the API will need to be subclassed. e.g. com.aepona.jain.protocol.ss7.oam.Mtp3SapMBean will need to extend jain.protocol.ss7.oam.Mtp3SapMBean. This subclass will just be a wrapper to facilitate the one to one relationship (between interface and class) that the MBean Server requires with Standard MBeans.

In the case that a JAIN OAM implementation is running without an agent the following sequence should occur.

> 1. A management application uses the JainSs7Factory to instantiate each of the OamLayerManagerMBeans.

> 2. The management application can then create managed object MBeans using the create methods defined on each OamLayerManagerMBean.

> 3. The management application can register as a NotificationListener with any of the MBeans in order to receive AlarmNotifications, ErrorNotifications and StatisticNotifications.

> 4. The management application can invoke operations defined on the MBean interface to manipulate the MBean.

In the case that a JAIN OAM implementation is running with an agent the following sequence should occur.

> 1. A management application uses the JainSs7Factory to instantiate each of the OamLayerManagerMBeans.

> 2. The management application should initialise the JMX Agent and register the OamLayerManagerMBeans with the MBean server.

> 3. The management application can then create managed object MBeans using the create methods defined on each OamLayerManagerMBean.

> > NB: It is the responsibility of the OamLayerManagerMBean to determine that it has been registered with the MBean server, and consequently register all MBeans created through that OamLayerManagerMBean with the same MBean server.

> 4. The management application can register as a NotificationListener with any of the MBeans in order to receive AlarmNotifications, ErrorNotifications and StatisticNotifications.

> > NB: The management application should not directly invoke the addNotificationListener() methods or any other methods on an MBean, but should invoke them through the MBean server using the javax.management.MbeanServer.invoke() method.

> 5. The management application can invoke operations defined on the MBean interface to manipulate the MBean. Again these methods should be invoked using the javax.management.MbeanServer.invoke() method.

Code Example

Initial Setup:

// OBTAIN AN INSTANCE OF THE FACTORY AND SET THE VENDOR PATHNAME

JainSS7Factory ss7Factory = JainSS7Factory.getInstance();

ss7Factory.setPathName(vendorPathName);

try {

// CREATE A LAYER MANAGER FOR EACH PROTOCOL LAYER

TcapLayerManagerMBean tcapLayerManager = (TcapLayerManagerMBean)ss7Factory.createSS7Object("jain.protocol.ss7.oam.tcap.TcapLayerManager");

SccpLayerManagerMBean sccpLayerManager = (SccpLayerManagerMBean)ss7Factory.createSS7Object("jain.protocol.ss7.oam.sccp.SccpLayerManager");

Mtp3LayerManagerMBean mtp3LayerManager = (Mtp3LayerManagerMBean)ss7Factory.createSS7Object("jain.protocol.ss7.oam.mtp3.Mtp3LayerManager");

Mtp2LayerManagerMBean mtp2LayerManager = (Mtp2LayerManagerMBean)ss7Factory.createSS7Object("jain.protocol.ss7.oam.mtp2.Mtp2LayerManager");

} catch (SS7PeerUnavailableException e) {

System.err.println("Cannot locate a Layer Manager implementation.\n" + e.getMessage());

}

try{

// CREATE AN OBJECT NAME FOR EACH LAYER MANAGER

ObjectName tcapLayerManagerObjectName = new ObjectName(vendorPathName + ".jain.protocol.ss7.oam.tcap:type=" + OamManagedObjectMBean.OBJECT_TYPE_TCAP_LAYER_MANAGER + ",id=1");
ObjectName sccpLayerManagerObjectName = new ObjectName(vendorPathName + ".jain.protocol.ss7.oam.sccp: type=" + OamManagedObjectMBean.OBJECT_TYPE_SCCP_LAYER_MANAGER+ ",id=1");
ObjectName mtp3LayerManagerObjectName = new ObjectName(vendorPathName + ".jain.protocol.ss7.oam.mtp3: type=" + OamManagedObjectMBean.OBJECT_TYPE_MTP3_LAYER_MANAGER+ ",id=1");
ObjectName mtp2LayerManagerObjectName = new ObjectName(vendorPathName + ".jain.protocol.ss7.oam.mtp2: type=" + OamManagedObjectMBean.OBJECT_TYPE_MTP2_LAYER_MANAGER+ ",id=1");
} catch (MalformedObjectNameException e) {

System.err.println("Cannot create ObjectName\n" + e.getMessage());

}

if(usingJMXAgent){

// CREATE AN MBEANSERVER(JMX AGENT) AND REGISTER THE LAYER MANAGERS WITH IT

MBeanServer server = new MBeanServer();

server.registerMBean(tcapLayerManager, tcapLayerManagerObjectName);
server.registerMBean(sccpLayerManager, sccpLayerManagerObjectName);
server.registerMBean(mtp3LayerManager, mtp3LayerManagerObjectName);
server.registerMBean(mtp2LayerManager, mtp2LayerManagerObjectName);

} else {

// ADD ENTRIES FOR LAYER MANAGERS TO LOOKUP TABLES.
// THE LOOKUP TABLE SERVES AS A MAPPING BETWEEN JMX OBJECTNAMES AND OBJECT REFERENCES
// WHEN THERE IS NO JMX AGENT (THE JMX AGENT WOULD PROVIDE SUCH A MAPPING)

tcapLayerManager.getLookupTable().put(tcapLayerManagerObjectName, tcapLayerManager);
sccpLayerManager.getLookupTable().put(sccpLayerManagerObjectName, sccpLayerManager);
mtp3LayerManager.getLookupTable().put(sccpLayerManagerObjectName, sccpLayerManager);
mtp2LayerManager.getLookupTable().put(sccpLayerManagerObjectName, sccpLayerManager);

}

Initial Provisioning:

// PROVISION THE MTP2 MANAGED OBJECTS

// create arrays to hold the created Managed Objects' ObjectNames

ObjectName[] mtp2Saps = new ObjectName[NUM_MTP2_SAPS];
ObjectName[] mtp2TimerProfiles = new ObjectName[NUM_MTP2_SAPS];

// CREATE EACH Mtp2Sap AND ITS ASSOCIATED Mtp2TimerProfile

for (int i=0; i < NUM_MTP2_SAPS; i++) {

try {
if(usingJMXAgent){

// CREATE AN Mtp2Sap AND SET ITS NAME
// (CALL METHOD OF MBEAN VIA THE INVOKE METHOD OF THE MBEANSERVER - DON'T NEED OBJECT REFERENCE

String[] signature = new String[]{"java.lang.Integer"};
Object[] parameters = new Object[]{new Integer(Mtp2SapMBean.PORT_TYPE_DTE)};
mtp2Saps[i] = (ObjectName)server.invoke(mtp2LayerManagerObjectName, "createMtp2Sap", parameters, signature);

signature = new String[]{"java.lang.String"};
parameters = new Object[]{mtp2Saps[i].toString()};
server.invoke(mtp2Saps[i], "setName", parameters, signature);

// CREATE AN Mtp2TimerProfile AND SET ITS NAME

signature = new String[]{};
parameters = new Object[]{};
mtp2TimerProfiles[i] = (ObjectName)server.invoke(mtp2LayerManagerObjectName, "createMtp2TimerProfile", parameters, signature);

signature = new String[]{"java.lang.String"};
parameters = new Object[]{mtp2TimerProfiles[i].toString()};
server.invoke(mtp2TimerProfiles[i], "setName", parameters, signature);

// INITIALISE THE TIMERS

signature = new String[]{};
parameters = new Object[]{};
server.invoke(mtp2TimerProfiles[i], "initialiseTimers", parameters, signature);

// ASSOCIATE THE Mtp2TimerProfile WITH THE Mtp2Sap

signature = new String[]{javax.management.ObjectName};
parameters = new Object[]{mtp2TimerProfiles[i]};
server.invoke(mtp2Saps[i], "setMtp2TimerProfile", parameters, signature);

} else {

// CREATE AN Mtp2Sap AND SET ITS NAME
// (USE THE LAYER MANAGER'S LOOKUP TABLE TO GET THE OBJECT REFERENCE ASSOCIATED WITH THE OBJECTNAME)

mtp2Saps[i] = mtp2LayerManager.createMtp2Sap(new Integer(Mtp2SapMBean.PORT_TYPE_DTE));

((Mtp2SapMBean)mtp2LayerManager.getLookupTable().get(mtp2Saps[i])).setName(mtp2Saps[i].toString());

// CREATE AN Mtp2TimerProfile AND SET ITS NAME

mtp2TimerProfile[i] = mtp2LayerManager.createMtp2TimerProfile();

((Mtp2TimerProfile)mtp2LayerManager.getLookupTable().get(mtp2TimerProfile[i])).setName(mtp2TimerProfile[i].toString());

// INITIALISE THE TIMERS

((Mtp2TimerProfile)mtp2LayerManager.getLookupTable().get(mtp2TimerProfile[i])).initialiseTimers();

// ASSOCIATE THE Mtp2TimerProfile WITH THE Mtp2Sap

((Mtp2SapMBean)mtp2LayerManager.getLookupTable().get(mtp2Saps[i])).setMtp2TimerProfile(mtp2TimerProfiles[i]);
}

} catch (TooManyInstancesException tooManySaps) {

System.err.println("Cannot create more than maximum number of MBean instances.\n" +e.getMessage());

}

} // end for each Mtp2Sap

// NOW COMMIT THE CHANGES.
// NB:
// If you want to receive any Alarms or Errors then register as a listener
// before committing the changes.

try {
if(usingJMXAgent){

signature = new String[]{};
parameters = new Object[]{};
server.invoke(mtp2LayerManagerObjectName, "commit", parameters, signature);

} else {
mtp2LayerManager.commit();
}

} catch (CommitException e) {

System.err.println("Failed to commit the Mtp2 Managed Object changes.\n" + e.getMessage();

}

Collecting Statistics:

public class Mtp2StatsCollector implements NotificationListener, NotificationFilter {

/**
* CONSTRUCTOR: Registers this Mtp2StatsCollector as a NotificationListener of
* the specified Mtp2LayerManager
*/

public Mtp2StatsCollector(Mtp2LayerManagerObjectName layerManagerObjectName) {

// REGISTER AS A STATISTIC LISTENER WITH AN Mtp2Sap
if(usingJMXAgent){

signature = new String[]{"javax.management.NotificationListener", "javax.management.NotificationFilter", "java.lang.Object"};
parameters = new Object[]{this, this, null};
server.invoke(mtp2Sap[0], "addNotificationListener", parameters, signature);

} else {

((Mtp2SapMBean)mtp2LayerManager.getLookupTable(mtp2Sap[0])).addNotificationListener(this, this, null);

}

}

/**
* This method is called by an Mtp2Sap when it is emitting an Asynchronous
* Mtp2StatisticNotification to check if the listener is interested in the notification
*/
public boolean isNotificationEnabled(Notification notification) {

//GET THE NOTIFICATION TYPE

String type = notification.getType();

// RETURN TRUE IF TYPE IS AN MTP2 STATISTIC TYPE

if(type == "jain.protocol.ss7.oam.mtp2.statistic.msu_discard_sl_congestion") {
return true;
} else if(type == "jain.protocol.ss7.oam.mtp2.statistic.num_sif_sio_received") {
return true;
} else if(type == "jain.protocol.ss7.oam.mtp2.statistic.num_sif_sio_trans") {
return true;
} else {
return false;
}

}

/**
* This method is called by an Mtp2Sap when it is emitting an Asynchronous
* Mtp2StatisticNotification
* Note - this method is only called if the isNotificationEnabled method returned true for this Notification
*/
public void handleNotification(Mtp2StatisticEvent asynchronousStat) {

System.out.println("Received an Mtp2 Statistic:\n"
+ asynchronousStat.toString());

if(asynchronousStat.getNotificationType() == "jain.protocol.ss7.oam.mtp2.statistic.num_sif_sio_received") {

System.out.println("The number of SIF and SIO octets received is "
+ ((OamStatisticNotification)asynchronousStat).getStatisticValue());
}
}

/**
* This method collects a single synchronous (one off) statistic
*/

public void collectStat() {

// COLLECT A SYNCHRONOUS STATISTIC

Mtp2StatisticNotification synchronousStat = null;

try {
if(usingJMXAgent) {
// collect the number of MSUs discarded due to Signalling Link congestion for the first Mtp2Sap

signature = new String[]{"java.lang.Integer"};
parameters = new Object[]{new Integer(Mtp2StatisticNotification.MTP2_MSU_DISCARD_SL_CONGESTION)};
synchronousStat = (Mtp2StatisticNotification)server.invoke(Mtp2Saps[0], "getStatistic", parameters, signature);

} else {
// collect the number of MSUs discarded due to Signalling Link congestion for the first Mtp2Sap

synchronousStat = ((Mtp2SapMBean)oamLookupTableImplClass.get(Mtp2Saps[0])).getStatistic(new Integer(Mtp2StatisticNotification.MTP2_MSU_DISCARD_SL_CONGESTION));
}

// display the value of the returned statistic

System.out.println( "The number of MSUs discarded due to Signalling Link congestion for ["
+ Mtp2Saps[0].getName() + "] is ["
+ synchronousStat.getStatisticValue() +"]");

} catch (StatisticNotSupportedException e) {

System.err.println("The implementation does not support the collection of statistics of type [MTP2_MSU_DISCARD_SL_CONGESTION]";
}
}

/**
* This method starts polling a particular statistic at the specified polling interval.
* The polled statistic will be processed by the processMtp2StatisticEvent() method
*
* @param pollingInterval - the polling interval in milliseconds
*/

public void pollStatistic(int pollingInterval) {

try {
// Start polling the Number of SIF and SIO octets received by the first Mtp2Sap
// with the supplied polling interval.

if(usingJMXAgent) {

signature = new String[]{"java.lang.Integer", "java.lang.Integer"};
parameters = new Object[]{new Integer(Mtp2StatisticNotification.MTP2_NUM_SIF_SIO_RECIEVED), new Integer(pollingInterval)};
server.invoke(Mtp2Saps[0], "startPollingStatistic", parameters, signature);

} else {

((Mtp2SapMBean)oamLookupTableImplClass.get(Mtp2Saps[0])).startPollingStatistic(new Integer(Mtp2StatisticNotification.MTP2_NUM_SIF_SIO_RECIEVED), new Integer(pollingInterval));

}

} catch (StatisticNotSupportedException e) {
System.err.println("The implementation does not support the collection of statistics of type [MTP2_NUM_SIF_SIO_RECIEVED]";

}
}

}

Handling Alarms & Errors

public class Mtp2AlarmAndErrorHandler implements NotificationListener {

/**
* This constructor registers this Mtp2AlarmAndErrorHandler as an
* Mtp2 alarm listener and an Mtp2 error listener of the MTP2 Managed Objects
* @param mtp2LayerManagerObjectName - the Mtp2LayerManager whose Managed Objects we want to
* register with.
*/
public Mtp2AlarmAndErrorHandler(ObjectName mtp2LayerManagerObjectName) {

// register as an listener of the first Mtp2Sap

if(usingJMXAgent) {
try {
signature = new String[]{"javax.management.NotificationListener", "javax.management.NotificationFilter", "java.lang.Object"};
parameters = new Object[]{this, this, null};
server.invoke(mtp2Saps[0], "addNotificationListener", parameters, signature);
} catch(Exception e) {
System.err.println("Failed to add as Notification Listener to Mtp2Sap\n" + e.getMessage();
}
} else {

((Mtp2SapMBean)oamLookupTableImplClass.get(mtp2Saps[0])).addNotificationListener(this, this, null);

}

}

/**
* This method is called by an Mtp2Sap when it is emitting an Asynchronous
* alrm or error to check if the listener is interested in the notification
*/

public boolean isNotificationEnabled(Notification notification) {

//GET THE NOTIFICATION TYPE

String type = notification.getType();

// RETURN TRUE IF TYPE IS A NOTIFICATION TYPE WE ARE INTERESTED IN

if(type == "jain.protocol.ss7.oam.mtp2.error.invalid_timer_expired") {
return true;
} else if(type == "jain.protocol.ss7.oam.mtp2.alarm.sl_down_physical") {
return true;
} else {
return false;
}
}

/**
* This method is called by an Mtp2Sap when it is emitting an Asynchronous
* alarm or error
*/
public void handleNotification(Notification asynchronousStat) {

System.out.println("Received an Mtp2 Alarm or Event:\n"
+ asynchronousStat.toString());

if(asynchronousStat.getNotificationType() == "jain.protocol.ss7.oam.mtp2.alarm.sl_down_physical") {

System.out.println("A signalling link is physically down");

} else if(asynchronousStat.getNotificationType() == "jain.protocol.ss7.oam.mtp2.error.invalid_timer_expired") {

System.out.println("Invalid timer expired");

}
}

}

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV NEXT | FRAMES NO FRAMES

11 August 2000

Copyright - 2000 Sun Microsystems