public class UserKeyStoreImpl extends Object implements UserKeyStore
Constructor and Description |
---|
UserKeyStoreImpl(EntityEngine entityEngine,
OfBizDelegator ofBizDelegator,
org.ofbiz.core.entity.DelegatorInterface delegatorInterface,
com.atlassian.event.api.EventPublisher eventPublisher,
com.atlassian.cache.CacheManager cacheManager) |
Modifier and Type | Method and Description |
---|---|
void |
changeKey(String oldUserKey,
String newUserKey) |
String |
ensureUniqueKeyForNewUser(String username) |
Long |
getIdForUserKey(String userKey) |
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.
|
protected int |
getUniqueValueRetryCount() |
Optional<ApplicationUserEntity> |
getUserForId(Long id) |
Optional<ApplicationUserEntity> |
getUserForKey(String key) |
Optional<ApplicationUserEntity> |
getUserForUsername(String username) |
String |
getUsernameForKey(String userKey) |
boolean |
isSystemKey(String key)
Returns true if passed
key has been generated automatically by Jira. |
void |
onClearCache(ClearCacheEvent event) |
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) |
public UserKeyStoreImpl(EntityEngine entityEngine, OfBizDelegator ofBizDelegator, org.ofbiz.core.entity.DelegatorInterface delegatorInterface, com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.cache.CacheManager cacheManager)
public String getUsernameForKey(String userKey)
getUsernameForKey
in interface UserKeyStore
public String getKeyForUsername(String username)
getKeyForUsername
in interface UserKeyStore
public Long getIdForUserKey(String userKey)
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 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(@Nonnull String key)
UserKeyStore
key
has been generated automatically by Jira.isSystemKey
in interface UserKeyStore
@Nonnull 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(@Nonnull String oldUserKey, @Nonnull String newUserKey)
changeKey
in interface UserKeyStore
@EventListener public void onClearCache(ClearCacheEvent event)
protected int getUniqueValueRetryCount()
Copyright © 2002-2021 Atlassian. All Rights Reserved.