|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cutunes.client.ClientCommunicator
Client communicator defines the main point of communication between the client (through either a Java app or web-based applet) and the server. This class:
Method Summary | |
void |
addSongToQueue(java.util.Hashtable songHash)
Adds a single songHash object to a Vector of songHashes. |
static ClientCommunicator |
getInstance()
Java singleton getInstance() method insures only a single instance of the ClientCommunicator is ever instantiated. |
java.sql.Timestamp |
getLastSync(int userID)
Queries server to the get the Timestamp of a given user's last sync. |
int |
getUserID(java.lang.String username,
java.lang.String password)
Queries the server to get the userID integer based on that users username/password pair. |
static void |
main(java.lang.String[] args)
Simple main method will parse and sync current user's information based on command line parameters. |
static boolean |
parseAndSyncData(java.lang.String username,
java.lang.String password,
boolean usingApplet)
Instanitates ItunesXMLParser and parses the current user's iTunes XML file. |
void |
sendSongGroup(int userID,
java.lang.String user,
java.util.Vector songs)
Sends the current group of SongHashes in songs Vector to the server using XML-RPC. |
void |
sendSongQueueNow()
Sends any songHash objects queued in songGroup Vector to the server immediately using XML-RPC. |
void |
setLastSync(int userID)
Queries the server to set the last sync time for the giving user to the current time. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static ClientCommunicator getInstance()
public int getUserID(java.lang.String username, java.lang.String password)
username
- String usernamepassword
- String password
public java.sql.Timestamp getLastSync(int userID)
userID
- UserID to get last sync for
public void setLastSync(int userID)
userID
- UserID to set last sync time forpublic void addSongToQueue(java.util.Hashtable songHash)
songHash
- SongHash object to add the queuepublic void sendSongQueueNow()
public void sendSongGroup(int userID, java.lang.String user, java.util.Vector songs)
userID
- UserID of current useruser
- Username of current usersongs
- Vector of songHash objects to sendpublic static boolean parseAndSyncData(java.lang.String username, java.lang.String password, boolean usingApplet)
If the user has never synced before, all songs will be sent to the server. Otherwise, only songs that have been played since the last sync will be sent. At the end of parsing/sending songs, the users last sync time will be updated to the current time.
If an applet is used to run this method (the usingApplet boolean is true) the applet status box will be updated.
username
- Username of current userpassword
- Password of current userusingApplet
- Whether an applet is called this method or not
public static void main(java.lang.String[] args)
args
- Requires USERNAME PASSWORD parameters
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |