CFEngine API

org.recommender.server
Class DBManager

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.recommender.server.DBManager
All Implemented Interfaces:
java.lang.Runnable

public class DBManager
extends java.lang.Thread

Implementation of the DBManager. This class handles the database accesses necessary to the CF Engine Application. This includes reading and writing out User Info, Item Info, Ratings Info. The interface should be generic enough.

Author:
Olivier Godde

Field Summary
static long minimumRunIntervalMs
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DBManager()
          Constructor, get the database to contact with and establish connection with it.
 
Method Summary
 java.lang.String getItemFieldName()
          Accessor, return itemFieldName
 int getMaxItem()
          Accessor, return maxItems
 int getMaxUser()
          Accessor, return maxUsers
 java.lang.String getRatingFieldName()
          Accessor, return ratingFiledName
 java.lang.String getRatingTableName()
          Accessor, return ratingTableName
 java.lang.String getUserFieldName()
          Accessor, return userFieldName
 void run()
          An infinite loop, whenever the size of DBList is greater than 50, get a copy of the dblist and insert all ratings in the list into database.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

minimumRunIntervalMs

public static final long minimumRunIntervalMs
See Also:
Constant Field Values
Constructor Detail

DBManager

public DBManager()
Constructor, get the database to contact with and establish connection with it.

Method Detail

run

public void run()
An infinite loop, whenever the size of DBList is greater than 50, get a copy of the dblist and insert all ratings in the list into database.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

getRatingTableName

public java.lang.String getRatingTableName()
Accessor, return ratingTableName

Returns:
ratingTableName

getUserFieldName

public java.lang.String getUserFieldName()
Accessor, return userFieldName

Returns:
userFieldName

getItemFieldName

public java.lang.String getItemFieldName()
Accessor, return itemFieldName

Returns:
itemFieldName

getRatingFieldName

public java.lang.String getRatingFieldName()
Accessor, return ratingFiledName

Returns:
ratingFieldName

getMaxUser

public int getMaxUser()
Accessor, return maxUsers

Returns:
maxUsers

getMaxItem

public int getMaxItem()
Accessor, return maxItems

Returns:
maxItems

CFEngine API

Copyright © 2003 - Oregon State University www.orst.edu