"WEBNMS_5 API Docs"

com.adventnet.nms.util.tl1
Class TL1ClientUtil

java.lang.Object
  extended by com.adventnet.nms.util.tl1.TL1ClientUtil

public class TL1ClientUtil
extends java.lang.Object

This class provides convenient utility methods for developing TL1 applications. It provides methods to convert and extract required * information from the TL1 Response Message and TL1 Autonomous Message into a more convenient format. This class is to be used only on the Web NMS Client Side.


Constructor Summary
TL1ClientUtil()
           
 
Method Summary
static com.adventnet.tl1.message.TL1AutonomousMessage convertNotification(java.lang.Object notifyEvent)
          To convert an Notification Event Object into an TL1AutonomousMessage.
static com.adventnet.tl1.message.TL1ResponseMessage convertResponse(com.adventnet.management.ManagementServerResultEvent rev)
          Method to convert ManagementServerResultEvent object into a TL1ResponseMessage object.
static com.adventnet.tl1.message.TL1ResponseMessage convertResponse(java.lang.Object result)
          Method to convert result Object into a TL1ResponseMessage object.
static java.util.Hashtable convertTL1Line(com.adventnet.tl1.message.TL1Line tl1Line, boolean pdef)
          Method to convert a TL1Line into a Hashtable.
static java.lang.String findAndReplace(java.lang.String str, java.lang.String find, java.lang.String replace)
          Method to search for a particular sub-string instances in a string and replace all those sun-string instances with another string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TL1ClientUtil

public TL1ClientUtil()
Method Detail

convertResponse

public static com.adventnet.tl1.message.TL1ResponseMessage convertResponse(com.adventnet.management.ManagementServerResultEvent rev)
Method to convert ManagementServerResultEvent object into a TL1ResponseMessage object.

Parameters:
rev - The ManagementServerResultEvent object that needs to converted into TL1ResponseMessage. This is the object obtained when you do a Synchronous Send using the Management Server or Management Client.
Returns:
TL1ResponseMessage Object. Returns null if the ManagementServerResultEvent object doesn't contain a proper TL1 Response Message.
Please refer to the javadocs of TL1ResponseMessage class in TL1-Api javadocs and ManagementServerResultEvent class in Managementserver javadocs for more details.

convertResponse

public static com.adventnet.tl1.message.TL1ResponseMessage convertResponse(java.lang.Object result)
Method to convert result Object into a TL1ResponseMessage object.

Parameters:
result - This is the object obtained in the callback setProtocolResult(Property prop, Object result) method when you do an Asynchronous Send using the Management Server or Management Client.
Returns:
TL1ResponseMessage object. Returns null if the result object doesn't contain a proper TL1 Response Message. Please refer to the javadocs of TL1ResponseMessage class in TL1-Api javadocs for more details.

convertNotification

public static com.adventnet.tl1.message.TL1AutonomousMessage convertNotification(java.lang.Object notifyEvent)
To convert an Notification Event Object into an TL1AutonomousMessage.

Parameters:
notifyEvent - This is the object obtained in the setEventResult(Property prop, Object notifEvent) method when you register for Notification with the Management Server or Management Client.
Returns:
TL1AutonomousMessage. Returns null if the Notification Event Object doesn't contain a proper TL1 Autonomous Message.
Please refer to the javadocs of TL1AutonomousMessage class in TL1-Api javadocs for more details.

convertTL1Line

public static java.util.Hashtable convertTL1Line(com.adventnet.tl1.message.TL1Line tl1Line,
                                                 boolean pdef)
Method to convert a TL1Line into a Hashtable. This TL1Line represents a single line in the TL1 Response Message. The Hashtable returned will have the parameter names as the keys and the parameter values, as values.

Parameters:
tl1line - The TL1Line Object.
pdef - boolean value. If this value is set to false this this method will map only the parameters which are name-value pairs. It will dump all position defined parameter values one by one blindly against a key "position_defined". The values are seperated by the character "#" If this value is set to true this method will map the position defined parameter also. Position number of the parameter is used as the key.
Returns:
If the parameters are name-value pairs the parameter name is used as the key. If the parameters are position defined their position number is used as the key. Parameter values are populated in the Hashtable values. Returns an empty Hashtable if you give a null TL1Line. For Example :
TL1Line will be in three formats. (i.e., TL1Line may have only name-value pairs, or only position-defined values or having both) In first case : TL1Line = "CARD=CPU-1:::PST=IS,SST=IDLE"
And the Hashtable contains values in the following format
KEY VALUE
CARD CPU-1
PST IS
SST IDLE

In second case : TL1Line = "CPU-1:::IS,IDLE"
And the Hashtable contains values in the following format
KEY VALUE
0 CPU-1
1 IS
2 IDLE

If the boolean value is false then the Hashtable will have as follows KEY VALUE
position_defined CPU-1#IS#IDLE

In third case : TL1Line = "CARD=CPU-1:::IS,IDLE"
And the Hashtable contains values in the following format
KEY VALUE
CARD CPU-1
1 IS
2 IDLE

If the boolean value is false then the Hashtable will have as follows KEY VALUE
CARD CPU-1
position_defined IS#IDLE

Please refer to the javadocs of TL1Line in TL1Api javadocs for more details

findAndReplace

public static java.lang.String findAndReplace(java.lang.String str,
                                              java.lang.String find,
                                              java.lang.String replace)
Method to search for a particular sub-string instances in a string and replace all those sun-string instances with another string.

Parameters:
str - String in which the change has to be made.
find - the String which has to be searched and removed.
replace - the String which will replace.
Returns:
String. Returns null if any one of the arguments is null.

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.