org.xmlBlaster.contrib.replication
Class ReplicationAgent
java.lang.Object
org.xmlBlaster.contrib.replication.ReplicationAgent
- All Implemented Interfaces:
- I_InitialUpdateListener
public class ReplicationAgent
- extends java.lang.Object
- implements I_InitialUpdateListener
Test basic functionality.
To run most of the tests you need to have a database (for example Postgres).
The connection configuration (url, password etc.) is configured as JVM
property or in #createTest(I_Info, Map)
and
#setUpDbPool(I_Info)
- Author:
- Michele Laghi
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static java.util.logging.Logger log
dbWatcher
private I_ChangeListener dbWatcher
dbWriter
private DbWriter dbWriter
slaveName
private java.lang.String slaveName
cmdLineArgs
private java.lang.String[] cmdLineArgs
hasDbWatcher
private boolean hasDbWatcher
stopWatcherOnIU
private boolean stopWatcherOnIU
running
private boolean running
ReplicationAgent
public ReplicationAgent()
- Default ctor.
createOwnGlobalInfo
private GlobalInfo createOwnGlobalInfo(Global global,
I_Info additionalInfo,
java.lang.String infoId)
throws java.lang.Exception
- Throws:
java.lang.Exception
prepare
public GlobalInfo prepare(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception
isRunning
public boolean isRunning()
main
public static void main(java.lang.String[] args)
- Keys are the info objects and values are maps containing the used properties as key/value pairs.
getDbWatcher
public I_ChangeListener getDbWatcher()
getDbWriter
public DbWriter getDbWriter()
getCommonDefaultMap
private static final java.util.Map getCommonDefaultMap(I_Info subInfo)
getReaderDefaultMap
private static final java.util.Map getReaderDefaultMap(I_Info readerInfo)
getWriterDefaultMap
private static final java.util.Map getWriterDefaultMap(I_Info writerInfo)
showSubHelp
private static final void showSubHelp(I_Info info,
java.util.Map defaultMap,
java.io.PrintStream out)
createReaderInfo
private I_Info createReaderInfo(GlobalInfo cfgInfo)
throws java.lang.Exception
- Throws:
java.lang.Exception
createWriterInfo
public I_Info createWriterInfo(GlobalInfo cfgInfo)
throws java.lang.Exception
- Throws:
java.lang.Exception
getFileFromClasspath
private static java.io.InputStream getFileFromClasspath(java.lang.String filename)
throws java.io.IOException
- Throws:
java.io.IOException
startDbWatcher
private void startDbWatcher(I_Info readerInfo)
throws java.lang.Exception
- Throws:
java.lang.Exception
init
public void init(I_Info readerInfo,
I_Info writerInfo)
throws java.lang.Exception
- Initializes the necessary stuff (encapsulated DbWatcher and DbWriter) and starts the DbWriter.
Note that the DbWatcher is only started if used, i.e. if the readerInfo is not null.
- Parameters:
readerInfo
- writerInfo
-
- Throws:
java.lang.Exception
startInitialUpdate
public void startInitialUpdate()
throws java.lang.Exception
- Specified by:
startInitialUpdate
in interface I_InitialUpdateListener
- Throws:
java.lang.Exception
stopInitialUpdate
public void stopInitialUpdate()
throws java.lang.Exception
- Specified by:
stopInitialUpdate
in interface I_InitialUpdateListener
- Throws:
java.lang.Exception
initializeDbWatcher
private static DbWatcher initializeDbWatcher(I_Info readerInfo,
DbWriter dbWriter)
throws java.lang.Exception
- Throws:
java.lang.Exception
shutdownDbWatcher
private final void shutdownDbWatcher()
throws java.lang.Exception
- Throws:
java.lang.Exception
shutdown
public void shutdown()
needsHelp
private static boolean needsHelp(java.lang.String[] args)
fillInfoWithCommandLine
private boolean fillInfoWithCommandLine(java.lang.String[] args,
GlobalInfo cfgInfo)
displayHelp
private void displayHelp(I_Info readerInfo,
I_Info writerInfo)
throws java.lang.Exception
- Throws:
java.lang.Exception
process
public final void process(I_Info readerInfo,
I_Info writerInfo)
throws java.lang.Exception
- Throws:
java.lang.Exception
registerForUpdates
public void registerForUpdates(I_Update registeredForUpdates)
Copyright © 1999-2014 The xmlBlaster.org contributers.