Class RequestHandler
java.lang.Object
com.mendix.externalinterface.connector.RequestHandler
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringbuildUserInfo(IContext context) voiddoProcessRequest(com.mendix.m2ee.api.IMxRuntimeRequest request, com.mendix.m2ee.api.IMxRuntimeResponse response, String path) protected StringformatDate(Date date) protected longgetExpiresTimeStamp(int addYears) protected Stringprotected ISessiongetSessionFromRequest(com.mendix.m2ee.api.IMxRuntimeRequest request) Get the session using the cookie.protected ISessiongetSessionFromRequest(com.mendix.m2ee.api.IMxRuntimeRequest request, boolean performCSRFCheck) Get the session using the cookie.protected booleanisSessionKilledByNewLogin(com.mendix.m2ee.api.IMxRuntimeRequest request) Returns whether the specified session has expired.protected Dateprotected abstract voidprocessRequest(com.mendix.m2ee.api.IMxRuntimeRequest request, com.mendix.m2ee.api.IMxRuntimeResponse response, String path) Process the request.
-
Field Details
-
CSRF_TOKEN_HEADER
- See Also:
-
CSRF_TOKEN_PARAMETER
- See Also:
-
EXPIRES
- See Also:
-
APPLICATION_OCTET_STREAM_TYPE
- See Also:
-
logger
protected com.mendix.logging.ILogNode logger
-
-
Constructor Details
-
RequestHandler
public RequestHandler() -
RequestHandler
Deprecated.As of Mendix 8.11. Use the no-arg constructor.Construct RequestHandler.
-
-
Method Details
-
doProcessRequest
public void doProcessRequest(com.mendix.m2ee.api.IMxRuntimeRequest request, com.mendix.m2ee.api.IMxRuntimeResponse response, String path) throws Exception - Throws:
Exception
-
processRequest
protected abstract void processRequest(com.mendix.m2ee.api.IMxRuntimeRequest request, com.mendix.m2ee.api.IMxRuntimeResponse response, String path) throws Exception Process the request.- Throws:
Exception
-
getSessionFromRequest
protected ISession getSessionFromRequest(com.mendix.m2ee.api.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
protected ISession getSessionFromRequest(com.mendix.m2ee.api.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
-
isSessionKilledByNewLogin
protected boolean isSessionKilledByNewLogin(com.mendix.m2ee.api.IMxRuntimeRequest request) Returns whether the specified session has expired.- Parameters:
request- the request from which to get the session- Returns:
- true if the session expired, false otherwise
-
buildUserInfo
-
getExpiresTimeStamp
protected long getExpiresTimeStamp(int addYears) -
formatDate
-
parseDate
- Throws:
ParseException
-
getSessionCookieName
-