|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.recommender.server.DBList
Implements a queue of ratings to be written to the database. 1 Accessor method to modify the queue (add ratings) shall be called by client threads, 2 Accessor method to get the content of the queue shall be called by DBManager thread, Thread safe property is guaranted by using Object monitors to provide synchronization.
Constructor Summary | |
DBList()
|
Method Summary | |
static void |
flush()
Flushes the list of queries, forcing execution of all the pending database requests. |
static java.lang.String |
getItemFieldName()
Accessor, return itemFieldName. |
static java.util.LinkedList |
getQueries()
Accessor function, to be called by DBManager Thread. |
static java.lang.String |
getRatingFieldName()
Accessor, return ratingFieldName. |
static java.lang.String |
getRatingTableName()
Accessor, return ratingTableName. |
static java.lang.String |
getUserFieldName()
Accessor, return userFieldName. |
static void |
init(java.lang.String ratingTable,
java.lang.String userField,
java.lang.String itemField,
java.lang.String ratingField)
Initialize the table this DBList will contact with. |
static void |
insertOrReplaceRating(ItemRating rating)
Insert clients' ratings into the table. |
static void |
removeRating(int userID,
int itemID)
Remove clients' ratings from the table. |
static void |
updateRating(ItemRating rating)
Update clients' ratings in the table. |
static void |
wakeUpFlushingThread()
Wakes up a Thread that executed a "flush" operation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DBList()
Method Detail |
public static void init(java.lang.String ratingTable, java.lang.String userField, java.lang.String itemField, java.lang.String ratingField)
ratingTable
- userField
- itemField
- ratingField
- public static void insertOrReplaceRating(ItemRating rating)
public static void removeRating(int userID, int itemID)
public static void updateRating(ItemRating rating)
public static void flush()
public static void wakeUpFlushingThread()
public static java.util.LinkedList getQueries()
public static java.lang.String getRatingTableName()
public static java.lang.String getUserFieldName()
public static java.lang.String getItemFieldName()
public static java.lang.String getRatingFieldName()
|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |