|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.server.RemoteObject | +--java.rmi.server.RemoteServer | +--java.rmi.server.UnicastRemoteObject | +--org.recommender.server.CFEngineImpl
Implementation of the CFEngine interface.
Field Summary | |
java.lang.Class |
algorithm
|
java.lang.Object |
newAlgObj
|
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Constructor Summary | |
CFEngineImpl()
Constructor, do nothing. |
|
CFEngineImpl(java.lang.String propertiesFilename)
Constructor, create a DataManager with a mode: experiment, autotest, or server, instantiate an algorithm and start a DBManager which is reponsible for dynamic database access. |
Method Summary | |
float |
getErrRating()
Get the error rating for the current server configuration. |
ItemRating[] |
getItemRatingList(int itemID)
Return an array of userIDs who have rated the given item. |
float |
getMaxRating()
Get the maximum rating allowed for the current server configuration. |
float |
getMinRating()
Get the minimum rating allowed for the current server configuration. |
int |
getNextItemId()
|
int |
getNextUserId()
|
ItemPrediction |
getPredictedRating(int userID,
int itemID)
Get predicted rating for user's item. |
ItemPrediction[] |
getPredictedRatingList(int userID,
int[] itemID)
Gets predicted ratings for a list of items. |
ItemRating |
getRating(int userID,
int itemID)
Retrieves a rating for user' item from cache. |
ItemRating[] |
getRatingList(int userID,
int[] itemIDs)
Retrieves ratings for user's items from cache. |
ItemPrediction[] |
getRecommendations(int userID,
int number,
int offset)
Get top n recommendation for user. |
ItemPrediction[] |
getRecommendationsByType(int userID,
int number,
int offset,
int type)
Get top n recommendations for current user of specific type. |
java.lang.String |
getStatistics()
|
ItemRating[] |
getUserRatingList(int userID)
Return an array of itemIDs which the given user has rated. |
void |
removeRating(int user,
int item)
Remove the rating from both database and the cache. |
void |
removeRatingList(int user,
int[] itemIDs)
Removes list of ratings from users profile |
void |
setRating(int user,
int item,
float ratingValue)
Send a new rating the CFEngine server. |
int |
setRatingList(ItemRating[] newRatings)
Add a list of new ItemRatings to both database and the cache. |
void |
shutdown()
Graciously shut the server down. |
java.lang.String |
test()
Test wether the CFEngine is alive on the host. |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public java.lang.Class algorithm
public java.lang.Object newAlgObj
Constructor Detail |
public CFEngineImpl() throws java.rmi.RemoteException
java.rmi.RemoteException
public CFEngineImpl(java.lang.String propertiesFilename) throws java.rmi.RemoteException, CFInternalErrorException
propertiesFilename
- path and filename to the properties
file that defines the configuration of this server.
java.rmi.RemoteException
CFInternalErrorException
Method Detail |
public java.lang.String test() throws java.rmi.RemoteException
test
in interface CFEngine
java.rmi.RemoteException
public ItemRating getRating(int userID, int itemID) throws java.rmi.RemoteException, CFIllegalParameterException, CFInternalErrorException
getRating
in interface CFEngine
userID
- itemID
-
java.rmi.RemoteException
- Throws exception when connection to server is lost
CFIllegalParameterException
- Throws exception if userID or Item ID are out of range
CFInternalErrorException
public ItemRating[] getRatingList(int userID, int[] itemIDs) throws java.rmi.RemoteException, CFIllegalListParameterException, CFInternalErrorException
getRatingList
in interface CFEngine
userID
- itemIDs
-
java.rmi.RemoteException
CFIllegalListParameterException
- Throws exception if userID or itemID[] are invalid
CFInternalErrorException
public ItemPrediction[] getRecommendations(int userID, int number, int offset) throws java.rmi.RemoteException, CFIllegalParameterException, CFInternalErrorException
getRecommendations
in interface CFEngine
userID
- User to get recommendations for.number
- Number of recommendations to be retrieved.offset
- Returns number of recommendations, starting at the offset
java.rmi.RemoteException
- Thrown upon client/server connection error
CFIllegalParameterException
- Throws exception for invalid curUser, number or offset
CFInternalErrorException
public ItemPrediction[] getRecommendationsByType(int userID, int number, int offset, int type) throws java.rmi.RemoteException, CFIllegalParameterException, CFInternalErrorException
getRecommendationsByType
in interface CFEngine
userID
- User to get recommendations for.number
- Number of recommendations to be retrieved.offset
- Returns number of recommendations, starting at the offsettype
- Catagory to gat recommendations from.
java.rmi.RemoteException
- Thrown upon client/server connection error
CFIllegalParameterException
- Throws exception if curUser,number,offset, or type are out of range
CFInternalErrorException
public ItemPrediction getPredictedRating(int userID, int itemID) throws java.rmi.RemoteException, CFIllegalParameterException, CFInternalErrorException
getPredictedRating
in interface CFEngine
userID
- itemID
-
java.rmi.RemoteException
- Thrown upon client/server connection error
CFIllegalParameterException
- Thrown if userID or itemID are out of range
CFInternalErrorException
public ItemPrediction[] getPredictedRatingList(int userID, int[] itemID) throws java.rmi.RemoteException, CFIllegalListParameterException, CFInternalErrorException
getPredictedRatingList
in interface CFEngine
userID
- itemID
- a list of items
java.rmi.RemoteException
- Thrown upon client/server connection error
CFIllegalListParameterException
- Throws exception if userID or itemID[] are invalid
CFInternalErrorException
public ItemRating[] getUserRatingList(int userID) throws java.rmi.RemoteException, CFIllegalParameterException
getUserRatingList
in interface CFEngine
userID
-
java.rmi.RemoteException
- Thrown upon client/server connection error
CFIllegalParameterException
- Throws exception if userID is invalidpublic ItemRating[] getItemRatingList(int itemID) throws java.rmi.RemoteException, CFIllegalParameterException
getItemRatingList
in interface CFEngine
itemID
-
java.rmi.RemoteException
- Thrown upon client/server connection error
CFIllegalParameterException
- Throws exception if itemID is out of rangepublic void setRating(int user, int item, float ratingValue) throws java.rmi.RemoteException, CFIllegalParameterException, CFInternalErrorException
setRating
in interface CFEngine
user
- item
- ratingValue
-
java.rmi.RemoteException
- Thrown upon client/server connection error
CFIllegalParameterException
- Throws exception for out of range user,item, or rating
CFInternalErrorException
public int setRatingList(ItemRating[] newRatings) throws java.rmi.RemoteException, CFIllegalListParameterException, CFInternalErrorException
setRatingList
in interface CFEngine
newRatings
- a list of new ratings wanted to add
java.rmi.RemoteException
- Thrown upon client/server connection error
CFIllegalListParameterException
- Throws exception if ItemRating[] has invalid contents
CFInternalErrorException
public void removeRating(int user, int item) throws java.rmi.RemoteException, CFIllegalParameterException, CFInternalErrorException
removeRating
in interface CFEngine
user
- item
-
java.rmi.RemoteException
- Thrown upon client/server connection error
CFIllegalParameterException
- Throws exception for out of range user or item
CFInternalErrorException
public void removeRatingList(int user, int[] itemIDs) throws java.rmi.RemoteException, CFIllegalListParameterException, CFInternalErrorException
removeRatingList
in interface CFEngine
user
- itemIDs
-
java.rmi.RemoteException
- Thrown upon client/server connection error
CFIllegalListParameterException
- Throws exception if userID or itemID[] are invalid
CFInternalErrorException
public float getMaxRating() throws java.rmi.RemoteException
getMaxRating
in interface CFEngine
java.rmi.RemoteException
- Thrown upon client/server connection errorpublic float getMinRating() throws java.rmi.RemoteException
getMinRating
in interface CFEngine
java.rmi.RemoteException
- Thrown upon client/server connection errorpublic float getErrRating() throws java.rmi.RemoteException
getErrRating
in interface CFEngine
java.rmi.RemoteException
- Thrown upon client/server connection errorpublic int getNextUserId() throws java.rmi.RemoteException, CFInternalErrorException
getNextUserId
in interface CFEngine
java.rmi.RemoteException
CFInternalErrorException
public int getNextItemId() throws java.rmi.RemoteException, CFInternalErrorException
getNextItemId
in interface CFEngine
java.rmi.RemoteException
CFInternalErrorException
public java.lang.String getStatistics() throws java.rmi.RemoteException
getStatistics
in interface CFEngine
java.rmi.RemoteException
public void shutdown() throws java.rmi.RemoteException
shutdown
in interface CFEngine
java.rmi.RemoteException
|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |