Skip to content

BlakeTacklind/DatabaseWraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 

Repository files navigation

Database Wrapper for Dank Exchange project

by Blake Tacklind blake@tacklind.com

package: com.dank.exchange.backend

Datatypes

User

  • Name: users unique name

Item

  • Name: items name

Request

  • FromUser: User the request is from
  • ToUser: User the request is for
  • FromItems: ArrayList of Items the From User has and wants to trade
  • ToItems: ArrayList of Items the To User has and wants to trade
  • Location: String for the location of a trade
  • Middleman: User for the optional middle man trade

Public functions

Give your user name
returns true if successful

boolean logIn(String name) throws TimeoutException 

Add the new user by String
return true if success

boolean addUser(String name) throws TimeoutException 

Delete currently logged in user
returns true if successful

boolean deleteSelf() throws TimeoutException, NotLoggedInException 

set middle man status of logged in user
returns true if successful

boolean setMiddleMan(boolean canMiddleMan) throws TimeoutException, NotLoggedInException 

return your list of friends
may return null if failed

ArrayList<User> getFriends() throws TimeoutException, NotLoggedInException 

returns mutual friends of logged in user and user given
may return null if failed

ArrayList<User> getMutualFriends(User friend) throws TimeoutException, NotLoggedInException 

Get List of middle men mutual to logged in user and friend
returns list of mutual middle men

ArrayList<User> getMutualMiddleMen(User friend) throws TimeoutException, NotLoggedInException

Give a user
returns contents of their knapsack

ArrayList<Item> getKnapsack(User user) throws TimeoutException 

add item named string to knapsack
returns true if posted

boolean addToKnapsack(String itemName) throws TimeoutException, NotLoggedInException 

remove item from knapsack
returns true if removed successfully

boolean removeFromKnapsack(Item item) throws TimeoutException, NotLoggedInException 

Get requests TO the logged in user
Returns the list of requests

ArrayList<Request> getRequestsTo() throws TimeoutException, NotLoggedInException 

Get requests FROM the logged in user
Returns the list of requests

ArrayList<Request> getRequestsFrom() throws TimeoutException, NotLoggedInException

Pass username to send friend request from current logged in user
returns true if successfully posted

boolean requestFriendship(String name) throws TimeoutException, NotLoggedInException 

Pass in yes or no to response, and request number
returns true if successfully posted response

boolean respondFriendship(Request request, boolean response) throws TimeoutException, NotLoggedInException 

clears a notification.
Works with friendship Accepted, friendship Rejected, Trade Denied, Middle Man Notification, and Trade Cancelled
returns true if successful

boolean clearRequest(Request request) throws TimeoutException, NotLoggedInException 

Removes friendship relation
(should also remove current requests between users?)
returns true if successful

boolean removeFriendship(User friend) throws TimeoutException, NotLoggedInException 

User to trade with, my item(s) to trade, their item(s) to trade
(temporarily removes items to be traded from senders knapsack?)
returns true if successfully posted request

boolean requestTrade(User friend, ArrayList<Item> myItems, ArrayList<Item> theirItems) throws TimeoutException, NotLoggedInException 

Decline the trade request
returns true if successful

boolean declineTrade(Request request) throws TimeoutException, NotLoggedInException 

Pass in: Request to respond to and location name in string
returns true if successfully posted response

boolean respondLocation(Request request, String location) throws TimeoutException, NotLoggedInException 

Accept the location of trade request
returns true if successful

boolean acceptLocation(Request request) throws TimeoutException, NotLoggedInException

Completes the trade, Items exchange hands
returns true if successful

boolean completeTrade(Request request) throws TimeoutException, NotLoggedInException 

Canceled a trade that has been accepted by both parties - Can be done by either
returns true if successful

boolean cancelTrade(Request request) throws TimeoutException, NotLoggedInException 

Empty Bodies

Start a trade with a middleman
returns true if successful

boolean middleManTrade(User them, User middleman, ArrayList<Item> items, boolean toThem) throws TimeoutException, NotLoggedInException

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages