Allow writing change XML to an existing IO stream.

The existing XmlChangeWriter required a file argument, but this
modification aligns it with XmlWriter which can also accept an existing
IO Writer so that data can be written to a pre-existing IO stream.
Minor javadoc updates.
Persist sequence state file before global state file.

Updated the complete method to persist the sequence-specific state file
prior to the global state file.  This prevents a small window where the
global state file could be completed and the overall replication marked
complete before the sequence-specific state file gets written.

Some minor formatting and javadoc updates.
Moved lifecycle management into single location.

The replication destination must be completed and released after use. 
This is now being done in one location instead of the initialisation and
replication methods both performing the task.
Added apidb replication continuous looping.

The existing apidb replication only allowed a single replication extract
to be retrieved at a time.  This has been enhanced to allow the
replication to run continously in a loop with a minimum interval to
reduce load on the database.
Fixed the "forever" iteration loop.

The replication loop was aborting after 0 iterations if set to loop
forever.
Fixed debug logging to work with rails3 schema.

A conditional logging block was still referring to "id" columns with the old
rails2 compatible name of id instead of <type>_id.
Added basic multi-replication testing.

Enhanced the existing replication unit tests to invoke the
multi-iteration replication functionality.
Explicitly drop temporary tables.

The replication queries create temp tables during processing.  These are
automatically dropped at the end of the transaction, however relying on
this causes problems if multiple replication queries are issued within
the same transaction.  Temp tables are now explicitly dropped when no
longer required and the automatic drop is only required in error
conditions.
Fixed file based lock to allow unlock and relock.

The existing file based lock implementation was failing to release all
resources correctly when unlocking which prevented a new lock from being
obtained.
Fix replication to persist after each interval.

The replicator had a bug where it wasn't telling the output destination
when an interval had been completed.  This caused the output destination
to continue writing to the same interval forever.
Added the apidb-replication project.

This project will be used to house replication specific code for the
apidb schema.  This will allow the existing apidb project to be
simplified.
Merge branch 'init' into fastrep
Added a replication file writer task.

Existing replication writing functionality is built into other tasks
such as the --replicate-apidb and --merge-replication-files tasks.  This
new task exposes a standard ChangeSink interface but supports the
standard init/process/complete lifecycle being invoked many times.  Each
lifecycle results in a new replication and state file being written.
The state is communicated from initiating replication task to this task
via a metatag.
ReplicationState stored to Map<String, String>.

The replication state was previously tied to a Properties storage implementation.  This has been updated to use Map<String, String> which is more generic and easily converted to and from Properties.  ReplicateState classes have been merged into a single exception hierarchy.
Apidb replication streams through pipeline.

The --replicate-apidb task used to be an all-in-one replication task
that read from the database and wrote out replication files.  It has
been enhanced to write through change streams to tasks such as the
--write-replication task.  Both ends of a replication change stream must
perform synchronisation around a ReplicationState object exchanged
during the initialization phase and persisted during the complete phase.
Created http replication project.

The existing apidb-replication project has been repurposed to be the http replication project.  The recent pipeline enhancements and replication task refactoring will allow HTTP replication to be made more generic and not tied to the apidb-replication implementation.
Fix minor typo in new log messages.
Merge branch 'log-improvement'
Remove duplicates of SinkEntityInspector now that we have a testutil project.

Note: there is still a copy of SinkEntityInspector in the core project
since testutil depends on core and therefore core cannot depend on testutil.