This module contains the necessary tools to discover and load the handlers for serving HTTPS

class DIRAC.Core.Tornado.Server.HandlerManager.HandlerManager(autoDiscovery=True)

Bases: object

This utility class allows to load the handlers, generate the appropriate route, and discover the handlers based on the CS. In order for a service to be considered as using HTTPS, it must have protocol = https as an option.

Each of the Handler will have one associated route to it:

  • Directly specified as LOCATION in the handler module

  • automatically deduced from the module name, of the form System/Component (e.g. DataManagement/FileCatalog)


Initialization function, you can set autoDiscovery=False to prevent automatic discovery of handler. If disabled you can use loadHandlersByServiceName() to load your handlers or loadHandlerInHandlerManager()


autoDiscovery – (default True) Disable the automatic discovery, can be used to choose service we want to load.


Force the discovery of URL, automatic call when we try to get handlers for the first time. You can disable the automatic call with autoDiscovery=False at initialization


Return all handler dictionary


dictionary with absolute url as key (“/System/Service”) and tornado.web.url object as value


Get all handler for usage in Tornado, as a list of tornado.web.url If there is no handler found before, it try to find them


a list of URL (not the string with “https://…” but the tornado object) see http://www.tornadoweb.org/en/stable/web.html#tornado.web.URLSpec


Load a list of handler from list of service using DIRAC moduleLoader Use DIRAC.Core.Base.private.ModuleLoader


servicesNames – list of service, e.g. [‘Framework/Hello’, ‘Configuration/Server’]


Tries to guess the url from module name. The URL would be of the form /System/Component (e.g. DataManagement/FileCatalog) We search something which looks like <...>.<component>System.<...>.<service>Handler


module – full module name (e.g. “DIRAC.something.something”)


the deduced URL or None