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.longgetExpiresTimeStamp(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.booleanReturns 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
-
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
-
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- Returns:
- the expiry time
-
formatDate
-
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
-