Class RequestHandler
java.lang.Object
com.mendix.externalinterface.connector.RequestHandler
- All Implemented Interfaces:
- IRequestHandler
Implementation of 
IRequestHandler that provides some access to the Mendix Runtime. Most importantly, it lets you access session
 information of requests.- 
Field SummaryFieldsFields inherited from interface com.mendix.externalinterface.connector.IRequestHandlerAPPLICATION_OCTET_STREAM_TYPE, CSRF_TOKEN_HEADER, CSRF_TOKEN_PARAMETER, EXPIRES
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected StringbuildUserInfo(IContext context) voiddoProcessRequest(IMxRuntimeRequest request, IMxRuntimeResponse response, String path) Method that is called when a new request is to be processed.protected StringformatDate(Date date) protected longgetExpiresTimeStamp(int addYears) protected Stringprotected ISessiongetSessionFromRequest(IMxRuntimeRequest request) Get the session using the cookie.protected ISessiongetSessionFromRequest(IMxRuntimeRequest request, boolean performCSRFCheck) Get the session using the cookie.protected booleanReturns whether the specified session has expired.protected Dateprotected abstract voidprocessRequest(IMxRuntimeRequest request, IMxRuntimeResponse response, String path) Method that is called when a new request is to be processed.
- 
Field Details- 
logger
 
- 
- 
Constructor Details- 
RequestHandlerpublic RequestHandler()Creates a new request handler.
 
- 
- 
Method Details- 
doProcessRequestpublic void doProcessRequest(IMxRuntimeRequest request, IMxRuntimeResponse response, String path) throws Exception Description copied from interface:IRequestHandlerMethod that is called when a new request is to be processed.- Specified by:
- doProcessRequestin interface- IRequestHandler
- Parameters:
- request- the request to handler
- response- the response to update for the request
- path- the request path after the handler type (e.g. for "/xas/commit" the handler type is "xas/" and the path is "commit")
- Throws:
- Exception
 
- 
processRequestprotected abstract void processRequest(IMxRuntimeRequest request, IMxRuntimeResponse response, String path) throws Exception Method that is called when a new request is to be processed. Implement this method instead of overridingdoProcessRequest(com.mendix.m2ee.api.IMxRuntimeRequest, com.mendix.m2ee.api.IMxRuntimeResponse, java.lang.String).- Parameters:
- request- the request to handler
- response- the response to update for the request
- path- the request path
- Throws:
- Exception
 
- 
getSessionFromRequestGet 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
 
- 
getSessionFromRequestprotected ISession getSessionFromRequest(IMxRuntimeRequest request, boolean performCSRFCheck) throws CoreException Get the session using the cookie.- Parameters:
- request- the request from which to get the session
- performCSRFCheck- whether a csrf check will be performed using the request headers
- Returns:
- the session
- Throws:
- CoreException- if the session cannot be retrieved
 
- 
isSessionKilledByNewLoginReturns 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
- 
getExpiresTimeStampprotected long getExpiresTimeStamp(int addYears) 
- 
formatDate
- 
parseDate- Throws:
- ParseException
 
- 
getSessionCookieName
 
-