blather.controller
Interface UserControllerInterface

All Known Implementing Classes:
UserController

public interface UserControllerInterface


Method Summary
 boolean changeEmail(java.lang.String newEmail)
          Changes this user's profile email address.
 BlabInterface[] getAllBlabs()
          Returns an array consisting of all of this user's blabs, sorted in reverse chronological order.
 BlabInterface[] getAllFriendBlabs()
          Returns an array consisting of all of this user's friends' blabs, sorted in reverse chronological order.
 java.lang.String getEmail()
          If this UserController's session ID is valid, return a string representation of this user's full email address.
 BlatherUserInterface[] getFriends()
          Returns an array of this user's friends.
 BlabInterface[] getSomeBlabs(int howMany)
          Returns an array consisting of some of this user's blabs, sorted in reverse chronological order.
 BlabInterface[] getSomeFriendBlabs(int howMany)
          Returns an array consisting of some of this user's friends' blabs, sorted in reverse chronological order.
 java.lang.String getUsername()
          Returns this user's username.
 boolean newBlab(java.lang.String blabContent)
          Creates a new blab for this user with the given content, with a timestamp of now, and adds this blab to the list of user blabs.
 boolean newFriend(java.lang.String username)
          Adds a friend to the list of users that this user is tracking.
 

Method Detail

getAllBlabs

BlabInterface[] getAllBlabs()
Returns an array consisting of all of this user's blabs, sorted in reverse chronological order. (Hint: the BlabUtil class provides a method to sort an array of blabs in chronological order.)

Returns:

getSomeBlabs

BlabInterface[] getSomeBlabs(int howMany)
Returns an array consisting of some of this user's blabs, sorted in reverse chronological order. (Hint: the BlabUtil class provides a method to sort an array of blabs in chronological order.)

Parameters:
howMany - the number of blabs to put in the array, starting with the most recent
Returns:

getAllFriendBlabs

BlabInterface[] getAllFriendBlabs()
Returns an array consisting of all of this user's friends' blabs, sorted in reverse chronological order. (Hint: the BlabUtil class provides a method to sort an array of blabs in chronological order.)

Returns:

getSomeFriendBlabs

BlabInterface[] getSomeFriendBlabs(int howMany)
Returns an array consisting of some of this user's friends' blabs, sorted in reverse chronological order. (Hint: the BlabUtil class provides a method to sort an array of blabs in chronological order.)

Parameters:
howMany - the number of blabs to put in the array, starting with the most recent
Returns:

changeEmail

boolean changeEmail(java.lang.String newEmail)
Changes this user's profile email address. Preconditions: (1) this UserController's Session ID must exist, (2) it must indicate that the user who is logged in is the same as the user we are changing the email for, and (3) newEmail must be a valid address.

Parameters:
newEmail -
Returns:
true on success, false on failure

newBlab

boolean newBlab(java.lang.String blabContent)
Creates a new blab for this user with the given content, with a timestamp of now, and adds this blab to the list of user blabs. Preconditions: (1) this UserController's Session ID must exist, and (2) it must indicate that the user who is logged in is the same as the user we are adding a blab for.

Parameters:
blabContent -
Returns:
true on success, false on failure

newFriend

boolean newFriend(java.lang.String username)
Adds a friend to the list of users that this user is tracking. Preconditions: (1) this UserController's Session ID must exist, (2) it must indicate that the user who is logged in is the same as the user we are adding a friend for, and (3) username must be a valid username.

Parameters:
username -
Returns:
true on success, false on failure

getUsername

java.lang.String getUsername()
Returns this user's username.

Returns:

getEmail

java.lang.String getEmail()
If this UserController's session ID is valid, return a string representation of this user's full email address. Otherwise, return a "sanitized" email address (using getDisplayEmail()). The idea is that we want to let people browse users and blabs without logging in, but not harvest email addresses for spam.

Returns:
a string representation of an email address (possibly obscured)

getFriends

BlatherUserInterface[] getFriends()
Returns an array of this user's friends.

Returns:
an array of this user's friends.