com.bretth.osmosis.core.mysql.v0_6
Class MysqlChangeReader

java.lang.Object
  extended by com.bretth.osmosis.core.mysql.v0_6.MysqlChangeReader
All Implemented Interfaces:
Task, ChangeSource, RunnableChangeSource, java.lang.Runnable

public class MysqlChangeReader
extends java.lang.Object
implements RunnableChangeSource

A change source reading from database history tables. This aims to be suitable for running at regular intervals with database overhead proportional to changeset size.

Author:
Brett Henderson

Constructor Summary
MysqlChangeReader(DatabaseLoginCredentials loginCredentials, DatabasePreferences preferences, boolean readAllUsers, java.util.Date intervalBegin, java.util.Date intervalEnd, boolean fullHistory)
          Creates a new instance.
 
Method Summary
 void run()
          Reads all data from the file and send it to the sink.
 void setChangeSink(ChangeSink changeSink)
          Sets the change sink to send data to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MysqlChangeReader

public MysqlChangeReader(DatabaseLoginCredentials loginCredentials,
                         DatabasePreferences preferences,
                         boolean readAllUsers,
                         java.util.Date intervalBegin,
                         java.util.Date intervalEnd,
                         boolean fullHistory)
Creates a new instance.

Parameters:
loginCredentials - Contains all information required to connect to the database.
preferences - Contains preferences configuring database behaviour.
readAllUsers - If this flag is true, all users will be read from the database regardless of their public edits flag.
intervalBegin - Marks the beginning (inclusive) of the time interval to be checked.
intervalEnd - Marks the end (exclusive) of the time interval to be checked.
fullHistory - Specifies if full version history should be returned, or just a single change per entity for the interval.
Method Detail

setChangeSink

public void setChangeSink(ChangeSink changeSink)
Sets the change sink to send data to.

Specified by:
setChangeSink in interface ChangeSource
Parameters:
changeSink - The sink for receiving all produced data.

run

public void run()
Reads all data from the file and send it to the sink.

Specified by:
run in interface java.lang.Runnable