com.atlassian.confluence.user
Class AuthenticatedUserThreadLocal

java.lang.Object
  extended by com.atlassian.confluence.user.AuthenticatedUserThreadLocal

public class AuthenticatedUserThreadLocal
extends java.lang.Object

A simple ThreadLocal to store the currently authenticated user. This can be used when the user comes from something other than the web interface (i.e. SOAP).


Constructor Summary
AuthenticatedUserThreadLocal()
           
 
Method Summary
static ConfluenceUser get()
           
static com.atlassian.user.User getUser()
          Deprecated. since 5.2. Use get() instead.
static java.lang.String getUsername()
           
static boolean isAnonymousUser()
           
static void reset()
          Remove any user from the current context
static void set(ConfluenceUser user)
           
static void setUser(com.atlassian.user.User user)
          Deprecated. since 5.2. Use set(ConfluenceUser) instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticatedUserThreadLocal

public AuthenticatedUserThreadLocal()
Method Detail

set

public static void set(ConfluenceUser user)
Since:
5.2

setUser

@Deprecated
public static void setUser(com.atlassian.user.User user)
Deprecated. since 5.2. Use set(ConfluenceUser) instead.


get

public static ConfluenceUser get()
Returns:
the currently authenticated user, null if anonymous user
Since:
5.2

getUser

@Deprecated
public static com.atlassian.user.User getUser()
Deprecated. since 5.2. Use get() instead.

Returns:
the currently authenticated user, null if anonymous user

reset

public static void reset()
Remove any user from the current context


getUsername

public static java.lang.String getUsername()

isAnonymousUser

public static boolean isAnonymousUser()
Returns:
true if anonymous user
Since:
5.3.1


Copyright © 2003-2014 Atlassian. All Rights Reserved.