|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectserver.DatabaseConnect
public class DatabaseConnect
this class is responsible for the database connect and executes sql queries
| Constructor Summary | |
|---|---|
DatabaseConnect()
|
|
| Method Summary | |
|---|---|
boolean |
addInteract(long fromUser,
long toUser)
method which logs who contacts who |
boolean |
addToContactList(long addUserId,
long userId)
method which adds a user to another users contact list |
boolean |
changePreferences(UserVerification userver,
StandardUser user)
updating the user preferences like changing nickname, changing email ... |
boolean |
checkIfInteractionUserHasVoted(long interactionUserUserId,
long itemId)
method checks a interaction user (i have chatted with) has voted for the same item |
boolean |
checkIfUserIsOwner(long userId,
long moduleId)
This method checks if a user is the owner of a module |
boolean |
checkLogin(UserVerification userver)
method which checks if the userlogin (username and password) is correct |
boolean |
checkPowerUserRequirements(long userId)
check if user is ready to become a power user or reject if the user does not fulfill the requirements to be a power user requirements to be a PowerUser: - vote 3 times a day or - vote 12 times a week or - vote 30 times a month or else - be a StandardUser |
boolean |
close()
method to close an existing database connection |
long |
createAccount(StandardUser user)
method to create a new useraccount |
boolean |
createModule(java.lang.String name,
java.lang.String language,
java.lang.String description,
java.lang.String question,
long ownerid)
method to create a new module |
boolean |
deleteContact(long deleteUserId,
long userId)
Method to delete a contact from the power user contactlist |
boolean |
deleteModule(long moduleId)
deletes a specified module |
boolean |
deleteSubscription(long userId)
deletes all subscribed modules of a specified user (long userId) |
boolean |
deleteSubscription(long userId,
long moduleId)
deletes a module subscription (long moduleId) of a specified user (long userId) |
boolean |
editOwnModule(long ownerid,
long moduleId,
java.lang.String name,
java.lang.String language,
java.lang.String description,
java.lang.String question)
method for a user to edit his own modules |
java.util.Vector<Item> |
getAllModuleItems(long moduleId)
|
java.util.Vector<StandardUser> |
getContactListStandardUser(long userId)
|
java.util.Vector<java.lang.Integer> |
getContactListUserIds(long userId)
|
java.util.Vector<java.lang.Integer> |
getInteractionUserId(long userId,
java.lang.String startDate,
java.lang.String endDate)
get interaction user ids for a specified time range |
java.util.Vector<StandardUser> |
getInteractionUsers(Item item,
long userId)
gets possible users for interaction (chat) |
java.util.Vector<Module> |
getModules(java.lang.String lang)
get all modules of the same language |
java.util.Vector<Module> |
getOwnModules(long userId)
returns modules, that the user from Userverification has created |
java.util.Vector<Item> |
getPersonalizedToplist(long userId,
long moduleId)
simple toplist like the getToplist method with the following difference this toplist is only for PowerUsers. the ranking of the items of the toplist is different it will be checked if the PowerUser who requests the PersonalizedToplist has interacted with another user who has voted for this item. if this condition is true the item will be ranked higher. |
PowerUser |
getPowerUser(UserVerification userver)
method which returns a PowerUser object if a user is a PowerUser |
java.util.ArrayList<java.lang.String> |
getSpamwords()
|
StandardUser |
getStandardUser(UserVerification userver)
|
StandardUser |
getStandardUserByUserId(long userId)
|
java.util.Vector<Module> |
getSubscribedModules(long userId)
getting all subscribed modules for a specified userId |
java.util.Vector<Item> |
getToplist(long moduleId)
method which returns a vector with all items for a specified module sorted by votes (toplist) this toplist shows the DAILY ranking of the items! |
java.util.Vector<Item> |
getToplistDuration(long moduleId,
int days)
method which returns a vector with all items for a specified module sorted by votes (toplist) this toplist shows the ranking of the items in a specific time range (int days) including today |
int |
getUserType(UserVerification userver)
method which gets the user type |
boolean |
hasVotedForItem(long userId,
long itemId)
|
boolean |
insertSubscribedModules(long moduleId,
long userId)
add new subscribed modules (update) |
boolean |
open()
method to open a new database connection |
boolean |
setChoice(long userId,
long itemId)
vote for items of a module |
boolean |
setChoice(long userId,
long moduleId,
java.lang.String newItemName,
java.lang.String url)
vote for items of a module while creating a new item |
boolean |
updateUserTypeFlag(long userId,
int userType)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DatabaseConnect()
| Method Detail |
|---|
public boolean open()
throws java.lang.Throwable
java.lang.Throwablepublic boolean close()
public long createAccount(StandardUser user)
throws java.lang.Throwable
user -
java.lang.Throwable
public boolean createModule(java.lang.String name,
java.lang.String language,
java.lang.String description,
java.lang.String question,
long ownerid)
throws java.lang.Throwable
name - of the modulequestion - for the moduledescription - for the module
java.lang.Throwable
public boolean setChoice(long userId,
long itemId)
throws java.lang.Throwable
userId - itemId -
java.lang.Throwable
public boolean setChoice(long userId,
long moduleId,
java.lang.String newItemName,
java.lang.String url)
throws java.lang.Throwable
userId - moduleId - newItemName - url -
java.lang.Throwable
public boolean addInteract(long fromUser,
long toUser)
throws java.lang.Throwable
fromUser - toUser -
java.lang.Throwable
public boolean addToContactList(long addUserId,
long userId)
throws java.lang.Throwable
addUserId - userId -
java.lang.Throwable
public boolean insertSubscribedModules(long moduleId,
long userId)
moduleId - userId -
public boolean checkLogin(UserVerification userver)
throws java.lang.Throwable
userver -
java.lang.Throwable
public int getUserType(UserVerification userver)
throws java.lang.Throwable
userver -
java.lang.Throwable
public StandardUser getStandardUser(UserVerification userver)
throws java.lang.Throwable
userver -
java.lang.Throwable
public PowerUser getPowerUser(UserVerification userver)
throws java.lang.Throwable
userver -
java.lang.Throwable
public StandardUser getStandardUserByUserId(long userId)
throws java.lang.Throwable
userId -
java.lang.Throwable
public java.util.Vector<Item> getToplist(long moduleId)
throws java.lang.Throwable
moduleId -
java.lang.Throwable
public java.util.Vector<Item> getToplistDuration(long moduleId,
int days)
throws java.lang.Throwable
moduleId - days -
java.lang.Throwable
public java.util.Vector<Item> getPersonalizedToplist(long userId,
long moduleId)
throws java.lang.Throwable
moduleId -
java.lang.Throwable
public java.util.Vector<java.lang.Integer> getInteractionUserId(long userId,
java.lang.String startDate,
java.lang.String endDate)
throws java.lang.Throwable
userId - startDate - endDate -
java.lang.Throwable
public boolean checkIfInteractionUserHasVoted(long interactionUserUserId,
long itemId)
throws java.lang.Throwable
interactionUserUserId - itemId -
java.lang.Throwable
public java.util.Vector<Module> getSubscribedModules(long userId)
throws java.lang.Throwable
userId -
java.lang.Throwable
public java.util.Vector<Module> getModules(java.lang.String lang)
throws java.lang.Throwable
lang -
java.lang.Throwable
public java.util.Vector<Module> getOwnModules(long userId)
throws java.lang.Throwable
userId -
java.lang.Throwable
public boolean hasVotedForItem(long userId,
long itemId)
throws java.lang.Throwable
userId -
java.lang.Throwable
public java.util.Vector<Item> getAllModuleItems(long moduleId)
throws java.lang.Throwable
moduleId -
java.lang.Throwable
public java.util.Vector<java.lang.Integer> getContactListUserIds(long userId)
throws java.lang.Throwable
userId -
java.lang.Throwable
public java.util.Vector<StandardUser> getContactListStandardUser(long userId)
throws java.lang.Throwable
userId -
java.lang.Throwable
public boolean checkIfUserIsOwner(long userId,
long moduleId)
throws java.lang.Throwable
userId - moduleId -
java.lang.Throwable
public boolean checkPowerUserRequirements(long userId)
throws java.lang.Throwable
userId -
java.lang.Throwable
public java.util.ArrayList<java.lang.String> getSpamwords()
throws java.lang.Throwable
java.lang.Throwable
public boolean changePreferences(UserVerification userver,
StandardUser user)
throws java.lang.Throwable
user -
java.lang.Throwable
public boolean editOwnModule(long ownerid,
long moduleId,
java.lang.String name,
java.lang.String language,
java.lang.String description,
java.lang.String question)
ownerid - moduleId - name - language - description - question -
public boolean updateUserTypeFlag(long userId,
int userType)
throws java.lang.Throwable
userType - 1 = StandardUser, 2 = PowerUser
java.lang.Throwable
public boolean deleteModule(long moduleId)
throws java.lang.Throwable
moduleId -
java.lang.Throwable
public boolean deleteContact(long deleteUserId,
long userId)
throws java.lang.Throwable
deleteUserId - userId -
java.lang.Throwable
public boolean deleteSubscription(long userId,
long moduleId)
throws java.lang.Throwable
userId - moduleId -
java.lang.Throwable
public boolean deleteSubscription(long userId)
throws java.lang.Throwable
userId -
java.lang.Throwable
public java.util.Vector<StandardUser> getInteractionUsers(Item item,
long userId)
throws java.lang.Throwable
item - userId -
java.lang.Throwable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||