Interface RequestHandlerDelegate
-
public interface RequestHandlerDelegateProvides 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringbuildUserInfo(IContext context)Returns a string representation of the user for the specified context, including its roles.java.lang.StringformatDate(java.util.Date date)Converts the specified date to a string.longgetExpiresTimeStamp(java.lang.Integer addYears)Returns the current time (in milliseconds since the Unix epoch) after the specified number of years.ISessiongetSessionFromRequest(IMxRuntimeRequest request)Get the session using the cookie.ISessiongetSessionFromRequest(IMxRuntimeRequest request, boolean performCSRFCheck)Get the session using the cookie.java.lang.StringgetSessionIdCookieName()Returns the name of the header field containing the session ID cookie.booleanisSessionKilledByNewLogin(IMxRuntimeRequest request)Returns whether the specified session was killed because the same user logged in for a different session.ILogNodelogger()Returns the logger of this request handler.java.util.DateparseDate(java.lang.String date)Converts the specified string to a date.
-
-
-
Method Detail
-
logger
ILogNode logger()
Returns the logger of this request handler.- Returns:
- the log node
-
getSessionFromRequest
ISession getSessionFromRequest(IMxRuntimeRequest request) throws CoreException
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
java.lang.String getSessionIdCookieName()
Returns the name of the header field containing the session ID cookie.- Returns:
- the header name
-
isSessionKilledByNewLogin
boolean isSessionKilledByNewLogin(IMxRuntimeRequest request)
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
java.lang.String buildUserInfo(IContext context)
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
long getExpiresTimeStamp(java.lang.Integer addYears)
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
java.lang.String formatDate(java.util.Date date)
Converts the specified date to a string.- Parameters:
date- the date to convert- Returns:
- the string representation of the date
-
parseDate
java.util.Date parseDate(java.lang.String date) throws java.text.ParseExceptionConverts the specified string to a date.- Parameters:
date- the string to parse- Returns:
- the parsed date
- Throws:
java.text.ParseException- if parsing the date fails
-
-