AuthorizationProvider

class borneo.AuthorizationProvider[source]

Bases: object

AuthorizationProvider is a callback interface used by the driver to obtain an authorization string for a request. It is called when an authorization string is required. In general applications need not implement this interface, instead using the default mechanisms.

Instances of this interface must be reentrant and thread-safe.

Methods Summary

close()

Closes the authorization provider and releases any resources it may be using.

get_authorization_string([request])

Returns an authorization string for the specified request.

get_logger()

Returns the logger of this provider if set, None if not.

set_logger(logger)

Sets a logger instance for this provider.

Methods Documentation

abstract close()[source]

Closes the authorization provider and releases any resources it may be using.

abstract get_authorization_string(request=None)[source]

Returns an authorization string for the specified request. The string is sent to the server in the request and is used for authorization. Authorization information can be request-dependent.

Parameters:

request (Request) – the request to be issued. This is an instance of Request().

Returns:

a string indicating that the application is authorized to perform the request.

Return type:

str

get_logger()[source]

Returns the logger of this provider if set, None if not.

Returns:

the logger.

Return type:

Logger or None

set_logger(logger)[source]

Sets a logger instance for this provider. If not set, the logger associated with the driver is used.

Parameters:

logger (Logger) – the logger to use.

Returns:

self.

Raises:

IllegalArgumentException – raises the exception if logger is not an instance of Logger.