Public Attributes | Private Member Functions | Private Attributes | Friends

rm_DriveHost Class Reference
[Resource Manager Database Library]

#include <rmdb.h>

Collaboration diagram for rm_DriveHost:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

Definition at line 305 of file rmdb.h.


Constructor & Destructor Documentation

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

Definition at line 1614 of file librmdb.exx.

References Select().

Here is the call graph for this function:


Member Function Documentation

void rm_DriveHost::EndSelectAll (  )  [private]

Definition at line 1738 of file librmdb.exx.

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

Referenced by rm_Operator::GetHost().

                               {
    log_FUNC_m(EndSelectAll);


    EXEC SQL
        CLOSE SELECT_ALL_DRIVEHOST;

    g_driveHostCursor_x.Unlock();
    string sqlErrDesc = errorDesc(SQLCODE,"CLOSE SELECT_ALL_DRIVEHOST");
    SQL_CHECKREAD_M(sqlErrDesc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_DriveHost::Insert (  )  [private]

Definition at line 1621 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().

                          {

    log_FUNC_m(Insert);

    EXEC SQL
        SET TRANSACTION NAME readWriteTrans;

    EXEC SQL INSERT TRANSACTION readWriteTrans INTO Drivehost VALUES(
                                  :host.cvalue_p,
                                  :driveKey,
                                  :controlDevice.cvalue_p
                                 );

    string sqlErrDesc = errorDesc(SQLCODE,"Insert record into Drivehost");

    SQL_CHECK_M( sqlErrDesc );

} // rm_DriveHost::Insert()

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 1750 of file librmdb.exx.

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

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

                                 {
    log_FUNC_m(Next);

    char hostVal[rmdb_MAX_HOSTNAME];
    char controlDeviceVal[rmdb_MAX_CTRLDEVICE];
    EXEC SQL
        FETCH SELECT_ALL_DRIVEHOST
            INTO
                :hostVal,
                :driveKey,
                :controlDeviceVal;

    if (SQLCODE == SQL_NOERROR) {
        host = hostVal;
        controlDevice = controlDeviceVal;
    }
    else {
        int fetchCode = SQLCODE;
        EXEC SQL
            CLOSE SELECT_ALL_DRIVEHOST;

        g_driveHostCursor_x.Unlock();
        SQLCODE = fetchCode;
        string sqlErrDesc = errorDesc(fetchCode,"CLOSE SELECT_ALL_DRIVEHOST");
        SQL_CHECKREAD_M(sqlErrDesc);
    };
    return *this;
}

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 328 of file rmdb.h.

References controlDevice, driveKey, and host.

                                                   {
        return (    ( driveKey == dh2.driveKey )            &&
                    ( host == dh2.host )                    &&
                    ( controlDevice == dh2.controlDevice )  );
    };

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

Definition at line 1643 of file librmdb.exx.

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

Referenced by rm_Operator::RemoveDriveHost().

                                                                        {
    log_FUNC_m(Remove);

    EXEC SQL
        SET TRANSACTION NAME readWriteTrans;

    EXEC SQL
        DELETE TRANSACTION readWriteTrans
        FROM Drivehost
            WHERE
                HOST =          :a_host.cvalue_p            AND
                DRIVEKEY =      :a_driveKey;

    string sqlErrDesc = errorDesc(SQLCODE,"Remove record from Drivehost");

    SQL_CHECK_M( sqlErrDesc );
} // 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 1686 of file librmdb.exx.

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

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

                                                                       {
    log_FUNC_m(Select);

    char hostVal[rmdb_MAX_HOSTNAME];
    char controlDeviceVal[rmdb_MAX_CTRLDEVICE];
    EXEC SQL
        SET TRANSACTION NAME readTrans
            READ ONLY
            ISOLATION LEVEL READ COMMITTED;

    EXEC SQL SELECT TRANSACTION readTrans * INTO
                    :hostVal,
                    :driveKey,
                    :controlDeviceVal
             FROM DRIVEHOST WHERE ((HOST = :a_host.cvalue_p) AND (DRIVEKEY = :a_driveKey));

    log_DBG_m(dbg_DETAIL, "selected DriveHost record " + cmn_Num2Str((Int32_t)SQLCODE));

    if (SQLCODE == SQL_NOERROR) {
        host = hostVal;
        controlDevice = controlDeviceVal;
    };
    string sqlErrDesc = errorDesc(SQLCODE,"Sel. rec. from Drivehost");
    SQL_CHECKREAD_M( sqlErrDesc );

} // 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 1716 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().

                                 {
    log_FUNC_m(StartSelectAll);

    g_driveHostCursor_x.Lock();

    EXEC SQL
        SET TRANSACTION NAME readTrans
            READ ONLY
            ISOLATION LEVEL READ COMMITTED;

    EXEC SQL
        OPEN TRANSACTION readTrans
        SELECT_ALL_DRIVEHOST;

    if ( SQLCODE != SQL_NOERROR ) {
        string sqlErrDesc = errorDesc(SQLCODE, "Opening SELECT_ALL_DRIVEHOST Cursor failed");
        log_ERR_m(sqlErrDesc);
        g_driveHostCursor_x.Unlock();
        throw ivd_DBException( SQLCODE ,sqlErrDesc, true);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_DriveHost::Update (  )  [private]

Definition at line 1664 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().

                          {
    log_FUNC_m(Update);
    EXEC SQL
        SET TRANSACTION NAME readWriteTrans;

    EXEC SQL
        UPDATE TRANSACTION readWriteTrans
        DRIVEHOST SET
                    HOST = :host.cvalue_p,
                    DRIVEKEY = :driveKey,
                    CONTROLDEVICE = :controlDevice.cvalue_p
        WHERE  (HOST = :host.cvalue_p) AND
               (DRIVEKEY = :driveKey);

    string sqlErrDesc = errorDesc(SQLCODE,"Update record in Drivehost");
    SQL_CHECK_M( sqlErrDesc );

} // rm_update_Drivehost

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class rm_Operator [friend]

Definition at line 307 of file rmdb.h.


Member Data Documentation

Definition at line 332 of file rmdb.h.


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