Interface RequestHandlerDelegate
public interface RequestHandlerDelegate
Provides the interface to the request handler. This is an internal class that is not to be used and may change at any time.
-
Method Summary
Modifier and TypeMethodDescriptionbuildUserInfo
(IContext context) Returns a string representation of the user for the specified context, including its roles.formatDate
(Date date) Converts the specified date to a string.long
getExpiresTimeStamp
(Integer addYears) Returns the current time (in milliseconds since the Unix epoch) after the specified number of years.getSessionFromRequest
(IMxRuntimeRequest request) Get the session using the cookie.getSessionFromRequest
(IMxRuntimeRequest request, boolean performCSRFCheck) Get the session using the cookie.Returns the name of the header field containing the session ID cookie.boolean
Returns whether the specified session was killed because the same user logged in for a different session.logger()
Returns the logger of this request handler.Converts the specified string to a date.
-
Method Details
-
logger
ILogNode logger()Returns the logger of this request handler.- Returns:
- the log node
-
getSessionFromRequest
Get the session using the cookie. No CSRF check will be performed.- Parameters:
request
- the request from which to get the session- Returns:
- the session
- Throws:
CoreException
- if the session cannot be retrieved
-
getSessionFromRequest
ISession getSessionFromRequest(IMxRuntimeRequest request, boolean performCSRFCheck) throws CoreException Get the session using the cookie.- Parameters:
request
- the request from which to get the sessionperformCSRFCheck
- whether a CSRF check will be performed using the request headers- Returns:
- the session
- Throws:
CoreException
- if the session cannot be retrieved
-
getSessionIdCookieName
String getSessionIdCookieName()Returns the name of the header field containing the session ID cookie.- Returns:
- the header name
-
isSessionKilledByNewLogin
Returns whether the specified session was killed because the same user logged in for a different session.- Parameters:
request
- the request from which to get the session- Returns:
- true if the session was killed, false otherwise
-
buildUserInfo
Returns a string representation of the user for the specified context, including its roles.If the context is a system context an empty string is returned.
- Parameters:
context
- the string representation
-
getExpiresTimeStamp
Returns the current time (in milliseconds since the Unix epoch) after the specified number of years.- Parameters:
addYears
- the number of years to add to the current time
-
formatDate
Converts the specified date to a string.- Parameters:
date
- the date to convert- Returns:
- the string representation of the date
-
parseDate
Converts the specified string to a date.- Parameters:
date
- the string to parse- Returns:
- the parsed date
- Throws:
ParseException
- if parsing the date fails
-