|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.learner.history.LearnerHistoryImpl
public class LearnerHistoryImpl
Hibernate-based implementation of the LearnerHistory interface.
The query methods make use of the HistoryQuery object, which can be used to
constrain the database columns to include or exclude desired values. The supplied query
methods allow for the pagination of the result set if it happens to be getting too large.
HistoryQuery| Field Summary | |
|---|---|
protected static Logger |
log
|
| Constructor Summary | |
|---|---|
LearnerHistoryImpl()
Basic Constructor |
|
| Method Summary | |
|---|---|
boolean |
alreadySeen(String learnerId,
String itemId)
returns true if an ItemPresentedEvent for the item with the given itemId can ba found,
false otherwise. |
ActivemathEvent |
fetchEvent(long id)
Fetches an ActivemathEventof which the id
is known from the database. if there is no such event, the method returns
null. |
List |
getHistoryEntries(HistoryQuery query)
Returns a list of all stored events that match the supplied query. |
List |
getHistoryEntries(HistoryQuery query,
int firstResult,
int maxResults)
Returns a sublist of the results of the given query, starting at the position
firstResult of the complete result list and having a length of at most maxResults. |
int |
getNumResults(HistoryQuery query)
gets the number of events stored in the database that match the given query. |
void |
onActivemathEvent(ActivemathEvent event)
The EventListener method. |
void |
onActivemathEvents(List<ActivemathEvent> events)
Handle a list of Activemath events. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Logger log
| Constructor Detail |
|---|
public LearnerHistoryImpl()
| Method Detail |
|---|
public void onActivemathEvent(ActivemathEvent event)
onActivemathEvent in interface ActivemathEventListenerevent - the event to respond toActivemathEventListenerpublic void onActivemathEvents(List<ActivemathEvent> events)
ActivemathEventListenerBatchedThis method must return as quickly as possible and must not block the calling thread for long.
onActivemathEvents in interface ActivemathEventListenerBatchedActivemathEventListenerBatchedpublic ActivemathEvent fetchEvent(long id)
ActivemathEventof which the id
is known from the database. if there is no such event, the method returns
null.
fetchEvent in interface LearnerHistoryid - The id of the event to fetch
ActivemathEvent, or
null idf no such event was found.org.activemath.xlm.history.XlmHistory#fetchEvent(long)public List getHistoryEntries(HistoryQuery query)
query.
Be aware that this list might be really big. You might consider calling getNumResults(org.activemath.learner.history.HistoryQuery)
first and then using getHistoryEntries(HistoryQuery, int, int).
getHistoryEntries in interface LearnerHistoryquery -
query.
public List getHistoryEntries(HistoryQuery query,
int firstResult,
int maxResults)
query, starting at the position
firstResult of the complete result list and having a length of at most maxResults.
If either firstResult or maxResults is negative (or zero for maxResults),
the corresponding value is ignored.
- Specified by:
getHistoryEntries in interface LearnerHistory
- Parameters:
query - the query to be executedfirstResult - The position of the first result to be included in the returned list. Has to be non-negative.maxResults - The number of results to include in the returned list. Has to be greater than zero.
- Returns:
- The sublist of the overall query results starting with the result at the given position and having at most the given length.
public int getNumResults(HistoryQuery query)
query. CAVEAT: Due to filtering of void events, this may
not be the actual number of events returned by getHistoryEntries()!
getNumResults in interface LearnerHistoryquery - The HistoryQueryto get the number of matching events
for.
query
public boolean alreadySeen(String learnerId,
String itemId)
LearnerHistorytrue if an ItemPresentedEvent for the item with the given itemId can ba found,
false otherwise.
alreadySeen in interface LearnerHistory
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||