@ParametersAreNonnullByDefault public class HibernateConfluenceUserDao extends Object implements ConfluenceUserDao
Constructor and Description |
---|
HibernateConfluenceUserDao(org.hibernate.SessionFactory sessionFactory) |
Modifier and Type | Method and Description |
---|---|
int |
countUnsyncedUsers()
Get a count of all unsynced users in Confluence.
|
void |
create(ConfluenceUser user)
Persist a new ConfluenceUser.
|
ConfluenceUser |
findByKey(@Nullable com.atlassian.sal.api.user.UserKey key)
Retrieve a ConfluenceUser by the user key.
|
Map<com.atlassian.sal.api.user.UserKey,Optional<ConfluenceUser>> |
findByKeys(Set<com.atlassian.sal.api.user.UserKey> userkeys)
Performs a bulk lookup of multiple
ConfluenceUser s. |
@Nullable ConfluenceUser |
findByUsername(String username)
Find the ConfluenceUser with the given user name.
|
Map<com.atlassian.sal.api.user.UserKey,String> |
findLowerNamesByKeys(Iterable<com.atlassian.sal.api.user.UserKey> keys)
Bulk operation to find lowercase name corresponding to user key.
|
Map<String,com.atlassian.sal.api.user.UserKey> |
findUserKeysByLowerNames(Iterable<String> names)
Bulk operation to find user key corresponding to lowercase name.
|
Set<ConfluenceUser> |
getAll() |
List<com.atlassian.sal.api.user.UserKey> |
getAllUserKeys()
Currently for testing purpose only
|
boolean |
isDeletedUser(ConfluenceUser user)
Check whether or not a user has been deleted completely from the application.
|
boolean |
isUnsyncedUser(ConfluenceUser user)
Check whether or not a user exists in the application as unsynced.
|
void |
remove(ConfluenceUser user)
Remove the supplied ConfluenceUser from persistence.
|
ConfluenceUser |
rename(ConfluenceUser userToRename,
String newUsername,
boolean overrideExisting)
Renames a user
|
ConfluenceUser |
rename(String oldUsername,
String newUsername,
boolean overrideExisting)
Renames a user
|
List<ConfluenceUser> |
searchUnsyncedUsers(String searchParam)
Search all unsynced users, whose account has been disconnected from an external directory, i.e.
|
void |
update(ConfluenceUser user)
Change a property of an existing ConfluenceUser.
|
public HibernateConfluenceUserDao(org.hibernate.SessionFactory sessionFactory)
public void create(ConfluenceUser user)
create
in interface ConfluenceUserDao
public void update(ConfluenceUser user)
ConfluenceUserDao
update
in interface ConfluenceUserDao
public ConfluenceUser findByKey(@Nullable com.atlassian.sal.api.user.UserKey key)
ConfluenceUserDao
findByKey
in interface ConfluenceUserDao
public @Nullable ConfluenceUser findByUsername(String username)
ConfluenceUserDao
Note that username lookups are case-insensitive, so the user you get back may not have exactly the same name as the name passed to this method.
findByUsername
in interface ConfluenceUserDao
public Set<ConfluenceUser> getAll()
getAll
in interface ConfluenceUserDao
public Map<String,com.atlassian.sal.api.user.UserKey> findUserKeysByLowerNames(Iterable<String> names)
ConfluenceUserDao
findUserKeysByLowerNames
in interface ConfluenceUserDao
public List<com.atlassian.sal.api.user.UserKey> getAllUserKeys()
ConfluenceUserDao
getAllUserKeys
in interface ConfluenceUserDao
public Map<com.atlassian.sal.api.user.UserKey,String> findLowerNamesByKeys(Iterable<com.atlassian.sal.api.user.UserKey> keys)
ConfluenceUserDao
findLowerNamesByKeys
in interface ConfluenceUserDao
public boolean isDeletedUser(ConfluenceUser user)
ConfluenceUserDao
isDeletedUser
in interface ConfluenceUserDao
public boolean isUnsyncedUser(ConfluenceUser user)
ConfluenceUserDao
ConfluenceUserDao.isDeletedUser(ConfluenceUser)
). This may
include users who have technically been removed through Confluence prior to 6.13.0.isUnsyncedUser
in interface ConfluenceUserDao
public List<ConfluenceUser> searchUnsyncedUsers(String searchParam)
ConfluenceUserDao
searchUnsyncedUsers
in interface ConfluenceUserDao
searchParam
- the username parameter to search bypublic int countUnsyncedUsers()
ConfluenceUserDao
countUnsyncedUsers
in interface ConfluenceUserDao
public Map<com.atlassian.sal.api.user.UserKey,Optional<ConfluenceUser>> findByKeys(Set<com.atlassian.sal.api.user.UserKey> userkeys)
ConfluenceUserDao
ConfluenceUser
s.findByKeys
in interface ConfluenceUserDao
userkeys
- The set of UserKey
sMap
of UserKey
s to Optional
ConfluenceUser
s. Every UserKey
present in the userkeys parameter will have an entry in this map.public void remove(ConfluenceUser user)
ConfluenceUserDao
remove
in interface ConfluenceUserDao
public ConfluenceUser rename(String oldUsername, String newUsername, boolean overrideExisting)
ConfluenceUserDao
rename
in interface ConfluenceUserDao
oldUsername
- old username for the usernewUsername
- new username for the useroverrideExisting
- True if possible existing mapping should make way for the renamed one. False for opposite
behaviour.public ConfluenceUser rename(ConfluenceUser userToRename, String newUsername, boolean overrideExisting)
ConfluenceUserDao
rename
in interface ConfluenceUserDao
userToRename
- ConfluenceUser object representing user to renamenewUsername
- new username for the useroverrideExisting
- True if possible existing mapping should make way for the renamed one. False for opposite
behaviour.Copyright © 2003–2020 Atlassian. All rights reserved.