2013-10-09 13:11:53 +02:00
|
|
|
/**
|
2015-03-07 22:58:48 -08:00
|
|
|
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
|
2013-10-09 13:11:53 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package akka.persistence.journal.japi;
|
|
|
|
|
|
2014-01-17 06:58:25 +01:00
|
|
|
import akka.persistence.*;
|
2015-06-03 15:56:00 +02:00
|
|
|
import scala.concurrent.Future;
|
2013-10-09 13:11:53 +02:00
|
|
|
|
|
|
|
|
interface SyncWritePlugin {
|
2014-12-08 11:02:14 +01:00
|
|
|
//#sync-write-plugin-api
|
|
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
void doWriteMessages(Iterable<PersistentRepr> messages);
|
2013-10-27 08:01:14 +01:00
|
|
|
|
2014-12-08 11:02:14 +01:00
|
|
|
/**
|
|
|
|
|
* Java API, Plugin API: synchronously deletes all persistent messages up to
|
|
|
|
|
* `toSequenceNr`. If `permanent` is set to `false`, the persistent messages
|
|
|
|
|
* are marked as deleted, otherwise they are permanently deleted.
|
|
|
|
|
*
|
|
|
|
|
* @see AsyncRecoveryPlugin
|
|
|
|
|
*/
|
|
|
|
|
void doDeleteMessagesTo(String persistenceId, long toSequenceNr, boolean permanent);
|
|
|
|
|
//#sync-write-plugin-api
|
2013-10-09 13:11:53 +02:00
|
|
|
}
|