Loading...
Searching...
No Matches
ConnectionProvider Namespace Reference

The ConnectionProvider namespace. More...

## Classes

class | AbstractConnection
| Abstract base class for connections. More...
class | AbstractConnectionWithInfo
| abstract base class for connections More...
struct | ConfigInfo
| config informaton More...
struct | ConnectionConstructorInfo
| information that can be used to dynamically construct a connection object More...
struct | ConnectionDataInfo
| Connection information hash containing only serializable data. More...
struct | ConnectionInfo
| Connection information hash. More...
struct | ConnectionOptionInfo
| Connection option information. More...
class | ConnectionSchemeCache
| Connection provider type cache class. More...
struct | ConnectionSchemeInfo
| Connection provider information. More...
class | FilesystemConnection
| class for filesystem connections; returns an object of type Qore::Dir More...
class | FtpConnection
| class for FTP connections; returns Qore::FtpClient objects More...
class | HttpBasedConnection
| base class for HTTP-based connections that need their URLs rewritten to create the real connection object More...
class | HttpConnection
| class for HTTP connections; returns Qore::HTTPClient objects More...
class | InvalidConnection
| this class is used to mark invalid connections so they can be loaded and reported as invalid More...
class | OptionHelper
| Class with helper methods to options in a hash. More...
struct | PingInfo
| ping response info More...
class | PollingConnectionMonitor
| Class for monitoring connection supporting the polling API. More...
class | UpdateOptionsInterface
| Interface class inherited by connection classes that declare the AbstractConnection::CF_UPDATE_OPTIONS feature. More...

## Functions

AbstractConnection | get_connection (string conn)
| returns an AbstractConnection object if the identifier is known to a registered connection provider
*hash< string, hash< ConnectionInfo > > | get_connection_hash (*bool verbose)
| returns a hash of connection information keyed by connection identifier; values are ConnectionInfo hashes as returned by AbstractConnection::getInfo() (with passwords included)
string | get_connection_url (string str)
| returns a URL string for the given identifier if the identifier is known to a registered connection provider or returns the URL itself if the identifier is a valid URL
*hash< string, AbstractConnection > | get_connections (*bool verbose)
| returns all known connections as a hash keyed by connection identifier; values are AbstractConnection objects; nothing is returned if no connections are known

## Variables

const | CCS_CUSTOMIZED = "customized"
| Customization status: customized.
const | CCS_IN_PROGRESS = "in-progress"
| Customization status: in-progress.
const | CCS_UNCUSTOMIZED = "uncustomized"
| Customization status: uncustomized.
const | CCS_UNSUPPORTED = "unsupported"
const | PF_AUTOMATIC_PING = (1 << 1)
| Ping flag: automatic / scheduled ping.
const | PF_THROW_EXCEPTION = (1 << 0)

## Detailed Description

The ConnectionProvider namespace.

the ConnectionProvider namespace. All classes used in the ConnectionProvider module should be inside this namespace

Contains all public definitions in the ConnectionProvider module.

All public declarations in the ConnectionProvider module are defined in this namespace

ConnectionSchemeCache.qc Copyright 2019 - 2024 Qore Technologies, s.r.o.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## Function Documentation

## get_connection()

AbstractConnection ConnectionProvider::get_connection | ( | string | conn | ) |

returns an AbstractConnection object if the identifier is known to a registered connection provider

Example:
  string connstr = get_connection(str);

Parameters

  conn | the connection identifier

Returns
  the connection object

Exceptions

  CONNECTION-ERROR | the connection string cannot be matched as an external url identifier by a connection provider module

Note
  connection provider modules are processed in the order they are declared with the `QORE_CONNECTION_PROVIDERS` environment variable; connection provider modules must be separated with PathSep characters

See also
  Connection Provider Modules

## get_connection_hash()

*hash< string, hash< ConnectionInfo > > ConnectionProvider::get_connection_hash | ( | *bool | verbose | ) |

returns a hash of connection information keyed by connection identifier; values are ConnectionInfo hashes as returned by AbstractConnection::getInfo() (with passwords included)

Example:
  *hash<string, hash<ConnectionInfo>> h = get_connection_hash();

Parameters

  verbose | display connection provider module errors on stdout (otherwise errors are silently ignored)

Returns
  a hash keyed by connection identifier; values are ConnectionInfo hashes as returned by AbstractConnection::getInfo() (with passwords included); nothing is returned if no connections are known

Note
  connection provider modules are processed in the order they are declared with the `QORE_CONNECTION_PROVIDERS` environment variable; connection provider modules must be separated with PathSep characters

See also
  - get_connections()
  - Connection Provider Modules

## get_connection_url()

string ConnectionProvider::get_connection_url | ( | string | str | ) |

returns a URL string for the given identifier if the identifier is known to a registered connection provider or returns the URL itself if the identifier is a valid URL

Example:
  string connstr = get_connection_url(str);

Parameters

  str | the connection identifier or a valid URL connection string (a URL string is considered valid for this function if it begins with a scheme and has at least one character after the scheme; ex: `"scheme://x..."`

Returns
  the URL string corresponding to the connection identifier, or, in case the argument is a valid URL string, returns the argument itself

Exceptions

  CONNECTION-ERROR | the connection string cannot be matched as an external url identifier by a connection provider module and there is no scheme (i.e. protocol) specification in the string followed by at least one character (ex: `"scheme://x..."`)

Note
  connection provider modules are processed in the order they are declared with the `QORE_CONNECTION_PROVIDERS` environment variable; connection provider modules must be separated with PathSep characters

See also
  Connection Provider Modules

## get_connections()

*hash< string, AbstractConnection > ConnectionProvider::get_connections | ( | *bool | verbose | ) |

returns all known connections as a hash keyed by connection identifier; values are AbstractConnection objects; nothing is returned if no connections are known

Example:
  *hash<string, AbstractConnection> h = get_connections();

Parameters

  verbose | display connection provider module errors on stdout (otherwise errors are ignored)

Returns
  a hash keyed by connection identifier; values are AbstractConnection objects; nothing is returned if no connections are known

Note
  connection provider modules are processed in the order they are declared with the `QORE_CONNECTION_PROVIDERS` environment variable; connection provider modules must be separated with PathSep characters

See also
  - get_connection_hash()
  - Connection Provider Modules