dxlmaxmindservice.app module

class dxlmaxmindservice.app.MaxMindDatabase(update_interval, database_path, license_key)

Bases: object

A class to handle IP lookups and updating of the MaxMind Database

Initializes the MaxMindDatabase

Parameters:
  • update_interval -- The interval to update the MaxMind database in minutes
  • database_path -- The path to a local MaxMind database to be used
  • license_key -- A MaxMind license key
lookup_ip(ip)

Looks up an IP or hostname in the MaxMind database

Parameters:ip -- The IP or Hostname to look up
Returns:A dictionary of the MaxMind Database response
class dxlmaxmindservice.app.MaxMindGeolocationService(config_dir)

Bases: dxlbootstrap.app.Application

The "MaxMind Geolocation Service" service class.

Constructor parameters:

Parameters:config_dir -- The location of the configuration files for the application
client

The DXL client used by the application to communicate with the DXL fabric

config

The application configuration (as read from the "dxlmaxmindservice.config" file)

database

The MaxMind Database access object

destroy()

Destroys the application (disconnects from fabric, frees resources, etc.)

on_dxl_connect()

Invoked after the client associated with the application has connected to the DXL fabric.

on_load_configuration(config)

Invoked after the application-specific configuration has been loaded

This callback provides the opportunity for the application to parse additional configuration properties.

Parameters:config -- The application configuration
on_register_services()

Invoked when services should be registered with the application

on_run()

Invoked when the application has started running.