Gateway Implementation

SVC.gateway

This package contains the Gateway implementation and all its classes.

Gateway Controllers

SVC.gateway.controllers

This module provides the main controller class that handles the dispatching of requests based on a provided dispatcher implementation.

class GatewayController(request, config, dispatcher)

Main controller used to dispatch request to the appropriate locations. The class delegates the dispatching of the request to the specified dispatcher object.

Parameters
  • request (Request) – The original request to be handled.

  • config (Config) – Application configuration.

  • dispatcher (Dispatcher) – Dispatcher to be use to dispatch the requests.

dispatch()

Dispatches the current request to the appropriate TMS and returns the provided response.

Returns

The response provided by the TMS.

Return type

Response

Gateway Dispatchers

SVC.gateway.dispatchers

This module contains the concrete implementation of the different Dispatchers used by the application.

class RequestDispatcher(ptca_key_retriever)

Basic dispatcher class that dispatches requests to the appropriate TMS using the white listed API keys.

Parameters

ptca_key_retriever (KeyRetriver) – Retriever instance that provides the necessary key.

dispatch(request_context)

Dispatches the current request to the appropriate TMS.

Parameters

request_context (RequestContext) – The current request context to be dispatched.

Returns

The response from the TMS.

Return type

Response