| Qore ConnectionProvider Module Reference 1.5

Static Public Member Functions | Public Attributes | Static Protected Member Functions | Static Protected Attributes | List of all members
ConnectionProvider::ConnectionSchemeCache Class Reference

Connection provider type cache class. More...

## Static Public Member Functions
static bool | empty ()
| Returns True if the cache is empty, False if not.
static hash< string, hash< ConnectionSchemeInfo > > | get ()
| Returns the entire cache.
static *hash< ConnectionSchemeInfo > | getScheme (string scheme)
| Returns info for the given connection scheme or NOTHING if not present. More...
static hash< ConnectionSchemeInfo > | getSchemeEx (string scheme)
| Returns info for the given connection scheme or throws an exception if not present. More...
static *hash< ConnectionSchemeInfo > | getSchemeImpl (string scheme, bool throw_exception, *code scheme_loader)
| Returns info for the given connection scheme; either throws an exception if not present or returns NOTHING. More...
static *list< string > | listSchemes ()
| Returns a list of all cached schemes.
static bool | registerScheme (string scheme, hash< ConnectionSchemeInfo > entry)
| Register a new connection provider in the cache. More...
static int | size ()
| Returns the number of types in the cache.

## Public Attributes
const | SchemeMap = ...
| Map of known connection schemes to modules.

## Static Protected Member Functions
static Mutex | lck ()
| Connection provider cache lock.
static bool | tryLoadModule (string mod, bool throw_exception)
| Try to load the given module.

## Static Protected Attributes
static hash< string, hash< ConnectionSchemeInfo > > | cache
| Connection provider cache.

## Detailed Description

Connection provider type cache class.

## Member Function Documentation

## ◆ getScheme()

static *hash<ConnectionSchemeInfo> ConnectionProvider::ConnectionSchemeCache::getScheme | ( | string | scheme | ) |
| static

Returns info for the given connection scheme or NOTHING if not present.

Parameters

  scheme | the scheme for the connection

Returns
  info for the given connection scheme; NOTHING is returned if the scheme is not registered

## ◆ getSchemeEx()

static hash<ConnectionSchemeInfo> ConnectionProvider::ConnectionSchemeCache::getSchemeEx | ( | string | scheme | ) |
| static

Returns info for the given connection scheme or throws an exception if not present.

Parameters

  scheme | the scheme for the connection provider

Returns
  info for the given connection scheme; an exception is thrown if the scheme is unknown

Exceptions

  SCHEME-ERROR | the scheme is unknown

## ◆ getSchemeImpl()

static *hash<ConnectionSchemeInfo> ConnectionProvider::ConnectionSchemeCache::getSchemeImpl | ( | string | scheme,
|  | bool | throw_exception,
|  | *code | scheme_loader
| ) |  |
| static

Returns info for the given connection scheme; either throws an exception if not present or returns NOTHING.

Parameters

  scheme | the scheme for the connection provider
  throw_exception | if True then an exception is thrown if the scheme cannot be resolved, otherwise NOTHING is returned
  scheme_loader | a closure taking a string scheme argument and returning `*hash<ConnectionSchemeInfo>`

Returns
  info for the given connection scheme or NOTHING is returned if the scheme cannot be resolved and the throw_exception argument is False

Exceptions

  SCHEME-ERROR | the scheme is unknown; only thrown if the throw_exception argument is True

## ◆ registerScheme()

static bool ConnectionProvider::ConnectionSchemeCache::registerScheme | ( | string | scheme,
|  | hash< ConnectionSchemeInfo > | entry
| ) |  |
| static

Register a new connection provider in the cache.

Parameters

  scheme | the scheme for the connection provider
  entry | the new connection provider entry

Returns
  True if the connection was reigstered, False if there is already a registered connection with this scheme