2013-10-09 13:11:53 +02:00
|
|
|
/**
|
|
|
|
|
* Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package akka.persistence.journal.japi;
|
|
|
|
|
|
2013-11-07 10:45:02 +01:00
|
|
|
import akka.persistence.PersistentRepr;
|
2013-10-09 13:11:53 +02:00
|
|
|
|
|
|
|
|
interface SyncWritePlugin {
|
|
|
|
|
//#sync-write-plugin-api
|
2013-10-27 08:01:14 +01:00
|
|
|
/**
|
2013-11-07 10:45:02 +01:00
|
|
|
* Java API, Plugin API: synchronously writes a batch of persistent messages to the
|
|
|
|
|
* journal. The batch write must be atomic i.e. either all persistent messages in the
|
|
|
|
|
* batch are written or none.
|
2013-10-27 08:01:14 +01:00
|
|
|
*/
|
2013-11-20 13:47:42 +01:00
|
|
|
void doWrite(Iterable<PersistentRepr> persistentBatch);
|
2013-10-27 08:01:14 +01:00
|
|
|
|
2013-10-09 13:11:53 +02:00
|
|
|
/**
|
2013-11-12 09:02:02 +01:00
|
|
|
* Java API, Plugin API: synchronously deletes all persistent messages within the
|
|
|
|
|
* range from `fromSequenceNr` to `toSequenceNr`. If `permanent` is set to `false`,
|
|
|
|
|
* the persistent messages are marked as deleted, otherwise they are permanently
|
|
|
|
|
* deleted.
|
|
|
|
|
*
|
|
|
|
|
* @see AsyncReplayPlugin
|
2013-10-09 13:11:53 +02:00
|
|
|
*/
|
2013-11-12 09:02:02 +01:00
|
|
|
void doDelete(String processorId, long fromSequenceNr, long toSequenceNr, boolean permanent);
|
2013-10-09 13:11:53 +02:00
|
|
|
|
|
|
|
|
/**
|
2013-11-07 10:45:02 +01:00
|
|
|
* Java API, Plugin API: synchronously writes a delivery confirmation to the journal.
|
2013-10-09 13:11:53 +02:00
|
|
|
*/
|
|
|
|
|
void doConfirm(String processorId, long sequenceNr, String channelId) throws Exception;
|
|
|
|
|
//#sync-write-plugin-api
|
|
|
|
|
}
|