Class DefaultUserContext
java.lang.Object
com.atlassian.administration.quicksearch.impl.spi.DefaultUserContext
- All Implemented Interfaces:
RenderingContext,UserContext
Default implementation of
UserContext.- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultUserContext(String username, Locale locale, com.atlassian.sal.api.message.I18nResolver resolver, jakarta.servlet.http.HttpServletRequest request) DefaultUserContext(String username, Locale locale, com.atlassian.sal.api.message.I18nResolver resolver, jakarta.servlet.http.HttpServletRequest request, Map<String, Object> context) -
Method Summary
Modifier and TypeMethodDescriptionGet the rendering context map.com.atlassian.sal.api.message.I18nResolverGet I18n resolver associated with the current user.Get locale associated with the current user.jakarta.servlet.http.HttpServletRequestGet current executing request.Name of the current user.booleanCheck whether there is an authenticated user.static UserContextunauthenticated(jakarta.servlet.http.HttpServletRequest request)
-
Constructor Details
-
DefaultUserContext
-
DefaultUserContext
-
-
Method Details
-
unauthenticated
-
getUsername
Description copied from interface:UserContextName of the current user. If there is no authenticated user associated with the executing request, returnnull.- Specified by:
getUsernamein interfaceUserContext- Returns:
- current user, or
nullif no user authenticated
-
isAuthenticated
public boolean isAuthenticated()Description copied from interface:UserContextCheck whether there is an authenticated user.- Specified by:
isAuthenticatedin interfaceUserContext- Returns:
true, if there is an authenticated user associated with the current request.
-
getLocale
Description copied from interface:UserContextGet locale associated with the current user. Default locale ifUserContext.isAuthenticated()returnsfalse.- Specified by:
getLocalein interfaceUserContext- Returns:
- get user locale
-
getI18nResolver
@Nonnull public com.atlassian.sal.api.message.I18nResolver getI18nResolver()Description copied from interface:UserContextGet I18n resolver associated with the current user. Default language resolver if no user associated with this context (UserContext.isAuthenticated()returnsfalse).- Specified by:
getI18nResolverin interfaceUserContext- Returns:
- i18n resolver
-
getRequest
@Nonnull public jakarta.servlet.http.HttpServletRequest getRequest()Description copied from interface:RenderingContextGet current executing request.- Specified by:
getRequestin interfaceRenderingContext- Returns:
- HTTP request
-
getContextMap
Description copied from interface:RenderingContextGet the rendering context map.- Specified by:
getContextMapin interfaceRenderingContext- Returns:
- context map
-