#include <rmdb.h>

Definition at line 471 of file rmdb.h.
Public Member Functions | |
| void | Select (Int32_t a_mediumKey) |
| void | SelectByBarcode (rm_String a_name) |
| void | StartSelectAll () |
| void | EndSelectAll () |
| rm_Medium & | Next () |
| rm_MedList | SelectByStatus (Int32_t a_status) |
| rm_Medium | SelectByDrive (Int32_t a_driveKey) |
| void | SelectBySlot (Int32_t a_slotKey) |
| vector< rm_Medium > | SelectByPartition (rm_String a_partName) |
| void | Print () |
| rm_Medium () | |
| rm_Medium (Int32_t a_mediumKey) | |
| i_Medium_t | Convert2Corba () |
| bool | operator== (const rm_Medium &m2) const |
Public Attributes | |
| Int32_t | mediumKey |
| Int32_t | mediaPoolKey |
| Int32_t | libraryKey |
| Int32_t | slotKey |
| Int32_t | diskSubsysKey |
| Int32_t | driveKey |
| rm_String | barcode |
| Int32_t | status |
| rm_String | location |
| Int32_t | mediumType |
| rm_String | mediumSerialNo |
| Int32_t | blockSize |
| Int16_t | numOfVolumes |
| Int16_t | idxOfSysVol |
| Int32_t | sizeOfSysVol |
| Int16_t | currentVolume |
| log_CLASSID_m | |
Private Member Functions | |
| void | Insert () |
| void | Update () |
| void | Remove (Int32_t a_mediumKey) |
Friends | |
| class | rm_Operator |
| class | rm_MediumPos_t |
| rm_Medium::rm_Medium | ( | ) |
Definition at line 2709 of file librmdb.exx.
02710 : barcode(rmdb_MAX_BARCODE), 02711 location(rmdb_MAX_LOCATION), 02712 mediumSerialNo(rmdb_MAX_MEDIUMSERIALNO) { 02713 }
| rm_Medium::rm_Medium | ( | Int32_t | a_mediumKey | ) |
Definition at line 2715 of file librmdb.exx.
References Select().
02716 : barcode(rmdb_MAX_BARCODE), 02717 location(rmdb_MAX_LOCATION), 02718 mediumSerialNo(rmdb_MAX_MEDIUMSERIALNO) { 02719 Select(a_mediumKey); 02720 }

