📄 ri.html
字号:
{</font></font>
<br><font face="Courier New,Courier"><font size=-1>
return true;</font></font>
<br><font face="Courier New,Courier"><font size=-1>
} else if(type == "jain.protocol.ss7.oam.mtp2.statistic.num_sif_sio_received")
{</font></font>
<br><font face="Courier New,Courier"><font size=-1>
return true;</font></font>
<br><font face="Courier New,Courier"><font size=-1>
} else if(type == "jain.protocol.ss7.oam.mtp2.statistic.num_sif_sio_trans")
{</font></font>
<br><font face="Courier New,Courier"><font size=-1>
return true;</font></font>
<br><font face="Courier New,Courier"><font size=-1>
} else {</font></font>
<br><font face="Courier New,Courier"><font size=-1>
return false;</font></font>
<br><font face="Courier New,Courier"><font size=-1>
}</font></font>
<p><font face="Courier New,Courier"><font size=-1>
}</font></font>
<br>
<p><font face="Courier New,Courier"><font size=-1>
/**</font></font>
<br><font face="Courier New,Courier"><font size=-1>
* This method is called by an Mtp2Sap when it is emitting an Asynchronous</font></font>
<br><font face="Courier New,Courier"><font size=-1>
* Mtp2StatisticNotification</font></font>
<br><font face="Courier New,Courier"><font size=-1>
* Note - this method is only called if the isNotificationEnabled method
returned true for this Notification</font></font>
<br><font face="Courier New,Courier"><font size=-1>
*/</font></font>
<br><font face="Courier New,Courier"><font size=-1>
public void handleNotification(Mtp2StatisticEvent asynchronousStat) {</font></font>
<p><font face="Courier New,Courier"><font size=-1>
System.out.println("Received an Mtp2 Statistic:\n"</font></font>
<br><font face="Courier New,Courier"><font size=-1>
+ asynchronousStat.toString());</font></font>
<p><font face="Courier New,Courier"><font size=-1>
if(asynchronousStat.getNotificationType() == "jain.protocol.ss7.oam.mtp2.statistic.num_sif_sio_received")
{</font></font>
<p><font face="Courier New,Courier"><font size=-1>
System.out.println("The number of SIF and SIO octets received is "</font></font>
<br><font face="Courier New,Courier"><font size=-1>
+ ((OamStatisticNotification)asynchronousStat).getStatisticValue());</font></font>
<br><font face="Courier New,Courier"><font size=-1>
}</font></font>
<br><font face="Courier New,Courier"><font size=-1>
}</font></font>
<br>
<br>
<br>
<p><font face="Courier New,Courier"><font size=-1>
/**</font></font>
<br><font face="Courier New,Courier"><font size=-1>
* This method collects a single synchronous (one off) statistic</font></font>
<br><font face="Courier New,Courier"><font size=-1>
*/</font></font>
<p><font face="Courier New,Courier"><font size=-1>
public void collectStat() {</font></font>
<p><font face="Courier New,Courier"><font size=-1>
// COLLECT A SYNCHRONOUS STATISTIC</font></font>
<p><font face="Courier New,Courier"><font size=-1>
Mtp2StatisticNotification synchronousStat = null;</font></font>
<p><font face="Courier New,Courier"><font size=-1>
try {</font></font>
<br><font face="Courier New,Courier"><font size=-1>
if(usingJMXAgent) {</font></font>
<br><font face="Courier New,Courier"><font size=-1>
// collect the number of MSUs discarded due to Signalling Link congestion
for the first Mtp2Sap</font></font>
<p><font face="Courier New,Courier"><font size=-1>
signature = new String[]{"java.lang.Integer"};</font></font>
<br><font face="Courier New,Courier"><font size=-1>
parameters = new Object[]{new Integer(Mtp2StatisticNotification.MTP2_MSU_DISCARD_SL_CONGESTION)};</font></font>
<br><font face="Courier New,Courier"><font size=-1>
synchronousStat = (Mtp2StatisticNotification)server.invoke(Mtp2Saps[0],
"getStatistic", parameters, signature);</font></font>
<p><font face="Courier New,Courier"><font size=-1>
} else {</font></font>
<br><font face="Courier New,Courier"><font size=-1>
// collect the number of MSUs discarded due to Signalling Link congestion
for the first Mtp2Sap</font></font>
<p><font face="Courier New,Courier"><font size=-1>
synchronousStat = ((Mtp2SapMBean)oamLookupTableImplClass.get(Mtp2Saps[0])).getStatistic(new
Integer(Mtp2StatisticNotification.MTP2_MSU_DISCARD_SL_CONGESTION));</font></font>
<br><font face="Courier New,Courier"><font size=-1>
}</font></font>
<p><font face="Courier New,Courier"><font size=-1>
// display the value of the returned statistic</font></font>
<p><font face="Courier New,Courier"><font size=-1>
System.out.println( "The number of MSUs discarded due to Signalling Link
congestion for ["</font></font>
<br><font face="Courier New,Courier"><font size=-1>
+ Mtp2Saps[0].getName() + "] is ["</font></font>
<br><font face="Courier New,Courier"><font size=-1>
+ synchronousStat.getStatisticValue() +"]");</font></font>
<p><font face="Courier New,Courier"><font size=-1>
} catch (StatisticNotSupportedException e) {</font></font>
<p><font face="Courier New,Courier"><font size=-1>
System.err.println("The implementation does not support the collection
of statistics of type [MTP2_MSU_DISCARD_SL_CONGESTION]";</font></font>
<br><font face="Courier New,Courier"><font size=-1>
}</font></font>
<br><font face="Courier New,Courier"><font size=-1>
}</font></font>
<br>
<br>
<br>
<p><font face="Courier New,Courier"><font size=-1>
/**</font></font>
<br><font face="Courier New,Courier"><font size=-1>
* This method starts polling a particular statistic at the specified polling
interval.</font></font>
<br><font face="Courier New,Courier"><font size=-1>
* The polled statistic will be processed by the processMtp2StatisticEvent()
method</font></font>
<br><font face="Courier New,Courier"><font size=-1>
*</font></font>
<br><font face="Courier New,Courier"><font size=-1>
* @param pollingInterval - the polling interval in milliseconds</font></font>
<br><font face="Courier New,Courier"><font size=-1>
*/</font></font>
<p><font face="Courier New,Courier"><font size=-1>
public void pollStatistic(int pollingInterval) {</font></font>
<p><font face="Courier New,Courier"><font size=-1>
try {</font></font>
<br><font face="Courier New,Courier"><font size=-1>
// Start polling the Number of SIF and SIO octets received by the first
Mtp2Sap</font></font>
<br><font face="Courier New,Courier"><font size=-1>
// with the supplied polling interval.</font></font>
<p><font face="Courier New,Courier"><font size=-1>
if(usingJMXAgent) {</font></font>
<p><font face="Courier New,Courier"><font size=-1>
signature = new String[]{"java.lang.Integer", "java.lang.Integer"};</font></font>
<br><font face="Courier New,Courier"><font size=-1>
parameters = new Object[]{new Integer(Mtp2StatisticNotification.MTP2_NUM_SIF_SIO_RECIEVED),
new Integer(pollingInterval)};</font></font>
<br><font face="Courier New,Courier"><font size=-1>
server.invoke(Mtp2Saps[0], "startPollingStatistic", parameters, signature);</font></font>
<p><font face="Courier New,Courier"><font size=-1>
} else {</font></font>
<p><font face="Courier New,Courier"><font size=-1>
((Mtp2SapMBean)oamLookupTableImplClass.get(Mtp2Saps[0])).startPollingStatistic(new
Integer(Mtp2StatisticNotification.MTP2_NUM_SIF_SIO_RECIEVED), new Integer(pollingInterval));</font></font>
<p><font face="Courier New,Courier"><font size=-1>
}</font></font>
<p><font face="Courier New,Courier"><font size=-1>
} catch (StatisticNotSupportedException e) {</font></font>
<br><font face="Courier New,Courier"><font size=-1>
System.err.println("The implementation does not support the collection
of statistics of type [MTP2_NUM_SIF_SIO_RECIEVED]";</font></font>
<p><font face="Courier New,Courier"><font size=-1>
}</font></font>
<br><font face="Courier New,Courier"><font size=-1>
}</font></font>
<p><font face="Courier New,Courier"><font size=-1> }</font></font>
<br>
<br>
<p>Handling Alarms & Errors
<br>
<br>
<p><font face="Courier New,Courier"><font size=-1> public
class Mtp2AlarmAndErrorHandler implements NotificationListener {</font></font>
<br>
<p><font face="Courier New,Courier"><font size=-1>
/**</font></font>
<br><font face="Courier New,Courier"><font size=-1>
* This constructor registers this Mtp2AlarmAndErrorHandler as an</font></font>
<br><font face="Courier New,Courier"><font size=-1>
* Mtp2 alarm listener and an Mtp2 error listener of the MTP2 Managed Objects</font></font>
<br><font face="Courier New,Courier"><font size=-1>
* @param mtp2LayerManagerObjectName - the Mtp2LayerManager whose Managed
Objects we want to</font></font>
<br><font face="Courier New,Courier"><font size=-1>
* register with.</font></font>
<br><font face="Courier New,Courier"><font size=-1>
*/</font></font>
<br><font face="Courier New,Courier"><font size=-1>
public Mtp2AlarmAndErrorHandler(ObjectName mtp2LayerManagerObjectName)
{</font></font>
<p><font face="Courier New,Courier"><font size=-1>
// register as an listener of the first Mtp2Sap</font></font>
<p><font face="Courier New,Courier"><font size=-1>
if(usingJMXAgent) {</font></font>
<br><font face="Courier New,Courier"><font size=-1>
try {</font></font>
<br><font face="Courier New,Courier"><font size=-1>
signature = new String[]{"javax.management.NotificationListener", "javax.management.NotificationFilter",
"java.lang.Object"};</font></font>
<br><font face="Courier New,Courier"><font size=-1>
parameters = new Object[]{this, this, null};</font></font>
<br><font face="Courier New,Courier"><font size=-1>
server.invoke(mtp2Saps[0], "addNotificationListener", parameters, signature);</font></font>
<br><font face="Courier New,Courier"><font size=-1>
} catch(Exception e) {</font></font>
<br><font face="Courier New,Courier"><font size=-1>
System.err.println("Failed to add as Notification Listener to Mtp2Sap\n"
+ e.getMessage();</font></font>
<br><font face="Courier New,Courier"><font size=-1>
}</font></font>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -