public class MockUserKeyStore extends Object implements UserKeyStore
Constructor and Description |
---|
MockUserKeyStore() |
Modifier and Type | Method and Description |
---|---|
void |
changeKey(String oldUserKey,
String newUserKey) |
String |
ensureUniqueKeyForNewUser(String username) |
Long |
getIdForUserKey(String name) |
String |
getKeyForUsername(String username) |
String |
getKeyFromId(long id)
Returns key generated from id.
|
Optional<String> |
getUniqueKeyFromId(long id)
Returns unique key generated from id.
|
Optional<String> |
getUniqueUsernameFromId(long id)
Returns unique username generated from id.
|
Optional<ApplicationUserEntity> |
getUserForId(Long id) |
Optional<ApplicationUserEntity> |
getUserForKey(String key) |
Optional<ApplicationUserEntity> |
getUserForUsername(String username) |
String |
getUsernameForKey(String key) |
boolean |
isSystemKey(String key)
Returns true if passed
key has been generated automatically by Jira. |
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) |
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 boolean isSystemKey(String key)
UserKeyStore
key
has been generated automatically by Jira.isSystemKey
in interface UserKeyStore
public String getKeyFromId(long id)
UserKeyStore
getKeyFromId
in interface UserKeyStore
@Nonnull public Optional<String> getUniqueKeyFromId(long id)
UserKeyStore
getUniqueKeyFromId
in interface UserKeyStore
@Nonnull public Optional<String> getUniqueUsernameFromId(long id)
UserKeyStore
getUniqueUsernameFromId
in interface UserKeyStore
public void changeKey(String oldUserKey, String newUserKey)
changeKey
in interface UserKeyStore
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
Copyright © 2002-2019 Atlassian. All Rights Reserved.