facebookJrDB
Class FacebookJrDB

java.lang.Object
  extended by facebookJrDB.FacebookJrDB
All Implemented Interfaces:
FacebookJrDBManager

public class FacebookJrDB
extends java.lang.Object
implements FacebookJrDBManager


Constructor Summary
FacebookJrDB()
           
 
Method Summary
 boolean acceptFriendInvite(java.lang.String fromPersonName, java.lang.String acceptedPersonName)
          The person with name acceptingPersonName accepts acceptedPersonName as a friend.
 boolean addCollegeNetwork(java.lang.String networkName, java.lang.String schoolName)
          Adds a college network to the database.
 boolean addHighSchoolNetwork(java.lang.String networkName, java.lang.String schoolName)
          Adds a high school network to the database.
 boolean addPerson(java.lang.String name, java.lang.String gender, java.lang.String relationshipStatus, java.lang.String email, java.lang.String photoURL)
          Adds a person to the database.
 boolean addRegionalNetwork(java.lang.String networkName, java.lang.String location)
          Adds a regional network to the database.
 java.util.ArrayList<java.lang.String> findMatches(java.lang.String gender, java.lang.String relationshipStatus)
          Returns a list of names (not just friends) that match the specified gender and relationship status.
 java.util.ArrayList<java.lang.String> getAllNetworks()
          Returns a list of all the networks in the database.
 java.util.ArrayList<java.lang.String> getAllPersons()
          Returns a list of all the persons in the database.
 java.lang.String getEmail(java.lang.String personName)
          Returns the person's email.
 java.util.ArrayList<java.lang.String> getFriends(java.lang.String personName)
          Returns the friends of personName.
 java.util.ArrayList<java.lang.String> getFriendsOnline(java.lang.String personName)
          Returns a list of friends that are online.
 java.lang.String getGender(java.lang.String personName)
          Returns the person's gender.
 java.lang.String getInfoNetwork(java.lang.String networkName)
          Returns a string with information about the network.
 java.lang.String getInfoPerson(java.lang.String personName)
          Returns a string with information about the person.
 java.lang.String getName(java.lang.String personName)
          Returns the person's name.
 java.util.ArrayList<java.lang.String> getNetworks(java.lang.String personName)
          Returns the networks of personName.
 java.lang.String getPersonPhotoURL(java.lang.String personName)
          Returns the person's photo url.
 java.lang.String getRelationshipStatus(java.lang.String personName)
          Returns the person's relationship status string.
 java.lang.String getStatus(java.lang.String personName)
          Returns the person's status string (e.g.
 java.lang.String getWallPostings(java.lang.String personName)
          Returns a string with all the wall postings.
 boolean joinCollegeNetwork(java.lang.String networkName, java.lang.String personName, int year, java.lang.String major)
          Adds the person with name personName, that graduated on the specified year and that belongs to the specified major to the network.
 boolean joinHighSchoolNetwork(java.lang.String networkName, java.lang.String personName, int year, boolean wentToCollege)
          Adds the person with name personName and that graduated on the specified year to the high school network.
 boolean joinRegionalNetwork(java.lang.String networkName, java.lang.String personName)
          Adds the person with name personName to the specified regional network.
 boolean postToWall(java.lang.String personWriting, java.lang.String writingToPerson, java.lang.String message)
          A message by personWriting is posted on the wall associated with writingToPerson.
 boolean refuseFriendInvite(java.lang.String fromPersonName, java.lang.String refusedPersonName)
          The person with name refusingPersonName does not accept refusedPersonName as a friend.
 boolean removeFriend(java.lang.String personName, java.lang.String friendName)
          Removes the friend named friendName from the group of friends associated with personName.
 boolean removePerson(java.lang.String name)
          Removes a person from the database.
 boolean sendFriendInvite(java.lang.String acceptingPersonName, java.lang.String invitedPersonName)
          The person with name invitingPersonName sends a friend invitation to invitedPersonName.
 boolean updateOnlineStatus(java.lang.String personName, boolean newStatus)
          Updates the online status of personName.
 boolean updateRelationshipStatus(java.lang.String personName, java.lang.String relationshipStatus)
          Updates the relationship status string of personName.
 boolean updateStatus(java.lang.String personName, java.lang.String relationshipStatus)
          Updates the status (e.g., "I am working on a project") of personName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FacebookJrDB

public FacebookJrDB()
Method Detail

addPerson

public boolean addPerson(java.lang.String name,
                         java.lang.String gender,
                         java.lang.String relationshipStatus,
                         java.lang.String email,
                         java.lang.String photoURL)
Description copied from interface: FacebookJrDBManager
Adds a person to the database.

Specified by:
addPerson in interface FacebookJrDBManager
Parameters:
name - person's name.
gender - possible values "M" or "F".
relationshipStatus - any string (e.g., "Single", "Married").
photoURL - name of photo file
Returns:
true if person was added and false otherwise.

removePerson

