Interface FriendDao

All Known Implementing Classes:
MongoFriendDao

public interface FriendDao
Provides database-level access to Friend instances.
  • Method Details

    • getFriendsForUser

      Pagination<Friend> getFriendsForUser(User user, int offset, int count)
      Fetches all Friend instances for the supplied User.
      Parameters:
      user - the User
      offset - the offset
      count - the number of results to return
      Returns:
      a Pagination<Friend>
    • getFriendsForUser

      Pagination<Friend> getFriendsForUser(User user, int offset, int count, String search)
      Fetches all Friend instances for the supplied User, specifying search query.
      Parameters:
      user - the User
      offset - the offset
      count - the number of results to return
      search - the search query which will be used to filter the returned Friend instances
      Returns:
      a Pagination<Friend>
    • getFriendForUser

      Friend getFriendForUser(User user, String friendId)
      Returns a single instance of Friend for the supplied User. Throwing a NotFoundException if the friend does not exist for the supplied User.
      Parameters:
      user - the User
      friendId - the id of the friend as returned by Friend.getId()
      Returns:
      the Friend instance, never null
    • deleteFriendForUser

      void deleteFriendForUser(User user, String friendId)
      Deletes the single instance of Friend for the supplied User. Throwing a NotFoundException if the friend does not exist for the supplied User.
      Parameters:
      user - the User
      friendId - the id of the friend as returned by Friend.getId()