facebookJrDB
Interface FacebookJrDBManInt


public interface FacebookJrDBManInt


Method Summary
 boolean acceptFriendInvite(java.lang.String acceptingPersonName, 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 status, 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 status)
          Returns a list of names (not just friends) that match the specified gender and 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 getStatus(java.lang.String personName)
          Returns the person's status string.
 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 refusingPersonName, 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 invitingPersonName, 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 updateStatus(java.lang.String personName, java.lang.String status)
          Update the status string of personName.
 

Method Detail

addPerson

boolean addPerson(java.lang.String name,
                  java.lang.String gender,
                  java.lang.String status,
                  java.lang.String email,
                  java.lang.String photoURL)
Adds a person to the database.

Parameters:
name - person's name.
gender - possible values "M" or "F".
status - possible values "Single" or "Married".
email -
photoURL - name of photo file
Returns:
true if person was added and false otherwise.

removePerson

boolean removePerson(java.lang.String name)
Removes a person from the database.

Parameters:
name -
Returns:
true if person was removed and false otherwise.

removeFriend

boolean removeFriend(java.lang.String personName,
                     java.lang.String friendName)
Removes the friend named friendName from the group of friends associated with personName.

Parameters:
personName -
friendName -
Returns:
true if friend was remove and false otherwise.

sendFriendInvite

boolean sendFriendInvite(java.lang.String invitingPersonName,
                         java.lang.String invitedPersonName)
The person with name invitingPersonName sends a friend invitation to invitedPersonName.

Parameters:
invitingPersonName -
invitedPersonName -
Returns:
true if invitation is sent and false otherwise.

acceptFriendInvite

boolean acceptFriendInvite(java.lang.String acceptingPersonName,
                           java.lang.String acceptedPersonName)
The person with name acceptingPersonName accepts acceptedPersonName as a friend.

Parameters:
acceptingPersonName -
acceptedPersonName -
Returns:
true if friend accepted and false otherwise.

refuseFriendInvite

boolean refuseFriendInvite(java.lang.String refusingPersonName,
                           java.lang.String refusedPersonName)
The person with name refusingPersonName does not accept refusedPersonName as a friend.

Parameters:
refusingPersonName -
refusedPersonName -
Returns:
true if person is refused and false otherwise.

postToWall

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.

Parameters:
personWriting -
writingToPerson -
message - message to post
Returns:
true if message posted and false otherwise.

updateStatus

boolean updateStatus(java.lang.String personName,
                     java.lang.String status)
Update the status string of personName.

Parameters:
personName -
status - new status (e.g., "I am tired")
Returns:
true if status is updated and false otherwise.

updateOnlineStatus

boolean updateOnlineStatus(java.lang.String personName,
                           boolean newStatus)
Updates the online status of personName.

Parameters:
personName -
newStatus - true means the person is online.
Returns:
true if online status is updated and false otherwise.

addRegionalNetwork

boolean addRegionalNetwork(java.lang.String networkName,
                           java.lang.String location)
Adds a regional network to the database.

Parameters:
networkName -
location -
Returns:
true if network added and false otherwise.

joinRegionalNetwork

boolean joinRegionalNetwork(java.lang.String networkName,
                            java.lang.String personName)
Adds the person with name personName to the specified regional network.

Parameters:
networkName -
personName -
Returns:
true if the person joins the network and false otherwise.

addHighSchoolNetwork

boolean addHighSchoolNetwork(java.lang.String networkName,
                             java.lang.String schoolName)
Adds a high school network to the database.

Parameters:
networkName -
schoolName -
Returns:
true if network added and false otherwise.

joinHighSchoolNetwork

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.

Parameters:
networkName -
personName -
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

boolean addCollegeNetwork(java.lang.String networkName,
                          java.lang.String schoolName)
Adds a college network to the database.

Parameters:
networkName -
schoolName -
Returns:
true if network added and false otherwise.

joinCollegeNetwork

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.

Parameters:
networkName -
personName -
year - graduation year
major - college major
Returns:
true if person joins the network and false otherwise.

getName

java.lang.String getName(java.lang.String personName)
Returns the person's name.

Parameters:
personName -
Returns:
string or null if person not found.

getGender

java.lang.String getGender(java.lang.String personName)
Returns the person's gender.

Parameters:
personName -
Returns:
"M" or "F" and null if person not found.

getStatus

java.lang.String getStatus(java.lang.String personName)
Returns the person's status string.

Parameters:
personName -
Returns:
"", "Single", "Married" and null if person not found.

getEmail

java.lang.String getEmail(java.lang.String personName)
Returns the person's email.

Parameters:
personName -
Returns:
string or null if person not found.

getPersonPhotoURL

java.lang.String getPersonPhotoURL(java.lang.String personName)
Returns the person's photo url.

Parameters:
personName -
Returns:
string or null if person not found.

getFriends

java.util.ArrayList<java.lang.String> getFriends(java.lang.String personName)
Returns the friends of personName.

Parameters:
personName -
Returns:
ArrayList with the names of friends or empty list.

getNetworks

java.util.ArrayList<java.lang.String> getNetworks(java.lang.String personName)
Returns the networks of personName.

Parameters:
personName -
Returns:
ArrayList with the names of networks or empty list.

getWallPostings

java.lang.String getWallPostings(java.lang.String personName)
Returns a string with all the wall postings.

Parameters:
personName -
Returns:
string or null if person not found.

getAllPersons

java.util.ArrayList<java.lang.String> getAllPersons()
Returns a list of all the persons in the database.

Returns:
ArrayList with names of persons in the database or empty list.

getAllNetworks

java.util.ArrayList<java.lang.String> getAllNetworks()
Returns a list of all the networks in the database.

Returns:
ArrayList with names of networks in the database or empty list.

getInfoPerson

java.lang.String getInfoPerson(java.lang.String personName)
Returns a string with information about the person. See the public test results for format information.

Parameters:
personName -
Returns:
string or null if person not found.

getInfoNetwork

java.lang.String getInfoNetwork(java.lang.String networkName)
Returns a string with information about the network. See the public tests results for format information.

Parameters:
networkName -
Returns:
string or null if network not found.

getFriendsOnline

java.util.ArrayList<java.lang.String> getFriendsOnline(java.lang.String personName)
Returns a list of friends that are online.

Parameters:
personName -
Returns:
ArrayList with names of friends online or empty list.

findMatches

java.util.ArrayList<java.lang.String> findMatches(java.lang.String gender,
                                                  java.lang.String status)
Returns a list of names (not just friends) that match the specified gender and 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).

Parameters:
gender - "M" or "F"
status - "Single" or "Married"
Returns:
ArrayList with the names of those satisfying the specified criteria or empty list.


Web Accessibility