public class BridgeItemEventDAO extends Object implements ItemEventDAO
Bridge to transition item event DAO use to new DAOs.
Modifier and Type | Class and Description |
---|---|
static class |
BridgeItemEventDAO.DynamicProvider |
Constructor and Description |
---|
BridgeItemEventDAO(DataAccessObject dao)
Construct a new bridge item DAO.
|
Modifier and Type | Method and Description |
---|---|
List<Event> |
getEventsForItem(long item)
Get the events for a specific item.
|
<E extends Event> |
getEventsForItem(long item,
Class<E> type)
Get the events for a specific item, filtering by type.
|
LongSet |
getUsersForItem(long item)
Get the users who have interacted with an item.
|
ObjectStream<ItemEventCollection<Event>> |
streamEventsByItem()
Stream events grouped by item.
|
<E extends Event> |
streamEventsByItem(Class<E> type)
Stream events grouped by item.
|
@Inject public BridgeItemEventDAO(DataAccessObject dao)
Construct a new bridge item DAO.
dao
- The underlying DAO.public ObjectStream<ItemEventCollection<Event>> streamEventsByItem()
ItemEventDAO
Stream events grouped by item.
streamEventsByItem
in interface ItemEventDAO
public <E extends Event> ObjectStream<ItemEventCollection<E>> streamEventsByItem(Class<E> type)
ItemEventDAO
Stream events grouped by item.
streamEventsByItem
in interface ItemEventDAO
type
- The type of item to look for.type
from all items. If an item exists but does not have any events, it may or may not be included depending on the DAO implementation.public List<Event> getEventsForItem(long item)
ItemEventDAO
Get the events for a specific item.
getEventsForItem
in interface ItemEventDAO
item
- The item ID.null
if the item is unknown.@Nullable public <E extends Event> List<E> getEventsForItem(long item, Class<E> type)
ItemEventDAO
Get the events for a specific item, filtering by type.
getEventsForItem
in interface ItemEventDAO
item
- The item ID.type
- The type of events to retrieve.null
if the item is unknown.@Nullable public LongSet getUsersForItem(long item)
ItemEventDAO
Get the users who have interacted with an item.
getUsersForItem
in interface ItemEventDAO
item
- The item ID.null
if the item is unknown.