X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2FDataPersistenceProvider.java;h=c655dcdb891488b52f1f42741046594e9651a5e6;hp=730310e22e2f37d5153c2c918ea5b458b3531fe2;hb=40723a37cc98de6c7dc396ca2558f7ef51e7337a;hpb=f9a9cd1ea40d2477ccb16b03c71a87595226595a diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/DataPersistenceProvider.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/DataPersistenceProvider.java index 730310e22e..c655dcdb89 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/DataPersistenceProvider.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/DataPersistenceProvider.java @@ -16,44 +16,58 @@ import akka.persistence.SnapshotSelectionCriteria; * API. */ public interface DataPersistenceProvider { + /** - * @return false if recovery is not applicable. In that case the provider is not persistent and may not have - * anything to be recovered + * Returns whether or not persistence recovery is applicable/enabled. + * + * @return true if recovery is applicable, otherwise false, in which case the provider is not persistent and may + * not have anything to be recovered */ boolean isRecoveryApplicable(); /** - * Persist a journal entry. + * Persists an entry to the applicable journal synchronously. * - * @param o - * @param procedure - * @param + * @param entry the journal entry to persist + * @param procedure the callback when persistence is complete + * @param the type of the journal entry */ - void persist(T o, Procedure procedure); + void persist(T entry, Procedure procedure); /** - * Save a snapshot + * Persists an entry to the applicable journal asynchronously. * - * @param o + * @param entry the journal entry to persist + * @param procedure the callback when persistence is complete + * @param the type of the journal entry */ - void saveSnapshot(Object o); + void persistAsync(T entry, Procedure procedure); /** - * Delete snapshots based on the criteria + * Saves a snapshot. * - * @param criteria + * @param snapshot the snapshot object to save + */ + void saveSnapshot(Object snapshot); + + /** + * Deletes snapshots based on the given criteria. + * + * @param criteria the search criteria */ void deleteSnapshots(SnapshotSelectionCriteria criteria); /** - * Delete journal entries up to the sequence number + * Deletes journal entries up to the given sequence number. * - * @param sequenceNumber + * @param sequenceNumber the sequence number */ void deleteMessages(long sequenceNumber); /** * Returns the last sequence number contained in the journal. + * + * @return the last sequence number */ long getLastSequenceNumber(); }