com.atlassian.jira.security
Interface JiraAuthenticationContext

All Known Implementing Classes:
JiraAuthenticationContextImpl, MockAuthenticationContext, MockSimpleAuthenticationContext

@PublicApi
public interface JiraAuthenticationContext

The JiraAuthenticationContext is used for tracking a user's session in JIRA and all it's custom parameters, such as Locale and I18n.


Method Summary
 void clearLoggedInUser()
          Clears any logged in user from authentication scope.
 I18nHelper getI18nBean()
          Deprecated. Use getI18nHelper() instead. Deprecated since v4.0
 I18nHelper getI18nHelper()
          Useful for localisation of messages.
 Locale getLocale()
          Get the users locale.
 com.atlassian.crowd.embedded.api.User getLoggedInUser()
          Deprecated. use getUser(). Since v6.0
 OutlookDate getOutlookDate()
          Deprecated. Use DateTimeFormatter instead. Since v5.0.
 String getText(String key)
          Deprecated. Use getText() method on getI18nHelper().
 ApplicationUser getUser()
          Returns the currently logged in User.
 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.
 void setLoggedInUser(com.atlassian.crowd.embedded.api.User user)
          Deprecated. use setLoggedInUser(com.atlassian.jira.user.ApplicationUser). Since v6.0
 

Method Detail

getUser

@IncompatibleReturnType(since="6.0",
                        was="com.atlassian.crowd.embedded.api.User")
ApplicationUser getUser()
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 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.

Returns:
The logged in ApplicationUser, or null

getLoggedInUser

@Deprecated
com.atlassian.crowd.embedded.api.User getLoggedInUser()
Deprecated. use getUser(). Since v6.0

Returns the currently logged in User.

Returns:
The logged in User, or null

isLoggedInUser

boolean isLoggedInUser()
Returns a boolean indicating whether there is a currently logged in user.

Returns:
true if there is a currently logged in user
Since:
v5.0.4

getLocale

Locale getLocale()
Get the users locale.

Returns:
The user's locale, or the default system locale.

getOutlookDate

@Deprecated
OutlookDate getOutlookDate()
Deprecated. Use DateTimeFormatter instead. Since v5.0.

Method used to get a nice representation of a date using a user's locale.

Returns:
A OutlookDate

getText

@Deprecated
String getText(String key)
Deprecated. Use getText() method on getI18nHelper().

Parameters:
key - the text key
Returns:
the translated text

getI18nHelper

I18nHelper getI18nHelper()
Useful for localisation of messages.

Returns:
An instance of I18nHelper

getI18nBean

@Deprecated
I18nHelper getI18nBean()
Deprecated. Use getI18nHelper() instead. Deprecated since v4.0

Useful for localisation of messages.

Returns:
An instance of I18nHelper

setLoggedInUser

void setLoggedInUser(com.atlassian.crowd.embedded.api.User user)
Deprecated. use setLoggedInUser(com.atlassian.jira.user.ApplicationUser). Since v6.0

This id usedin places like Jelly where we need to switch the identity of a user during execution.

Parameters:
user - the currently logged in user

setLoggedInUser

void setLoggedInUser(ApplicationUser user)
This is used in places like Jelly where we need to switch the identity of a user during execution.

Parameters:
user - the currently logged in user

clearLoggedInUser

void clearLoggedInUser()
Clears any logged in user from authentication scope. After this call the anonymous user is considered to be about, ie no-one is about



Copyright © 2002-2014 Atlassian. All Rights Reserved.