public boolean removePerson(java.lang.String name)
Description copied from interface: FacebookJrDBManager
Removes a person from the database.

Specified by:
removePerson in interface FacebookJrDBManager
Returns:
true if person was removed and false otherwise.

removeFriend

public boolean removeFriend(java.lang.String personName,
                            java.lang.String friendName)
Description copied from interface: FacebookJrDBManager
Removes the friend named friendName from the group of friends associated with personName.

Specified by:
removeFriend in interface FacebookJrDBManager
Returns:
true if friend was removed and false otherwise.

sendFriendInvite

public boolean sendFriendInvite(java.lang.String acceptingPersonName,
                                java.lang.String invitedPersonName)
Description copied from interface: FacebookJrDBManager
The person with name invitingPersonName sends a friend invitation to invitedPersonName.

Specified by:
sendFriendInvite in interface FacebookJrDBManager
Returns:
true if invitation is sent and false otherwise.

acceptFriendInvite

public boolean acceptFriendInvite(java.lang.String fromPersonName,
                                  java.lang.String acceptedPersonName)
Description copied from interface: FacebookJrDBManager
The person with name acceptingPersonName accepts acceptedPersonName as a friend.

Specified by:
acceptFriendInvite in interface FacebookJrDBManager
Returns:
true if friend accepted and false otherwise.

refuseFriendInvite

public boolean refuseFriendInvite(java.lang.String fromPersonName,
                                  java.lang.String refusedPersonName)
Description copied from interface: FacebookJrDBManager
The person with name refusingPersonName does not accept refusedPersonName as a friend.

Specified by:
refuseFriendInvite in interface FacebookJrDBManager
Returns:
true if person is refused and false otherwise.

postToWall

public boolean postToWall(java.lang.String personWriting,
                          java.lang.String writingToPerson,
                          java.lang.String message)
Description copied from interface: FacebookJrDBManager
A message by personWriting is posted on the wall associated with writingToPerson. Any person can post to any other person's wall.

Specified by:
postToWall in interface FacebookJrDBManager
message - message to post
Returns:
true if message posted and false otherwise.

updateRelationshipStatus

public boolean updateRelationshipStatus(java.lang.String personName,
                                        java.lang.String relationshipStatus)
Description copied from interface: FacebookJrDBManager
Updates the relationship status string of personName.

Specified by:
updateRelationshipStatus in interface FacebookJrDBManager
relationshipStatus - new status (e.g., "Complicated")
Returns:
true if status is updated and false otherwise.

updateStatus

public boolean updateStatus(java.lang.String personName,
                            java.lang.String relationshipStatus)
Description copied from interface: FacebookJrDBManager
Updates the status (e.g., "I am working on a project") of personName

Specified by:
updateStatus in interface FacebookJrDBManager
Returns:
true if status is updated and false otherwise.

updateOnlineStatus

public boolean updateOnlineStatus(java.lang.String personName,
                                  boolean newStatus)
Description copied from interface: FacebookJrDBManager
Updates the online status of personName.

Specified by:
updateOnlineStatus in interface FacebookJrDBManager
newStatus - true means the person is online.
Returns:
true if online status is updated and false otherwise.

addRegionalNetwork

public boolean addRegionalNetwork(java.lang.String networkName,
                                  java.lang.String location)
Description copied from interface: FacebookJrDBManager
Adds a regional network to the database.

Specified by:
addRegionalNetwork in interface FacebookJrDBManager
Returns:
true if network added and false otherwise.

joinRegionalNetwork

public boolean joinRegionalNetwork(java.lang.String networkName,
                                   java.lang.String personName)
Description copied from interface: FacebookJrDBManager
Adds the person with name personName to the specified regional network.

Specified by:
joinRegionalNetwork in interface FacebookJrDBManager
Returns:
true if the person joins the network and false otherwise.

addHighSchoolNetwork

public boolean addHighSchoolNetwork(java.lang.String networkName,
                                    java.lang.String schoolName)
Description copied from interface: FacebookJrDBManager
Adds a high school network to the database.

Specified by:
addHighSchoolNetwork in interface FacebookJrDBManager
Returns:
true if network added and false otherwise.

joinHighSchoolNetwork

public boolean joinHighSchoolNetwork(java.lang.String networkName,
                                     java.lang.String personName,
                                     int year,
                                     boolean wentToCollege)
Description copied from interface: FacebookJrDBManager
Adds the person with name personName and that graduated on the specified year to the high school network.

Specified by:
joinHighSchoolNetwork in interface FacebookJrDBManager
year - high school graduation year.
wentToCollege - whether the person attended college or not.
Returns:
true if the person joins the network and false otherwise.

addCollegeNetwork

public boolean addCollegeNetwork(java.lang.String networkName,
                                 java.lang.String schoolName)
Description copied from interface: FacebookJrDBManager
Adds a college network to the database.

Specified by:
addCollegeNetwork in interface FacebookJrDBManager
Returns:
true if network added and false otherwise.

