public class JiraAuthenticationContextImpl extends Object implements JiraAuthenticationContext
Constructor and Description |
---|
JiraAuthenticationContextImpl(com.atlassian.seraph.auth.AuthenticationContext authenticationContext,
I18nHelper.BeanFactory i18n) |
Modifier and Type | Method and Description |
---|---|
void |
clearLoggedInUser()
Clears any logged in user from authentication scope.
|
static void |
clearRequestCache() |
I18nHelper |
getI18nBean()
Useful for localisation of messages.
|
I18nHelper |
getI18nHelper()
Useful for localisation of messages.
|
Locale |
getLocale()
Get the users locale.
|
ApplicationUser |
getLoggedInUser()
Returns the currently logged in User.
|
OutlookDate |
getOutlookDate()
Method used to get a nice representation of a date using a user's locale.
|
static Map<String,Object> |
getRequestCache()
Deprecated.
Use
RequestCacheFactory instead; it has safer semantics. |
static <T> T |
getRequestCache(String cacheKey,
com.google.common.base.Supplier<T> cacheFactory)
Deprecated.
Use
RequestCacheFactory instead; it has safer semantics. |
String |
getText(String key) |
ApplicationUser |
getUser()
Returns the currently logged in User.
|
protected UserManager |
getUserManager() |
boolean |
isLoggedInUser()
Returns a boolean indicating whether there is a currently logged in user.
|
void |
setLoggedInUser(ApplicationUser user)
This is used in places like Jelly where we need to switch the identity of a user during execution.
|
public JiraAuthenticationContextImpl(com.atlassian.seraph.auth.AuthenticationContext authenticationContext, I18nHelper.BeanFactory i18n)
public static void clearRequestCache()
public static Map<String,Object> getRequestCache()
RequestCacheFactory
instead; it has safer semantics.public static <T> T getRequestCache(@Nonnull String cacheKey, @Nonnull com.google.common.base.Supplier<T> cacheFactory)
RequestCacheFactory
instead; it has safer semantics.public ApplicationUser getLoggedInUser()
JiraAuthenticationContext
Warning: previous incarnations of this method returned com.atlassian.crowd.embedded.api.User
.
This method had previously been deprecated and has been reused to return an ApplicationUser
instead. That
class has different semantics for Object.equals(Object)
and therefore does not extend the User
class. This means that the 6.0 version is not binary or source compatible with earlier versions when this method
is used.
getLoggedInUser
in interface JiraAuthenticationContext
ApplicationUser
, or null
protected UserManager getUserManager()
public boolean isLoggedInUser()
JiraAuthenticationContext
isLoggedInUser
in interface JiraAuthenticationContext
public ApplicationUser getUser()
JiraAuthenticationContext
Warning: previous incarnations of this method returned com.atlassian.crowd.embedded.api.User
.
This method had previously been deprecated and has been reused to return an ApplicationUser
instead. That
class has different semantics for Object.equals(Object)
and therefore does not extend the User
class. This means that the 6.0 version is not binary or source compatible with earlier versions when this method
is used.
getUser
in interface JiraAuthenticationContext
ApplicationUser
, or null
public Locale getLocale()
JiraAuthenticationContext
getLocale
in interface JiraAuthenticationContext
public OutlookDate getOutlookDate()
JiraAuthenticationContext
getOutlookDate
in interface JiraAuthenticationContext
OutlookDate
public String getText(String key)
getText
in interface JiraAuthenticationContext
key
- the text keypublic I18nHelper getI18nHelper()
JiraAuthenticationContext
getI18nHelper
in interface JiraAuthenticationContext
I18nHelper
public I18nHelper getI18nBean()
JiraAuthenticationContext
getI18nBean
in interface JiraAuthenticationContext
I18nHelper
public void setLoggedInUser(ApplicationUser user)
JiraAuthenticationContext
setLoggedInUser
in interface JiraAuthenticationContext
user
- the currently logged in userpublic void clearLoggedInUser()
JiraAuthenticationContext
clearLoggedInUser
in interface JiraAuthenticationContext
Copyright © 2002-2016 Atlassian. All Rights Reserved.