@Shareable @DefaultProvider(value=RatingSnapshotDAO.Builder.class) public class RatingSnapshotDAO extends Object implements EventDAO, UserEventDAO, ItemEventDAO, UserDAO, ItemDAO, Serializable
A DAO that has a snapshot of the rating data. This snapshot is stored in a BinaryRatingDAO.
| Modifier and Type | Class and Description |
|---|---|
static class |
RatingSnapshotDAO.Builder |
| 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.
|
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.
|
LongSet |
getItemIds()
Get all known item IDs.
|
LongSet |
getUserIds()
Get all known user IDs.
|
LongSet |
getUsersForItem(long item)
Get the users who have interacted with an item.
|
ObjectStream<Event> |
streamEvents()
Stream all events.
|
<E extends Event> |
streamEvents(Class<E> type)
Stream all events of a given type.
|
<E extends Event> |
streamEvents(Class<E> type,
SortOrder order)
Stream all events of a given type in a specified order.
|
ObjectStream<ItemEventCollection<Event>> |
streamEventsByItem()
Stream events grouped by item.
|
<E extends Event> |
streamEventsByItem(Class<E> type)
Stream events grouped by item.
|
ObjectStream<UserHistory<Event>> |
streamEventsByUser()
Stream events grouped by user.
|
<E extends Event> |
streamEventsByUser(Class<E> type)
Stream events grouped by user.
|
public ObjectStream<Event> streamEvents()
EventDAOStream all events.
streamEvents in interface EventDAOpublic <E extends Event> ObjectStream<E> streamEvents(Class<E> type)
EventDAOStream all events of a given type.
streamEvents in interface EventDAOtype - The event type.public <E extends Event> ObjectStream<E> streamEvents(Class<E> type, SortOrder order)
EventDAOStream all events of a given type in a specified order.
streamEvents in interface EventDAOtype - The event type.order - The order.public LongSet getItemIds()
ItemDAOGet all known item IDs.
getItemIds in interface ItemDAOpublic ObjectStream<ItemEventCollection<Event>> streamEventsByItem()
ItemEventDAOStream events grouped by item.
streamEventsByItem in interface ItemEventDAOpublic <E extends Event> ObjectStream<ItemEventCollection<E>> streamEventsByItem(Class<E> type)
ItemEventDAOStream events grouped by item.
streamEventsByItem in interface ItemEventDAOtype - 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)
ItemEventDAOGet the events for a specific item.
getEventsForItem in interface ItemEventDAOitem - The item ID.null if the item is unknown.@Nullable public <E extends Event> List<E> getEventsForItem(long item, Class<E> type)
ItemEventDAOGet the events for a specific item, filtering by type.
getEventsForItem in interface ItemEventDAOitem - The item ID.type - The type of events to retrieve.null if the item is unknown.@Nullable public LongSet getUsersForItem(long item)
ItemEventDAOGet the users who have interacted with an item.
getUsersForItem in interface ItemEventDAOitem - The item ID.null if the item is unknown.public LongSet getUserIds()
UserDAOGet all known user IDs.
getUserIds in interface UserDAOpublic ObjectStream<UserHistory<Event>> streamEventsByUser()
UserEventDAOStream events grouped by user.
streamEventsByUser in interface UserEventDAOpublic <E extends Event> ObjectStream<UserHistory<E>> streamEventsByUser(Class<E> type)
UserEventDAOStream events grouped by user.
streamEventsByUser in interface UserEventDAOtype - 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.@Nullable public UserHistory<Event> getEventsForUser(long user)
UserEventDAOGet the events for a specific user.
getEventsForUser in interface UserEventDAOuser - The user ID.null if the user is unknown.@Nullable public <E extends Event> UserHistory<E> getEventsForUser(long user, Class<E> type)
UserEventDAOGet the events for a specific user, filtering by type.
getEventsForUser in interface UserEventDAOuser - The user ID.type - The type of events to retrieve.null if the user is unknown.