joinCollegeNetwork

public boolean joinCollegeNetwork(java.lang.String networkName,
                                  java.lang.String personName,
                                  int year,
                                  java.lang.String major)
Description copied from interface: FacebookJrDBManager
Adds the person with name personName, that graduated on the specified year and that belongs to the specified major to the network.

Specified by:
joinCollegeNetwork in interface FacebookJrDBManager
year - graduation year
major - college major
Returns:
true if person joins the network and false otherwise.

getName

public java.lang.String getName(java.lang.String personName)
Description copied from interface: FacebookJrDBManager
Returns the person's name.

Specified by:
getName in interface FacebookJrDBManager
Returns:
string or null if person not found.

getGender

public java.lang.String getGender(java.lang.String personName)
Description copied from interface: FacebookJrDBManager
Returns the person's gender.

Specified by:
getGender in interface FacebookJrDBManager
Returns:
"M" or "F" and null if person not found.

getRelationshipStatus

public java.lang.String getRelationshipStatus(java.lang.String personName)
Description copied from interface: FacebookJrDBManager
Returns the person's relationship status string.

Specified by:
getRelationshipStatus in interface FacebookJrDBManager
Returns:
string or null if person not found.

getStatus

public java.lang.String getStatus(java.lang.String personName)
Description copied from interface: FacebookJrDBManager
Returns the person's status string (e.g. "I want a vacation")

Specified by:
getStatus in interface FacebookJrDBManager
Returns:
string or null if person not found.

getEmail

public java.lang.String getEmail(java.lang.String personName)
Description copied from interface: FacebookJrDBManager
Returns the person's email.

Specified by:
getEmail in interface FacebookJrDBManager
Returns:
string or null if person not found.

getPersonPhotoURL

public java.lang.String getPersonPhotoURL(java.lang.String personName)
Description copied from interface: FacebookJrDBManager
Returns the person's photo url.

Specified by:
getPersonPhotoURL in interface FacebookJrDBManager
Returns:
string or null if person not found.

getFriends

public java.util.ArrayList<java.lang.String> getFriends(java.lang.String personName)
Description copied from interface: FacebookJrDBManager
Returns the friends of personName.

Specified by:
getFriends in interface FacebookJrDBManager
Returns:
ArrayList with the names of friends or empty list.

getNetworks

public java.util.ArrayList<java.lang.String> getNetworks(java.lang.String personName)
Description copied from interface: FacebookJrDBManager
Returns the networks of personName.

Specified by:
getNetworks in interface FacebookJrDBManager
Returns:
ArrayList with the names of networks or empty list.

getWallPostings

public java.lang.String getWallPostings(java.lang.String personName)
Description copied from interface: FacebookJrDBManager
Returns a string with all the wall postings.

Specified by:
getWallPostings in interface FacebookJrDBManager
Returns:
string or null if person not found.

getAllPersons

public java.util.ArrayList<java.lang.String> getAllPersons()
Description copied from interface: FacebookJrDBManager
Returns a list of all the persons in the database.

Specified by:
getAllPersons in interface FacebookJrDBManager
Returns:
ArrayList with names of persons in the database or empty list.

getAllNetworks

public java.util.ArrayList<java.lang.String> getAllNetworks()
Description copied from interface: FacebookJrDBManager
Returns a list of all the networks in the database.

Specified by:
getAllNetworks in interface FacebookJrDBManager
Returns:
ArrayList with names of networks in the database or empty list.

getInfoPerson

public java.lang.String getInfoPerson(java.lang.String personName)
Description copied from interface: FacebookJrDBManager
Returns a string with information about the person. See the public test results for format information.

Specified by:
getInfoPerson in interface FacebookJrDBManager
Returns:
string or null if person not found.

getInfoNetwork

public java.lang.String getInfoNetwork(java.lang.String networkName)
Description copied from interface: FacebookJrDBManager
Returns a string with information about the network. See the public tests results for format information.

Specified by:
getInfoNetwork in interface FacebookJrDBManager
Returns:
string or null if network not found.

getFriendsOnline

public java.util.ArrayList<java.lang.String> getFriendsOnline(java.lang.String personName)
Description copied from interface: FacebookJrDBManager
Returns a list of friends that are online.

Specified by:
getFriendsOnline in interface FacebookJrDBManager
Returns:
ArrayList with names of friends online or empty list.

findMatches

public java.util.ArrayList<java.lang.String> findMatches(java.lang.String gender,
                                                         java.lang.String relationshipStatus)
Description copied from interface: FacebookJrDBManager
Returns a list of names (not just friends) that match the specified gender and relationship status. If any parameter is null then the parameter is ignored in the search (i.e., any value for the parameter will be accepted in the search).

Specified by:
findMatches in interface FacebookJrDBManager
Parameters:
gender - "M" or "F"
relationshipStatus - (e.g., "Single", "Married", etc.)
Returns:
ArrayList with the names of those satisfying the specified criteria or empty list.


Web Accessibility