#include <ConnectionParameters.hpp>
Public Member Functions | |
ConnectionParameters (const std::vector< ControllerInfo > &ctrls, const std::wstring &db=DEFAULT_DB, const std::wstring &uname=DEFAULT_USER, const std::wstring &upass=DEFAULT_PASSWD, ConnectPolicy cp=DEFAULT_POLICY, int pingDelayInMs=DEFAULT_PING_DELAY, int controllerTimeoutInMs=DEFAULT_CONTROLLER_TIMEOUT, bool persistentConnection=DEFAULT_CONNECTION_PERSISTENCY, bool retrieveSQLWarnings=DEFAULT_RETRIEVE_SQL_WARNINGS) throw (ConnectionException, UnexpectedException) | |
Creates instance with a set of values:. | |
ConnectionParameters (const ConnectionParameters &from) | |
Copy contructor. | |
virtual | ~ConnectionParameters () |
Destructor, frees the reference to the controller pool. | |
ConnectionParameters & | operator= (const ConnectionParameters &from) |
Assignement operator - does the same as copy constructor. | |
bool | isValidDatabaseName (const std::wstring &, wchar_t &) const |
Validates database name. | |
const std::wstring & | checkDatabaseName (const std::wstring &) const throw (ConnectionException, UnexpectedException) |
Checks the database name. | |
std::wstring | getDatabaseName () const |
Gives the database name. | |
std::wstring | getUserName () const |
Gives the user name. | |
std::wstring | getUserPass () const |
Gives the user password. | |
AbstractControllerPool & | getControllerPool () |
Gives the controller pool. | |
int | getPingDelayInMs () |
Gives the ping delay in milliseconds. | |
int | getControllerTimeoutInMs () |
Gives the controller timeout in milliseconds. | |
bool | getPersistentConnection () const |
Tell whether the connection must remain persistent. | |
bool | getRetrieveSQLWarnings () const |
Whether the controller should retrieve SQL warnings. | |
Static Public Attributes | |
static const std::wstring | DEFAULT_USER |
Default username = "user". | |
static const std::wstring | DEFAULT_PASSWD |
Default password = "". | |
static const std::wstring | DEFAULT_DB |
Default database name = "myDB". | |
static const ConnectPolicy | DEFAULT_POLICY |
Default policy = ROUND_ROBIN. | |
static const int | DEFAULT_PING_DELAY |
Default ping delay = 1000 ms. | |
static const int | DEFAULT_CONTROLLER_TIMEOUT |
Default controller timeout = 25000 ms. | |
static const bool | DEFAULT_CONNECTION_PERSISTENCY |
Default for persistent connections value = false. | |
static const bool | DEFAULT_RETRIEVE_SQL_WARNINGS |
Default for retrieve SQL warnings = false. |
This connection parameters will be used by the Connection class. It is a replacement for SequoiaUrl Java class
CarobNS::ConnectionParameters::ConnectionParameters | ( | const std::vector< ControllerInfo > & | ctrls, | |
const std::wstring & | db = DEFAULT_DB , |
|||
const std::wstring & | uname = DEFAULT_USER , |
|||
const std::wstring & | upass = DEFAULT_PASSWD , |
|||
ConnectPolicy | cp = DEFAULT_POLICY , |
|||
int | pingDelayInMs = DEFAULT_PING_DELAY , |
|||
int | controllerTimeoutInMs = DEFAULT_CONTROLLER_TIMEOUT , |
|||
bool | persistentConnection = DEFAULT_CONNECTION_PERSISTENCY , |
|||
bool | retrieveSQLWarnings = DEFAULT_RETRIEVE_SQL_WARNINGS | |||
) | throw (ConnectionException, UnexpectedException) |
Creates instance with a set of values:.
ctrls | a list of controllers to connect to as a vector of ControllerInfo. | |
db | name of the database (default to "user) | |
uname | user name to use on this database (default to "") | |
upass | user pass (default to "myDB") | |
cp | controller pool policy for failover, one of enum ConnectPolicy (default to ROUND_ROBIN) | |
pingDelayInMs | Interval in milliseconds between two pings of a controller | |
controllerTimeoutInMs | timeout in milliseconds after which a controller is considered as dead if it did not respond to pings | |
persistentConnection | whether to create a persistent connection (default to false) | |
retrieveSQLWarnings | whether SQL Warnings should be retrieved (default to false) |
CarobNS::ConnectionParameters::ConnectionParameters | ( | const ConnectionParameters & | from | ) |
Copy contructor.
Copies fields and adds a reference to the controller pool
from | instance to copy settings from |
bool CarobNS::ConnectionParameters::isValidDatabaseName | ( | const std::wstring & | , | |
wchar_t & | ||||
) | const |
Validates database name.
If invalid returns false and set param char to the first invalid character.
ConnectionParameters& CarobNS::ConnectionParameters::operator= | ( | const ConnectionParameters & | from | ) |
Assignement operator - does the same as copy constructor.
from | instance to copy settings from |