Qore ConnectionProvider Module Reference  1.2.1
ConnectionProvider Namespace Reference

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

Classes

class  AbstractConnection
 abstract base class for connections More...
 
hashdecl  ConfigInfo
 config informaton as returned by AbstractConnection::getConfigHash() More...
 
hashdecl  ConnectionConstructorInfo
 information that can be used to dynamically construct a connection object More...
 
hashdecl  ConnectionInfo
 connection information hash as returned by AbstractConnection::getInfo() More...
 
class  FilesystemConnection
 class for filesystem connections; returns an object of type Qore::Dir; this can be used to monitor filesystem free space or to ensure a network filesystem is mounted, for example 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...
 
hashdecl  PingInfo
 ping response info as returned by AbstractConnection::ping() More...
 

Functions

AbstractConnection get_connection (string conn)
 returns an AbstractConnection object if the identifier is known to a registered connection provider More...
 
*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) More...
 
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 More...
 
*hash< string, AbstractConnectionget_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 More...
 

Detailed Description

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

the ConnectionProvider namespace contains all the objects in the ConnectionProvider module

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
connthe connection identifier
Returns
the connection object
Exceptions
CONNECTION-ERRORthe 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
verbosedisplay 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_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
strthe 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-ERRORthe 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
verbosedisplay 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