public class MockUserKeyStore extends Object implements UserKeyStore
Constructor and Description |
---|
MockUserKeyStore() |
Modifier and Type | Method and Description |
---|---|
String |
ensureUniqueKeyForNewUser(String username) |
Long |
getIdForUserKey(String name) |
String |
getKeyForUsername(String username) |
Optional<ApplicationUserEntity> |
getUserForId(Long id) |
Optional<ApplicationUserEntity> |
getUserForKey(String key) |
Optional<ApplicationUserEntity> |
getUserForUsername(String username) |
String |
getUsernameForKey(String key) |
String |
removeByKey(String key)
It is dangerous to use this method. In general operation JIRA needs to keep the userName -> key
mapping around even if the user is deleted.
|
void |
renameUser(String oldUsername,
String newUsername) |
void |
setMapping(String key,
String username) |
void |
useDefaultMapping(boolean useDefaultMapping) |
public String getUsernameForKey(String key)
getUsernameForKey
in interface UserKeyStore
public String getKeyForUsername(String username)
getKeyForUsername
in interface UserKeyStore
public void renameUser(String oldUsername, String newUsername)
renameUser
in interface UserKeyStore
public String ensureUniqueKeyForNewUser(String username)
ensureUniqueKeyForNewUser
in interface UserKeyStore
public String removeByKey(String key)
UserKeyStore
This method is used by cloud for import where all the users are deleted anyways (see JiraUserServiceImpl).
removeByKey
in interface UserKeyStore
key
- the key to remove.public Long getIdForUserKey(String name)
getIdForUserKey
in interface UserKeyStore
public Optional<ApplicationUserEntity> getUserForId(Long id)
getUserForId
in interface UserKeyStore
public Optional<ApplicationUserEntity> getUserForKey(String key)
getUserForKey
in interface UserKeyStore
public Optional<ApplicationUserEntity> getUserForUsername(String username)
getUserForUsername
in interface UserKeyStore
public void useDefaultMapping(boolean useDefaultMapping)
Copyright © 2002-2017 Atlassian. All Rights Reserved.