public class HttpHeaderApplicationUserBuilder extends Object implements ApplicationUserBuilder
| Modifier and Type | Field and Description |
|---|---|
static String |
CALENDAR_PATTERN_PWD |
static String |
CALENDAR_PATTERN_SESSION |
static String |
CALENDAR_PATTERN_SESSION_TZ |
static String[] |
CALENDAR_PATTERNS |
static String |
HTTP_HEADER_EMAIL |
static String |
HTTP_HEADER_FIRST_NAME |
static String |
HTTP_HEADER_LAST_NAME |
static String |
HTTP_HEADER_ROLES |
static String |
HTTP_HEADER_SESSION_ID |
static String |
HTTP_HEADER_SESSION_INIT_TIME |
static String |
HTTP_HEADER_USER_ID |
| Constructor and Description |
|---|
HttpHeaderApplicationUserBuilder() |
| Modifier and Type | Method and Description |
|---|---|
ApplicationUser |
build(javax.servlet.http.HttpServletRequest request)
Builds an application user from the headers contained within the HTTP servlet request.
|
protected void |
buildEmail(ApplicationUser applicationUser,
Map<String,String> httpHeaders,
String headerName) |
protected void |
buildFirstName(ApplicationUser applicationUser,
Map<String,String> httpHeaders,
String headerName) |
protected void |
buildLastName(ApplicationUser applicationUser,
Map<String,String> httpHeaders,
String headerName) |
ApplicationUser |
buildNoRoles(javax.servlet.http.HttpServletRequest request)
Builds a user object without the roles from the headers contained within the HTTP servlet request.
|
protected void |
buildRoles(ApplicationUser applicationUser,
Map<String,String> httpHeaders,
String headerName)
Parses the header and assigns roles to the given user object.
|
protected void |
buildSessionId(ApplicationUser applicationUser,
Map<String,String> httpHeaders,
String headerName) |
protected void |
buildSessionInitTime(ApplicationUser applicationUser,
Map<String,String> httpHeaders,
String headerName) |
protected ApplicationUser |
buildUser(Map<String,String> headerMap,
boolean includeRoles)
Builds the application user from the header map.
|
protected void |
buildUserId(ApplicationUser applicationUser,
Map<String,String> httpHeaders,
String headerName)
Builds a user Id.
|
protected ApplicationUser |
createNewApplicationUser()
A Factory Method for creating a new
ApplicationUser. |
Date |
getHeaderValueDate(String headerName,
Map<String,String> httpHeaders)
Gets an HTTP header date value from the map of headers for the specified header name.
|
protected String |
getHeaderValueString(String headerName,
Map<String,String> httpHeaders)
Gets an HTTP header string value from the map of headers for the specified header name.
|
public static final String HTTP_HEADER_USER_ID
public static final String HTTP_HEADER_FIRST_NAME
public static final String HTTP_HEADER_LAST_NAME
public static final String HTTP_HEADER_EMAIL
public static final String HTTP_HEADER_ROLES
public static final String HTTP_HEADER_SESSION_INIT_TIME
public static final String HTTP_HEADER_SESSION_ID
public static final String CALENDAR_PATTERN_PWD
public static final String CALENDAR_PATTERN_SESSION
public static final String CALENDAR_PATTERN_SESSION_TZ
public static final String[] CALENDAR_PATTERNS
public ApplicationUser build(javax.servlet.http.HttpServletRequest request)
ApplicationUserBuilderbuild in interface ApplicationUserBuilderrequest - the HTTP servlet request.public ApplicationUser buildNoRoles(javax.servlet.http.HttpServletRequest request)
ApplicationUserBuilderbuildNoRoles in interface ApplicationUserBuilderrequest - the HTTP servlet request.protected ApplicationUser buildUser(Map<String,String> headerMap, boolean includeRoles)
headerMap - the map of headers.includeRoles - If true, the user's roles will be included. Otherwise, not.protected ApplicationUser createNewApplicationUser()
ApplicationUser. Provide ability for subclasses to override this if a custom user class is required. The
custom user class must extend ApplicationUser.protected void buildUserId(ApplicationUser applicationUser, Map<String,String> httpHeaders, String headerName)
applicationUser - the application user.httpHeaders - the HTTP headers.headerName - the header name for the user Id.protected void buildFirstName(ApplicationUser applicationUser, Map<String,String> httpHeaders, String headerName)
protected void buildLastName(ApplicationUser applicationUser, Map<String,String> httpHeaders, String headerName)
protected void buildEmail(ApplicationUser applicationUser, Map<String,String> httpHeaders, String headerName)
protected void buildSessionId(ApplicationUser applicationUser, Map<String,String> httpHeaders, String headerName)
protected void buildSessionInitTime(ApplicationUser applicationUser, Map<String,String> httpHeaders, String headerName)
protected void buildRoles(ApplicationUser applicationUser, Map<String,String> httpHeaders, String headerName)
applicationUser - - the user object to populate the roles tohttpHeaders - - the HTTP headers given in the current requestheaderName - - the name of the header containing the rolesprotected String getHeaderValueString(String headerName, Map<String,String> httpHeaders)
headerName - the HTTP header name to get.httpHeaders - the HTTP headers.public Date getHeaderValueDate(String headerName, Map<String,String> httpHeaders)
headerName - the HTTP header name to get.httpHeaders - the HTTP headers.Copyright © 2019. All rights reserved.