rm_DriveHost Class Reference
[Resource Manager Database Library]

#include <rmdb.h>

Collaboration diagram for rm_DriveHost:

Collaboration graph
[legend]

List of all members.


Detailed Description

Definition at line 291 of file rmdb.h.


Public Attributes

rm_String host
Int32_t driveKey
rm_String controlDevice

Private Member Functions

void Insert ()
void Update ()
void Remove (Int32_t a_driveKey, const rm_String &a_host)
void Select (Int32_t a_driveKey, const rm_String &a_host)
void StartSelectAll ()
void EndSelectAll ()
rm_DriveHostNext ()
 rm_DriveHost ()
 rm_DriveHost (Int32_t a_drivekey, rm_String a_host)
bool operator== (const rm_DriveHost &dh2) const

Private Attributes

 log_CLASSID_m

Friends

class rm_Operator

Constructor & Destructor Documentation

rm_DriveHost::rm_DriveHost (  )  [private]

Definition at line 1581 of file librmdb.exx.

rm_DriveHost::rm_DriveHost ( Int32_t  a_drivekey,
rm_String  a_host 
) [private]

Definition at line 1588 of file librmdb.exx.

References Select().

01589     :   host(rmdb_MAX_HOSTNAME),
01590         controlDevice(rmdb_MAX_CTRLDEVICE){
01591     Select(a_driveKey, a_host);
01592 }

Here is the call graph for this function:


Member Function Documentation

void rm_DriveHost::Insert (  )  [private]

Definition at line 1595 of file librmdb.exx.

References controlDevice, rm_String::cvalue_p, driveKey, errorDesc(), host, log_FUNC_m, NAME, and SQL_CHECK_M.

Referenced by rm_Operator::Add().

01595                           {
01596 
01597     log_FUNC_m(Insert);
01598 
01599     EXEC SQL
01600         SET TRANSACTION NAME readWriteTrans;
01601 
01602     EXEC SQL INSERT TRANSACTION readWriteTrans INTO Drivehost VALUES(
01603                                   :host.cvalue_p,
01604                                   :driveKey,
01605                                   :controlDevice.cvalue_p
01606                                  );
01607 
01608     string sqlErrDesc = errorDesc(SQLCODE,"Insert record into Drivehost");
01609 
01610     SQL_CHECK_M( sqlErrDesc );
01611 
01612 } // rm_DriveHost::Insert()

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_DriveHost::Update (  )  [private]

Definition at line 1638 of file librmdb.exx.

References controlDevice, rm_String::cvalue_p, driveKey, errorDesc(), host, log_FUNC_m, NAME, and SQL_CHECK_M.

Referenced by rm_Operator::Update().

01638                           {
01639     log_FUNC_m(Update);
01640     EXEC SQL
01641         SET TRANSACTION NAME readWriteTrans;
01642 
01643     EXEC SQL
01644         UPDATE TRANSACTION readWriteTrans
01645         DRIVEHOST SET
01646                     HOST = :host.cvalue_p,
01647                     DRIVEKEY = :driveKey,
01648                     CONTROLDEVICE = :controlDevice.cvalue_p
01649         WHERE  (HOST = :host.cvalue_p) AND
01650                (DRIVEKEY = :driveKey);
01651 
01652     string sqlErrDesc = errorDesc(SQLCODE,"Update record in Drivehost");
01653     SQL_CHECK_M( sqlErrDesc );
01654 
01655 } // rm_update_Drivehost

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_DriveHost::Remove ( Int32_t  a_driveKey,
const rm_String a_host 
) [private]

Definition at line 1617 of file librmdb.exx.

References rm_String::cvalue_p, errorDesc(), log_FUNC_m, NAME, and SQL_CHECK_M.

Referenced by rm_Operator::RemoveDriveHost().

01617                                                                         {
01618     log_FUNC_m(Remove);
01619 
01620     EXEC SQL
01621         SET TRANSACTION NAME readWriteTrans;
01622 
01623     EXEC SQL
01624         DELETE TRANSACTION readWriteTrans
01625         FROM Drivehost
01626             WHERE
01627                 HOST =          :a_host.cvalue_p            AND
01628                 DRIVEKEY =      :a_driveKey;
01629 
01630     string sqlErrDesc = errorDesc(SQLCODE,"Remove record from Drivehost");
01631 
01632     SQL_CHECK_M( sqlErrDesc );
01633 } // rm_DriveHost::Remove()

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_DriveHost::Select ( Int32_t  a_driveKey,
const rm_String a_host 
) [private]

Definition at line 1660 of file librmdb.exx.

References cmn_Num2Str(), controlDevice, rm_String::cvalue_p, dbg_DETAIL, driveKey, errorDesc(), host, log_DBG_m, log_FUNC_m, NAME, rmdb_MAX_CTRLDEVICE, rmdb_MAX_HOSTNAME, SQL_CHECKREAD_M, and SQL_NOERROR.

Referenced by rm_DriveHost(), and rm_Operator::SelectDriveHost().

