|
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.TimestampChangeDetector
Check the database and compare the change timestamp of a table to the previous one.
The nature of this plugin is based on a timestamp comparison, as such it does not detect DELETE changes of database rows, as this will not create a new timestamp. All other commands (CREATE, INSERT, UPDATE) will touch the timestamp and are therefor detected. Additionally a DROP is detected.
| DB statement | Reported change | Comment |
|---|---|---|
| CREATE | CREATE | - |
| INSERT | UPDATE | SQL INSERT statement are reported as UPDATE |
| UPDATE | UPDATE | - |
| DELETE | - | Is not detected |
| DROP | DROP | see mom.eraseOnDrop configuration |
Note that the previous timestamp value is hold in RAM only, after plugin restart it is lost and a complete set of data is send again.
| Field Summary | |
protected java.lang.String |
changeCommand
|
protected java.lang.String |
changeDetectStatement
|
protected I_ChangeListener |
changeListener
|
protected I_DataConverter |
dataConverter
|
protected I_DbPool |
dbPool
|
protected java.lang.String |
groupColName
|
protected boolean |
ignoreExistingDataOnStartup
|
protected I_Info |
info
|
protected java.lang.String |
newTimestamp
|
protected java.lang.String |
oldTimestamp
|
protected boolean |
poolOwner
|
protected java.lang.String |
queryMeatStatement
|
protected boolean |
tableExists
|
protected int |
timestampColNum
|
protected boolean |
useGroupCol
|
| Constructor Summary | |
TimestampChangeDetector()
|
|
| Method Summary | |
void |
activateDetection()
|
int |
checkAgain(java.util.Map attrMap)
Check the observed data for changes. |
java.lang.String |
getChangeCommand()
|
java.lang.String |
getChangeDetectStatement()
|
java.lang.String |
getGroupColName()
|
java.lang.String |
getNewTimestamp()
|
java.lang.String |
getOldTimestamp()
|
java.lang.String |
getQueryMeatStatement()
|
int |
getTimestampColNum()
|
void |
init(I_Info info,
I_ChangeListener changeListener,
I_DataConverter dataConverter)
Needs to be called after construction. |
boolean |
isIgnoreDetection()
|
boolean |
isIgnoreExistingDataOnStartup()
|
boolean |
isPoolOwner()
|
boolean |
isTableExists()
|
boolean |
isUseGroupCol()
|
static java.lang.String |
modifyMinStrIfDate(java.lang.String in,
long time)
|
java.lang.String |
modifyMinStrIfDateWithPersistence(java.lang.String in,
long time)
Modifies a string if it contains the special token '${currentDate}'. |
void |
setChangeCommand(java.lang.String changeCommand)
|
void |
setChangeDetectStatement(java.lang.String changeDetectStatement)
|
void |
setGroupColName(java.lang.String groupColName)
|
void |
setOldTimestamp(java.lang.String oldTimestamp)
|
void |
setPoolOwner(boolean poolOwner)
|
void |
setQueryMeatStatement(java.lang.String queryMeatStatement)
|
void |
setTimestampColNum(int timestampColNum)
|
void |
setUseGroupCol(boolean useGroupCol)
|
void |
shutdown()
Cleanup resources. |
void |
stopDetection()
|
| 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 java.lang.String changeDetectStatement
protected int timestampColNum
protected java.lang.String groupColName
protected boolean useGroupCol
protected boolean tableExists
protected boolean ignoreExistingDataOnStartup
protected java.lang.String changeCommand
protected java.lang.String oldTimestamp
protected java.lang.String newTimestamp
protected java.lang.String queryMeatStatement
| Constructor Detail |
public TimestampChangeDetector()
| Method Detail |
public java.lang.String modifyMinStrIfDateWithPersistence(java.lang.String in,
long time)
throws java.lang.Exception
in -
java.lang.Exception
public static java.lang.String modifyMinStrIfDate(java.lang.String in,
long time)
throws java.lang.Exception
java.lang.Exception
public void init(I_Info info,
I_ChangeListener changeListener,
I_DataConverter dataConverter)
throws java.lang.Exception
I_ChangeDetector
init in interface I_ChangeDetectorinfo - changeListener - dataConverter -
java.lang.ExceptionI_ChangeDetector.init(org.xmlBlaster.contrib.I_Info, org.xmlBlaster.contrib.dbwatcher.I_ChangeListener, org.xmlBlaster.contrib.dbwatcher.convert.I_DataConverter)
public int checkAgain(java.util.Map attrMap)
throws java.lang.Exception
checkAgain in interface I_ChangeDetectorattrMap - Currently "oldTimestamp" can be passed to force a specific scan
java.lang.Exception - Can be of any typeI_ChangeDetector.checkAgain(java.util.Map)
public void shutdown()
throws java.lang.Exception
I_ChangeDetector
shutdown in interface I_ChangeDetectorjava.lang.Exception - Can be of any typeI_ChangeDetector.shutdown()public java.lang.String getChangeCommand()
getChangeCommand in interface TimestampChangeDetectorMBeanpublic java.lang.String getChangeDetectStatement()
getChangeDetectStatement in interface TimestampChangeDetectorMBeanpublic java.lang.String getGroupColName()
getGroupColName in interface TimestampChangeDetectorMBeanpublic java.lang.String getNewTimestamp()
getNewTimestamp in interface TimestampChangeDetectorMBeanpublic java.lang.String getOldTimestamp()
getOldTimestamp in interface TimestampChangeDetectorMBeanpublic java.lang.String getQueryMeatStatement()
getQueryMeatStatement in interface TimestampChangeDetectorMBeanpublic int getTimestampColNum()
getTimestampColNum in interface TimestampChangeDetectorMBeanpublic boolean isIgnoreExistingDataOnStartup()
isIgnoreExistingDataOnStartup in interface TimestampChangeDetectorMBeanpublic boolean isPoolOwner()
isPoolOwner in interface TimestampChangeDetectorMBeanpublic boolean isTableExists()
isTableExists in interface TimestampChangeDetectorMBeanpublic boolean isUseGroupCol()
isUseGroupCol in interface TimestampChangeDetectorMBeanpublic void setChangeCommand(java.lang.String changeCommand)
setChangeCommand in interface TimestampChangeDetectorMBeanpublic void setChangeDetectStatement(java.lang.String changeDetectStatement)
setChangeDetectStatement in interface TimestampChangeDetectorMBeanpublic void setGroupColName(java.lang.String groupColName)
setGroupColName in interface TimestampChangeDetectorMBeanpublic void setOldTimestamp(java.lang.String oldTimestamp)
setOldTimestamp in interface TimestampChangeDetectorMBeanpublic void setPoolOwner(boolean poolOwner)
setPoolOwner in interface TimestampChangeDetectorMBeanpublic void setQueryMeatStatement(java.lang.String queryMeatStatement)
setQueryMeatStatement in interface TimestampChangeDetectorMBeanpublic void setTimestampColNum(int timestampColNum)
setTimestampColNum in interface TimestampChangeDetectorMBeanpublic void setUseGroupCol(boolean useGroupCol)
setUseGroupCol in interface TimestampChangeDetectorMBeanpublic void stopDetection()
stopDetection in interface TimestampChangeDetectorMBeanpublic void activateDetection()
activateDetection in interface TimestampChangeDetectorMBeanpublic boolean isIgnoreDetection()
isIgnoreDetection in interface TimestampChangeDetectorMBean
|
xmlBlaster 1.6.2 contributions API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||