public class

BootstrapJiraAuthenticationContext

extends Object
implements JiraAuthenticationContext
java.lang.Object
   ↳ com.atlassian.jira.i18n.BootstrapJiraAuthenticationContext

Class Overview

Simple JiraAuthenticationContext to be used in the Bootstrap container, because it is needed to show start up errors.

Basically it says all access is anonymous, and it always returns an I18nHelper in English.

Summary

Public Constructors
BootstrapJiraAuthenticationContext()
Public Methods
void clearLoggedInUser()
Clears any logged in user from authentication scope.
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.
String getText(String key)
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.security.JiraAuthenticationContext

Public Constructors

public BootstrapJiraAuthenticationContext ()

Public Methods

public 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

public I18nHelper getI18nBean ()

Useful for localisation of messages.

Returns

public I18nHelper getI18nHelper ()

Useful for localisation of messages.

Returns

public Locale getLocale ()

Get the users locale.

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

public ApplicationUser getLoggedInUser ()

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 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

public OutlookDate getOutlookDate ()

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

Returns

public String getText (String key)

public 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 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

public boolean isLoggedInUser ()

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

Returns
  • true if there is a currently logged in user

public 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