Get list of all registered Request Handlers

0
Is a list of all registered request handlers available? From within a request handler, I want to redirect to a “SSO/logout” if it exists, if not, to “index.html”. 
asked
2 answers
0

Not sure if that information can be accessed programmatically, but as the request handlers are initialized from the startup microflow you know which handlers are created.

Maybe store the handlers in constants or in an entity then access that information. It’s a more indirect way, but will allow you to make decisions in the code.

Another option might be to perform an http request on the url and read the response headers to see if the url exists.

answered
0

Quick prototype, ill try convert to a pure java

var /* class java.util.HashMap */ hmstat=root
	.getContext()
	.getActionStack()[0]
	.getComponent()
	.runtime()
	.getConnector()
	.getRequestStatistics();
hmstat.forEach(
	function(/* java.lang.String */ statk,/* long */ statkidx){
        var /* com.mendix.external.connector.RequestHandlerStatistics */ objstat=hmstat.get(statk);
		com.mendix.core.Core.getLogger('rhstat').info(
			statk+","+
			objstat.countOfRequests()+","+
			objstat.lastRequestDate()
		);
	}
);
/* sample output:
foobar/,0,Thu Nov 21 06:07:29 UTC 2019
users,0,Thu Nov 21 02:47:10 UTC 2019
fileform,0,Thu Nov 21 02:47:10 UTC 2019
...
...
...
xas/,383,Thu Nov 21 06:21:56 UTC 2019
rsspost,0,Thu Nov 21 02:47:10 UTC 2019
p/,0,Thu Nov 21 02:47:09 UTC 2019
*/

You just need to get to  com.mendix.external.connector.MxRuntimeConnector. Here foobar was newly registered and created dynamically at runtime, had no hits, and count indicates 0, so it should list all request handlers including mendix ones and com.mendix.externalinterface.connector.RequestHandler implementations

answered