SequoiaDB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
sdbclient::sdbDataSourceConf Class Reference

The configure of sdb data source. More...

#include <sdbDataSourceComm.hpp>

Public Member Functions

 sdbDataSourceConf ()
 
void setUserInfo (const string &username, const string &passwd)
 Set user name and password.
 
string getUserName () const
 Get user name.
 
string getPasswd () const
 Get password.
 
void setConnCntInfo (INT32 initCnt, INT32 deltaIncCnt, INT32 maxIdleCnt, INT32 maxCnt)
 Set connection number parameters.
 
INT32 getInitConnCount () const
 Get the initial connection number.
 
INT32 getDeltaIncCount () const
 Get the increment of connection each time.
 
INT32 getMaxIdleCount () const
 Get the max idle connection number.
 
INT32 getMaxCount () const
 Get the max connection number.
 
void setCheckIntervalInfo (INT32 interval, INT32 aliveTime=0)
 Set the interval time of check idle connection. And set the time in millisecond for abandoning a connection which keep alive time is up.
 
INT32 getCheckInterval () const
 Get the interval time in millisecond of check idle connection.
 
INT32 getKeepAliveTimeout () const
 Get the keep alive time.
 
void setSyncCoordInterval (INT32 interval)
 Set the interval time in seconds of synchronize coord node.
 
INT32 getSyncCoordInterval () const
 Get the interval time in seconds of synchronize coord node.
 
void setValidateConnection (BOOLEAN bCheck)
 Set whether to check the validation of a connection when it's given out.
 
BOOLEAN getValidateConnection () const
 Get whether to check the validation of a connection when it's given out.
 
void setConnectStrategy (DATASOURCE_STRATEGY strategy)
 Set the strategy of sdbDataSource.
 
DATASOURCE_STRATEGY getConnectStrategy () const
 Get the strategy of sdbDataSource.
 
void setUseSSL (BOOLEAN useSSL)
 Set whether use the SSL or not.
 
BOOLEAN getUseSSL () const
 Get whether use SSL or not.
 
BOOLEAN isValid ()
 Check whether sdbDataSourceConf is valid.
 

Detailed Description

The configure of sdb data source.

Constructor & Destructor Documentation

sdbclient::sdbDataSourceConf::sdbDataSourceConf ( )
inline

brief The constructor of sdbDataSourceConf.

Member Function Documentation

INT32 sdbclient::sdbDataSourceConf::getCheckInterval ( ) const
inline

Get the interval time in millisecond of check idle connection.

Return values
INT32the interval time in millisecond of check idle connection
DATASOURCE_STRATEGY sdbclient::sdbDataSourceConf::getConnectStrategy ( ) const
inline

Get the strategy of sdbDataSource.

Return values
DATASOURCE_STRATEGYThe strategy of sdbDataSource
INT32 sdbclient::sdbDataSourceConf::getDeltaIncCount ( ) const
inline

Get the increment of connection each time.

Return values
UINT32The increment of connection each time
INT32 sdbclient::sdbDataSourceConf::getInitConnCount ( ) const
inline

Get the initial connection number.

Return values
INT32The initial connection number
INT32 sdbclient::sdbDataSourceConf::getKeepAliveTimeout ( ) const
inline

Get the keep alive time.

Return values
INT32the keep alive time in millisecond
INT32 sdbclient::sdbDataSourceConf::getMaxCount ( ) const
inline

Get the max connection number.

Return values
INT32The max connection number
INT32 sdbclient::sdbDataSourceConf::getMaxIdleCount ( ) const
inline

Get the max idle connection number.

Return values
INT32The max idle connection number
string sdbclient::sdbDataSourceConf::getPasswd ( ) const
inline

Get password.

Return values
stringpassword
INT32 sdbclient::sdbDataSourceConf::getSyncCoordInterval ( ) const
inline

Get the interval time in seconds of synchronize coord node.

Return values
INT32the interval time in seconds of synchronize coord node
string sdbclient::sdbDataSourceConf::getUserName ( ) const
inline

Get user name.

Return values
stringuser name
BOOLEAN sdbclient::sdbDataSourceConf::getUseSSL ( ) const
inline

Get whether use SSL or not.

Return values
BOOLEANReturn use SSL or not
BOOLEAN sdbclient::sdbDataSourceConf::getValidateConnection ( ) const
inline

Get whether to check the validation of a connection when it's given out.

Return values
BOOLEANif TRUE check the validation, else not check the validation
BOOLEAN sdbclient::sdbDataSourceConf::isValid ( )

Check whether sdbDataSourceConf is valid.

Return values
BOOLEANThe validation of sdbDataSourceConf
void sdbclient::sdbDataSourceConf::setCheckIntervalInfo ( INT32  interval,
INT32  aliveTime = 0 
)

Set the interval time of check idle connection. And set the time in millisecond for abandoning a connection which keep alive time is up.

Parameters
[in]intervalThe interval time in millisecond of check idle connection
[in]aliveTimeIf a connection has not be used(send and receive) for a long time(longer than "aliveTime"), the pool will not let it come back. The pool will also clean this kind of idle connections in the pool periodically. This value default to be 0ms. means not care about how long does a connection have not be used(send and receive).
Note
When "aliveTime" is not set to 0, it's better to set it greater than "interval" triple over. Besides, unless you know what you need, never enable this option.
void sdbclient::sdbDataSourceConf::setConnCntInfo ( INT32  initCnt,
INT32  deltaIncCnt,
INT32  maxIdleCnt,
INT32  maxCnt 
)

Set connection number parameters.

Parameters
[in]initCntThe initial connection number
[in]deltaIncCntThe increment of connection each time
[in]maxIdleCntThe max idle connection number
[in]maxCntThe max connection number
void sdbclient::sdbDataSourceConf::setConnectStrategy ( DATASOURCE_STRATEGY  strategy)
inline

Set the strategy of sdbDataSource.

Parameters
[in]strategyThe enum of strategy: DS_STY_SERIAL, DS_STY_RANDOM, DS_STY_LOCAL, DS_STY_BALANCE
void sdbclient::sdbDataSourceConf::setSyncCoordInterval ( INT32  interval)
inline

Set the interval time in seconds of synchronize coord node.

Parameters
[in]intervalThe interval time in millisecond of synchronize coord node
void sdbclient::sdbDataSourceConf::setUserInfo ( const string &  username,
const string &  passwd 
)

Set user name and password.

Parameters
[in]usernameThe user name
[in]passwdThe password
void sdbclient::sdbDataSourceConf::setUseSSL ( BOOLEAN  useSSL)
inline

Set whether use the SSL or not.

Parameters
[in]useSSLIf true, use SSL, else, not use SSL
void sdbclient::sdbDataSourceConf::setValidateConnection ( BOOLEAN  bCheck)
inline

Set whether to check the validation of a connection when it's given out.

Parameters
[in]bCheckIf TURE check the validation, else not check the validation

The documentation for this class was generated from the following file: