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-11-07 10:45:02 +01:00
|
|
|
* Java API, Plugin API: synchronously writes a `persistent` message to the journal.
|
2013-10-09 13:11:53 +02:00
|
|
|
*/
|
2013-11-07 10:45:02 +01:00
|
|
|
void doWrite(PersistentRepr persistent) throws Exception;
|
2013-10-09 13:11:53 +02:00
|
|
|
|
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-07 10:45:02 +01:00
|
|
|
void doWriteBatch(Iterable<PersistentRepr> persistentBatch);
|
2013-10-27 08:01:14 +01:00
|
|
|
|
2013-10-09 13:11:53 +02:00
|
|
|
/**
|
2013-11-07 10:45:02 +01:00
|
|
|
* Java API, Plugin API: synchronously deletes a persistent message. If `physical`
|
|
|
|
|
* is set to `false`, the persistent message is marked as deleted, otherwise it is
|
|
|
|
|
* physically deleted.
|
2013-10-09 13:11:53 +02:00
|
|
|
*/
|
2013-11-07 10:45:02 +01:00
|
|
|
void doDelete(String processorId, long sequenceNr, boolean physical);
|
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
|
|
|
|
|
}
|