Package com.atlassian.confluence.follow
Class DefaultFollowManager
- java.lang.Object
-
- com.atlassian.confluence.follow.DefaultFollowManager
-
- All Implemented Interfaces:
FollowManager
,FollowManagerInternal
public class DefaultFollowManager extends Object implements FollowManagerInternal
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultFollowManager.CanUserUseConfluence
static class
DefaultFollowManager.UserCanUseConfluencePredicate
Deprecated.since 7.0.1.
-
Constructor Summary
Constructors Constructor Description DefaultFollowManager(ConnectionDao connectionDao, SpacePermissionManager spacePermissionManager, com.atlassian.event.api.EventPublisher eventPublisher, PaginationServiceInternal paginationService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
followUser(ConfluenceUser follower, ConfluenceUser followee)
Sets the follower to follow the specified user.<T> Paginated<T>
getFollowers(ConfluenceUser user, PaginationQuery<ConfluenceUser,T> query)
Constructs a new Paginated response containing the followers of specified user, limited and converted by the given PaginationQuery.<T> Paginated<T>
getFollowing(ConfluenceUser user, PaginationQuery<ConfluenceUser,T> query)
Returns a list of users that the specified user is following, limited and converted by the given PaginationQuery.boolean
isUserFollowing(com.atlassian.user.User follower, com.atlassian.user.User followee)
True if the follower is following the followeevoid
removeAllConnectionsFor(com.atlassian.user.User user)
Removes all connections for this user (as a follower and as a followee).void
unfollowUser(com.atlassian.user.User follower, com.atlassian.user.User followee)
Unsets the follower from following the specified user.
-
-
-
Constructor Detail
-
DefaultFollowManager
public DefaultFollowManager(ConnectionDao connectionDao, SpacePermissionManager spacePermissionManager, com.atlassian.event.api.EventPublisher eventPublisher, PaginationServiceInternal paginationService)
-
-
Method Detail
-
isUserFollowing
public boolean isUserFollowing(com.atlassian.user.User follower, com.atlassian.user.User followee)
Description copied from interface:FollowManager
True if the follower is following the followee- Specified by:
isUserFollowing
in interfaceFollowManager
- Parameters:
follower
- the proposed followerfollowee
- the proposed followee- Returns:
- true if the follower is following the followee
-
followUser
public void followUser(ConfluenceUser follower, ConfluenceUser followee)
Description copied from interface:FollowManager
Sets the follower to follow the specified user. If the follow is alreading following the followee then this method does nothing.- Specified by:
followUser
in interfaceFollowManager
- Parameters:
follower
- the followerfollowee
- the new followee
-
unfollowUser
public void unfollowUser(com.atlassian.user.User follower, com.atlassian.user.User followee)
Description copied from interface:FollowManager
Unsets the follower from following the specified user. If the follow is not following the followee then this method does nothing.- Specified by:
unfollowUser
in interfaceFollowManager
- Parameters:
follower
- the followerfollowee
- the new followee
-
removeAllConnectionsFor
public void removeAllConnectionsFor(com.atlassian.user.User user)
Description copied from interface:FollowManager
Removes all connections for this user (as a follower and as a followee).- Specified by:
removeAllConnectionsFor
in interfaceFollowManager
- Parameters:
user
- the user
-
getFollowers
public <T> Paginated<T> getFollowers(ConfluenceUser user, PaginationQuery<ConfluenceUser,T> query)
Description copied from interface:FollowManagerInternal
Constructs a new Paginated response containing the followers of specified user, limited and converted by the given PaginationQuery.NOTE: this method will implicitly add a Predicate filtering results to ConfluenceUsers that are permitted to use Confluence.
- Specified by:
getFollowers
in interfaceFollowManagerInternal
- Parameters:
user
- the user to check for followersquery
- a constructed PaginationQuery containing optional predicates and model conversion strategy.- Returns:
- a Paginated response ready for page requests or paged iteration.
-
getFollowing
public <T> Paginated<T> getFollowing(ConfluenceUser user, PaginationQuery<ConfluenceUser,T> query)
Description copied from interface:FollowManagerInternal
Returns a list of users that the specified user is following, limited and converted by the given PaginationQuery.- Specified by:
getFollowing
in interfaceFollowManagerInternal
- Parameters:
user
- the user to check for followeesquery
- a constructed PaginationQuery containing optional predicates and model conversion strategy.- Returns:
- a list of usernames
-
-