|
xmlBlaster 1.6.2 contributions API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.xmlBlaster.contrib.dbwatcher.detector.MD5ChangeDetector
Check the database and compare the MD5 of the result set to the previous one.
Configuration:
If the table does not exist in the DB no event is triggered, if an empty table comes to existence an empty event with untouched topic name is triggered:
topic='db.change.event.${ICAO_ID}'
<?xml version='1.0' encoding='UTF-8' ?>
<sql>
</sql>
Note that the previous MD5 values are hold in RAM only, after plugin restart they are lost and a complete set of data is send again.
| DB statement | Reported change | Comment |
|---|---|---|
| CREATE | CREATE | - |
| INSERT | INSERT | On multiple table entries for a changeDetector.groupColName the change is reported as UPDATE |
| UPDATE | UPDATE | - |
| DELETE | DELETE | - |
| DROP | DROP | see mom.eraseOnDrop configuration |
| Field Summary | |
protected int |
changeCount
|
protected java.lang.String |
changeDetectStatement
|
protected I_ChangeListener |
changeListener
|
protected I_DataConverter |
dataConverter
|
protected I_DbPool |
dbPool
|
protected java.security.MessageDigest |
digest
|
protected java.lang.String |
groupColName
|
protected I_Info |
info
|
protected java.util.Map |
md5Map
|
protected boolean |
poolOwner
|
protected java.lang.String |
queryMeatStatement
|
protected boolean |
tableExists
|
protected java.util.Set |
touchSet
|
protected boolean |
useGroupCol
|
| Constructor Summary | |
MD5ChangeDetector()
Default constructor, you need to call init(org.xmlBlaster.contrib.I_Info, org.xmlBlaster.contrib.dbwatcher.I_ChangeListener, org.xmlBlaster.contrib.dbwatcher.convert.I_DataConverter) thereafter. |
|
MD5ChangeDetector(I_Info info,
I_ChangeListener changeListener,
I_DataConverter dataConverter)
Convenience constructor which calls init(org.xmlBlaster.contrib.I_Info, org.xmlBlaster.contrib.dbwatcher.I_ChangeListener, org.xmlBlaster.contrib.dbwatcher.convert.I_DataConverter). |
|
| Method Summary | |
int |
checkAgain(java.util.Map attrMap)
Check the observed data for changes. |
void |
init(I_Info info,
I_ChangeListener changeListener,
I_DataConverter dataConverter)
Needs to be called after construction. |
void |
shutdown()
Cleanup resources. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected I_Info info
protected I_ChangeListener changeListener
protected I_DataConverter dataConverter
protected I_DbPool dbPool
protected boolean poolOwner
protected boolean tableExists
protected java.security.MessageDigest digest
protected final java.util.Map md5Map
protected final java.util.Set touchSet
protected java.lang.String changeDetectStatement
protected java.lang.String groupColName
protected boolean useGroupCol
protected int changeCount
protected java.lang.String queryMeatStatement
| Constructor Detail |
public MD5ChangeDetector()
init(org.xmlBlaster.contrib.I_Info, org.xmlBlaster.contrib.dbwatcher.I_ChangeListener, org.xmlBlaster.contrib.dbwatcher.convert.I_DataConverter) thereafter.
public MD5ChangeDetector(I_Info info,
I_ChangeListener changeListener,
I_DataConverter dataConverter)
throws java.lang.Exception
init(org.xmlBlaster.contrib.I_Info, org.xmlBlaster.contrib.dbwatcher.I_ChangeListener, org.xmlBlaster.contrib.dbwatcher.convert.I_DataConverter).
info - The configuration environmentchangeListener - The listener to notify if something has changeddataConverter - A converter or null
java.lang.Exception| Method Detail |
public void init(I_Info info,
I_ChangeListener changeListener,
I_DataConverter dataConverter)
throws java.lang.Exception
init in interface I_ChangeDetectorinfo - The configurationchangeListener - The listener to notify if something has changeddataConverter - If not null the data will be transformed immediately during change detection
java.lang.Exception
public int checkAgain(java.util.Map attrMap)
throws java.lang.Exception
checkAgain in interface I_ChangeDetectorattrMap - This map can be null. The event source can transport
some specific information to help the changeDetector doing its work
efficiently.
java.lang.Exception - Can be of any typeI_ChangeDetector.checkAgain(Map)
public void shutdown()
throws java.lang.Exception
I_ChangeDetector
shutdown in interface I_ChangeDetectorjava.lang.Exception - Typicall XmlBlasterExceptionorg.xmlBlaster.contrib.dbwatcher.db.I_DbPool#shutdown
|
xmlBlaster 1.6.2 contributions API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||