com.atlassian.jira.security
Class JiraAuthenticationContextImpl

java.lang.Object
  extended by com.atlassian.jira.security.JiraAuthenticationContextImpl
All Implemented Interfaces:
JiraAuthenticationContext

public class JiraAuthenticationContextImpl
extends Object
implements JiraAuthenticationContext


Constructor Summary
JiraAuthenticationContextImpl(com.atlassian.seraph.auth.AuthenticationContext authenticationContext, I18nHelper.BeanFactory i18n)
           
 
Method Summary
 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.
 com.atlassian.crowd.embedded.api.User 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()
           
 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.
 void setLoggedInUser(com.atlassian.crowd.embedded.api.User user)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JiraAuthenticationContextImpl

public JiraAuthenticationContextImpl(com.atlassian.seraph.auth.AuthenticationContext authenticationContext,
                                     I18nHelper.BeanFactory i18n)
Method Detail

clearRequestCache

public static void clearRequestCache()

getRequestCache

public static Map<String,Object> getRequestCache()

getLoggedInUser

public com.atlassian.crowd.embedded.api.User getLoggedInUser()
Description copied from interface: JiraAuthenticationContext
Returns the currently logged in User.

Specified by:
getLoggedInUser in interface JiraAuthenticationContext
Returns:
The logged in User, or null

getUserManager

protected UserManager 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 interface JiraAuthenticationContext
Returns:
true if there is a currently logged in user

getUser

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

Specified by:
getUser in interface JiraAuthenticationContext
Returns:
The logged in ApplicationUser, or null

getLocale

public Locale getLocale()
Description copied from interface: JiraAuthenticationContext
Get the users locale.

Specified by:
getLocale in interface JiraAuthenticationContext
Returns:
The user's locale, or the default system locale.

getOutlookDate

public OutlookDate 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 interface JiraAuthenticationContext
Returns:
A OutlookDate

getText

public String getText(String key)
Specified by:
getText in interface JiraAuthenticationContext
Parameters:
key - the text key
Returns:
the translated text

getI18nHelper

public I18nHelper getI18nHelper()
Description copied from interface: JiraAuthenticationContext
Useful for localisation of messages.

Specified by:
getI18nHelper in interface JiraAuthenticationContext
Returns:
An instance of I18nHelper

getI18nBean

public I18nHelper getI18nBean()
Description copied from interface: JiraAuthenticationContext
Useful for localisation of messages.

Specified by:
getI18nBean in interface JiraAuthenticationContext
Returns:
An instance of I18nHelper

setLoggedInUser

@Deprecated
public void setLoggedInUser(com.atlassian.crowd.embedded.api.User user)
Deprecated. 

Description copied from interface: JiraAuthenticationContext
This id usedin places like Jelly where we need to switch the identity of a user during execution.

Specified by:
setLoggedInUser in interface JiraAuthenticationContext
Parameters:
user - the currently logged in user

setLoggedInUser

public void setLoggedInUser(ApplicationUser user)
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 interface JiraAuthenticationContext
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 interface JiraAuthenticationContext


Copyright © 2002-2014 Atlassian. All Rights Reserved.