Package de.xima.fc.user
Class UserContextFactory
- java.lang.Object
-
- de.xima.fc.user.UserContextFactory
-
public class UserContextFactory extends Object
Factory methods for creating newUserContext
instances.- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
Fields Modifier and Type Field Description static UserContext
ANONYMOUS
User context for theanonymous user
.static UserContext
SETUP
Deprecated.UseforSystem()
instead.static UserContext
SYSTEM
User context for thesystem user
.
-
Constructor Summary
Constructors Constructor Description UserContextFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static UserContext
copyOf(UserContext uc)
static UserContext
forAnonymous()
static UserContext
forBenutzer(Benutzer ben)
Deprecated.useforUser(IUser)
instead.static UserContext
forRequest(javax.servlet.http.HttpServletRequest request)
Deprecated.static UserContext
forRequest(javax.servlet.http.HttpServletRequest request, boolean createSession)
Deprecated.static UserContext
forSystem()
static UserContext
forUser(IUser user)
static UserContext
forWebContext(javax.faces.context.FacesContext ctx, IAuthenticationTarget target)
Reads the user from the given Faces context, and creates a new user context wrapper for that user.static UserContext
forWebContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, IAuthenticationTarget target)
Reads the user from the given request and response, and creates a new user context wrapper for that user.static UserContext
forXfcSession(XfcSession session)
Deprecated.static UserContext
getNew()
Deprecated.UseforAnonymous()
.
-
-
-
Field Detail
-
ANONYMOUS
public static UserContext ANONYMOUS
User context for theanonymous user
. Theparameters
cannot be modified.
-
SYSTEM
public static UserContext SYSTEM
User context for thesystem user
. Theparameters
cannot be modified.
-
SETUP
@Deprecated public static UserContext SETUP
Deprecated.UseforSystem()
instead.
-
-
Method Detail
-
forAnonymous
public static UserContext forAnonymous()
- Returns:
- User context for the anonymous user
VirtualUser.ANONYMOUS
.
-
copyOf
public static UserContext copyOf(UserContext uc)
- Parameters:
uc
- A user context to copy.- Returns:
- A new user context with the same user and parameters. Modifications to the parameters do not affect the parameters of the original user context.
-
forSystem
public static UserContext forSystem()
- Returns:
- User context for the system user
VirtualUser.SYSTEM
.
-
forUser
public static UserContext forUser(IUser user)
- Parameters:
user
- The user to wrap.- Returns:
- A new modifiable user context for the given user.
-
forWebContext
public static UserContext forWebContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, IAuthenticationTarget target)
Reads the user from the given request and response, and creates a new user context wrapper for that user.- Parameters:
request
- The request from which to read the user.response
- The response from which to read the user.target
- Authentication target (e.g. backend or frontend).- Returns:
- A new modifiable user context for the user from the given request.
-
forWebContext
public static UserContext forWebContext(javax.faces.context.FacesContext ctx, IAuthenticationTarget target)
Reads the user from the given Faces context, and creates a new user context wrapper for that user.- Parameters:
ctx
- Faces context from which to read the user.target
- Authentication target (e.g. backend or frontend).- Returns:
- A new modifiable user context for the user from the given request.
-
forBenutzer
@Deprecated public static UserContext forBenutzer(Benutzer ben)
Deprecated.useforUser(IUser)
instead.
-
forRequest
@Deprecated public static UserContext forRequest(javax.servlet.http.HttpServletRequest request)
Deprecated.
-
forRequest
@Deprecated public static UserContext forRequest(javax.servlet.http.HttpServletRequest request, boolean createSession)
Deprecated.
-
forXfcSession
@Deprecated public static UserContext forXfcSession(XfcSession session)
Deprecated.
-
getNew
@Deprecated public static UserContext getNew()
Deprecated.UseforAnonymous()
.- Returns:
- User context for the anonymous user
VirtualUser.ANONYMOUS
.
-
-