@ParametersAreNonnullByDefault public class RecordingStoreListener extends Object implements StoreListener
StoreListener
that records every calls to build usage statistics.StoreStats
Constructor and Description |
---|
RecordingStoreListener(StoreStats stats)
Constructs a new
RecordingStoreListener . |
Modifier and Type | Method and Description |
---|---|
void |
onClose()
Handles the closure of the back-end.
|
<K,V> void |
onFailure(FailureCallReport<K,V> callReport)
Handles a failed call on the back-end.
|
void |
onInitialize()
Handles the initialization of the back-end.
|
<K,V,R> void |
onSuccess(SuccessCallReport<K,V,R> callReport)
Handles a succeeded call on the back-end.
|
StoreStats |
stats() |
public RecordingStoreListener(StoreStats stats)
RecordingStoreListener
.stats
- the stats to update@Nonnull public StoreStats stats()
public void onInitialize()
StoreListener
This method is called after the initialization of the back-end.
onInitialize
in interface StoreListener
public <K,V,R> void onSuccess(SuccessCallReport<K,V,R> callReport)
StoreListener
onSuccess
in interface StoreListener
K
- the type of the key used during the call; nullableV
- the type of the value used during the call; nullableR
- the type of the result of the call; nullablecallReport
- information about the callpublic <K,V> void onFailure(FailureCallReport<K,V> callReport)
StoreListener
onFailure
in interface StoreListener
K
- the type of the key used during the call; nullableV
- the type of the value used during the call; nullablecallReport
- information about the callpublic void onClose()
StoreListener
This method is called after closing the back-end.
onClose
in interface StoreListener
Copyright © 2013–2019 Atlanmod. All rights reserved.