2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.cluster;
11 import akka.japi.Procedure;
12 import akka.persistence.SnapshotSelectionCriteria;
15 * DataPersistenceProvider provides methods to persist data and is an abstraction of the akka-persistence persistence
18 public interface DataPersistenceProvider {
20 * @return false if recovery is not applicable. In that case the provider is not persistent and may not have
21 * anything to be recovered
23 boolean isRecoveryApplicable();
26 * Persist a journal entry.
32 <T> void persist(T o, Procedure<T> procedure);
39 void saveSnapshot(Object o);
42 * Delete snapshots based on the criteria
46 void deleteSnapshots(SnapshotSelectionCriteria criteria);
49 * Delete journal entries up to the sequence number
51 * @param sequenceNumber
53 void deleteMessages(long sequenceNumber);
56 * Returns the last sequence number contained in the journal.
58 long getLastSequenceNumber();