com.flickrrecsys.db
Class DbSettings

java.lang.Object
  extended by com.flickrrecsys.db.DbSettings

public class DbSettings
extends java.lang.Object

Connecting to settings table in the database

Author:
Hossein Ghodsi

Constructor Summary
DbSettings(java.lang.String path)
          Constructor which gets the connection to the database
 
Method Summary
 boolean alreadyExist(java.lang.String nsid)
          Check if the record has already been added
 Settings getUserSettings(java.lang.String nsid)
          Get user settings
 int insert(java.lang.String nsid)
          Insert default settings
 void updateContactLastUpdate(int sid, java.sql.Timestamp contactLastUpdate)
          Update contactlastupdate
 void updateFavoLastUpdate(int sid, java.sql.Timestamp favoLastUpdate)
          Update favolastupdate
 void updateGroupLastUpdate(int sid, java.lang.String nsid, java.sql.Timestamp groupLastUpdate)
          Update group last update
 void updateInfoLastUpdate(int sid, java.sql.Timestamp infoLastUpdate)
          Update infolastupdate
 void updateLimitCoac(int sid, int limitCoac)
          Update limitcoac
 void updateLimitFavo(int sid, int limitFavo)
          Update limitfavo
 void updateLimitTs(int sid, int limitTs)
          Update limitts
 void updateNoCoac(int sid, int noCoac)
          Update number of contact
 void updatePerformedTasks(int sid, java.lang.String performedTasks)
          Update performed tasks
 void updateTagLastUpdate(int sid, java.sql.Timestamp tagLastUpdate)
          Update taglastupdate
 void updateTagSimilarity(int sid, float tagSimilarity)
          Update tag similarity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbSettings

public DbSettings(java.lang.String path)
Constructor which gets the connection to the database

Parameters:
path - to where the database details are
Method Detail

insert

public int insert(java.lang.String nsid)
           throws java.sql.SQLException,
                  java.security.NoSuchAlgorithmException,
                  java.io.UnsupportedEncodingException
Insert default settings

Parameters:
nsid - user id from the flickr website
Returns:
row affected
Throws:
java.sql.SQLException
java.security.NoSuchAlgorithmException
java.io.UnsupportedEncodingException

alreadyExist

public boolean alreadyExist(java.lang.String nsid)
                     throws java.sql.SQLException
Check if the record has already been added

Parameters:
nsid - user id from the flickr website
Returns:
true or false
Throws:
java.sql.SQLException

updateInfoLastUpdate

public void updateInfoLastUpdate(int sid,
                                 java.sql.Timestamp infoLastUpdate)
                          throws java.sql.SQLException
Update infolastupdate

Parameters:
sid - settings id
infoLastUpdate - date and time
Throws:
java.sql.SQLException

updateContactLastUpdate

public void updateContactLastUpdate(int sid,
                                    java.sql.Timestamp contactLastUpdate)
                             throws java.sql.SQLException
Update contactlastupdate

Parameters:
sid - settings id
contactLastUpdate - date and time
Throws:
java.sql.SQLException

updateTagLastUpdate

public void updateTagLastUpdate(int sid,
                                java.sql.Timestamp tagLastUpdate)
                         throws java.sql.SQLException
Update taglastupdate

Parameters:
sid - settings id
tagLastUpdate - date and time
Throws:
java.sql.SQLException

updateGroupLastUpdate

public void updateGroupLastUpdate(int sid,
                                  java.lang.String nsid,
                                  java.sql.Timestamp groupLastUpdate)
                           throws java.sql.SQLException
Update group last update

Parameters:
sid - settings id
nsid - user id from the flickr website
groupLastUpdate - date and time
Throws:
java.sql.SQLException

updateFavoLastUpdate

public void updateFavoLastUpdate(int sid,
                                 java.sql.Timestamp favoLastUpdate)
                          throws java.sql.SQLException
Update favolastupdate

Parameters:
sid - settings id
favoLastUpdate - date and time
Throws:
java.sql.SQLException

updateTagSimilarity

public void updateTagSimilarity(int sid,
                                float tagSimilarity)
                         throws java.sql.SQLException
Update tag similarity

Parameters:
sid - settings id
tagSimilarity - date and time
Throws:
java.sql.SQLException

updateNoCoac

public void updateNoCoac(int sid,
                         int noCoac)
                  throws java.sql.SQLException
Update number of contact

Parameters:
sid - settings id
noCoac - number of contact
Throws:
java.sql.SQLException

updatePerformedTasks

public void updatePerformedTasks(int sid,
                                 java.lang.String performedTasks)
                          throws java.sql.SQLException
Update performed tasks

Parameters:
sid - settings id
performedTasks - performed tasks
Throws:
java.sql.SQLException

getUserSettings

public Settings getUserSettings(java.lang.String nsid)
                         throws java.sql.SQLException
Get user settings

Parameters:
nsid - user id from the flickr website
Returns:
Settings object
Throws:
java.sql.SQLException

updateLimitFavo

public void updateLimitFavo(int sid,
                            int limitFavo)
                     throws java.sql.SQLException
Update limitfavo

Parameters:
sid - settings id
limitFavo - number of results to be displayed
Throws:
java.sql.SQLException

updateLimitCoac

public void updateLimitCoac(int sid,
                            int limitCoac)
                     throws java.sql.SQLException
Update limitcoac

Parameters:
sid - settings id
limitCoac - number of coac to be displayed
Throws:
java.sql.SQLException

updateLimitTs

public void updateLimitTs(int sid,
                          int limitTs)
                   throws java.sql.SQLException
Update limitts

Parameters:
sid - settings id
limitTs - number of contacts to be displayed
Throws:
java.sql.SQLException