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 voiddeleteMessages(long sequenceNumber)Deletes journal entries up to the given sequence number.voiddeleteSnapshots(SnapshotSelectionCriteria criteria)Deletes snapshots based on the given criteria.longgetLastSequenceNumber()Returns the last sequence number contained in the journal.booleanhandleJournalResponse(JournalProtocol.Response response)Receive and potentially handle aJournalProtocolresponse.booleanhandleSnapshotResponse(SnapshotProtocol.Response response)Receive and potentially handle aSnapshotProtocolresponse.booleanisRecoveryApplicable()Returns whether or not persistence recovery is applicable/enabled.<T> voidpersist(T entry, Procedure<T> procedure)Persists an entry to the applicable journal synchronously.<T> voidpersistAsync(T entry, Procedure<T> procedure)Persists an entry to the applicable journal asynchronously.voidsaveSnapshot(Object snapshot)Saves a snapshot.
-
-
-
Constructor Detail
-
NonPersistentDataProvider
public NonPersistentDataProvider(ExecuteInSelfActor actor)
-
-
Method Detail
-
isRecoveryApplicable
public boolean isRecoveryApplicable()
Description copied from interface:DataPersistenceProviderReturns whether or not persistence recovery is applicable/enabled.- Specified by:
isRecoveryApplicablein 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:DataPersistenceProviderPersists an entry to the applicable journal synchronously.- Specified by:
persistin 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:DataPersistenceProviderPersists an entry to the applicable journal asynchronously.- Specified by:
persistAsyncin 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:DataPersistenceProviderSaves a snapshot.- Specified by:
saveSnapshotin interfaceDataPersistenceProvider- Parameters:
snapshot- the snapshot object to save
-
deleteSnapshots
public void deleteSnapshots(SnapshotSelectionCriteria criteria)
Description copied from interface:DataPersistenceProviderDeletes snapshots based on the given criteria.- Specified by:
deleteSnapshotsin interfaceDataPersistenceProvider- Parameters:
criteria- the search criteria
-
deleteMessages
public void deleteMessages(long sequenceNumber)
Description copied from interface:DataPersistenceProviderDeletes journal entries up to the given sequence number.- Specified by:
deleteMessagesin interfaceDataPersistenceProvider- Parameters:
sequenceNumber- the sequence number
-
getLastSequenceNumber
public long getLastSequenceNumber()
Description copied from interface:DataPersistenceProviderReturns the last sequence number contained in the journal.- Specified by:
getLastSequenceNumberin interfaceDataPersistenceProvider- Returns:
- the last sequence number
-
handleJournalResponse
public boolean handleJournalResponse(JournalProtocol.Response response)
Description copied from interface:DataPersistenceProviderReceive and potentially handle aJournalProtocolresponse.- Specified by:
handleJournalResponsein interfaceDataPersistenceProvider- Parameters:
response- AJournalProtocolresponse- Returns:
trueif the response was handled
-
handleSnapshotResponse
public boolean handleSnapshotResponse(SnapshotProtocol.Response response)
Description copied from interface:DataPersistenceProviderReceive and potentially handle aSnapshotProtocolresponse.- Specified by:
handleSnapshotResponsein interfaceDataPersistenceProvider- Parameters:
response- ASnapshotProtocolresponse- Returns:
trueif the response was handled
-
-