Class LogRepositoryImplementation<T extends EventLog>
java.lang.Object
io.github.tkasozi.repository.redis.LogRepositoryImplementation<T>
- Type Parameters:
T
-EventLog
- All Implemented Interfaces:
LogRepository<T>
public class LogRepositoryImplementation<T extends EventLog>
extends Object
implements LogRepository<T>
Extra functionality.
-
Constructor Summary
ConstructorsConstructorDescriptionLogRepositoryImplementation
(@NonNull org.springframework.data.keyvalue.core.KeyValueOperations keyValueOperations, @NonNull Class<T> clazz) Required args constructor. -
Method Summary
Modifier and TypeMethodDescriptionSorts by date.getByTimeOffset
(Long timeOffset) Filters out events by timeOffset.
-
Constructor Details
-
LogRepositoryImplementation
public LogRepositoryImplementation(@NonNull @NonNull org.springframework.data.keyvalue.core.KeyValueOperations keyValueOperations, @NonNull @NonNull Class<T> clazz) Required args constructor.- Parameters:
keyValueOperations
- For redis operations.clazz
- For casting stored data.
-
-
Method Details
-
getAllSortedByDate
Sorts by date.- Specified by:
getAllSortedByDate
in interfaceLogRepository<T extends EventLog>
- Returns:
- A list of sorted events.
-
getByTimeOffset
Filters out events by timeOffset.- Specified by:
getByTimeOffset
in interfaceLogRepository<T extends EventLog>
- Parameters:
timeOffset
- Cut off time.- Returns:
- List of logs within the given offset.
-