xmlBlaster 2.2.0 API

org.xmlBlaster.contrib.dbwatcher.convert
Interface I_AttributeTransformer


public interface I_AttributeTransformer

Supports adding of customized attributes (key/values) to the xml dump.

Example:


<sql>
 <desc>
  <command>INSERT</command>
  <ident>AFTN_CIRCUIT_STATE</ident>
  <colname type='DATE' nullable='0'>DATUM</colname>
  <colname type='NUMBER' precision='11' nullable='0'>CPU</colname>
 </desc>
 <row num='0'>
  <col name='DATUM'>2005-01-05 15:41:36.0</col>
  <col name='CPU'>238089</col>
  <attr name='SUBNET_ID'>TCP</attr>
  <attr name='CIRCUIT'>AAAAAAAAAAAAAAAZ</attr>
  <attr name='CIRCUIT_STATE'>OPERATIVE</attr>
 </row>
</sql>
  

The above attr tags are created by all Map entries returned with the transform(ResultSet rs, int rowCount) method. It is up to your plugin to create arbitrary map entries which you want to add.

Author:
Marcel Ruff

Method Summary
 void init(I_Info info)
          Is called after construction.
 void shutdown()
          Cleanup resources.
 java.util.Map transform(java.sql.ResultSet rs, int rowCount)
          Customized transformation to key/values from a given JDBC result set.
 

Method Detail

init

void init(I_Info info)
          throws java.lang.Exception
Is called after construction.

Parameters:
info - The configuration environment
Throws:
java.lang.Exception

transform

java.util.Map transform(java.sql.ResultSet rs,
                        int rowCount)
                        throws java.lang.Exception
Customized transformation to key/values from a given JDBC result set.

This is called from I_DataConverter for each row instance 'rs', you may not call rs.next().

Parameters:
rs - The SQL result
rowCount - -1 when called for the <desc> section else it is the current row count of the ResultSet beginning with 0
Returns:
If not null your attributes are added to the XML dump, if null no attributes are added
Throws:
java.lang.Exception - if the plugin desires so

shutdown

void shutdown()
              throws java.lang.Exception
Cleanup resources.

Throws:
java.lang.Exception

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.