Migrating static adapters from Generic Log Adapter V3.3 to V4.0
To migrate a static adapter from Generic Log Adapter V3.3 to V4.0:
- In an Eclipse workbench, locate the plug-in project and open the plugin.xml file in the plug-in editor.
- Click the plugin.xml tab.
- In the <requires> element, delete the <import plugin="org.eclipse.hyades.logging.adapter.config"> statement.
This package was merged into the org.eclipse.hyades.logging.parsers package in the GLA 4.0 release.
<requires>
<import plugin="org.eclipse.hyades.logging.parsers"/>
</requires>
- Right-click and click Save.
- In the Package Explorer view of the Java perspective, right-click the plug-in project and click Properties.
- Click Java Build Path.
- Delete all the entries except JRE System Libraries and Plug-in Dependencies.
- Click OK.
- Delete the META-INF folder from the plug-in project.
- In the src folder of your workspace, create a class called CustomParserExtension.
For example, <workspace>\TSMParser\src\com\ibm\tivoli\TSMParser\CustomParserExtension.java.
This class must extend the ParserWrapper class.
See the sample code below.
package com.ibm.tivoli.TSMparser;
import org.eclipse.hyades.logging.parsers.importer.ParserWrapper;
public class CustomParserExtension extends ParserWrapper {
public CustomParserExtension() {
super();
currentPlugin = "com.ibm.tivoli.TSMparser";
}
}
- In the plugin.xml file, delete the class="org.eclipse.hyades.logging.adapter.config.StaticParserWrapper" statement
and add the class created in step 4. For example, class="com.ibm.tivoli.TSMparser.CustomParserExtension.
See the sample code below.
<extension
point="org.eclipse.hyades.logging.parsers.logParser">
<parser
name="%TSM_PARSER_ACTLOG_NAME"
icon="./icons/full/obj16/apache_error.gif"
description="%TSM_PARSER_ACTLOG_DESCRIPTION"
class="com.ibm.tivoli.TSMparser.CustomParserExtension"
ui_name="%TSM_PARSER_ACTLOG_NAME"
id="com.ibm.tivoli.TSMparser.ActlogQueryParser">
<field
useBrowse="true"
defaultValue="d:\test\query.log"
name="%TSM_PARSER_ACTLOG_FILE_PATH_NAME"
helpContextId=""
tooltip="%TSM_PARSER_ACTLOG_FILE_PATH_TOOLTIP"
id="file_path"
browseType="*.log">
</field>
</parser>
</extension>
- In the plugin.xml file for the static parser class, add an org.eclipse.hyades.logging.parsers.staticParser extension element.
See the sample code below.
<extension
point="org.eclipse.hyades.logging.parsers.staticParser">
<parserClassname
name="com.ibm.tivoli.TSMparser.ActlogQueryParser">
</parserClassname>
</extension>
- To test the adapter:
- Go to the Java perspective and click Debug As > Eclipse Application.
- Import a log for the static parser created above, deleting any previously imported files.
(C) Copyright IBM Corporation 2006. All Rights Reserved.