Class JdbcSecurityEventRepository
java.lang.Object
com.irurueta.authserver.authorization.infrastructure.persistence.mfa.JdbcSecurityEventRepository
- All Implemented Interfaces:
SecurityEventRepository
@Repository
public class JdbcSecurityEventRepository
extends Object
implements SecurityEventRepository
SecurityEventRepository over the security_events table.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringQuery returning the latest events of a user, newest first.private static final StringStatement storing an event; the database generates its identifier.private final org.springframework.jdbc.core.simple.JdbcClientJDBC client used to run the statements.private final SecurityEventRowMapperMaps a row to an event. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindRecentByUser(UUID userId, int limit) Lists the most recent events of a user, newest first.voidstore(SecurityEvent event) Stores an event.
-
Field Details
-
INSERT_EVENT
Statement storing an event; the database generates its identifier.- See Also:
-
FIND_RECENT_BY_USER
Query returning the latest events of a user, newest first.- See Also:
-
jdbcClient
private final org.springframework.jdbc.core.simple.JdbcClient jdbcClientJDBC client used to run the statements. -
securityEventRowMapper
Maps a row to an event.
-
-
Constructor Details
-
JdbcSecurityEventRepository
public JdbcSecurityEventRepository()
-
-
Method Details
-
store
Description copied from interface:SecurityEventRepositoryStores an event.- Specified by:
storein interfaceSecurityEventRepository- Parameters:
event- the event to store.
-
findRecentByUser
Description copied from interface:SecurityEventRepositoryLists the most recent events of a user, newest first.- Specified by:
findRecentByUserin interfaceSecurityEventRepository- Parameters:
userId- identifier of the user.limit- maximum number of events to return.- Returns:
- the events, possibly empty.
-