Extension Types

The Caliper SDK gives you the ability to extend the Q2 Product offering in a variety of ways, from Online Banking forms to Back Office pages to SSO integrations. Each of these have distinct shapes sent across the network, which require corresponding handling of this traffic. The SDK answers this problem with RequestHandlers.

There are lots of RequestHandler types in the Caliper SDK, which are detailed below, but they all have some things in common. For instance:

  • self.logger - This is an instance of a python logger, which can be called with a number of standard log levels to give you more visibility into your application at runtime.

    • self.logger.INFO(“Here’s an info level line”)
    • self.logger.DEBUG(“Here’s a debug level line”)
    • Used in conjunction with q2 run -l <log_level> you have very granular control over what parts of your application are logged out.
  • self.core - This is a lazy loaded instance of the core referenced in configuration/settings.py:CORE. If this is set to None in your settings file, an error will be thrown. More on cores in the Custom Coreflows section of the doc

HTTP Handlers

Most of the RequestHandlers are this type, meaning a port is opened and your extensions “listen” for traffic when you type q2 run.

  • They can all install themselves into the Q2 database with the q2 install command
  • They can all uninstall themselves with the q2 uninstall command
  • They can all return information about their installation with the q2 get_installed command
  • They all have a get function that can be filled out to handle HTTP GET requests
  • They all have a post function that can be filled out to handle HTTP POST requests

Ultimately these all inherit from Tornado’s RequestHandler, so all of those docs are relevant as well.

For specific request types, look at the detailed docs below:

Non HTTP Handlers

It is also possible to have Handlers that get their input from other means. These are outlined below:

Supporting Handlers

  • Base Request Handler
    • Contains common code for all HTTP RequestHandlers
  • HQ Request Handler
    • Common code for Handlers that get data from HQ (Central/Online/Tecton)
  • Q2TectonBaseRequestHandler
    • Common code for Q2TectonClientRequestHandler and Q2TectonServerRequestHandler

Deprecated Handlers

  • Q2LegacyRequestHandler
    • Replaced by all the specific handler types above
  • Q2TectonOnlineRequestHandler
    • Replaced by Q2TectonServer and Q2TectonClient Handlers