| void rm_Medium::Select | ( | Int32_t | a_mediumKey | ) |
Definition at line 2848 of file librmdb.exx.
References barcode, blockSize, currentVolume, diskSubsysKey, driveKey, errorDesc(), idxOfSysVol, libraryKey, location, log_FUNC_m, mediaPoolKey, mediumKey, mediumSerialNo, mediumType, NAME, numOfVolumes, rmdb_MAX_BARCODE, rmdb_MAX_LOCATION, rmdb_MAX_MEDIUMSERIALNO, sizeOfSysVol, slotKey, SQL_CHECKREAD_M, SQL_NOERROR, and status.
Referenced by rm_Operator::AllocateAdmin(), rm_Operator::AllocateMigCollocation(), rm_Operator::GetBestCopy(), rm_Medium(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumVol(), and rm_Operator::VolumeFull().
02848 { 02849 02850 log_FUNC_m(Select); 02851 02852 EXEC SQL 02853 SET TRANSACTION NAME readTrans 02854 READ ONLY 02855 ISOLATION LEVEL READ COMMITTED; 02856 02857 char barcodeVal[rmdb_MAX_BARCODE]; 02858 char locationVal[rmdb_MAX_LOCATION]; 02859 char mediumSerialNoVal[rmdb_MAX_MEDIUMSERIALNO]; 02860 EXEC SQL 02861 SELECT TRANSACTION readTrans 02862 * INTO 02863 :mediumKey, 02864 :mediaPoolKey, 02865 :libraryKey, 02866 :slotKey, 02867 :diskSubsysKey, 02868 :driveKey, 02869 :barcodeVal, 02870 :status, 02871 :locationVal, 02872 :mediumType, 02873 :mediumSerialNoVal, 02874 :blockSize, 02875 :numOfVolumes, 02876 :idxOfSysVol, 02877 :sizeOfSysVol, 02878 :currentVolume 02879 FROM MEDIA WHERE MEDIAKEY = :a_mediumKey; 02880 02881 if (SQLCODE == SQL_NOERROR) { 02882 barcode = barcodeVal; 02883 location = locationVal; 02884 mediumSerialNo = mediumSerialNoVal; 02885 }; 02886 string sqlErrDesc = errorDesc(SQLCODE,"Select record from Medium", a_mediumKey); 02887 SQL_CHECKREAD_M( sqlErrDesc ); 02888 }// rm_Medium::Select()


| void rm_Medium::SelectByBarcode | ( | rm_String | a_name | ) |
Definition at line 2891 of file librmdb.exx.
References barcode, blockSize, currentVolume, rm_String::cvalue_p, diskSubsysKey, driveKey, errorDesc(), idxOfSysVol, libraryKey, location, log_FUNC_m, mediaPoolKey, mediumKey, mediumSerialNo, mediumType, NAME, numOfVolumes, rmdb_MAX_BARCODE, rmdb_MAX_LOCATION, rmdb_MAX_MEDIUMSERIALNO, sizeOfSysVol, slotKey, SQL_CHECKREAD_M, SQL_NOERROR, and status.
Referenced by rm_Operator::Add(), rm_Operator::InventoryUpdate(), rm_Operator::MediumLoaded(), rm_Operator::MediumUnLoaded(), rm_Operator::RemoveMedium(), rm_Operator::RemoveMediumVol(), rm_Operator::SelectAllMediumVolByMedium(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumVol(), and rm_Operator::Update().
02891 { 02892 log_FUNC_m(SelectByName); 02893 02894 EXEC SQL 02895 SET TRANSACTION NAME readTrans 02896 READ ONLY 02897 ISOLATION LEVEL READ COMMITTED; 02898 02899 char barcodeVal[rmdb_MAX_BARCODE]; 02900 char locationVal[rmdb_MAX_LOCATION]; 02901 char mediumSerialNoVal[rmdb_MAX_MEDIUMSERIALNO]; 02902 02903 EXEC SQL 02904 SELECT TRANSACTION readTrans 02905 * INTO 02906 :mediumKey, 02907 :mediaPoolKey, 02908 :libraryKey, 02909 :slotKey, 02910 :diskSubsysKey, 02911 :driveKey, 02912 :barcodeVal, 02913 :status, 02914 :locationVal, 02915 :mediumType, 02916 :mediumSerialNoVal, 02917 :blockSize, 02918 :numOfVolumes, 02919 :idxOfSysVol, 02920 :sizeOfSysVol, 02921 :currentVolume 02922 FROM MEDIA WHERE BARCODE = :a_name.cvalue_p; 02923 02924 if (SQLCODE == SQL_NOERROR) { 02925 barcode = barcodeVal; 02926 location = locationVal; 02927 mediumSerialNo = mediumSerialNoVal; 02928 }; 02929 string sqlErrDesc = errorDesc(SQLCODE, "Selecting Medium record by Name" , a_name); 02930 SQL_CHECKREAD_M(sqlErrDesc); 02931 }


| void rm_Medium::StartSelectAll | ( | ) |
Definition at line 3007 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::SelectAllMedium().
03007 { 03008 log_FUNC_m(StartSelectAll); 03009 03010 g_mediumCursor_x.Lock(); 03011 03012 EXEC SQL 03013 SET TRANSACTION NAME readTrans 03014 READ ONLY 03015 ISOLATION LEVEL READ COMMITTED; 03016 03017 EXEC SQL 03018 OPEN TRANSACTION readTrans 03019 SELECT_ALL_MEDIA; 03020 03021 if ( SQLCODE != SQL_NOERROR ) { 03022 string sqlErrDesc = errorDesc(SQLCODE, "Opening SELECT_ALL_MEDIA Cursor failed"); 03023 log_ERR_m(sqlErrDesc); 03024 g_mediumCursor_x.Unlock(); 03025 throw ivd_DBException( SQLCODE ,sqlErrDesc, true); 03026 } 03027 }


| void rm_Medium::EndSelectAll | ( | ) |
Definition at line 3029 of file librmdb.exx.
References errorDesc(), log_FUNC_m, SQL_CHECKREAD_M, and cmn_Mutex::Unlock().
03029 { 03030 log_FUNC_m(EndSelectAll); 03031 03032 EXEC SQL 03033 CLOSE SELECT_ALL_MEDIA; 03034 g_mediumCursor_x.Unlock(); 03035 string sqlErrDesc = errorDesc(SQLCODE, "CLOSE SELECT_ALL_MEDIA" ); 03036 SQL_CHECKREAD_M( sqlErrDesc ); 03037 03038 }

| rm_Medium & rm_Medium::Next | ( | ) |
Definition at line 3040 of file librmdb.exx.
References barcode, blockSize, currentVolume, diskSubsysKey, driveKey, errorDesc(), idxOfSysVol, libraryKey, location, log_FUNC_m, mediaPoolKey, mediumKey, mediumSerialNo, mediumType, numOfVolumes, rmdb_MAX_BARCODE, rmdb_MAX_LOCATION, rmdb_MAX_MEDIUMSERIALNO, sizeOfSysVol, slotKey, SQL_CHECKREAD_M, SQL_NOERROR, status, and cmn_Mutex::Unlock().
Referenced by rm_Operator::SelectAllMedium().
03040 { 03041 log_FUNC_m(Next); 03042 03043 char barcodeVal[rmdb_MAX_BARCODE]; 03044 char locationVal[rmdb_MAX_LOCATION]; 03045 char mediumSerialNoVal[rmdb_MAX_MEDIUMSERIALNO]; 03046 03047 EXEC SQL 03048 FETCH SELECT_ALL_MEDIA 03049 INTO 03050 :mediumKey, 03051 :mediaPoolKey, 03052 :libraryKey, 03053 :slotKey, 03054 :diskSubsysKey, 03055 :driveKey, 03056 :barcodeVal, 03057 :status, 03058 :locationVal, 03059 :mediumType, 03060 :mediumSerialNoVal, 03061 :blockSize, 03062 :numOfVolumes, 03063 :idxOfSysVol, 03064 :sizeOfSysVol, 03065 :currentVolume; 03066 03067 if (SQLCODE == SQL_NOERROR) { 03068 barcode = barcodeVal; 03069 location = locationVal; 03070 mediumSerialNo = mediumSerialNoVal; 03071 } 03072 else { 03073 int fetchCode = SQLCODE; 03074 EXEC SQL 03075 CLOSE SELECT_ALL_MEDIA; 03076 g_mediumCursor_x.Unlock(); 03077 SQLCODE = fetchCode; 03078 string sqlErrDesc = errorDesc(fetchCode, "CLOSE SELECT_ALL_MEDIA" ); 03079 SQL_CHECKREAD_M( sqlErrDesc ); 03080 }; 03081 03082 return *this; 03083 03084 }


| rm_MedList rm_Medium::SelectByStatus | ( | Int32_t | a_status | ) |
Definition at line 2935 of file librmdb.exx.
References barcode, blockSize, currentVolume, diskSubsysKey, driveKey, errorDesc(), idxOfSysVol, libraryKey, location, log_ERR_m, log_FUNC_m, mediaPoolKey, mediumKey, mediumSerialNo, mediumType, NAME, numOfVolumes, rmdb_MAX_BARCODE, rmdb_MAX_LOCATION, rmdb_MAX_MEDIUMSERIALNO, sizeOfSysVol, slotKey, SQL_CHECKREAD_M, SQL_NOERROR, SQL_NOTFOUND, and status.
02935 { 02936 log_FUNC_m(SelectByStatus); 02937 02938 EXEC SQL 02939 SET TRANSACTION NAME readTrans 02940 READ ONLY 02941 ISOLATION LEVEL READ COMMITTED; 02942 02943 EXEC SQL 02944 DECLARE SELECT_FREE_MEDIA CURSOR FOR 02945 SELECT * FROM MEDIA 02946 WHERE 02947 bin_and(MEDIA.STATUS, :a_status) = 0; 02948 02949 EXEC SQL 02950 OPEN TRANSACTION readTrans SELECT_FREE_MEDIA; 02951 02952 if ( SQLCODE != SQL_NOERROR ) { 02953 string sqlErrDesc = errorDesc(SQLCODE, "Opening SELECT_FREE_MEDIA Cursor failed"); 02954 log_ERR_m(sqlErrDesc); 02955 throw ivd_DBException( SQLCODE ,sqlErrDesc, true); 02956 } 02957 02958 rm_MedList medVec; 02959 char barcodeVal[rmdb_MAX_BARCODE]; 02960 char locationVal[rmdb_MAX_LOCATION]; 02961 char mediumSerialNoVal[rmdb_MAX_MEDIUMSERIALNO]; 02962 02963 while (SQLCODE == SQL_NOERROR){ 02964 02965 EXEC SQL 02966 FETCH SELECT_FREE_MEDIA 02967 INTO 02968 :mediumKey, 02969 :mediaPoolKey, 02970 :libraryKey, 02971 :slotKey, 02972 :diskSubsysKey, 02973 :driveKey, 02974 :barcodeVal, 02975 :status, 02976 :locationVal, 02977 :mediumType, 02978 :mediumSerialNoVal, 02979 :blockSize, 02980 :numOfVolumes, 02981 :idxOfSysVol, 02982 :sizeOfSysVol, 02983 :currentVolume; 02984 02985 if (SQLCODE == SQL_NOERROR) { 02986 barcode = barcodeVal; 02987 location = locationVal; 02988 mediumSerialNo = mediumSerialNoVal; 02989 }; 02990 medVec.push_back(*this); 02991 }; 02992 02993 if (SQLCODE != SQL_NOTFOUND){ 02994 string sqlErrDesc = errorDesc(SQLCODE,"end of SELECT_ALL_MEDIA cursor"); 02995 SQL_CHECKREAD_M( sqlErrDesc ); 02996 }; 02997 EXEC SQL 02998 CLOSE SELECT_ALL_MEDIA; 02999 string sqlErrDesc = errorDesc(SQLCODE, "CLOSE SELECT_ALL_MEDIA" ); 03000 SQL_CHECKREAD_M( sqlErrDesc ); 03001 03002 return medVec; 03003 }

Definition at line 3086 of file librmdb.exx.
References barcode, blockSize, currentVolume, diskSubsysKey, driveKey, errorDesc(), idxOfSysVol, libraryKey, location, log_FUNC_m, mediaPoolKey, mediumKey, mediumSerialNo, mediumType, NAME, numOfVolumes, rmdb_MAX_BARCODE, rmdb_MAX_LOCATION, rmdb_MAX_MEDIUMSERIALNO, sizeOfSysVol, slotKey, SQL_CHECKREAD_M, SQL_NOERROR, and status.
Referenced by rm_Operator::AllocateAdmin(), rm_Operator::AllocateRecall(), rm_Operator::InventoryUpdate(), rm_Operator::SelectDriveForMig(), and rm_Operator::SelectMediumByDrive().
03086 { 03087 log_FUNC_m(SelectByDrive); 03088 EXEC SQL 03089 SET TRANSACTION NAME readTrans 03090 READ ONLY 03091 ISOLATION LEVEL READ COMMITTED; 03092 03093 char barcodeVal[rmdb_MAX_BARCODE]; 03094 char locationVal[rmdb_MAX_LOCATION]; 03095 char mediumSerialNoVal[rmdb_MAX_MEDIUMSERIALNO]; 03096 03097 EXEC SQL 03098 SELECT TRANSACTION readTrans 03099 * INTO 03100 :mediumKey, 03101 :mediaPoolKey, 03102 :libraryKey, 03103 :slotKey, 03104 :diskSubsysKey, 03105 :driveKey, 03106 :barcodeVal, 03107 :status, 03108 :locationVal, 03109 :mediumType, 03110 :mediumSerialNoVal, 03111 :blockSize, 03112 :numOfVolumes, 03113 :idxOfSysVol, 03114 :sizeOfSysVol, 03115 :currentVolume 03116 FROM MEDIA WHERE DRIVEKEY = :a_driveKey; 03117 03118 if (SQLCODE == SQL_NOERROR) { 03119 barcode = barcodeVal; 03120 location = locationVal; 03121 mediumSerialNo = mediumSerialNoVal; 03122 }; 03123 string sqlErrDesc = errorDesc(SQLCODE, "Selecting Medium record by Drive"); 03124 SQL_CHECKREAD_M( sqlErrDesc ); 03125 return *this; 03126 }


| void rm_Medium::SelectBySlot | ( | Int32_t | a_slotKey | ) |
Definition at line 3128 of file librmdb.exx.
References barcode, blockSize, currentVolume, diskSubsysKey, driveKey, errorDesc(), idxOfSysVol, libraryKey, location, log_FUNC_m, mediaPoolKey, mediumKey, mediumSerialNo, mediumType, NAME, numOfVolumes, rmdb_MAX_BARCODE, rmdb_MAX_LOCATION, rmdb_MAX_MEDIUMSERIALNO, sizeOfSysVol, slotKey, SQL_CHECKREAD_M, SQL_NOERROR, and status.
Referenced by rm_Operator::InventoryUpdate().
03128 { 03129 log_FUNC_m(SelectBySlot); 03130 EXEC SQL 03131 SET TRANSACTION NAME readTrans 03132 READ ONLY 03133 ISOLATION LEVEL READ COMMITTED; 03134 03135 char barcodeVal[rmdb_MAX_BARCODE]; 03136 char locationVal[rmdb_MAX_LOCATION]; 03137 char mediumSerialNoVal[rmdb_MAX_MEDIUMSERIALNO]; 03138 03139 EXEC SQL 03140 SELECT TRANSACTION readTrans 03141 * INTO 03142 :mediumKey, 03143 :mediaPoolKey, 03144 :libraryKey, 03145 :slotKey, 03146 :diskSubsysKey, 03147 :driveKey, 03148 :barcodeVal, 03149 :status, 03150 :locationVal, 03151 :mediumType, 03152 :mediumSerialNoVal, 03153 :blockSize, 03154 :numOfVolumes, 03155 :idxOfSysVol, 03156 :sizeOfSysVol, 03157 :currentVolume 03158 FROM MEDIA WHERE SLOTKEY = :a_slotKey; 03159 03160 if (SQLCODE == SQL_NOERROR) { 03161 barcode = barcodeVal; 03162 location = locationVal; 03163 mediumSerialNo = mediumSerialNoVal; 03164 }; 03165 string sqlErrDesc = errorDesc(SQLCODE, "Selecting Medium record by Slot " , a_slotKey); 03166 SQL_CHECKREAD_M( sqlErrDesc ); 03167 03168 }


Definition at line 3170 of file librmdb.exx.
References barcode, blockSize, cmn_Num2Str(), currentVolume, rm_String::cvalue_p, dbg_DETAIL, dbg_LOW, dbg_NORM, diskSubsysKey, driveKey, errorDesc(), idxOfSysVol, ie_RMDB_ERROR, ivd_Error, libraryKey, location, log_DBG_m, log_FUNC_m, mediaPoolKey, mediumKey, mediumSerialNo, mediumType, NAME, numOfVolumes, rmdb_MAX_BARCODE, rmdb_MAX_LOCATION, rmdb_MAX_MEDIUMSERIALNO, sizeOfSysVol, slotKey, SQL_CHECKREAD_M, SQL_NOERROR, SQL_NOTFOUND, and status.
Referenced by rm_Operator::GetMediaInfo(), and rm_Operator::SelectAllMediaByPart().
03170 { 03171 log_FUNC_m(SelectByPartition); 03172 03173 EXEC SQL 03174 SET TRANSACTION NAME readTrans 03175 READ ONLY 03176 ISOLATION LEVEL READ COMMITTED; 03177 03178 char barcodeVal[rmdb_MAX_BARCODE]; 03179 char locationVal[rmdb_MAX_LOCATION]; 03180 char mediumSerialNoVal[rmdb_MAX_MEDIUMSERIALNO]; 03181 03182 03183 EXEC SQL 03184 DECLARE SELECT_MEDIA_BY_PARTITION CURSOR FOR 03185 SELECT MEDIA.* 03186 FROM MEDIA, MEDIAPOOL, PARTITION 03187 WHERE 03188 MEDIA.MEDIAPOOLKEY = MEDIAPOOL.MEDIAPOOLKEY AND 03189 MEDIAPOOL.PARTITIONUUID = PARTITION.PARTUUID AND 03190 PARTITION.PARTNAME = :a_partName.cvalue_p 03191 ORDER BY MEDIA.MEDIAKEY; 03192 03193 log_DBG_m(dbg_DETAIL,"Will select all media for Partition:" << a_partName); 03194 03195 if (SQLCODE != SQL_NOERROR) { 03196 log_DBG_m(dbg_DETAIL,"SQLERROR when declaring Cursor SELECT_MEDIA_BY_PARTITION " << SQLCODE); 03197 throw ivd_Error(ie_RMDB_ERROR, "Declare SELECT_MEDIA_BY_PARTITION Cursor failed"); 03198 } 03199 03200 EXEC SQL 03201 OPEN TRANSACTION readTrans 03202 SELECT_MEDIA_BY_PARTITION; 03203 03204 vector<rm_Medium> mediumVec; 03205 bool endOfCursor = false; 03206 do { 03207 EXEC SQL 03208 FETCH SELECT_MEDIA_BY_PARTITION 03209 INTO 03210 :mediumKey, 03211 :mediaPoolKey, 03212 :libraryKey, 03213 :slotKey, 03214 :diskSubsysKey, 03215 :driveKey, 03216 :barcodeVal, 03217 :status, 03218 :locationVal, 03219 :mediumType, 03220 :mediumSerialNoVal, 03221 :blockSize, 03222 :numOfVolumes, 03223 :idxOfSysVol, 03224 :sizeOfSysVol, 03225 :currentVolume; 03226 03227 if (SQLCODE == SQL_NOERROR) { 03228 log_DBG_m(dbg_DETAIL,"Selected volume [BarcodeVal, MediumKey, PartName]: [" 03229 << barcodeVal << "," << mediumKey << "," << a_partName ); 03230 03231 barcode = barcodeVal; 03232 location = locationVal; 03233 mediumSerialNo = mediumSerialNoVal; 03234 03235 mediumVec.push_back(*this); 03236 } 03237 else if (SQLCODE == SQL_NOTFOUND) { 03238 log_DBG_m(dbg_NORM,"reached end of cursor"); 03239 endOfCursor = true; 03240 } 03241 else { 03242 log_DBG_m(dbg_LOW,"Fatal Medium error sqlcode: " << SQLCODE ); 03243 throw ivd_Error ( 03244 ie_RMDB_ERROR, 03245 "Fatal Medium select by Partition error sqlcode:" 03246 + cmn_Num2Str((Int32_t)SQLCODE), 03247 true); 03248 }; 03249 03250 } while (endOfCursor == false); 03251 03252 EXEC SQL 03253 CLOSE SELECT_MEDIA_BY_PARTITION; 03254 string sqlErrDesc = errorDesc(SQLCODE, "CLOSE SELECT_ALL_MEDIA_BY_PARTITION" ); 03255 SQL_CHECKREAD_M( sqlErrDesc ); 03256 return mediumVec; 03257 }


| void rm_Medium::Print | ( | ) |
Definition at line 3262 of file librmdb.exx.
References barcode, blockSize, currentVolume, diskSubsysKey, driveKey, idxOfSysVol, libraryKey, location, mediaPoolKey, mediumKey, mediumSerialNo, mediumType, numOfVolumes, sizeOfSysVol, slotKey, and status.
03262 { 03263 cout << "NOW PRINTING MEDIA: " << endl; 03264 cout << "mediumKey : " << mediumKey << "<-" << endl; 03265 cout << "mediaPoolKey : " << mediaPoolKey << "<-" << endl; 03266 cout << "libraryKey : " << libraryKey << "<-" << endl; 03267 cout << "slotKey : " << slotKey << "<-" << endl; 03268 cout << "diskSubsysKey : " << diskSubsysKey<< "<-" << endl; 03269 cout << "driveKey : " << driveKey << "<-" << endl; 03270 cout << "barcode: " << barcode << "<-" << endl; 03271 cout << "status : " << status << "<-" << endl; 03272 cout << "location : " << location << "<-" << endl; 03273 cout << "mediumType : " << mediumType << "<-" << endl; 03274 cout << "mediumSerialNo : " << mediumSerialNo << "<-" << endl; 03275 cout << "blockSize : " << blockSize << "<-" << endl; 03276 cout << "numOfVolumes : " << numOfVolumes << "<-" << endl; 03277 cout << "idxOfSysVol : " << idxOfSysVol << "<-" << endl; 03278 cout << "sizeOfSysVol : " << sizeOfSysVol << "<-" << endl; 03279 cout << "currentVolume : " << currentVolume<< "<-" << endl; 03280 03281 } // rm_Medium::Print
| void rm_Medium::Insert | ( | ) | [private] |
Definition at line 2724 of file librmdb.exx.
References barcode, blockSize, currentVolume, rm_String::cvalue_p, dbg_NORM, diskSubsysKey, driveKey, errorDesc(), idxOfSysVol, ie_PRECONDITION, ivd_Error, libraryKey, location, log_DBG_m, log_FUNC_m, MAX, mediaPoolKey, mediumKey, mediumSerialNo, mediumType, NAME, numOfVolumes, sizeOfSysVol, slotKey, SQL_CHECK_M, SQL_NOERROR, SQL_UNIQUEVIOLATION, and status.
Referenced by rm_Operator::Add(), and rm_Operator::InventoryUpdate().
02724 { 02725 log_FUNC_m(Insert); 02726 02727 EXEC SQL 02728 SET TRANSACTION NAME readWriteTrans; 02729 02730 Int32_t k(0); 02731 if (mediumKey == 0) { 02732 EXEC SQL 02733 SELECT TRANSACTION readWriteTrans 02734 MAX(MEDIAKEY) INTO :k FROM MEDIA; 02735 mediumKey = ++k; 02736 if (k > USHRT_MAX) { 02737 stringstream err; 02738 err << " The medium key is too large (" 02739 << k << "). Not supported by the FSC. " 02740 << " (Barcode: " << barcode.cvalue_p << ")\n"; 02741 throw ivd_Error(ie_PRECONDITION, err.str(), true); 02742 } 02743 log_DBG_m(dbg_NORM,"new key:" << mediumKey); 02744 } 02745 else { 02746 EXEC SQL 02747 SELECT TRANSACTION readWriteTrans 02748 MEDIAKEY INTO :k FROM MEDIA 02749 WHERE MEDIAKEY = :mediumKey; 02750 if (SQLCODE == SQL_NOERROR) { 02751 log_DBG_m(dbg_NORM,"key exists"); 02752 throw ivd_DBException( SQL_UNIQUEVIOLATION ,"Medium Key already exists"); 02753 } 02754 } 02755 if (mediaPoolKey < 1) bi1 = -1; else bi1 = 0; 02756 if (libraryKey < 1) bi2 = -1; else bi2 = 0; 02757 if (slotKey < 1) bi3 = -1; else bi3 = 0; 02758 if (diskSubsysKey < 1) bi4 = -1; else bi4 = 0; 02759 if (driveKey < 1) bi5 = -1; else bi5 = 0; 02760 if (currentVolume < 1) bi6 = -1; else bi6 = 0; 02761 02762 EXEC SQL 02763 INSERT TRANSACTION readWriteTrans 02764 INTO MEDIA VALUES( 02765 :mediumKey, 02766 :mediaPoolKey INDICATOR :bi1, 02767 :libraryKey INDICATOR :bi2, 02768 :slotKey INDICATOR :bi3, 02769 :diskSubsysKey INDICATOR :bi4, 02770 :driveKey INDICATOR :bi5, 02771 :barcode.cvalue_p, 02772 :status, 02773 :location.cvalue_p, 02774 :mediumType, 02775 :mediumSerialNo.cvalue_p, 02776 :blockSize, 02777 :numOfVolumes, 02778 :idxOfSysVol, 02779 :sizeOfSysVol, 02780 :currentVolume INDICATOR :bi6 02781 ); 02782 string sqlErrDesc = errorDesc(SQLCODE,"Insert record into Medium", mediumKey); 02783 SQL_CHECK_M( sqlErrDesc ); 02784 02785 }// rm_Medium::Insert()


| void rm_Medium::Update | ( | ) | [private] |
Definition at line 2807 of file librmdb.exx.
References barcode, blockSize, currentVolume, rm_String::cvalue_p, diskSubsysKey, driveKey, errorDesc(), idxOfSysVol, libraryKey, location, log_FUNC_m, mediaPoolKey, mediumKey, mediumSerialNo, mediumType, NAME, numOfVolumes, sizeOfSysVol, slotKey, SQL_CHECK_M, and status.
Referenced by rm_Operator::AllocateAdmin(), rm_Operator::AllocateRecall(), rm_Operator::InventoryUpdate(), rm_Operator::MediumLoaded(), rm_Operator::MediumUnLoaded(), rm_Operator::ReleaseResources(), rm_Operator::Update(), and rm_Operator::VolumeFull().
02807 { 02808 log_FUNC_m(Update); 02809 02810 if (mediaPoolKey < 1) bi1 = -1; else bi1 = 0; 02811 if (libraryKey < 1) bi2 = -1; else bi2 = 0; 02812 if (slotKey < 1) bi3 = -1; else bi3 = 0; 02813 if (diskSubsysKey < 1) bi4 = -1; else bi4 = 0; 02814 if (driveKey < 1) bi5 = -1; else bi5 = 0; 02815 if (currentVolume < 1) bi6 = -1; else bi6 = 0; 02816 02817 EXEC SQL 02818 SET TRANSACTION NAME readWriteTrans; 02819 02820 EXEC SQL 02821 UPDATE TRANSACTION readWriteTrans 02822 MEDIA SET 02823 MEDIAPOOLKEY = :mediaPoolKey INDICATOR :bi1, 02824 LIBRARYKEY = :libraryKey INDICATOR :bi2, 02825 SLOTKEY = :slotKey INDICATOR :bi3, 02826 DISKSUBSYSKEY = :diskSubsysKey INDICATOR :bi4, 02827 DRIVEKEY = :driveKey INDICATOR :bi5, 02828 BARCODE = :barcode.cvalue_p, 02829 STATUS = :status, 02830 LOCATION = :location.cvalue_p, 02831 MEDIATYPE = :mediumType, 02832 MEDIASERIALNO = :mediumSerialNo.cvalue_p, 02833 BLOCKSIZE = :blockSize, 02834 NUMOFVOLUMES = :numOfVolumes, 02835 IDXOFSYSVOL = :idxOfSysVol, 02836 SIZEOFSYSVOL = :sizeOfSysVol, 02837 CURRENTVOLUME = :currentVolume INDICATOR :bi6 02838 02839 WHERE MEDIAKEY = :mediumKey; 02840 string sqlErrDesc = errorDesc(SQLCODE,"Update Medium record", mediumKey); 02841 SQL_CHECK_M( sqlErrDesc ); 02842 02843 }// rm_Medium::Update()


| void rm_Medium::Remove | ( | Int32_t | a_mediumKey | ) | [private] |
Definition at line 2789 of file librmdb.exx.
References errorDesc(), log_FUNC_m, NAME, and SQL_CHECK_M.
Referenced by rm_Operator::RemoveMedium().
02789 { 02790 log_FUNC_m(Remove); 02791 02792 EXEC SQL 02793 SET TRANSACTION NAME readWriteTrans; 02794 02795 EXEC SQL 02796 DELETE TRANSACTION readWriteTrans 02797 FROM MEDIA WHERE MEDIAKEY = :a_mediumKey; 02798 02799 string sqlErrDesc = errorDesc(SQLCODE,"check for free slot", a_mediumKey); 02800 SQL_CHECK_M( sqlErrDesc ); 02801 02802 }// rm_Medium::Remove


| i_Medium_t rm_Medium::Convert2Corba | ( | ) |
Definition at line 2139 of file rm_operator.cpp.
References barcode, i_Medium_t::barcode, blockSize, i_Medium_t::blockSize, currentVolume, i_Medium_t::currentVolume, i_Medium_t::diskSubsysName, driveKey, rm_Drive::driveName, i_Medium_t::driveName, idxOfSysVol, i_Medium_t::idxOfSysVol, ipc_nilStr, rm_Library::libraryKey, libraryKey, rm_Library::libraryName, i_Medium_t::libraryName, location, i_Medium_t::location, log_FUNC_m, mediaPoolKey, rm_MediaPool::mediaPoolName, i_Medium_t::mediaPoolName, mediumKey, i_Medium_t::mediumKey, mediumSerialNo, i_Medium_t::mediumSerialNo, mediumType, i_Medium_t::mediumType, numOfVolumes, i_Medium_t::numOfVolumes, rm_Partition::partitionName, i_Medium_t::partitionName, rm_MediaPool::partitionUUIDString, rm_CATCH_DB_THROW_IVD_m, rm_Partition::SelectByUuid(), sizeOfSysVol, i_Medium_t::sizeOfSysVol, rm_Slot::slotAddr, i_Medium_t::slotAddr, slotKey, rm_Slot::slotType, i_Medium_t::slotType, status, and i_Medium_t::status.
Referenced by rm_Operator::GetMediaInfo(), and rm_Operator::SelectMedium().
02139 { 02140 log_FUNC_m(Convert2Corba); 02141 try { 02142 i_Medium_t iMedium; 02143 iMedium.mediumKey = mediumKey; 02144 if ( mediaPoolKey > 0 ) { 02145 rm_MediaPool mp( mediaPoolKey); 02146 iMedium.mediaPoolName = CORBA::string_dup(mp.mediaPoolName.c_str()); 02147 if (!mp.partitionUUIDString.empty()){ 02148 rm_Partition pm; 02149 pm.SelectByUuid(mp.partitionUUIDString); 02150 iMedium.partitionName = CORBA::string_dup(pm.partitionName.c_str()); 02151 } else { 02152 iMedium.partitionName = CORBA::string_dup(ipc_nilStr); 02153 } 02154 } else { 02155 iMedium.mediaPoolName = CORBA::string_dup(ipc_nilStr); 02156 } 02157 02158 02159 if ( libraryKey > 0) { 02160 rm_Library lib( libraryKey); 02161 iMedium.libraryName = CORBA::string_dup(lib.libraryName.c_str()); 02162 02163 if ( slotKey > 0) { 02164 rm_Slot s( slotKey,lib.libraryKey); 02165 iMedium.slotAddr = CORBA::string_dup(s.slotAddr.c_str()); 02166 iMedium.slotType = s.slotType; 02167 } else { 02168 iMedium.slotAddr = CORBA::string_dup(ipc_nilStr); 02169 iMedium.slotType = 0; 02170 } 02171 02172 02173 } else { 02174 iMedium.libraryName = CORBA::string_dup(ipc_nilStr); 02175 } 02176 02177 02178 if ( driveKey > 0) { 02179 rm_Drive d( driveKey); 02180 iMedium.driveName = CORBA::string_dup(d.driveName.c_str()); 02181 } else { 02182 iMedium.driveName = CORBA::string_dup(ipc_nilStr); 02183 } 02184 02185 02186 iMedium.diskSubsysName = CORBA::string_dup(ipc_nilStr); 02187 02188 iMedium.barcode = CORBA::string_dup( barcode.c_str()); 02189 iMedium.status = status; 02190 iMedium.location = CORBA::string_dup( location.c_str()); 02191 iMedium.mediumType = mediumType; 02192 iMedium.mediumSerialNo = CORBA::string_dup( mediumSerialNo.c_str()); 02193 iMedium.blockSize = blockSize; 02194 iMedium.numOfVolumes = numOfVolumes; 02195 iMedium.idxOfSysVol = idxOfSysVol; 02196 iMedium.sizeOfSysVol = sizeOfSysVol; 02197 iMedium.currentVolume = currentVolume; 02198 02199 return iMedium; 02200 }rm_CATCH_DB_THROW_IVD_m; 02201 }


| bool rm_Medium::operator== | ( | const rm_Medium & | m2 | ) | const [inline] |
Definition at line 520 of file rmdb.h.
References barcode, mediaPoolKey, mediumKey, rm_MediumPos_t::mediumKey, mediumSerialNo, and mediumType.
00520 { 00521 return ( ( mediumKey == m2.mediumKey ) && 00522 ( mediaPoolKey == m2.mediaPoolKey ) && 00523 ( mediumType == m2.mediumType ) && 00524 ( mediumSerialNo == m2.mediumSerialNo ) && 00525 ( barcode == m2.barcode ) ); 00526 };
friend class rm_Operator [friend] |
friend class rm_MediumPos_t [friend] |
Definition at line 476 of file rmdb.h.
Referenced by rm_Operator::Add(), rm_Operator::AllocateAdmin(), rm_Operator::AllocateMigCollocation(), rm_Operator::AllocateRecall(), Convert2Corba(), rm_Operator::GetBestCopy(), Insert(), rm_Operator::InventoryUpdate(), Next(), operator==(), Print(), rm_Operator::ReleaseResources(), rm_Operator::RemoveMedium(), rm_Operator::RemoveMediumVol(), Select(), rm_Operator::SelectAllMediumVolByMedium(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::SelectMediumVol(), rm_Operator::SelectMediumVolumeCol(), rm_Operator::SelectMediumVolumeMig(), rm_Operator::Update(), and Update().
Definition at line 477 of file rmdb.h.
Referenced by rm_Operator::Add(), rm_Operator::AllocateAdmin(), rm_Operator::AllocateMigCollocation(), rm_Operator::AllocateRecall(), Convert2Corba(), Insert(), rm_Operator::InventoryUpdate(), Next(), operator==(), Print(), Select(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectDriveForMig(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::Update(), and Update().
Definition at line 478 of file rmdb.h.
Referenced by rm_Operator::Add(), rm_Operator::AllocateAdmin(), rm_Operator::AllocateRecall(), Convert2Corba(), rm_Operator::GetBestCopy(), Insert(), rm_Operator::InventoryUpdate(), rm_Operator::MediumUnLoaded(), Next(), Print(), Select(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectDriveForMig(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::Update(), and Update().
Definition at line 479 of file rmdb.h.
Referenced by rm_Operator::Add(), rm_Operator::AllocateAdmin(), rm_Operator::AllocateRecall(), Convert2Corba(), Insert(), rm_Operator::InventoryUpdate(), rm_Operator::MediumUnLoaded(), Next(), Print(), Select(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectDriveForMig(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::Update(), and Update().
Definition at line 480 of file rmdb.h.
Referenced by rm_Operator::Add(), Insert(), rm_Operator::InventoryUpdate(), Next(), Print(), Select(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::Update(), and Update().
Definition at line 481 of file rmdb.h.
Referenced by rm_Operator::Add(), rm_Operator::AllocateAdmin(), rm_Operator::AllocateMigCollocation(), rm_Operator::AllocateRecall(), Convert2Corba(), rm_Operator::GetBestCopy(), Insert(), rm_Operator::InventoryUpdate(), rm_Operator::MediumLoaded(), rm_Operator::MediumUnLoaded(), Next(), Print(), Select(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::SelectOpenedVolume(), rm_Operator::Update(), and Update().
Definition at line 482 of file rmdb.h.
Referenced by rm_Operator::Add(), rm_Operator::AllocateAdmin(), rm_Operator::AllocateMigCollocation(), rm_Operator::AllocateRecall(), rm_Operator::AutoDetect(), rm_Operator::CheckAndAdd(), Convert2Corba(), rm_Operator::GetBestCopy(), Insert(), rm_Operator::InventoryUpdate(), rm_Operator::MediumUnLoaded(), Next(), operator==(), Print(), rm_Operator::ReleaseResources(), Select(), rm_Operator::SelectAllMediumVol(), rm_Operator::SelectAllMediumVolByMedium(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectDriveForMig(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::SelectMediumVol(), rm_Operator::SelectMediumVolumeMig(), rm_Operator::SelectOpenedVolume(), Update(), and rm_Operator::VolumeFull().
Definition at line 483 of file rmdb.h.
Referenced by rm_Operator::Add(), rm_Operator::AllocateAdmin(), rm_Operator::AllocateMigCollocation(), rm_Operator::AllocateRecall(), rm_Operator::AutoDetect(), Convert2Corba(), rm_Operator::GetBestCopy(), Insert(), rm_Operator::InventoryUpdate(), rm_Operator::MediumUnLoaded(), Next(), Print(), rm_Operator::ReleaseResources(), rm_Operator::RemoveMedium(), Select(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::Update(), Update(), and rm_Operator::VolumeFull().
Definition at line 484 of file rmdb.h.
Referenced by rm_Operator::Add(), Convert2Corba(), Insert(), Next(), Print(), Select(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::Update(), and Update().
Definition at line 485 of file rmdb.h.
Referenced by rm_Operator::Add(), rm_Operator::AllocateAdmin(), rm_Operator::AllocateMigCollocation(), rm_Operator::AllocateRecall(), Convert2Corba(), rm_Operator::GetBestCopy(), Insert(), rm_Operator::InventoryUpdate(), rm_Operator::IsMediumWORM(), Next(), operator==(), Print(), Select(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::SelectOpenedVolume(), rm_Operator::Update(), and Update().
Definition at line 486 of file rmdb.h.
Referenced by rm_Operator::Add(), Convert2Corba(), Insert(), Next(), operator==(), Print(), Select(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::Update(), and Update().
Definition at line 487 of file rmdb.h.
Referenced by rm_Operator::Add(), rm_Operator::AllocateMigCollocation(), rm_Operator::AllocateRecall(), Convert2Corba(), Insert(), rm_Operator::InventoryUpdate(), Next(), Print(), Select(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::SelectOpenedVolume(), rm_Operator::Update(), and Update().
Definition at line 488 of file rmdb.h.
Referenced by rm_Operator::Add(), Convert2Corba(), Insert(), rm_Operator::InventoryUpdate(), Next(), Print(), Select(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::Update(), and Update().
Definition at line 489 of file rmdb.h.
Referenced by rm_Operator::Add(), Convert2Corba(), Insert(), rm_Operator::InventoryUpdate(), Next(), Print(), Select(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::Update(), and Update().
Definition at line 490 of file rmdb.h.
Referenced by rm_Operator::Add(), Convert2Corba(), Insert(), rm_Operator::InventoryUpdate(), Next(), Print(), Select(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::Update(), and Update().
Definition at line 492 of file rmdb.h.
Referenced by rm_Operator::Add(), Convert2Corba(), Insert(), rm_Operator::InventoryUpdate(), Next(), Print(), rm_Operator::ReleaseResources(), Select(), SelectByBarcode(), SelectByDrive(), SelectByPartition(), SelectBySlot(), SelectByStatus(), rm_Operator::SelectMedium(), rm_Operator::SelectMediumByDrive(), rm_Operator::SelectMediumForMig(), rm_Operator::SelectMediumVolumeCol(), rm_Operator::SelectMediumVolumeMig(), rm_Operator::Update(), and Update().
1.5.6