01660                                                                        {
01661     log_FUNC_m(Select);
01662 
01663     char hostVal[rmdb_MAX_HOSTNAME];
01664     char controlDeviceVal[rmdb_MAX_CTRLDEVICE];
01665     EXEC SQL
01666         SET TRANSACTION NAME readTrans
01667             READ ONLY
01668             ISOLATION LEVEL READ COMMITTED;
01669 
01670     EXEC SQL SELECT TRANSACTION readTrans * INTO
01671                     :hostVal,
01672                     :driveKey,
01673                     :controlDeviceVal
01674              FROM DRIVEHOST WHERE ((HOST = :a_host.cvalue_p) AND (DRIVEKEY = :a_driveKey));
01675 
01676     log_DBG_m(dbg_DETAIL, "selected DriveHost record " + cmn_Num2Str((Int32_t)SQLCODE));
01677 
01678     if (SQLCODE == SQL_NOERROR) {
01679         host = hostVal;
01680         controlDevice = controlDeviceVal;
01681     };
01682     string sqlErrDesc = errorDesc(SQLCODE,"Sel. rec. from Drivehost");
01683     SQL_CHECKREAD_M( sqlErrDesc );
01684 
01685 } // rm_DriveHost::Select

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_DriveHost::StartSelectAll (  )  [private]

Definition at line 1690 of file librmdb.exx.

References errorDesc(), cmn_Mutex::Lock(), log_ERR_m, log_FUNC_m, NAME, SQL_NOERROR, and cmn_Mutex::Unlock().

Referenced by rm_Operator::GetHost(), and rm_Operator::SelectAllDriveHosts().

01690                                  {
01691     log_FUNC_m(StartSelectAll);
01692 
01693     g_driveHostCursor_x.Lock();
01694 
01695     EXEC SQL
01696         SET TRANSACTION NAME readTrans
01697             READ ONLY
01698             ISOLATION LEVEL READ COMMITTED;
01699 
01700     EXEC SQL
01701         OPEN TRANSACTION readTrans
01702         SELECT_ALL_DRIVEHOST;
01703 
01704     if ( SQLCODE != SQL_NOERROR ) {
01705         string sqlErrDesc = errorDesc(SQLCODE, "Opening SELECT_ALL_DRIVEHOST Cursor failed");
01706         log_ERR_m(sqlErrDesc);
01707         g_driveHostCursor_x.Unlock();
01708         throw ivd_DBException( SQLCODE ,sqlErrDesc, true);
01709     }
01710 }

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_DriveHost::EndSelectAll (  )  [private]

Definition at line 1712 of file librmdb.exx.

References errorDesc(), log_FUNC_m, SQL_CHECKREAD_M, and cmn_Mutex::Unlock().

Referenced by rm_Operator::GetHost().

01712                                {
01713     log_FUNC_m(EndSelectAll);
01714 
01715 
01716     EXEC SQL
01717         CLOSE SELECT_ALL_DRIVEHOST;
01718 
01719     g_driveHostCursor_x.Unlock();
01720     string sqlErrDesc = errorDesc(SQLCODE,"CLOSE SELECT_ALL_DRIVEHOST");
01721     SQL_CHECKREAD_M(sqlErrDesc);
01722 }

Here is the call graph for this function:

Here is the caller graph for this function:

rm_DriveHost & rm_DriveHost::Next (  )  [private]

Definition at line 1724 of file librmdb.exx.

References controlDevice, driveKey, errorDesc(), host, log_FUNC_m, rmdb_MAX_CTRLDEVICE, rmdb_MAX_HOSTNAME, SQL_CHECKREAD_M, SQL_NOERROR, and cmn_Mutex::Unlock().

Referenced by rm_Operator::GetHost(), and rm_Operator::SelectAllDriveHosts().

01724                                  {
01725     log_FUNC_m(Next);
01726 
01727     char hostVal[rmdb_MAX_HOSTNAME];
01728     char controlDeviceVal[rmdb_MAX_CTRLDEVICE];
01729     EXEC SQL
01730         FETCH SELECT_ALL_DRIVEHOST
01731             INTO
01732                 :hostVal,
01733                 :driveKey,
01734                 :controlDeviceVal;
01735 
01736     if (SQLCODE == SQL_NOERROR) {
01737         host = hostVal;
01738         controlDevice = controlDeviceVal;
01739     }
01740     else {
01741         int fetchCode = SQLCODE;
01742         EXEC SQL
01743             CLOSE SELECT_ALL_DRIVEHOST;
01744 
01745         g_driveHostCursor_x.Unlock();
01746         SQLCODE = fetchCode;
01747         string sqlErrDesc = errorDesc(fetchCode,"CLOSE SELECT_ALL_DRIVEHOST");
01748         SQL_CHECKREAD_M(sqlErrDesc);
01749     };
01750     return *this;
01751 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool rm_DriveHost::operator== ( const rm_DriveHost dh2  )  const [inline, private]

Definition at line 314 of file rmdb.h.

References controlDevice, driveKey, and host.

00314                                                    {
00315         return (    ( driveKey == dh2.driveKey )            &&
00316                     ( host == dh2.host )                    &&
00317                     ( controlDevice == dh2.controlDevice )  );
00318     };


Friends And Related Function Documentation

friend class rm_Operator [friend]

Definition at line 293 of file rmdb.h.


Member Data Documentation

Definition at line 318 of file rmdb.h.


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

Generated on Mon Feb 27 19:46:39 2012 for OPENARCHIVE by  doxygen 1.5.6