Class PersistentDataProvider
java.lang.Object
org.opendaylight.controller.cluster.PersistentDataProvider
- All Implemented Interfaces:
DataPersistenceProvider
A DataPersistenceProvider implementation with persistence enabled.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteMessages
(long sequenceNumber) Deletes journal entries up to the given sequence number.void
deleteSnapshots
(SnapshotSelectionCriteria criteria) Deletes snapshots based on the given criteria.long
Returns the last sequence number contained in the journal.boolean
Receive and potentially handle aJournalProtocol
response.boolean
Receive and potentially handle aSnapshotProtocol
response.boolean
Returns whether or not persistence recovery is applicable/enabled.<T> void
Persists an entry to the applicable journal synchronously.<T> void
persistAsync
(T entry, Procedure<T> procedure) Persists an entry to the applicable journal asynchronously.void
saveSnapshot
(Object snapshot) Saves a snapshot.
-
Constructor Details
-
PersistentDataProvider
-
-
Method Details
-
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
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
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
Description copied from interface:DataPersistenceProvider
Saves a snapshot.- Specified by:
saveSnapshot
in interfaceDataPersistenceProvider
- Parameters:
snapshot
- the snapshot object to save
-
deleteSnapshots
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
-
handleJournalResponse
Description copied from interface:DataPersistenceProvider
Receive and potentially handle aJournalProtocol
response.- Specified by:
handleJournalResponse
in interfaceDataPersistenceProvider
- Parameters:
response
- AJournalProtocol
response- Returns:
true
if the response was handled
-
handleSnapshotResponse
Description copied from interface:DataPersistenceProvider
Receive and potentially handle aSnapshotProtocol
response.- Specified by:
handleSnapshotResponse
in interfaceDataPersistenceProvider
- Parameters:
response
- ASnapshotProtocol
response- Returns:
true
if the response was handled
-