Class JiraAuthenticationContextImpl
- All Implemented Interfaces:
JiraAuthenticationContext
-
Constructor Summary
ConstructorDescriptionJiraAuthenticationContextImpl
(com.atlassian.seraph.auth.AuthenticationContext authenticationContext, I18nHelper.BeanFactory i18n) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears any logged in user from authentication scope.static void
Useful for localisation of messages.Get the users locale.Returns the currently logged in User.Method used to get a nice representation of a date using a user's locale.Deprecated.static <T> T
getRequestCache
(String cacheKey, com.google.common.base.Supplier<T> cacheFactory) Deprecated.UseRequestCacheFactory
instead; it has safer semantics.getUser()
Returns the currently logged in User.protected UserManager
boolean
Returns a boolean indicating whether there is a currently logged in user.void
This is used in places like Jelly where we need to switch the identity of a user during execution.
-
Constructor Details
-
JiraAuthenticationContextImpl
public JiraAuthenticationContextImpl(com.atlassian.seraph.auth.AuthenticationContext authenticationContext, I18nHelper.BeanFactory i18n)
-
-
Method Details
-
clearRequestCache
public static void clearRequestCache() -
getRequestCache
Deprecated.UseRequestCacheFactory
instead; it has safer semantics. -
getRequestCache
public static <T> T getRequestCache(@Nonnull String cacheKey, @Nonnull com.google.common.base.Supplier<T> cacheFactory) Deprecated.UseRequestCacheFactory
instead; it has safer semantics. -
getLoggedInUser
Description copied from interface:JiraAuthenticationContext
Returns the currently logged in User.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 anApplicationUser
instead. That class has different semantics forObject.equals(Object)
and therefore does not extend theUser
class. This means that the 6.0 version is not binary or source compatible with earlier versions when this method is used.- Specified by:
getLoggedInUser
in interfaceJiraAuthenticationContext
- Returns:
- The logged in
ApplicationUser
, ornull
-
getUserManager
-
isLoggedInUser
public boolean isLoggedInUser()Description copied from interface:JiraAuthenticationContext
Returns a boolean indicating whether there is a currently logged in user.- Specified by:
isLoggedInUser
in interfaceJiraAuthenticationContext
- Returns:
- true if there is a currently logged in user
-
getUser
Description copied from interface:JiraAuthenticationContext
Returns the currently logged in User.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 anApplicationUser
instead. That class has different semantics forObject.equals(Object)
and therefore does not extend theUser
class. This means that the 6.0 version is not binary or source compatible with earlier versions when this method is used.- Specified by:
getUser
in interfaceJiraAuthenticationContext
- Returns:
- The logged in
ApplicationUser
, ornull
-
getLocale
Description copied from interface:JiraAuthenticationContext
Get the users locale.- Specified by:
getLocale
in interfaceJiraAuthenticationContext
- Returns:
- The user's locale, or the default system locale.
-
getOutlookDate
Description copied from interface:JiraAuthenticationContext
Method used to get a nice representation of a date using a user's locale.- Specified by:
getOutlookDate
in interfaceJiraAuthenticationContext
- Returns:
- A
OutlookDate
-
getI18nHelper
Description copied from interface:JiraAuthenticationContext
Useful for localisation of messages.- Specified by:
getI18nHelper
in interfaceJiraAuthenticationContext
- Returns:
- An instance of
I18nHelper
-
setLoggedInUser
Description copied from interface:JiraAuthenticationContext
This is used in places like Jelly where we need to switch the identity of a user during execution.- Specified by:
setLoggedInUser
in interfaceJiraAuthenticationContext
- Parameters:
user
- the currently logged in user
-
clearLoggedInUser
public void clearLoggedInUser()Description copied from interface:JiraAuthenticationContext
Clears any logged in user from authentication scope. After this call the anonymous user is considered to be about, ie no-one is about- Specified by:
clearLoggedInUser
in interfaceJiraAuthenticationContext
-
RequestCacheFactory
instead; it has safer semantics.