public class BridgeUserEventDAO extends Object implements UserEventDAO
Bridge to transition user event DAO use to new DAOs.
Modifier and Type | Class and Description |
---|---|
static class |
BridgeUserEventDAO.DynamicProvider |
Constructor and Description |
---|
BridgeUserEventDAO(DataAccessObject dao)
Construct a new bridge user DAO.
|
Modifier and Type | Method and Description |
---|---|
UserHistory<Event> |
getEventsForUser(long user)
Get the events for a specific user.
|
<E extends Event> |
getEventsForUser(long user,
Class<E> type)
Get the events for a specific user, filtering by type.
|
ObjectStream<UserHistory<Event>> |
streamEventsByUser()
Stream events grouped by user.
|
<E extends Event> |
streamEventsByUser(Class<E> type)
Stream events grouped by user.
|
@Inject public BridgeUserEventDAO(DataAccessObject dao)
Construct a new bridge user DAO.
dao
- The underlying DAO.public ObjectStream<UserHistory<Event>> streamEventsByUser()
UserEventDAO
Stream events grouped by user.
streamEventsByUser
in interface UserEventDAO
public <E extends Event> ObjectStream<UserHistory<E>> streamEventsByUser(Class<E> type)
UserEventDAO
Stream events grouped by user.
streamEventsByUser
in interface UserEventDAO
type
- The type of item to look for.type
. If a user exists, but does not have any history, they may or may not be included depending on the DAO implementation.public UserHistory<Event> getEventsForUser(long user)
UserEventDAO
Get the events for a specific user.
getEventsForUser
in interface UserEventDAO
user
- The user ID.null
if the user is unknown.@Nullable public <E extends Event> UserHistory<E> getEventsForUser(long user, Class<E> type)
UserEventDAO
Get the events for a specific user, filtering by type.
getEventsForUser
in interface UserEventDAO
user
- The user ID.type
- The type of events to retrieve.null
if the user is unknown.