Class NonPersistentDataProvider
- java.lang.Object
-
- org.opendaylight.controller.cluster.NonPersistentDataProvider
-
- All Implemented Interfaces:
DataPersistenceProvider
public class NonPersistentDataProvider extends Object implements DataPersistenceProvider
A DataPersistenceProvider implementation with persistence disabled, essentially a no-op.
-
-
Constructor Summary
Constructors Constructor Description NonPersistentDataProvider(ExecuteInSelfActor actor)
-
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(SnapshotSelectionCriteria criteria)
Deletes snapshots based on the given criteria.long
getLastSequenceNumber()
Returns the last sequence number contained in the journal.boolean
handleJournalResponse(JournalProtocol.Response response)
Receive and potentially handle aJournalProtocol
response.boolean
handleSnapshotResponse(SnapshotProtocol.Response response)
Receive and potentially handle aSnapshotProtocol
response.boolean
isRecoveryApplicable()
Returns whether or not persistence recovery is applicable/enabled.<T> void
persist(T entry, Procedure<T> procedure)
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 Detail
-
NonPersistentDataProvider
public NonPersistentDataProvider(ExecuteInSelfActor actor)
-
-
Method Detail
-
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, 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, 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 snapshot)
Description copied from interface:DataPersistenceProvider
Saves a snapshot.- Specified by:
saveSnapshot
in interfaceDataPersistenceProvider
- Parameters:
snapshot
- the snapshot object to save
-
deleteSnapshots
public void deleteSnapshots(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
-
handleJournalResponse
public boolean handleJournalResponse(JournalProtocol.Response response)
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
public boolean handleSnapshotResponse(SnapshotProtocol.Response response)
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
-
-