|
Migration from Release 3 to 4.0.0
This section gives a complete list of API changes in the TL1 product from release 3 to 4.0.0.
Package com.adventnet.tl1
This is the Core TL1 package and contains classes and interfaces for establishing a manager-based connection as well as agent-based connections.
|
Class |
Methods Removed/Changed |
Comments |
|
TL1Session |
close() |
Previously, invocation of this method removes all the tasks associated with the session such as, Receive, Process, Callback, Timeout etc. In the present API, this method closes the Receive, Process task only. To close all other tasks, application has to invoke the cleanup() method. |
|
getTL1Clients() |
This method is deprecated. Equivalent: getTL1Client(String) where String represents the Client ID. | |
|
TL1ServerSession |
getAgentSession() |
Obsolete. |
Package com.adventnet.tl1.transport
This package contains TL1 Transport Framework which offers protocol-neutral transport for applications built using TL1 API.
|
Class/Interface |
Comments |
|
ConnectException |
Equivalent: ConnectionDownException. |
|
IOTimeoutException |
Equivalent: TimeoutException. Previously, the read() method in Transport Provider throws IOTimeoutException when the data could not be received because of some delay. This class has been changed to TimeoutException. |
Package com.adventnet.tl1.parser
This package contains Parser APIs which are used for parsing the messages exchanged between the manager and agent applications.
Following changes have to be carried out in the TL1 Parser API.
Classes Removed
|
Class/Interface |
Comments |
|
TcsParser |
Removed. The TcsParser interface previously was only meant for accessing TL1 message definitions and upgrade messages based on those definitions. |
|
TcsMessageParser |
Removed. The TcsMessageParser class is an implementation of TcsParser, which rationalizes the message received from the device based on the TL1 message definitions. This functionality is now available through the com.adventnet.tl1.TcsMessageRationalizer class which implements com.adventnet.tl1.MessageRationalizer. |
Migration Path from the old TcsMessageParser to the new TcsMessageRationalizer is given below:
Old Snippet:
|
import com.adventnet.tl1.parser.TcsParser; import com.adventnet.tl1.parser.TcsMessageParser; ... TL1Session ts = new TL1Session(new TL1API()); // session instance is created. TcsMessageParser tcsParser = new TcsMessageParser();
if(tcsParser.loadModule(filename, modulename)) { ts.setTL1Parser(tcsParser); } ... |
New Snippet:
|
import com.adventnet.tl1.MessageRationalizer; import com.adventnet.tl1.TcsMessageRationalizer; ... TL1Session ts = new TL1Session(new TL1API()); // session instance is created. TcsMessageRationalizer tcsRationalizer = new TcsMessageRationalizer();
if(tcsRationalizer.loadModule(commandset_url, modulename)) { ts.setMessageRationalizer(tcsRationalizer); } ... |
Methods Removed/Changed
|
Class |
Methods Removed/Changed |
Comments |
|
TL1MessageParser |
setParsingMode(int) |
Equivalent: setParserMode(boolean) -or- setParserMode(boolean,byte)
where boolean represents parse mode. If set to true indicates rigorous mode and false indicates flexible mode. By default, flexible mode is enabled. Byte represents the message type. |
Package com.adventnet.tl1.commandset
This package contains Command Set APIs for accessing the XML-based TL1 message definitions and pre-built TL1 commands. Following are the changes to be done in the Command Set API.
In the previous release of TL1 API (3.0), Command Set API contains message definitions as properties. This has posed difficulties if one needs to access these definitions to the parameter level. To simplify it, this version of API encapsulates these message definitions in the form of objects. These objects are easy to access and manipulate. This change has also brought in lot of migration changes. To get a better view of the Command Set API, refer the Java docs.
Classes Removed/Changed
|
Class/Interface |
Comments |
|
TcsMetadata |
Equivalent: CommandSet. |
|
TcsData |
Equivalent: DataSet. |
|
Commandcode |
Equivalent: CommandCode. |
|
AutoMessage |
Equivalent: AutonomousMessage. |
|
TemplateGroup |
Removed. |
|
Template |
Equivalent: ParameterBlockTemplate. |
Methods Removed/Changed
|
Class |
Methods Removed/Changed |
Comments |
|
Parameter |
clear() |
Removed |
|
String getDepth() setDepth(String) |
The getDepth() method returns an integer and setDepth(int) takes an integer argument. | |
|
getEnum() setEnum() |
Equivalent: getEnumerationString() setEnumerationString() | |
|
getValues() setValues() |
Removed. | |
|
ParameterBlock |
String getDepth() setDepth(String) |
The getDepth() returns an integer and setDepth(int)takes an integer argument. |
|
getMaximumParameterDepth() |
Equivalent: getMaxDepth() | |
|
getParameterOrder() |
Removed. | |
|
Vector getParameters() setParameters(Vector) |
getParameters() returning array of Parameter objects while the setParameters() takes an array of Parameter objects | |
|
Vector getParameters(int) |
Returns an array of Parameter objects. | |
|
getTemplateName() setTemplateName() |
In the previous version, the templates are written only for access identifiers and hence only those parameter blocks that contribute to access identifier of an input message referred this template. The template name of a parameter block identifies a particular parameter block within the template. Now the Templates can be referred by any parameter blocks. The template name of the parameter block is the name of the ParameterBlockTemplate and name of the parameter block identifies the block within template. see: ParameterBlockTemplate. | |
|
isTemplate() |
Equivalent: isTemplateParameterBlock(). | |
|
isTemplateUser() |
Removed. | |
|
AutoMessage |
CommandCode getAutoCode() |
This method returns an AutoCode object instead of CommandCode object. |
|
Vector getAutoCodes |
Removed. Application has to write its own logic to generate this vector. | |
|
getCategory() |
This method still works. The change is that this method has been moved to its parent class (Message). | |
|
getComment() setComment |
Removed. The comment should be now treated as getCommentedTextBlock()->first ParameterBlock()->first Parameter()'s value | |
|
TextBlock |
getExists() setExists() |
Removed. This functionality is captured in get/setMinOccurence/ and set/getMaxOccurence. |
|
getMaximumBlockDepth |
Equivalent: getMaxDepth | |
|
getParamBlocks |
Equivalent: getParameterBlocks returning array of ParameterBlocks. | |
|
Vector getParameterBlockNames |
Now returns an array of Strings | |
|
Vector getParameterBlocks(int) |
Now return an array of Strings | |
|
InputMessage |
clear() |
Removed. need to set individual attiributes to null. |
|
getCategory()
|
This method still works. The change is that this method has been moved to its parent class (Message). | |
|
getCommandCodes |
Removed. | |
|
Vector getMessagePayloadBlock setMessagePayloadBlock([])
|
Now : get : returns an array of parameter blocks set : takes an array of parameter blocks.
| |
|
Module |
Properties getAlarmCodes |
now returns an array of AlarmCode objects which contains a cache for holding severity and codes. |
|
getAutoMessage() setAutoMessage() |
Equivalent: get method : getAutonomousMessage() and returns an AutonomousMessage. set method : setAutonomousMessage() which receives an AutonomousMessage obj. | |
|
getCategories()
|
Equivalent: getInputMessageCategories() and returns an array of strings. see also getAutonomousMessageCategories() | |
|
getInputMessageForCommandCode |
Equivalent: getInputMessageForCode(String) | |
|
Vector getInputMessageNames |
This method now returns an array of Strings | |
|
getInputMessages(category) |
Equivalent: getInputMessageNames(category) and returns an array of strings. | |
|
getMessages |
Removed. instead use getInputMessageNames()+ getInputMessage() and getAutonomousMessageNames()+ getAutonomousMessage() | |
|
Vector getResponseMessageNames |
now returns an array of Strings | |
|
getResponseName(ccode) |
Removed. use getResponseMessageForCode() instead | |
|
getTemplateGroup |
Removed. see: ParameterBlockTemplate, ParameterTemplate | |
|
removeAutoMessage |
Equivalent: removeAutonomousMessage | |
|
void setAlarmCodes(Properties) |
Equivalent: setAlarmCode(AlarmCode) | |
|
setAutoMessage(AutoMessage) |
Equivalent: addAutonomousMessage | |
|
setInputMessage(InputMessage) |
Equivalent: addInputMessage(InputMessage) | |
|
setResponseMessage() |
Equivalent: addResponseMessage() | |
|
setTemplateGroup |
Equivalent: addParameterBlockTemplate, addParameterTemplate | |
|
updateAutoMesage(AutoMessage, String) |
Equivalent: updateAutonomousMessage(String, AutonomousMessage) | |
|
updateInputMessage(InputMessage, String) |
Equivalent: updateInputMessage(String, InputMessage) | |
|
updateResponseMessage (ResponseMessage, String) |
Equivalent: updateResponseMessage(String, ResponseMessage) | |
|
ResponseMessage |
getComment setComment |
Removed. The comment should be now treated as getCommentedTextBlock()->first ParameterBlock()->first Parameter()'s value |
|
InputMessageData |
updateData(Data, String) |
Equivalent: updateData(String, Data) |
|
isDataAlreadyAvailable() |
Obsolete. | |
|
getDataNamesForCommandCode() |
Obsolete. | |
|
Data |
getTargetIdentifierString() getAccessIdentifierString() getCorrelationTagString() getGeneralBlockString() getMessagePayloadBlockString() |
Equivalent: getTargetIdentifier() getAccessIdentifier() getCorrelationTag() getGeneralBlock() getMessagePayloadBlock(String)
These methods now return a ParameterBlockData instead of String. |
|