Introduce read/write API for archived content

StorageService always had an archive() method to create
a history trail for entities, e.g. projects, but there was
no way to retrieve archived content, or backup/restore
the archive via REST API.

This patch add a couple of new methods to StorageService:

* readFromArchive() retrieves the history of an entity and
passes it to a consumer function (StorageConsumer). This
allows the JPA implementation to make use of database
cursors for minimal memory consumption.

* writeToArchive() allows to push new entries to the
history bypassing the archive() function. This will be
used in a subsequent patch to implement a restore API.

All known implementations of StorageService are adapted
in this patch, and some more archiving tests have been
added.

Change-Id: I1adbe767efb58c99f91ce12daaf88ed64dc62117
Signed-off-by: Michael Ochmann <michael.ochmann@sap.com>
11 files changed