|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Describes the interface for the CF Engine. Contains methods that will be invoked by remote clients of the CF Engine (CFEngineClient) and will be implemented by the implementation class (CFEngineImpl) and created by a CF Engine server (CFEngineServer).
Method Summary | |
float |
getErrRating()
Get the error rating for the current server configuration. |
ItemRating[] |
getItemRatingList(int itemID)
Return an array of all known ratings for 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 a user's predicted rating for an item. |
ItemPrediction[] |
getPredictedRatingList(int userID,
int[] itemID)
Gets predicted ratings for a list of items. |
ItemRating |
getRating(int userID,
int itemID)
Retrieves one user's rating for a given item. |
ItemRating[] |
getRatingList(int userID,
int[] itemIDs)
Retrieves the ratings by the user for a list of given items. |
ItemPrediction[] |
getRecommendations(int curUser,
int number,
int offset)
Get ten items with high predicted ratings for current user. |
ItemPrediction[] |
getRecommendationsByType(int curUser,
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 all known ratings for the given user. |
void |
removeRating(int user,
int item)
Removes rating from both database and cache. |
void |
removeRatingList(int user,
int[] itemIDs)
Removes list of ratings from users profile. |
void |
setRating(int user,
int item,
float rating)
Add new rating to both database and the cache. |
int |
setRatingList(ItemRating[] newRatings)
Add a list of new ItemRatings to both database and the cache. |
void |
shutdown()
Shuts the server down. |
java.lang.String |
test()
Test whether the CFEngine is alive on the host. |
Method Detail |
public java.lang.String test() throws java.rmi.RemoteException
java.rmi.RemoteException
public void setRating(int user, int item, float rating) throws java.rmi.RemoteException, CFIllegalParameterException, CFInternalErrorException
user
- item
- rating
-
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
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
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
user
- itemIDs
-
java.rmi.RemoteException
- Thrown upon client/server connection error
CFIllegalListParameterException
- Throws exception if userID or itemID are invalid
CFInternalErrorException
public ItemRating getRating(int userID, int itemID) throws java.rmi.RemoteException, CFIllegalParameterException, CFInternalErrorException
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
userID
- itemIDs
-
java.rmi.RemoteException
CFIllegalListParameterException
- Throws exception if userID or itemID[] are invalid
CFInternalErrorException
public ItemPrediction getPredictedRating(int userID, int itemID) throws java.rmi.RemoteException, CFIllegalParameterException, CFInternalErrorException
userID
- itemID
-
java.rmi.RemoteException
- Thrown upon client/server connection error
CFIllegalParameterException
- Thrown if userID or itemID are out of range
CFInternalErrorException
public ItemPrediction[] getRecommendations(int curUser, int number, int offset) throws java.rmi.RemoteException, CFIllegalParameterException, CFInternalErrorException
curUser
- 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[] getPredictedRatingList(int userID, int[] itemID) throws java.rmi.RemoteException, CFIllegalListParameterException, CFInternalErrorException
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
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
itemID
-
java.rmi.RemoteException
- Thrown upon client/server connection error
CFIllegalParameterException
- Throws exception if itemID is out of rangepublic void shutdown() throws java.rmi.RemoteException
java.rmi.RemoteException
public ItemPrediction[] getRecommendationsByType(int curUser, int number, int offset, int type) throws java.rmi.RemoteException, CFIllegalParameterException, CFInternalErrorException
curUser
- 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 float getMaxRating() throws java.rmi.RemoteException
java.rmi.RemoteException
- Thrown upon client/server connection errorpublic float getMinRating() throws java.rmi.RemoteException
java.rmi.RemoteException
- Thrown upon client/server connection errorpublic float getErrRating() throws java.rmi.RemoteException
java.rmi.RemoteException
- Thrown upon client/server connection errorpublic int getNextUserId() throws java.rmi.RemoteException, CFInternalErrorException
java.rmi.RemoteException
CFInternalErrorException
public int getNextItemId() throws java.rmi.RemoteException, CFInternalErrorException
java.rmi.RemoteException
CFInternalErrorException
public java.lang.String getStatistics() throws java.rmi.RemoteException
java.rmi.RemoteException
|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |