Class DelegatingPersistentDataProvider
- java.lang.Object
-
- org.opendaylight.controller.cluster.DelegatingPersistentDataProvider
-
- All Implemented Interfaces:
DataPersistenceProvider
public class DelegatingPersistentDataProvider extends Object implements DataPersistenceProvider
A DataPersistenceProvider implementation that delegates to another implementation.- Author:
- Thomas Pantelis
-
-
Constructor Summary
Constructors Constructor Description DelegatingPersistentDataProvider(DataPersistenceProvider delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteMessages(long sequenceNumber)
Deletes journal entries up to the given sequence number.void
deleteSnapshots(akka.persistence.SnapshotSelectionCriteria criteria)
Deletes snapshots based on the given criteria.DataPersistenceProvider
getDelegate()
long
getLastSequenceNumber()
Returns the last sequence number contained in the journal.boolean
isRecoveryApplicable()
Returns whether or not persistence recovery is applicable/enabled.<T> void
persist(T entry, akka.japi.Procedure<T> procedure)
Persists an entry to the applicable journal synchronously.<T> void
persistAsync(T entry, akka.japi.Procedure<T> procedure)
Persists an entry to the applicable journal asynchronously.void
saveSnapshot(Object entry)
Saves a snapshot.void
setDelegate(DataPersistenceProvider delegate)
-
-
-
Constructor Detail
-
DelegatingPersistentDataProvider
public DelegatingPersistentDataProvider(DataPersistenceProvider delegate)
-
-
Method Detail
-
setDelegate
public void setDelegate(DataPersistenceProvider delegate)
-
getDelegate
public DataPersistenceProvider getDelegate()
-
isRecoveryApplicable
public boolean isRecoveryApplicable()
Description copied from interface:DataPersistenceProvider
Returns whether or not persistence recovery is applicable/enabled.- Specified by:
isRecoveryApplicable
in interfaceDataPersistenceProvider
- Returns:
- true if recovery is applicable, otherwise false, in which case the provider is not persistent and may not have anything to be recovered
-
persist
public <T> void persist(T entry, akka.japi.Procedure<T> procedure)
Description copied from interface:DataPersistenceProvider
Persists an entry to the applicable journal synchronously.- Specified by:
persist
in interfaceDataPersistenceProvider
- Type Parameters:
T
- the type of the journal entry- Parameters:
entry
- the journal entry to persistprocedure
- the callback when persistence is complete
-
persistAsync
public <T> void persistAsync(T entry, akka.japi.Procedure<T> procedure)
Description copied from interface:DataPersistenceProvider
Persists an entry to the applicable journal asynchronously.- Specified by:
persistAsync
in interfaceDataPersistenceProvider
- Type Parameters:
T
- the type of the journal entry- Parameters:
entry
- the journal entry to persistprocedure
- the callback when persistence is complete
-
saveSnapshot
public void saveSnapshot(Object entry)
Description copied from interface:DataPersistenceProvider
Saves a snapshot.- Specified by:
saveSnapshot
in interfaceDataPersistenceProvider
- Parameters:
entry
- the snapshot object to save
-
deleteSnapshots
public void deleteSnapshots(akka.persistence.SnapshotSelectionCriteria criteria)
Description copied from interface:DataPersistenceProvider
Deletes snapshots based on the given criteria.- Specified by:
deleteSnapshots
in interfaceDataPersistenceProvider
- Parameters:
criteria
- the search criteria
-
deleteMessages
public void deleteMessages(long sequenceNumber)
Description copied from interface:DataPersistenceProvider
Deletes journal entries up to the given sequence number.- Specified by:
deleteMessages
in interfaceDataPersistenceProvider
- Parameters:
sequenceNumber
- the sequence number
-
getLastSequenceNumber
public long getLastSequenceNumber()
Description copied from interface:DataPersistenceProvider
Returns the last sequence number contained in the journal.- Specified by:
getLastSequenceNumber
in interfaceDataPersistenceProvider
- Returns:
- the last sequence number
-
-