xmlBlaster 2.1.0 API

org.xmlBlaster.contrib.dbwatcher
Interface I_ChangeListener

All Superinterfaces:
java.util.EventListener
All Known Implementing Classes:
DbWatcher

public interface I_ChangeListener
extends java.util.EventListener

Interface which reports back changes to the observed data. The change can be a pure, empty event or it can contain all details already depending on the implementing notifier.

Author:
Marcel Ruff

Method Summary
 void hasChanged(ChangeEvent changeEvent)
          Is called for every data source changed.
 int publishMessagesFromStmt(java.lang.String stmt, boolean useGroupCol, ChangeEvent changeEvent, java.sql.Connection conn)
          Does a SQL query with stmt and sends all ResultSets to I_ChangePublisher.
 void shutdown()
          Cleanup resources.
 

Method Detail

hasChanged

void hasChanged(ChangeEvent changeEvent)
Is called for every data source changed.

Parameters:
changeEvent - Transports all needed information about the change

publishMessagesFromStmt

int publishMessagesFromStmt(java.lang.String stmt,
                            boolean useGroupCol,
                            ChangeEvent changeEvent,
                            java.sql.Connection conn)
                            throws java.lang.Exception
Does a SQL query with stmt and sends all ResultSets to I_ChangePublisher.

The messages are formatted by the configured I_DataConverter plugin.

Note: This is a common convenienve function, in a future refactoring we should have this method in a separate interface.

Parameters:
stmt - The SQL query string (with/without grouping)
useGroupCol - If true we send a message for each ChangeEvent.getGroupColName() change
changeEvent - The reason to send
conn - The JDBC connection, if null we get one ourself in auto commit mode
Returns:
The number of changes detected TODO! (currently returns -1)
Throws:
java.lang.Exception - of any type

shutdown

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

Throws:
java.lang.Exception - Can be of any type as implemented by plugin

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.