public class

HibernateConnectionDao

extends HibernateDaoSupport
implements ConnectionDao
java.lang.Object
   ↳ org.springframework.dao.support.DaoSupport
     ↳ org.springframework.orm.hibernate.support.HibernateDaoSupport
       ↳ com.atlassian.confluence.follow.persistence.dao.hibernate.HibernateConnectionDao

Summary

[Expand]
Inherited Fields
From class org.springframework.dao.support.DaoSupport
Public Constructors
HibernateConnectionDao()
Public Methods
void followUser(User follower, User followee)
Sets the follower to follow the specified user.
List<String> getFollowees(User follower)
Returns a list of usernames for the users that the specified user is following
List<String> getFollowers(User followee)
Returns a list of users that are followers of the specified user
boolean isUserFollowing(User follower, User followee)
True if the follower is following the followee
void removeAllConnectionsFor(User user)
Removes all connections for this user (as a follower and as a followee).
void unfollowUser(User follower, User followee)
Unsets the follower from following the specified user.
[Expand]
Inherited Methods
From class org.springframework.orm.hibernate.support.HibernateDaoSupport
From class org.springframework.dao.support.DaoSupport
From class java.lang.Object
From interface com.atlassian.confluence.follow.persistence.dao.ConnectionDao
From interface org.springframework.beans.factory.InitializingBean

Public Constructors

public HibernateConnectionDao ()

Public Methods

public void followUser (User follower, User followee)

Sets the follower to follow the specified user. If the follow is alreading following the followee then this method does nothing.

Parameters
follower the follower
followee the new followee

public List<String> getFollowees (User follower)

Returns a list of usernames for the users that the specified user is following

Parameters
follower the username
Returns
  • a list of usernames

public List<String> getFollowers (User followee)

Returns a list of users that are followers of the specified user

Parameters
followee the user to check for followers
Returns
  • a list of usernames

public boolean isUserFollowing (User follower, User followee)

True if the follower is following the followee

Parameters
follower the proposed follower
followee the proposed followee
Returns
  • true if the follower is following the followee

public void removeAllConnectionsFor (User user)

Removes all connections for this user (as a follower and as a followee).

Parameters
user the user

public void unfollowUser (User follower, User followee)

Unsets the follower from following the specified user. If the follow is not following the followee then this method does nothing.

Parameters
follower the follower
followee the new followee