|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cutunes.server.RequestHandler
RequestHandler specifies the format of the incoming XML-RPC messages. All messages requires some sort of access to the database, but all database logic has been separated into the DatabaseController class. The four methods below define the API used to communicate between the client and server, making for a very simple and easy to understand API.
Constructor Summary | |
RequestHandler()
Constructor gets an instance of the DatabaseController. |
Method Summary | |
boolean |
bulkLoadSongs(int userID,
boolean sendAllSongs,
java.util.Date lastSync,
java.lang.String version,
java.util.Vector songGroup)
This method received the user's song information over XML-RPC and adds it to the database. |
java.sql.Timestamp |
getLastSync(int userID,
java.lang.String version)
Queries database to get the time of the user's last sync. |
java.lang.Integer |
getUserID(java.lang.String username,
java.lang.String password,
java.lang.String version)
getUserID() performs basic login checks and returns the given user's unique ID number. |
boolean |
setLastSync(int userID,
java.lang.String version)
Sets the user's last sync time to the current time. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RequestHandler()
Method Detail |
public java.lang.Integer getUserID(java.lang.String username, java.lang.String password, java.lang.String version)
username
- String usernamepassword
- String passwordversion
- String identifying version of client software
public java.sql.Timestamp getLastSync(int userID, java.lang.String version)
userID
- Unique ID of userversion
- String identifying version of client software
public boolean setLastSync(int userID, java.lang.String version)
userID
- Unique ID of userversion
- String identifying version of client software
public boolean bulkLoadSongs(int userID, boolean sendAllSongs, java.util.Date lastSync, java.lang.String version, java.util.Vector songGroup)
The songsFile contains all the track information to put in the songs table of the database (this includes track name, album, artist, etc). This information is always loaded into the database using MySQLs bulk load function, even if it already exists in the table (in which case it is ignored).
The hasSongsFile contains all the information about the playcount and last play date of a specified song for a given user. It is written and bulk loaded only if the sendAllSongs boolean is true (which indicates this is a user's first sync). Otherwise this information is loaded using the DatabaseController's updateHasSong function (which updates weekly playcounts according to a specified algorithm).
userID
- Unique ID identifying usersendAllSongs
- Boolean variable is true if this is a user's first
sync, in which case the has_song table data is bulk
loadedlastSync
- The time of the user's last syncversion
- String identifying version of client softwaresongGroup
- Vector of SongData objects
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |