Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

i_ManagementInterface_i Class Reference
[Management Interface]

#include <i_mif_impl.h>

Inheritance diagram for i_ManagementInterface_i:
Inheritance graph
[legend]
Collaboration diagram for i_ManagementInterface_i:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 i_ManagementInterface_i ()
virtual ~i_ManagementInterface_i ()
void EnableDebug (CORBA::Char a_level, const char *a_output, const char *a_flags, CORBA::ULong a_ivdfsFlags)
void DisableDebug ()
void Remove ()
void UpdateSystemCfg (const char *a_userAtDomain, const i_DataBlock_t &a_cfgFile, i_Index_t &a_newRevNo)
i_DataBlock_tShowSystemCfg (i_Index_t a_revNo)
i_Count_t ShowSystemCfgRevs ()
void SystemStatus (i_UIMessageServer_ptr a_uims)
char * AddLibrary (const char *a_userAtDomain, const i_DataBlock_t &a_cfgFile, i_UIMessageServer_ptr a_uims)
void RemoveLibrary (const char *a_name)
char * UpdateLibrary (const char *a_userAtDomain, const char *a_name, const i_DataBlock_t &a_cfgFile, i_Index_t &a_newRevNo)
i_DataBlock_tShowLibrary (const char *a_name, i_Index_t a_revNo)
i_Count_t ShowLibraryRevs (const char *a_name)
void UpdateLibraryInventory (const char *a_name, CORBA::Boolean a_physicalInv)
void ListLibraries (i_UIMessageServer_ptr a_uims, CORBA::Long a_filter)
void ShowLibraryInventory (const char *a_name, i_UIMessageServer_ptr a_uims)
void EnableLibrary (const char *a_name, i_UIMessageServer_ptr a_uims)
void DisableLibrary (const char *a_mame, i_UIMessageServer_ptr a_uims)
i_Library_tGetLibrary (const char *a_name)
void ListSlots (i_UIMessageServer_ptr a_uims, CORBA::Long a_filter)
i_Slot_tGetSlot (const char *a_libraryName, const char *a_slotAddr, CORBA::Long a_type)
char * AddDrive (const char *a_userAtDomain, const i_DataBlock_t &a_cfgFile)
void RemoveDrive (const char *a_name)
char * UpdateDrive (const char *a_userAtDomain, const char *a_name, const i_DataBlock_t &a_cfgFile, i_Index_t &a_newRevNo)
i_DataBlock_tShowDrive (const char *a_name, i_Index_t a_revNo)
i_Count_t ShowDriveRevs (const char *a_name)
i_Drive_tGetDrive (const char *a_name)
void ListDrives (i_UIMessageServer_ptr a_uims, CORBA::Long a_filter)
void EnableDrive (const char *driveName, i_UIMessageServer_ptr a_uims)
void DisableDrive (const char *driveName, i_UIMessageServer_ptr a_uims)
i_MediaInfoSeq_tGetMediaInfo (const char *a_partName)
i_MinorColSeq_tEnumMinorCollocationId (i_ColID_t a_majColId)
i_MajorColSeq_tEnumMajorCollocationId ()
void ListDriveHosts (i_UIMessageServer_ptr a_uims, CORBA::Long a_filter)
i_DriveHost_tGetDriveHost (const char *a_driveName, const char *driveHost)
char * AddPool (const char *a_userAtDomain, const i_DataBlock_t &a_cfgFile)
void RemovePool (const char *a_name)
char * UpdatePool (const char *a_userAtDomain, const char *a_name, const i_DataBlock_t &a_cfgFile, i_Index_t &a_newRevNo)
i_DataBlock_tShowPool (const char *a_name, i_Index_t a_revNo)
i_Count_t ShowPoolRevs (const char *a_name)
void ListPools (i_UIMessageServer_ptr a_uims, CORBA::Long a_filter)
void PoolReorgStat (i_UIMessageServer_ptr a_uims)
i_MediaPool_tGetPool (const char *a_name)
i_MediaPoolSeq_tGetAllPools ()
void RemoveMedium (const char *a_barcode, i_UIMessageServer_ptr a_uims)
void AddMedium (const char *a_barcode)
i_JobID_t FormatAndInitMedium (i_UIMessageServer_ptr a_uims, CORBA::Boolean a_doFormat, CORBA::Boolean a_doInit, CORBA::Boolean a_forced, const char *a_barcode, const i_VolNumList_t &a_volumes)
i_JobID_t RecreateFriAndMic (i_UIMessageServer_ptr a_uims, CORBA::Boolean a_fri, CORBA::Boolean a_mic, CORBA::Boolean a_forced, const char *a_barcode, const i_VolNumList_t &a_volumes, CORBA::Boolean a_into, const char *a_intoPath)
i_JobID_t CloseVolume (i_UIMessageServer_ptr a_uims, const char *a_barcode, const i_VolNumList_t &a_volumes)
i_Job_ptr Backup (const char *a_barcode)
void ListMedia (i_UIMessageServer_ptr a_uims, CORBA::Long a_filter)
void ListSingleMedium (const char *a_barcode, i_UIMessageServer_ptr a_uims, CORBA::Long a_filter)
void MarkMediumUnusable (const char *a_barcode)
void MarkMediumUnreliable (const char *a_barcode)
void MarkMediumGood (const char *a_barcode)
void MarkMediumOffline (const char *a_barcode)
void MarkMediumOnline (const char *a_barcode)
void DuplicateMedium (i_UIMessageServer_ptr a_uims, const char *a_sourceBarCode, const char *a_targetBarCode, CORBA::Boolean a_forced)
void AddMediumToPool (const char *a_barcode, const char *a_poolName, i_UIMessageServer_ptr a_uims)
i_Medium_tGetMedium (const char *a_barcode)
i_Medium_tGetMediumByKey (i_DBKey_t a_mediumKey)
i_MediumSeq_tGetAllMedia ()
void ListMediumVolumes (const char *a_barcode, i_UIMessageServer_ptr a_uims, CORBA::Long a_filter)
i_MediumVol_tGetMediumVolume (const char *a_barcode, CORBA::Long a_volNum)
i_MediumVol_tGetMediumVolumeByUUID (const char *a_uuid)
string WaitingForResStatus (i_JobParams_var &a_jobParam, i_Resource_t &a_jobResource, UInt32_t a_copyNum)
void JobInfo (const char *a_partName, i_BitFlag_t a_jobTypeMask, i_UIMessageServer_ptr a_uims)
i_JobList_tGetAllAdminJobs ()
void JobInfoDetail (i_JobID_t a_jobId, i_UIMessageServer_ptr a_uims)
void SetPriority (i_JobID_t a_jobId, i_JobPriorityMod_e a_chgType, CORBA::Long a_value, i_UIMessageServer_ptr a_uims)
void AbortJob (const i_JobIDList_t &a_jobIds, i_UIMessageServer_ptr a_uims)
i_JobID_t CheckFSCvsIVDFS (const char *a_partName, i_Count_t a_numFilesPerBatch, CORBA::Short a_sysLoadPct, i_UIMessageServer_ptr a_uims)
i_JobID_t CheckFSCvsMedia (const char *a_partName, const i_StringList_t &a_volumes, CORBA::Boolean a_autoCorrect, CORBA::Boolean a_removeMissingOnMedia, i_UIMessageServer_ptr a_uims)
i_JobID_t LimitedCheckFSCvsMedia (const i_StringList_t &a_barcodes, const i_VolNumList_t &a_volumes, CORBA::Boolean a_autoCorrect, CORBA::Boolean a_removeMissingOnMedia, i_UIMessageServer_ptr a_uims)
i_JobID_t FSCRecover (const char *a_partName, const i_StringList_t &a_volumes, i_UIMessageServer_ptr a_uims)
i_JobID_t IVDFSRecover (const char *a_partName, i_UIMessageServer_ptr a_uims)
i_JobID_t ReorgScan (const char *a_partName, i_Time_t a_date, CORBA::Long a_numOfGenerations, i_UIMessageServer_ptr a_uims)
 Invokes a scan job on the partition manager.
i_JobID_t Reorg (const char *a_barcode, const i_VolNumList_t &a_volumes, i_UIMessageServer_ptr a_uims)
 Invokes a maintenance job for reorganization on the partition mgr.
i_JobID_t CopyContentsPerVolume (const char *a_barcode, const i_VolNumList_t &a_volumes,::CORBA::Boolean a_best_effort, i_UIMessageServer_ptr a_uims)
 Invokes a maintenance job for redundant copy on the partition mgr.
i_JobID_t CopyContents (const char *a_barcode, i_UIMessageServer_ptr a_uims)
 Invokes a maintenance job for redundant copy on the partition mgr.
void FileHistory (const char *a_clientHost, const char *a_fsID, CORBA::Boolean a_byFileName, const i_FileList_t &a_files, i_UIMessageServer_ptr a_uims)
void RecallFile (const char *a_clientHost, const char *a_fsID, CORBA::Boolean a_byFileName, const i_FileList_t &a_files, i_MigID_t a_migID, const char *a_into, i_UIMessageServer_ptr a_uims)
i_Count_t ReleaseFile (const char *a_clientHost, const char *a_fsID, const i_StringList_t &a_files, i_UIMessageServer_ptr a_uims)
i_Count_t MigrateFile (const char *a_clientHost, const char *a_fsID, const i_StringList_t &a_files, i_UIMessageServer_ptr a_uims)
i_ActivateResult_t ActivateFile (const char *a_clientHost, const char *a_fsID, const i_StringList_t &a_files, i_UIMessageServer_ptr a_uims)
i_Count_t TrigMigration (const char *a_partName, i_UIMessageServer_ptr a_uims)
void TrigDeletion (const char *a_partName, i_UIMessageServer_ptr a_uims, bool &a_noMonitor)
void SetCollocationInfo (const char *a_clientHost, const char *a_fsID, i_ColID_t a_colId, const char *a_path, bool a_force, i_UIMessageServer_ptr a_uims)
i_ColInfoList_tGetCollocationInfo (const char *a_clientHost, const char *a_partID, bool a_byPartName=false)
void SetHl7Info (const char *a_clientHost, const char *a_fsID, const char *a_hostname, CORBA::ULong a_port, const char *a_path, bool a_force, i_UIMessageServer_ptr a_uims)
i_HL7InfoList_tGetHl7Info (const char *a_clientHost, const char *a_partID, bool a_byPartName)
void Mount (const char *host, const char *a_fileUUID, const char *a_mountPoint)
void Umount (const char *host, const char *a_fileUUID, const char *a_mountPoint)
i_PartInfoList_tReportAllPartitions ()
char * AddPartition (const char *a_userAtDomain, const i_DataBlock_t &a_cfgFile)
void RemovePartition (const char *a_name, i_UIMessageServer_ptr a_uims)
void UpdatePartition (const char *a_userAtDomain, const char *a_name, const i_DataBlock_t &a_cfgFile, i_Index_t &a_newRevNo)
i_DataBlock_tShowPartition (const char *a_name, i_Index_t a_revNo)
i_Count_t ShowPartitionRevs (const char *a_name)
void ListPartitions (i_UIMessageServer_ptr a_uims, CORBA::Long a_filter)
void EnablePartition (const char *a_name, i_UIMessageServer_ptr a_uims)
void DisablePartition (const char *a_name, i_UIMessageServer_ptr a_uims)
void PartitionStatus (const char *a_name, i_UIMessageServer_ptr a_uims)
void PartitionReorgStat (const char *a_name, CORBA::ULong a_threshold, i_UIMessageServer_ptr a_uims)
i_StringList_tGetFSList (const char *a_client)
i_Partition_tGetPartition (const char *a_name)
i_Partition_tGetPartitionByUUID (const char *a_uuid)
void ListJobs (string &a_partName, UInt32_t a_jobTypeMask, ui_ResultPacker &a_uires, bool printHeader)
void ListAdminJobs (ui_ResultPacker &a_uires, bool printHeader)
void ListJob (UInt64_t a_jobId, ui_ResultPacker &a_uires)
void SetJobPriority (UInt64_t a_jobId, i_JobPriorityMod_e a_chgType, Int32_t a_value, i_UIMessageServer_ptr a_uims)
void MakeInventoryHeader (ui_ResultPacker &a_uires)
i_Medium_tGetMediumBySlot (i_Slot_t &a_slot, i_MediumSeq_t &a_medSeq)
i_PartitionInfo_t ReportInfo (string partitionName)
void ValidatePMConfig (const cfg_PMCfg &a_partCfg, const string &a_partUUID, string a_name)
void ValidatePoolConfig (const cfg_RMPool &a_poolCfg)

Public Attributes

i_ResourceManager_var m_rm
i_Service_var m_svc

Private Member Functions

ivd_PartitionStatus_e GetPartitionStatus (mif_PartEntry &a_pe, string &a_mtPoint)
ivd_PartitionStatus_e GetPartitionStatus (mif_PartEntry &a_pe, string &a_mtPoint, UInt32_t a_rmdbPartStatus, ivd_PartitionActivity_e &a_activity)
void GetMediumInfo (const i_Medium_t &a_medium, ui_ResultPacker &a_uires, ui_BitFlag a_flags)

Private Attributes

mif_JobManager m_jobMgr
mif_PartMgr m_partMgr
i_LibraryAgent_var m_la
 log_CLASSID_m

Detailed Description

Definition at line 48 of file i_mif_impl.h.


Constructor & Destructor Documentation

i_ManagementInterface_i::i_ManagementInterface_i (  ) 

Definition at line 60 of file i_mif_impl.cpp.

References dbg_DETAIL, dbg_LOW, dbg_NORM, evt_ERROR, g_cmn, mif_PartMgr::GetAllPartFromRM(), ivd_BaseException::GetError(), ipc_EXEC_m, ivd_Sleep, log_DBG_m, log_ERR_m, log_FUNC_m, log_WriteEvent(), cmn_SysInfo::m_hostName, m_jobMgr, m_partMgr, m_rm, m_svc, ipc_Corba::RegisterMIF(), ipc_Corba::ResolveRM(), ipc_Corba::ResolveSvc(), mif_JobManager::SetIMif(), mif_PartMgr::SetMif(), cmn_Global::si, and mif_PartMgr::StartAllPart().

                                                :
    m_partMgr() {
    log_FUNC_m(i_ManagementInterface_i);

    m_partMgr.SetMif(this);
    

    
    // Get SVC reference.
    {
        CORBA::Object_var obj = ipc_Corba::ResolveSvc(g_cmn.si.m_hostName);
        m_svc = i_Service::_narrow(obj);
        log_DBG_m(dbg_DETAIL, "MIF: m_svc referenced as: " << m_svc << endl);
    }

    //
    // Get RM reference.
    int retries = 4;
    do {
        try {
            ipc_EXEC_m(
                CORBA::Object_var obj = ipc_Corba::ResolveRM();
                m_rm = i_ResourceManager::_narrow(obj);
                log_DBG_m(dbg_DETAIL,"Sucessfully resolved RM");
                break;
            );
        }
        catch(ivd_Error &ie) {
            if (ie.GetError() == ie_IPC_RESOLVE) {
                log_DBG_m(dbg_NORM, "Couldn't resolve RM reference. Sleep & retry.");
                ivd_Sleep(15); //wait for RM to register
                retries--;
                if (retries == 0) {
                    log_WriteEvent(evt_ERROR, "MIF couldn't resolve RM even after retries.");
                    throw;
                }
            } else {
                throw;
            }
        }
    } while(true);

    // Read all partition from rmdb to be able to serve FSEvtMgr
    m_partMgr.GetAllPartFromRM();

    //Register to naming service (after this fsEvtMgr will contact MIF)
    ipc_EXEC_m(
        log_DBG_m(dbg_LOW, "Registering MIF to NamingService.")
        i_ManagementInterface_var iMIF = this->_this();

        ipc_Corba::RegisterMIF(iMIF);
        log_DBG_m(dbg_DETAIL, "MIF: Reference registered.");
    )

    


    //
    // Start all PMs.
    try {
        m_partMgr.StartAllPart();
    }
    catch(ivd_Exception& e){
        log_ERR_m("could not start all partitions: " << e);
    }

    m_jobMgr.SetIMif(this);

} // i_ManagementInterface_i::i_ManagementInterface_i()

Here is the call graph for this function:

i_ManagementInterface_i::~i_ManagementInterface_i (  )  [virtual]

Definition at line 132 of file i_mif_impl.cpp.

References log_FUNC_m, and ipc_Corba::Shutdown().

                                                  {
    log_FUNC_m(~i_ManagementInterface_i);

    ipc_Corba::Shutdown();

} // i_ManagementInterface_i::~i_ManagementInterface_i()

Here is the call graph for this function:


Member Function Documentation

void i_ManagementInterface_i::AbortJob ( const i_JobIDList_t a_jobIds,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 982 of file i_mif_job.cpp.

References i_Job_i::AbortJob(), dbg_DETAIL, dbg_NORM, job_Manager::FindJob(), mif_PartMgr::GetAllPart(), ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, log_DBG_m, log_FUNC_m, m_jobMgr, m_partMgr, and mps_Online.

                                                                {
    
    log_FUNC_m(AbortJob);
    try {
        log_DBG_m(dbg_DETAIL,"will cancel " << a_jobIds.length() << " jobs");
        
        //i_UIMessageServer_var ui = a_uims;
        stringstream resMsg;
        vector<bool> found;

        found.resize(a_jobIds.length());
        for (UInt32_t numOfJob = 0; numOfJob < found.size(); numOfJob++){
            found[numOfJob] = false;
        }

        //
        // first try to abord all jobs in MIF (admin jobs)
        try {            
            for (UInt32_t jobIdx = 0 ; jobIdx < a_jobIds.length(); jobIdx++ ){
                i_Job_i * iJob;
                iJob = m_jobMgr.FindJob(a_jobIds[jobIdx]);
                ipc_EXEC_m(iJob->AbortJob();)
                resMsg << "Job " << a_jobIds[jobIdx] << " aborted.";
                ipc_EXEC_m(a_uims->DisplayMessage(
                                CORBA::string_dup(resMsg.str().c_str()));
                );
                resMsg.str("");
                found[jobIdx] = true;
            }
        }
        catch (ivd_Exception){
            log_DBG_m(dbg_NORM, "could not find Job in  Mif:");
        }
        resMsg.str("");

        //
        // now try to abort all jobs on partitions (mig, recall)
        vector <mif_PartEntry> allPart = m_partMgr.GetAllPart();
        log_DBG_m(dbg_NORM," " << allPart.size() <<" partitions configured");
        
        for (UInt32_t jobIdx = 0 ; jobIdx < a_jobIds.length(); jobIdx++ ){
            if (found[jobIdx]) 
                continue; // already aborted on MIF
            
            for (UInt32_t pmIdx = 0 ; pmIdx < allPart.size(); pmIdx++ ){
                if (allPart[pmIdx].m_partStatus != mps_Online)
                    continue;

                try {
                    ipc_EXEC_m(
                        allPart[pmIdx].m_iPM->AbortJob(a_jobIds[jobIdx]);
                       
                        found[jobIdx] = true;
                        resMsg << "Job " << a_jobIds[jobIdx] << " aborted";

                        a_uims->DisplayMessage(
                             CORBA::string_dup(resMsg.str().c_str()));
                        break;
                    )
                }
                catch (ivd_Exception){
                    log_DBG_m(dbg_DETAIL, "Did not find job in partition: " 
                              << allPart[pmIdx].m_partName);
                }
            }

            if (!found[jobIdx]){
                resMsg << "Could not find job " << a_jobIds[jobIdx];
                ipc_EXEC_m(
                    a_uims->DisplayWarning(
                        CORBA::string_dup(resMsg.str().c_str()));
                );
            } 

            log_DBG_m(dbg_DETAIL,"Clearing result");
            resMsg.str("");
        }
    } 
    ipc_CATCH_IVD_THROW_CORBA_m
    a_uims->Remove();
} //i_ManagementInterface_i::AbortJob

Here is the call graph for this function:

i_ActivateResult_t i_ManagementInterface_i::ActivateFile ( const char *  a_clientHost,
const char *  a_fsID,
const i_StringList_t a_files,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 328 of file i_mif_file.cpp.

References dbg_DETAIL, ie_NO_HSM, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, iPM, ivd_Error, log_DBG_m, log_FUNC_A_m, and ipc_Corba::ResolvePMByFSID().

                                                                     {

    log_FUNC_A_m(ActivateFile,
        "Client: " << a_clientHost << ", FSID:" << a_fsID <<
        " #files:" << a_files.length());

    try {
        i_PartitionManager_var iPM;

        CORBA::Object_var obj = ipc_Corba::ResolvePMByFSID(
                         string(a_clientHost), string(a_fsID), false);
        iPM = i_PartitionManager::_narrow(obj);

        ipc_EXEC_m (
            log_DBG_m(dbg_DETAIL,"Resolving HSM");
            i_HSM_var iHSM = iPM->GetHSM();
            if (CORBA::is_nil(iHSM))
                throw ivd_Error(ie_NO_HSM, "Partition not mounted or no valid HSM reference.");

            return iHSM->ActivateFiles(a_files, a_uims);
        );

    } ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

char * i_ManagementInterface_i::AddDrive ( const char *  a_userAtDomain,
const i_DataBlock_t a_cfgFile 
)

Definition at line 297 of file i_mif_drive.cpp.

References cfg_RMDrive::aveSeekTime, i_Drive_t::aveSeekTime, i_Drive_t::capabilities, cfg_RMDrive::capabilities, i_Drive_t::cleanNr, cmn_Num2Str(), i_DriveHost_t::controlDevice, cfg_RMDrive::dataThroughput, i_Drive_t::dataThroughput, dbg_DETAIL, dbg_NORM, cfg_RMDrive::driveIndex, i_Drive_t::driveIndex, i_DriveHost_t::driveName, i_Drive_t::driveName, i_Drive_t::firmwareRev, ivd_BaseException::GetError(), i_DriveHost_t::host, cfg_RMDrive::hosts, ie_PRECONDITION, ie_RMDB_NOTFOUND, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ipc_nilStr, ivd_Error, i_Drive_t::lastClean, cfg_RMDrive::library, i_Drive_t::libraryName, cfg_RMDrive::loadTime, i_Drive_t::loadTime, log_DBG_m, log_ERR_m, log_FUNC_m, log_WriteEvent(), m_rm, i_Drive_t::mediaFamily, cfg_RMDrive::mediaFamily, MIF_CFG_DRIVE, mif_DRIVE, cfg_RMDrive::name, i_Drive_t::options, mif_CfgRep::ParseToFile(), mif_CfgRep::ReplaceHosts(), ipc_Corba::ResolveLA(), i_Drive_t::rewindTime, i_Drive_t::scsiID, i_Drive_t::status, cfg_RMDrive::unLoadTime, i_Drive_t::unloadTime, and i_Drive_t::usageCount.

                                                                    {
    
    log_FUNC_m(AddDrive);
    try {
        pf_File pFile;
        mif_CfgRep::ParseToFile(pFile, a_cfgFile, MIF_CFG_DRIVE, a_userAtDomain);
        mif_CfgRep::ReplaceHosts(pFile);

        cfg_RMDrive driveCfg(pFile);

        //
        // Check if drive's mediaFamily matches library
        if (!driveCfg.library.empty()) {
            i_Library_t_var lib;
            try {
                ipc_EXEC_m(
                    lib = m_rm->SelectLibrary(
                                        CORBA::string_dup(driveCfg.library.c_str()));
                    log_DBG_m(dbg_NORM, "MIF: Library is configured.");       
                );
            
                if (lib->mediaFamily != driveCfg.mediaFamily) {
                    throw ivd_Error(ie_PRECONDITION,
                        "Medium family of drive does not match library.");
                }
            } 
            catch (ivd_Error& e) {
                if (e.GetError() == ie_RMDB_NOTFOUND) {
                    throw ivd_Error(ie_RMDB_NOTFOUND, 
                        "Library not configured: " + driveCfg.library);
                }
                else {
                    throw;
                }
            }
        }

        //
        // copy configuration data
        i_Drive_t driveI;
        driveI.aveSeekTime      = driveCfg.aveSeekTime;

        UInt32_t capBitFlags(0);
        for (UInt32_t i(0); i < driveCfg.capabilities.size(); i++) {
            capBitFlags = capBitFlags | driveCfg.capabilities[i].Val();
            log_DBG_m(dbg_DETAIL,"capBitFlags = " << hex << capBitFlags);
        }

        driveI.capabilities     = capBitFlags;
        driveI.cleanNr          = 0;    // new drive.
        driveI.dataThroughput   = driveCfg.dataThroughput;
        driveI.driveIndex       = CORBA::string_dup(cmn_Num2Str(driveCfg.driveIndex).c_str()); // string[64] <- int ?! (driveCfg.driveIndex)
        driveI.driveName        = CORBA::string_dup(driveCfg.name.c_str());                    // string[50] <- string ?!
        driveI.lastClean        = 0;    // new drive. time_t(0)
        driveI.loadTime         = driveCfg.loadTime;
        driveI.mediaFamily      = driveCfg.mediaFamily;
        driveI.options          = 0; 
        driveI.rewindTime       = 0;
        driveI.aveSeekTime      = 0;
        driveI.status           = 0;    // initial status.
        driveI.unloadTime       = driveCfg.unLoadTime;
        driveI.usageCount       = 0;    // new drive. time_t(0)
        driveI.libraryName      = CORBA::string_dup(driveCfg.library.c_str());
        driveI.firmwareRev      = CORBA::string_dup(ipc_nilStr);
        driveI.scsiID           = CORBA::string_dup(ipc_nilStr);
        //
        // check if drive is configured.
        try {
            i_Drive_t_var tmp;
            ipc_EXEC_m(tmp = m_rm->SelectDrive(driveI.driveName));;
            log_DBG_m(dbg_NORM, "MIF: Drive is configured.");       
            
            throw ivd_Error(ie_PRECONDITION, 
                "Drive already configured: " + string(driveI.driveName));
            
        }
        catch (ivd_Exception &e) {
            log_DBG_m(dbg_NORM, e);
            if (e.GetError() == ie_RMDB_NOTFOUND) {
                // continue
            }
            else {
                throw;
            }
        }
   
        //
        // add drive entry to RMDB.
        ipc_EXEC_m(
            m_rm->AddDrive(driveI);
            log_DBG_m(dbg_NORM, "MIF: Drive " 
                                << driveCfg.name << " added into RMDB" << endl);
        );

        //
        // add this drive control device entries to RMDB.
        for (UInt32_t ct=0; ct<driveCfg.hosts.size(); ct++) {
            {
                i_DriveHost_t driveHostI;

                driveHostI.host          = CORBA::string_dup(driveCfg.hosts[ct].name.c_str());
                driveHostI.driveName     = CORBA::string_dup(driveCfg.name.c_str());
                driveHostI.controlDevice = CORBA::string_dup(driveCfg.hosts[ct].controlDevice.c_str());

                ipc_EXEC_m(
                    m_rm->AddDriveHost(driveHostI);
                );
            }
        }

        // Call LA->Reconfigure
        try {
            ipc_EXEC_m(
                i_Library_t_var lib = m_rm->SelectLibrary(driveI.libraryName);

                CORBA::Object_var objLA =
                    ipc_Corba::ResolveLA(string(lib->host), 
                string(driveI.libraryName));
                i_LibraryAgent_var iLA = i_LibraryAgent::_narrow(objLA);

                iLA->Reconfigure(lib);
            );
        }
        catch (ivd_Exception &e) {
            log_ERR_m("Reconfiguring Library failed." << endl << e);
        }

        //
        // notify jobs in job list about new resource
        ipc_EXEC_m(
            m_rm->UseNewResource();
        );

        mif_CfgRep cfg(mif_DRIVE, driveCfg.name);
        cfg.Upload(pFile);

        log_DBG_m(dbg_NORM, 
            "MIF: drive configuration added to CfgDB repository." << endl);

        ostringstream eventText;
        eventText << "Added new.";

        log_WriteEvent(eventText.str(), "DRIVE", 0, driveCfg.name);
        return CORBA::string_dup(driveCfg.name.c_str());
        
    }
    ipc_CATCH_IVD_THROW_CORBA_m
} // i_ManagementInterface_i::AddDrive()

Here is the call graph for this function:

char * i_ManagementInterface_i::AddLibrary ( const char *  a_userAtDomain,
const i_DataBlock_t a_cfgFile,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 483 of file i_mif_library.cpp.

References cfg_RMLibrary::auditTime, i_Library_t::auditTime, i_Library_t::capabilities, cfg_RMLibrary::controlDevice, i_Library_t::controlDevice, dbg_DETAIL, dbg_NORM, i_Library_t::firmwareRev, ivd_BaseException::GetError(), i_Library_t::host, cfg_RMLibrary::host, ie_MIF_LA_PROBLEM, ie_PRECONDITION, ie_RMDB_NOTFOUND, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ipc_nilStr, ivd_Error, i_Slot_t::libraryName, i_Library_t::libraryName, i_Library_t::libraryType, cfg_RMLibrary::libType, i_Library_t::loadNr, log_DBG_m, log_ERR_m, log_FUNC_m, log_WriteEvent(), m_rm, cfg_RMLibrary::mailSlots, cfg_RMLibrary::mediaAccessTime, i_Library_t::mediaAccessTime, cfg_RMLibrary::mediaExchangeTime, cfg_RMLibrary::mediaFamily, i_Library_t::mediaFamily, i_Library_t::mediaXChgTime, MIF_CFG_LIBRARY, mif_LIBRARY, cfg_RMLibrary::name, i_Library_t::options, mif_CfgRep::ParseToFile(), mif_CfgRep::ReplaceHosts(), ipc_Corba::ResolveLA(), rmdb_LIBRARY_ERROR, i_Library_t::scsiID, i_Slot_t::slotAddr, cfg_RMLibrary::slotList, i_Slot_t::slotType, i_Slot_t::status, i_Library_t::status, i_Library_t::unloadNr, and mif_CfgRep::Upload().

                                                                        {

    log_FUNC_m(AddLibrary);
    try {

        pf_File pFile;
        mif_CfgRep::ParseToFile(pFile, a_cfgFile, MIF_CFG_LIBRARY, a_userAtDomain);
        mif_CfgRep::ReplaceHosts(pFile);
        
        cfg_RMLibrary libraryCfg(pFile);
        
        log_DBG_m(dbg_NORM, "libraryCfg.host: " << libraryCfg.host);
        
        //check if slot overlap
        for (UInt32_t k(0); k+1 < libraryCfg.slotList.size(); k++){
            for (UInt32_t l(k+1); l < libraryCfg.slotList.size(); l++){
                if (libraryCfg.slotList[l].Val() == libraryCfg.slotList[k].Val())
                    throw ivd_Error(ie_PRECONDITION, "Overlapping slots.");
            }
        } 
        
        //
        // copy configuration data
        i_Library_t libraryI;
        libraryI.libraryName     = CORBA::string_dup(libraryCfg.name.c_str());
        libraryI.controlDevice   = CORBA::string_dup(libraryCfg.controlDevice.c_str());
        libraryI.host            = CORBA::string_dup(libraryCfg.host.c_str());
        
        libraryI.libraryType     = libraryCfg.libType;
        libraryI.mediaFamily     = libraryCfg.mediaFamily;   
        log_DBG_m(dbg_DETAIL,"MIF: libraryCfg.libType: " << libraryCfg.libType);

        libraryI.options         = 0;   // int <- vector<val_Element> ?! (libraryCfg.options) 
        libraryI.capabilities    = 0;   // int <- vector<val_Element> ?! (libraryCfg.capabilities)

        libraryI.auditTime       = libraryCfg.auditTime;       
        libraryI.mediaXChgTime   = libraryCfg.mediaExchangeTime;
        libraryI.mediaAccessTime = libraryCfg.mediaAccessTime;

        libraryI.status          = 0;   // initial status.
        libraryI.loadNr          = 0;   // new library!
        libraryI.unloadNr        = 0;   // new library!
        libraryI.firmwareRev     = CORBA::string_dup(ipc_nilStr);   // new library!
        libraryI.scsiID          = CORBA::string_dup(ipc_nilStr);   // new library!
        log_DBG_m(dbg_NORM, "MIF: i_Library_t structure filled.");

        //
        // check if library is configured.
        try {
            i_Library_t_var libI;
            ipc_EXEC_m(libI = m_rm->SelectLibrary( libraryI.libraryName));
            log_DBG_m(dbg_NORM, "MIF: Library is configured.");
            throw ivd_Error(ie_PRECONDITION, 
                "Library already configured: " + string(libraryI.libraryName));
           
        } catch (ivd_Exception &e) {
            log_DBG_m(dbg_NORM, e);
            if (e.GetError() == ie_RMDB_NOTFOUND) {
                //continue
            } else 
                throw;
        }
        
        //
        // add library entry to RMDB
        try {
            ipc_EXEC_m(
                m_rm->AddLibrary(libraryI);
                log_DBG_m(dbg_NORM, 
                    "MIF: library " << libraryCfg.name << " added into RMDB");
            );
        } catch (ivd_Error& e){
            if (e.GetError() == ie_RMDB_NOTFOUND)
                throw ivd_Error(ie_RMDB_NOTFOUND, 
                "Adding of Library failed. " + libraryCfg.name);
            else 
                throw;
        }

        //
        // add this library's repository slot entries to RMDB.

        for (UInt32_t ct=0; ct<libraryCfg.slotList.size(); ct++) {
            {
                i_Slot_t repSlotI;

                repSlotI.libraryName = libraryI.libraryName;
                repSlotI.slotAddr    = CORBA::string_dup(libraryCfg.slotList[ct].Val().c_str());
                repSlotI.slotType    = rmdb_REP_SLOT_TYPE_ID;
                //repSlotI.slotKey   = generated!
                
                //slot status will be set to proper value by inventory
                repSlotI.status      = ss_UNKNOWN;

                ipc_EXEC_m(
                    m_rm->AddSlot(repSlotI);
                );
            }
        }


        //
        // add this library's mail slot entries to RMDB.

        for (UInt32_t ct=0; ct<libraryCfg.mailSlots.size(); ct++) {
            {
                i_Slot_t mailSlotI;

                mailSlotI.libraryName = libraryI.libraryName;
                mailSlotI.slotAddr    = CORBA::string_dup(libraryCfg.mailSlots[ct].Val().c_str());
                mailSlotI.slotType    = rmdb_MAIL_SLOT_TYPE_ID;
                //mailSlotI.slotKey   = generated!
                mailSlotI.status      = rmdb_SLOT_FREE;

                ipc_EXEC_m(
                    m_rm->AddSlot(mailSlotI);
                );
            }
        }
        
        //
        // notify jobs in job list about new resource
        ipc_EXEC_m(
            m_rm->UseNewResource();
        );
        log_DBG_m(dbg_NORM, "MIF: after UseNewResource()");

        //
        // save first revision of library cfg file to configuration repository.
        log_DBG_m(dbg_DETAIL, 
            "MIF: configuration stream is: \n" << pFile);

        mif_CfgRep cfg(mif_LIBRARY, libraryCfg.name);
        cfg.Upload(pFile);

        log_DBG_m(dbg_NORM, 
            "MIF: library configuration added to CfgDB repository.");

        ostringstream eventText;
        eventText << "Added new.";

        log_WriteEvent(eventText.str(), "LIBRARY", 0, libraryCfg.name);
        
        //
        // start new LA.
        try {
            i_LibraryAgent_var la;
            eventText.str("");
            ipc_EXEC_m(
                m_rm->StartLA(CORBA::string_dup(libraryCfg.name.c_str()));
            );
            
            ipc_EXEC_m(
                CORBA::Object_var obj =
                ipc_Corba::ResolveLA(
                    libraryCfg.host, libraryCfg.name, true);
                la = i_LibraryAgent::_narrow(obj);
            );
            if (la->_is_nil() || la->_non_existent()) {
                //Set status of library to "ERROR" because LA is not running
                UInt32_t status(rmdb_LIBRARY_ERROR);
                m_rm->LibraryStatusSet(libraryI.libraryName, status);
                throw ivd_Error(
                    ie_MIF_LA_PROBLEM, "Library agent not accessible.");
            }
            eventText << "Library " << libraryCfg.name 
                      << " added successfully.";
        }
        catch (ivd_Error& e) {
            log_ERR_m(
                "MIF: Library Agent for this library can't be started " <<
                "after adding it. Reported error: " << e);
                
            eventText << "Library " << libraryCfg.name 
                      << " added, but could not be started.";
            
            //Set status of library to "ERROR": Library is enabled, but LA is not running for some reason
            UInt32_t status(rmdb_LIBRARY_ERROR);
            m_rm->LibraryStatusSet(libraryI.libraryName, status);
        }
        a_uims->DisplayMessage(eventText.str().c_str());

        return CORBA::string_dup(libraryCfg.name.c_str());

    } ipc_CATCH_IVD_THROW_CORBA_m
} // i_ManagementInterface_i::AddLibrary()

Here is the call graph for this function:

void i_ManagementInterface_i::AddMedium ( const char *  a_barcode  ) 

Definition at line 664 of file i_mif_medium.cpp.

References i_Medium_t::barcode, i_Medium_t::blockSize, i_Medium_t::currentVolume, dbg_NORM, i_Medium_t::diskSubsysName, i_Medium_t::driveName, i_Medium_t::idxOfSysVol, ie_PRECONDITION, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ipc_nilStr, ivd_Error, i_Medium_t::libraryName, i_Medium_t::location, log_DBG_m, log_FUNC_m, log_WriteEvent(), m_rm, i_Medium_t::mediaPoolName, i_Medium_t::mediumSerialNo, i_Medium_t::mediumType, i_Medium_t::numOfVolumes, i_Medium_t::partitionName, i_Medium_t::sizeOfSysVol, i_Medium_t::slotAddr, i_Medium_t::slotType, and i_Medium_t::status.

                                                             {
    log_FUNC_m(AddMedium);
    try {
        i_Medium_t mediumI;

        string barcode(a_barcode);
        if ( barcode.find_first_of("/") != string::npos)
            throw ivd_Error(ie_PRECONDITION, "Barcode may not contain \"/\".");

        // mediumI.mediumKey -> generated!
        mediumI.mediaPoolName   = CORBA::string_dup(ipc_nilStr);        // -> added by ivdpool -A <mediaPool> -B <barcode>
        mediumI.libraryName     = CORBA::string_dup(ipc_nilStr);        // -> added by ivdlibrary --update-inventory
        mediumI.slotAddr        = CORBA::string_dup(ipc_nilStr);        // -> added by ivdlibrary --update-inventory
        mediumI.slotType        = 0;                                    // -> added by ivdlibrary --update-inventory
        mediumI.diskSubsysName  = CORBA::string_dup(ipc_nilStr);        // -> currently not used
        mediumI.driveName       = CORBA::string_dup(ipc_nilStr);        // ->  ?????
        mediumI.barcode         = CORBA::string_dup(a_barcode);
        mediumI.status          = rmdb_INIT_MEDIUM_STATUS;
        mediumI.location        = CORBA::string_dup(ipc_nilStr);        // [255] -> currently not used
        mediumI.mediumType      = 0;                                    // ->
        mediumI.mediumSerialNo  = CORBA::string_dup(ipc_nilStr);    // -> added by ivdlibrary --update-inventory ?
        mediumI.blockSize       = 0;
        mediumI.numOfVolumes    = 0;
        mediumI.idxOfSysVol     = 0;
        mediumI.sizeOfSysVol    = 0;
        mediumI.currentVolume   = -1;
        mediumI.partitionName   = CORBA::string_dup(ipc_nilStr);

        //
        // add medium record to RMDB
        ipc_EXEC_m(
            m_rm->AddMedium(mediumI);
        log_DBG_m(dbg_NORM,
            "MIF: Medium with barcode " << a_barcode << " added into RMDB.");

        ostringstream eventText;
        eventText << "Added.";

        log_WriteEvent(eventText.str(), "MEDIUM", 0, a_barcode);
        );
    }
    ipc_CATCH_IVD_THROW_CORBA_m
} // i_ManagementInterface_i::AddMedium()

Here is the call graph for this function:

void i_ManagementInterface_i::AddMediumToPool ( const char *  a_barcode,
const char *  a_poolName,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 292 of file i_mif_medium.cpp.

References i_Medium_t::barcode, i_Medium_t::blockSize, i_Medium_t::currentVolume, dbg_LOW, dbg_NORM, cmn_Global::dirs, i_Medium_t::diskSubsysName, ivd_Directories::dm, i_Medium_t::driveName, evt_ERROR, g_cmn, ivd_BaseException::GetError(), ivd_BaseException::GetFriendly(), i_Medium_t::idxOfSysVol, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ipc_nilStr, i_Medium_t::libraryName, i_Medium_t::location, log_DBG_m, log_FUNC_m, log_WriteEvent(), m_rm, i_Medium_t::mediaPoolName, i_Medium_t::mediumSerialNo, i_Medium_t::mediumType, mf_DISK, i_Medium_t::numOfVolumes, i_Medium_t::partitionName, i_Medium_t::sizeOfSysVol, i_Medium_t::slotAddr, i_Medium_t::slotType, and i_Medium_t::status.

                                                                              {
    log_FUNC_m(AddMediumToPool);
    try {
        i_Medium_t_var medium;

        ostringstream baseMsg;
        baseMsg << "Medium " << a_barcode;
        ostringstream msg;
        bool mediumInRMDB(false);

        // select medium from RMDB
        try {
            ipc_EXEC_m(
                medium = m_rm->SelectMedium(CORBA::string_dup(a_barcode));
                log_DBG_m(dbg_NORM, baseMsg.str() << " found.");
                mediumInRMDB = true;
            )
        } catch (ivd_Exception &e) {
            log_DBG_m(dbg_NORM, e);
            if (e.GetError() == ie_RMDB_NOTFOUND) {
                mediumInRMDB = false;
                // continue
            } else
                throw;
        }

        // check if medium is assigned to a pool
        if (mediumInRMDB) {
            string mediaPoolName;
            mediaPoolName = medium->mediaPoolName;
            if (mediaPoolName.empty()) {
                log_DBG_m(dbg_NORM, "MIF: Medium is currently not assigned to any media pool.");
            }
            else {
                msg << baseMsg.str() << " already assigned to pool "
                    << medium->mediaPoolName << ".";
                log_DBG_m(dbg_LOW,msg.str());
                ipc_EXEC_m(a_uims->DisplayError(msg.str().c_str());)
                msg.str("");
                return;
            }
        }

        i_MediaPool_t_var mediaPool;
        // select pool from RMDB
        try {
            ipc_EXEC_m(
                mediaPool = m_rm->SelectMediaPool(CORBA::string_dup(a_poolName));
                log_DBG_m(dbg_NORM, "MediaPool " << a_poolName << " found.");
            )
        } catch (ivd_Exception &e) {
            log_DBG_m(dbg_NORM, e);
            if (e.GetError() == ie_RMDB_NOTFOUND) {
                msg << "Pool does not exist. Add to pool failed";
                log_DBG_m(dbg_LOW,msg.str());
                a_uims->DisplayError(msg.str().c_str());
                return;
            } else
                throw;
        }

        i_Medium_t med;
        if (mediumInRMDB) {
            med = medium;
        } else {
            med.barcode         = CORBA::string_dup(a_barcode);
            med.currentVolume   = 0;
            med.diskSubsysName  = CORBA::string_dup(ipc_nilStr);
            med.driveName       = CORBA::string_dup(ipc_nilStr);
            med.idxOfSysVol     = 0;
            med.libraryName     = CORBA::string_dup(ipc_nilStr);
            med.location        = CORBA::string_dup(ipc_nilStr);
            med.mediumSerialNo  = CORBA::string_dup(ipc_nilStr);
            med.numOfVolumes    = 0;
            med.sizeOfSysVol    = 0;
            med.slotAddr        = CORBA::string_dup(ipc_nilStr);
            med.slotType        = 0;
            med.status          = 0;
            med.partitionName   = CORBA::string_dup(ipc_nilStr);
        }

        if (mediaPool->mediaFamily == mf_DISK) {
            med.mediumType = mt_DISK;
            log_DBG_m(dbg_NORM, "Disk Medium added to pool.");

            string dmBarcode(med.barcode);
            cmn_Path dmPath( g_cmn.dirs.dm + dmBarcode );
#if TGT_OS_windows
            if (dmBarcode.substr(0, 2) == string("\\\\")) {
                dmPath = dmBarcode;
            }
#endif

#if TGT_OS_linux
    #warning "Check if path exists."
#elif TGT_OS_windows
    #pragma message ("WARNING: Check if path exists.")
#endif
            log_DBG_m(dbg_NORM, "Disk medium directory should be: " << dmPath);

        } else {
            med.mediumType = mf_UNKNOWN;
            log_DBG_m(dbg_NORM, "Unknown Medium added to pool.");
        }

        med.mediaPoolName = mediaPool->mediaPoolName;
        med.blockSize = mediaPool->blockSize;
        try {
            ipc_EXEC_m(
                if (mediumInRMDB)
                    m_rm->UpdateMedium(med);
                else
                    m_rm->AddMedium(med);

                msg << baseMsg.str() << " added to pool " << med.mediaPoolName
                    << ".";
                log_DBG_m(dbg_LOW,msg.str().c_str());
                a_uims->DisplayMessage(msg.str().c_str());
                log_WriteEvent(msg.str(), "MEDIUM", 0, string(med.barcode));
            )
        } catch (ivd_Exception &e) {
            msg << baseMsg.str() << " adding to pool " <<
                    med.mediaPoolName << " failed (" << e.GetFriendly() << ").";
            log_DBG_m(dbg_LOW,msg.str());
            a_uims->DisplayError(msg.str().c_str());
            log_WriteEvent(evt_ERROR, msg.str(), "MEDIUM", 0, string(med.barcode));
        }
    }
    ipc_CATCH_IVD_THROW_CORBA_m
} // i_ManagementInterface_i::AddMediumToPool()

Here is the call graph for this function:

char * i_ManagementInterface_i::AddPartition ( const char *  a_userAtDomain,
const i_DataBlock_t a_cfgFile 
)

Definition at line 963 of file i_mif_partition.cpp.

References mif_PartMgr::AddPart(), cfg_PMCfg::clients, dbg_DETAIL, dbg_NORM, i_Partition_t::fsHost, i_Partition_t::fsID, i_Partition_t::fsMountpoint, ivd_BaseException::GetError(), ivd_BaseException::GetFriendly(), cfg_PMCfg::globalTreeOptions, ie_MIF_CFG_ALREADY_CONFIGURED, ie_MIF_RM_PROBLEM, ie_PRECONDITION, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ivd_Error, log_DBG_m, log_FUNC_m, log_WriteEvent(), m_partMgr, m_rm, MIF_CFG_PARTITION, mif_PARTITION, cfg_PMCfg::name, i_Partition_t::options, mif_CfgRep::ParseToFile(), i_Partition_t::partitionName, cfg_PMTree::pools, mif_CfgRep::ReplaceClients(), SetPartitionOptions(), i_Partition_t::status, mif_CfgRep::Upload(), and ValidatePMConfig().

                                                                    {

    log_FUNC_m(AddPartition);
    try {

        string userStr(a_userAtDomain);
        pf_File pFile;
        mif_CfgRep::ParseToFile(pFile, a_cfgFile, MIF_CFG_PARTITION, userStr);
        mif_CfgRep::ReplaceClients(pFile);

        cfg_PMCfg partCfg(pFile);

        try {
            i_Partition_t_var partI;
            ipc_EXEC_m(partI =  m_rm->SelectPartition(partCfg.name.c_str()));;
            log_DBG_m(dbg_NORM, "MIF: Partition is configured.");
            throw ivd_Error(ie_PRECONDITION,
                "Partition already configured: " + string(partCfg.name));

        } catch (ivd_Exception &e) {
            log_DBG_m(dbg_NORM, e);
            if (e.GetError() == ie_RMDB_NOTFOUND) {
                // continue
            } else
                throw;
        }

        // validate specified configuration options
        ValidatePMConfig(partCfg, "", partCfg.name);

        //
        // add partition tables into RMDB.
        string partUUID;
        try {
            i_Partition_t iPart;
            iPart.status = rmdb_PARTITION_ENABLED;
            iPart.partitionName = CORBA::string_dup(partCfg.name.c_str());

            // i_Part UUID & MigIDTime & MgID Count is generated by RM!!
            // Note: only one client supported today
            iPart.fsHost = CORBA::string_dup(partCfg.clients[0].name.c_str());
            iPart.fsMountpoint = CORBA::string_dup("NYI");
            iPart.fsID = CORBA::string_dup(partCfg.clients[0].fileSystemId.c_str());

            Int32_t partOptions(0);
            SetPartitionOptions(partOptions, &partCfg.clients[0]);
            iPart.options = partOptions;

            partUUID =  m_rm->AddPartition(iPart);

        } catch (ivd_Exception &e) {
            log_DBG_m(dbg_NORM, "Partition already in rmdb: " << partCfg.name);
            throw ivd_Error(ie_MIF_CFG_ALREADY_CONFIGURED, e.GetFriendly());
        }

        // partition ID insertion in POOL records in RMDB
        for (UInt32_t i=0; i < partCfg.globalTreeOptions.pools.size(); i++) {

            i_MediaPool_t_var poolI;

            ipc_EXEC_m(
                poolI =  m_rm->SelectMediaPool(
                    CORBA::string_dup(partCfg.globalTreeOptions.pools[i].Val().c_str()));
            );
            log_DBG_m(dbg_NORM,
                "MIF: Media pool selected: " << poolI->mediaPoolName);

            poolI->partitionUUIDString = CORBA::string_dup(partUUID.c_str());
            log_DBG_m(dbg_NORM, "New partitionUUIDString for this media pool: " << partUUID);

            ipc_EXEC_m(
                m_rm->UpdateMediaPool(poolI);
            );
            log_DBG_m(dbg_NORM, "MIF: Media pool record updated.");
        }

        // partition ADDITION to CfgDB

        //
        // save first revision of partition cfg file to configuration repository.
        mif_CfgRep cfg(mif_PARTITION, partCfg.name);
        cfg.Upload(pFile);

        log_DBG_m(dbg_DETAIL,
            "MIF: partition configuration stream is: " << endl << pFile);

        // add the partition to partition manager, start PM and notify the client
        try {
            ipc_EXEC_m(
                m_partMgr.AddPart(partCfg.name,
                                        partUUID,
                                        partCfg.clients[0].name,
                                        partCfg.clients[0].fileSystemId);
            );
        } catch (ivd_Error& e){
            ostringstream msg;
            msg << "Adding of partition failed. " << e.GetFriendly();
            throw ivd_Error(ie_MIF_RM_PROBLEM, msg.str() );
        }
        log_DBG_m(dbg_NORM, "MIF: partition added to part mgr.");

        ostringstream eventText;
        eventText << "Added new.";

        log_WriteEvent(eventText.str(), "PARTITION", 0, partCfg.name);

        return CORBA::string_dup(partCfg.name.c_str());
    } ipc_CATCH_IVD_THROW_CORBA_m
} // i_ManagementInterface_i::AddPartition()

Here is the call graph for this function:

char * i_ManagementInterface_i::AddPool ( const char *  a_userAtDomain,
const i_DataBlock_t a_cfgFile 
)

Definition at line 199 of file i_mif_pool.cpp.

References cfg_RMPool::blockSize, i_MediaPool_t::blockSize, dbg_DETAIL, dbg_NORM, ivd_BaseException::GetError(), ivd_BaseException::GetFriendly(), ie_MIF_RM_PROBLEM, ie_PRECONDITION, ipc_EXEC_m, ipc_nilStr, ivd_Error, log_DBG_m, log_FUNC_m, log_WriteEvent(), m_rm, cfg_RMPool::maxMediaAge, i_MediaPool_t::maxMediaAge, i_MediaPool_t::maxNrReadWrite, cfg_RMPool::maxReadWrite, cfg_RMPool::mediaFamily, i_MediaPool_t::mediaFamily, i_MediaPool_t::mediaPoolName, i_MediaPool_t::mediaPoolType, mf_DISK, MIF_CFG_POOL, mif_POOL, cfg_RMPool::name, cfg_RMPool::numOfVolumes, i_MediaPool_t::numOfVolumes, mif_CfgRep::ParseToFile(), i_MediaPool_t::partitionUUIDString, cfg_RMPool::poolType, cfg_RMPool::sizeOfSysVol, i_MediaPool_t::sizeOfSysVol, i_MediaPool_t::sizeOfVolume, cfg_RMPool::sysVolLocation, i_MediaPool_t::sysVolLocation, ValidatePoolConfig(), and cfg_RMPool::volumeSize.

                                                                        {

    log_FUNC_m(AddPool);
    try {
        pf_File pFile;
        mif_CfgRep::ParseToFile(pFile, a_cfgFile, MIF_CFG_POOL, a_userAtDomain);

        cfg_RMPool poolCfg(pFile);
        ValidatePoolConfig(poolCfg);
        //
        // copy configuration data
        i_MediaPool_t poolI;
        // poolI.mediaPoolKey         = generated!
        poolI.mediaPoolName         = CORBA::string_dup(poolCfg.name.c_str());
        poolI.mediaFamily           = poolCfg.mediaFamily;
        poolI.mediaPoolType         = poolCfg.poolType;
        poolI.partitionUUIDString   = CORBA::string_dup(ipc_nilStr);
        poolI.maxMediaAge           = poolCfg.maxMediaAge;
        poolI.maxNrReadWrite        = poolCfg.maxReadWrite;
        poolI.blockSize             = poolCfg.blockSize;
        poolI.sysVolLocation        = poolCfg.sysVolLocation;
        poolI.numOfVolumes          = poolCfg.numOfVolumes;

        // System volume size is in MB
        poolI.sizeOfSysVol          = poolCfg.sizeOfSysVol/cfg_MEGABYTE;

        if (poolI.mediaFamily == mf_DISK)
            poolI.sizeOfVolume      = poolCfg.volumeSize/cfg_MEGABYTE;
        else
            poolI.sizeOfVolume      = 0;

        log_DBG_m(dbg_NORM, "MIF: i_MediaPool_t structure filled.");

        try {
            i_MediaPool_t_var mp;
            ipc_EXEC_m(
                mp = m_rm->SelectMediaPool(poolI.mediaPoolName);
                log_DBG_m(dbg_NORM, "MIF: Media pool is configured.");
                throw ivd_Error(ie_PRECONDITION,
                    "Pool already configured: " + string(poolI.mediaPoolName));
            );
        } catch (ivd_Exception &e) {
            log_DBG_m(dbg_NORM, e);
            if (e.GetError() == ie_RMDB_NOTFOUND) {
                // continue
            } else
                throw;
        }

        //
        // add media pool entry to RMDB
        try {
            ipc_EXEC_m(
                m_rm->AddMediaPool(poolI);
                log_DBG_m(dbg_NORM,
                        "MIF: Media pool " << poolCfg.name << " added into RMDB.");
            );
        } catch (ivd_Error& e) {
            ostringstream msg;
            msg << "Adding of pool failed. " << e.GetFriendly();
            throw ivd_Error(ie_MIF_RM_PROBLEM, msg.str() );
        }

        //
        // notify jobs in job list about new resource
        ipc_EXEC_m(
            m_rm->UseNewResource();
        );

        //
        // save first revision of drive cfg file to configuration repository.
        mif_CfgRep cfg(mif_POOL, poolCfg.name);
        cfg.Upload(pFile);

        log_DBG_m(dbg_DETAIL, "Media pool cfg is: \n" << pFile);

        ostringstream eventText;
        eventText << "Added new.";

        log_WriteEvent(eventText.str(), "POOL", 0, poolCfg.name);
        return CORBA::string_dup(poolCfg.name.c_str());
    }
    ipc_CATCH_IVD_THROW_CORBA_m;
} // i_ManagementInterface_i::AddPool()

Here is the call graph for this function:

i_Job_ptr i_ManagementInterface_i::Backup ( const char *  a_barcode  ) 

Definition at line 485 of file i_mif_impl.cpp.

References mif_JobManager::CreateBackupJob(), ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, and m_jobMgr.

                                                               {
    log_FUNC_m(Backup);

    try {
        return m_jobMgr.CreateBackupJob(a_barcode);
    }
    ipc_CATCH_IVD_THROW_CORBA_m

    return i_Job::_nil();
}

Here is the call graph for this function:

i_JobID_t i_ManagementInterface_i::CheckFSCvsIVDFS ( const char *  a_partName,
i_Count_t  a_numFilesPerBatch,
CORBA::Short  a_sysLoadPct,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 1299 of file i_mif_partition.cpp.

References mif_PartMgr::GetPart(), ie_PRECONDITION, ivd_Error, log_FUNC_m, mif_PartEntry::m_iPM, m_partMgr, mif_PartEntry::m_partStatus, and mps_Online.

Referenced by CheckFSCvsMedia().

                                                           {

    log_FUNC_m(CheckFSCvsIVDFS);

    try {
        mif_PartEntry pe = m_partMgr.GetPart(a_partName);
        if (pe.m_partStatus != mps_Online) {
            throw ivd_Error(ie_PRECONDITION, "Partition not ready - cannot check HSMFS.");
        }
        return pe.m_iPM->CheckFSCvsIVDFS(a_numFilesPerBatch, a_sysLoadPct, a_uims);
    }
    ipc_CATCH_IVD_THROW_CORBA_m;
}

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobID_t i_ManagementInterface_i::CheckFSCvsMedia ( const char *  a_partName,
const i_StringList_t a_volumes,
CORBA::Boolean  a_autoCorrect,
CORBA::Boolean  a_removeMissingOnMedia,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 1317 of file i_mif_partition.cpp.

References CheckFSCvsIVDFS(), mif_PartMgr::GetPart(), ie_PRECONDITION, ivd_Error, log_FUNC_m, mif_PartEntry::m_iPM, m_partMgr, mif_PartEntry::m_partStatus, and mps_Online.

                                  {

    log_FUNC_m(CheckFSCvsIVDFS);

    try {
        mif_PartEntry pe = m_partMgr.GetPart(a_partName);
        if (pe.m_partStatus != mps_Online) {
            throw ivd_Error(ie_PRECONDITION, "Partition not ready - cannot check FSC.");
        }
        return pe.m_iPM->CheckFSCvsMedia(a_volumes, a_autoCorrect, a_removeMissingOnMedia, a_uims);
    }
    ipc_CATCH_IVD_THROW_CORBA_m;
}

Here is the call graph for this function:

i_JobID_t i_ManagementInterface_i::CloseVolume ( i_UIMessageServer_ptr  a_uims,
const char *  a_barcode,
const i_VolNumList_t a_volumes 
)

Definition at line 627 of file i_mif_medium.cpp.

References mif_JobManager::CreateCloseVolumeJob(), i_Job_i::GetJobId(), ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, m_jobMgr, and NULL.

                                                                         {
    log_FUNC_m(CloseVolume);
    try {
        i_AdminJob_i * iJob = m_jobMgr.CreateCloseVolumeJob(a_uims,
                                                            a_barcode,
                                                            a_volumes );

        if (iJob != NULL) {
            return iJob->GetJobId();
        }
        else {
            return 0;
        }
    }
    ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

i_JobID_t i_ManagementInterface_i::CopyContents ( const char *  a_barcode,
i_UIMessageServer_ptr  a_uims 
)

Invokes a maintenance job for redundant copy on the partition mgr.

Definition at line 825 of file i_mif_medium.cpp.

References dbg_NORM, mif_PartMgr::GetPart(), log_DBG_m, log_FUNC_m, mif_PartEntry::m_iPM, m_partMgr, mif_PartEntry::m_partStatus, m_rm, and mps_Online.

                                                                                {
    log_FUNC_m(CopyContents);

    try {
        i_Medium_t_var med = m_rm->SelectMedium(a_barcode);

        log_DBG_m(dbg_NORM, "Medium belogs to partition " << med->partitionName);
        mif_PartEntry pe = m_partMgr.GetPart(string(med->partitionName));
        if (pe.m_partStatus != mps_Online) {
            a_uims->DisplayError("Partition not ready - can not invoke copy-contents.");
            return 0;
        }
        log_DBG_m(dbg_NORM, "Starting copy-contents for medium " << a_barcode);
        a_uims->DisplayMessage("Copy-contents Job started.");

        i_VolNumList_t volumes; //empty
                                //a_best_effort = false because of old call
        return pe.m_iPM->CopyContents(a_barcode, volumes, false, a_uims);
    }
    ipc_CATCH_IVD_THROW_CORBA_m;

} //i_ManagementInterface_i::CopyContents

Here is the call graph for this function:

i_JobID_t i_ManagementInterface_i::CopyContentsPerVolume ( const char *  a_barcode,
const i_VolNumList_t a_volumes,
::CORBA::Boolean  a_best_effort,
i_UIMessageServer_ptr  a_uims 
)

Invokes a maintenance job for redundant copy on the partition mgr.

void i_ManagementInterface_i::DisableDebug (  ) 

Definition at line 320 of file i_mif_impl.cpp.

References dbg_NORM, g_cmn, mif_PartMgr::GetAllPart(), ivd_BaseException::GetFriendly(), ipc_EXEC_m, log_DBG_m, log_FUNC_m, log_WRN_m, cmn_SysInfo::m_hostName, m_partMgr, m_rm, mps_Online, ipc_Corba::ResolveFSEvtMgr(), ipc_Corba::ResolveLA(), ipc_Corba::ResolveSvc(), cmn_Global::si, and i_Component_i::StopDebug().

                                           {
    log_FUNC_m(DisableDebug);

    try {
        // MIF (myself)
        log_DBG_m(dbg_NORM, "StopDebug on MIF");
        try {
            StopDebug();
        }
        catch(...) {
            // ignore - try to do us much as possible
        }

        // RM
        log_DBG_m(dbg_NORM, "StopDebug on RM");
        try {
            m_rm->StopDebug();
        }
        catch(...) {
            // ignore - try to do us much as possible
        }


        // LA
        i_LibrarySeq_t_var libSeq;
        try {
            libSeq = m_rm->SelectAllLibraries();
        }
        catch (...) {
            // ignore - try to do us much as possible
        }

        for (UInt32_t i = 0; i < libSeq->length(); i++) {
            i_LibraryAgent_var iLA;

            try {
                CORBA::Object_var obj = ipc_Corba::ResolveLA(
                                           string(libSeq[i].host),
                                           string(libSeq[i].libraryName),
                                           false);
                iLA = i_LibraryAgent::_narrow(obj);
            }
            catch (...) {
                // ignore error and check next one...
                log_DBG_m(dbg_NORM, "Warning: cannot resolve LM: " <<
                          libSeq[i].libraryName);
                iLA = i_LibraryAgent::_nil();
            }

            if (!CORBA::is_nil(iLA)) {
                log_DBG_m(dbg_NORM, "StopDebug on LM: " <<
                          libSeq[i].libraryName);
                try {
                    iLA->StopDebug();
                }
                catch(...) {
                    // ignore - try to do us much as possible
                }
            }
        }

        // get through list of partitions to get client list & update PM
        map<string, bool> clientList;
        clientList[g_cmn.si.m_hostName] = true; // add myself

        vector<mif_PartEntry> allPart = m_partMgr.GetAllPart();
        for (UInt32_t i=0; i < allPart.size(); ++i) {
            clientList[allPart[i].m_partHost] = true;

            // PM
            if (allPart[i].m_partStatus == mps_Online) {
                log_DBG_m(dbg_NORM, "StopDebug on PM: " <<
                          allPart[i].m_partName);
                try {
                    allPart[i].m_iPM->StopDebug();
                }
                catch(...) {
                    // ignore - try to do us much as possible
                }

                // HSM (if running)
                ipc_EXEC_m(
                    i_HSM_var iHSM;
                    try {
                        iHSM = allPart[i].m_iPM->GetHSM();
                    }
                    catch(...) {
                        iHSM = i_HSM::_nil();
                    }

                    if (!CORBA::is_nil(iHSM)) {
                        log_DBG_m(dbg_NORM, "StopDebug on HSM: " <<
                                  allPart[i].m_partName);
                        try {
                            iHSM->StopDebug();
                        }
                        catch(...) {
                            // ignore - try to do us much as possible
                        }
                    }
                );
            }
        }

        // now go through all clients that have partition configured
        for (map<string, bool>::iterator iter = clientList.begin();
             iter != clientList.end();
             ++iter) {

            // - SVC
            i_Service_var iSVC;
            try {
                CORBA::Object_var obj = ipc_Corba::ResolveSvc(iter->first, false);
                iSVC = i_Service::_narrow(obj);
            }
            catch (...) {
                // ignore error and check next one...
                log_DBG_m(dbg_NORM, "Warning: cannot resolve SVC: " <<
                          iter->first);
                iSVC = i_Service::_nil();
            }

            if (!CORBA::is_nil(iSVC)) {
                log_DBG_m(dbg_NORM, "StopDebug on SVC: " << iter->first);
                try {
                    iSVC->StopDebug();
                }
                catch(...) {
                    // ignore - try to do us much as possible
                }
            }

            // - FSE (all clients)
            i_FsEvMgr_var iFSE;
            try {
                CORBA::Object_var obj = ipc_Corba::ResolveFSEvtMgr(iter->first,
                                                                false);
                iFSE = i_FsEvMgr::_narrow(obj);
            }
            catch (...) {
                // ignore error and check next one...
                log_DBG_m(dbg_NORM, "Warning: cannot resolve FSE: " <<
                          iter->first);
                iFSE = i_FsEvMgr::_nil();
            }

            if (!CORBA::is_nil(iFSE)) {
                log_DBG_m(dbg_NORM, "StopDebug on FSE: " << iter->first);
                try {
                    iFSE->StopDebug();
                }
                catch(...) {
                    // ignore - try to do us much as possible
                }
            }
        }

    }
    catch (const ivd_Exception& ie) {
        log_WRN_m("Can't stop debugging: " << ie.GetFriendly() );
    }
}

Here is the call graph for this function:

void i_ManagementInterface_i::DisableDrive ( const char *  driveName,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 264 of file i_mif_drive.cpp.

References log_FUNC_m, log_WriteEvent(), m_rm, and rmdb_DRIVE_DISABLED.

                                                      {
    
    log_FUNC_m(DisableDrive);

    UInt32_t status(rmdb_DRIVE_DISABLED);
    try {
        i_Drive_t_var d = m_rm->SelectDrive(a_name);
        if (d->status & rmdb_DRIVE_DISABLED) {
            ostringstream msg;
            msg << "Drive already disabled." ;
            log_WriteEvent(msg.str(), "DRIVE", 0, string(a_name));
            a_uims->DisplayWarning(msg.str().c_str());
        } 
        else {
            // set disabled flag
            m_rm->DriveStatusSet(a_name, status);
            ostringstream msg;
            msg << "Drive disabled." ;
            log_WriteEvent(msg.str(), "DRIVE", 0, string(a_name));
            a_uims->DisplayMessage(msg.str().c_str());
        }
    }
    ipc_CATCH_IVD_THROW_CORBA_m;

} // i_ManagementInterface_i::DisableDrive

Here is the call graph for this function:

void i_ManagementInterface_i::DisableLibrary ( const char *  a_mame,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 433 of file i_mif_library.cpp.

References dbg_LOW, dbg_NORM, ivd_BaseException::GetError(), ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, log_DBG_m, log_FUNC_m, log_WriteEvent(), m_rm, and rmdb_LIBRARY_DISABLED.

                                  {
    
    log_FUNC_m(DisableLibrary);
    

    UInt32_t status(rmdb_LIBRARY_DISABLED);
    try {
        // set disabled flag
        ostringstream msg;
        try {
            ipc_EXEC_m(
                m_rm->LibraryStatusSet(a_name, status);
            );
        } catch (ivd_Exception &e) {
            log_DBG_m(dbg_NORM, e);
            if (e.GetError() == ie_RMDB_NOTFOUND) {
                msg << "Library does not exist. Enable failed";
                log_DBG_m(dbg_LOW,msg.str());
                a_uims->DisplayError(msg.str().c_str());
                return;            
            } else 
                throw;
        }
        msg << "Library disabled." ;
        log_WriteEvent(msg.str(), "LIBRARY", 0, string(a_name));
        a_uims->DisplayMessage(msg.str().c_str());
    }
    ipc_CATCH_IVD_THROW_CORBA_m
    
    //stop LA for this library
    try {
        ipc_EXEC_m(
            m_rm->StopLA(CORBA::string_dup(a_name));
        );
    }
    catch (ivd_Exception &e) {
        log_DBG_m(dbg_NORM, 
            "MIF: Library Agent for this library can't be stopped." << e);
    }
}

Here is the call graph for this function:

void i_ManagementInterface_i::DisablePartition ( const char *  a_name,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 503 of file i_mif_partition.cpp.

References dbg_LOW, dbg_NORM, mif_PartMgr::DisablePart(), evt_ERROR, evt_WARNING, ivd_BaseException::GetFriendly(), mif_PartMgr::GetPart(), ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, log_DBG_m, log_FUNC_m, log_WriteEvent(), mif_PartEntry::m_iPM, m_partMgr, mif_PartEntry::m_partStatus, m_rm, mps_Online, rmdb_PARTITION_DISABLED, and rmdb_PARTITION_RECOVERY_MODE.

                                                                              {
    log_FUNC_m(DisablePartition);

    try {
        i_Partition_t_var partition;
        ostringstream msg;

        //
        // check if partition already disabled
        try {
            ipc_EXEC_m(
                partition = m_rm->SelectPartition(a_partName);
                log_DBG_m(dbg_NORM, "MIF: Partition is configured.");

                if (partition->status & rmdb_PARTITION_DISABLED) {
                    msg << "Partition already disabled.";
                    log_WriteEvent(evt_WARNING, msg.str(),
                                   "PARTITION", 0, string(a_partName));
                    a_uims->DisplayWarning(msg.str().c_str());
                    return;
                }
                if (partition->status & rmdb_PARTITION_RECOVERY_MODE) {
                    msg << "Partition is in recovery mode.";
                    log_WriteEvent(evt_WARNING, msg.str(),
                        "PARTITION", 0, string(a_partName));
                    a_uims->DisplayWarning(msg.str().c_str());
                    return;
                }
            );
        }
        catch (ivd_Exception) {
            log_DBG_m(dbg_NORM, "MIF: Partition is not configured.");
            msg << "Cannot find partition.";
            log_WriteEvent(evt_WARNING, msg.str(),
                           "PARTITION", 0, string(a_partName));
            a_uims->DisplayWarning(msg.str().c_str());
            return;
        }

        //
        // check if partition is mounted -> deny
        mif_PartEntry pe = m_partMgr.GetPart(a_partName);
        if (pe.m_partStatus == mps_Online) {
            i_HSM_var iHSM;
            try {
                ipc_EXEC_m(
                    iHSM = pe.m_iPM->GetHSM();
                );
                if (!CORBA::is_nil(iHSM)) {
                    msg <<  "HSM File System mounted. Cannot disable partition.";
                    log_WriteEvent(evt_ERROR, msg.str(),
                                   "PARTITION", 0, string(a_partName));
                    a_uims->DisplayError(msg.str().c_str());
                    return;
                }
            } catch (ivd_Error &e) {
                log_DBG_m(dbg_LOW, "Could not contact PM: " << e);
                // PM probably not running
            }
        }

        //
        // update partition field in RMDB.
        try {
            ipc_EXEC_m(m_rm->DisablePartition(a_partName);)
        }
        catch (ivd_Exception &e) {
            msg << "Updating Partition Record in RMDB failed. "
                << e.GetFriendly();
            log_WriteEvent(evt_ERROR, msg.str(),
                           "PARTITION", 0, string(a_partName));
            a_uims->DisplayError(msg.str().c_str());
        }

        ostringstream sstr;
        sstr << "Partition disabled." ;
        log_WriteEvent(sstr.str(), "PARTITION", 0, string(a_partName));
        a_uims->DisplayMessage(sstr.str().c_str());

        //
        // stop PM for this partition and notify the client
        try {
            m_partMgr.DisablePart(a_partName);
            msg << "Partition Manager stopped.";
            log_WriteEvent(msg.str(), "PARTITION", 0, string(a_partName));
            a_uims->DisplayMessage(msg.str().c_str());
        }
        catch (ivd_Exception &e) {
            msg << "Stopping Partition Manager failed. " << e.GetFriendly();
            log_WriteEvent(evt_ERROR, msg.str(), "PARTITION", 0, string(a_partName));
            a_uims->DisplayError(msg.str().c_str());
        }
    }
    ipc_CATCH_IVD_THROW_CORBA_m
} // i_ManagementInterface_i::DisablePartition()

Here is the call graph for this function:

void i_ManagementInterface_i::DuplicateMedium ( i_UIMessageServer_ptr  a_uims,
const char *  a_sourceBarCode,
const char *  a_targetBarCode,
CORBA::Boolean  a_forced 
)

Definition at line 610 of file i_mif_medium.cpp.

References mif_JobManager::CreateDuplMedJob(), log_FUNC_m, and m_jobMgr.

                                                                     {
    log_FUNC_m(DuplicateMedium);
    try {
        m_jobMgr.CreateDuplMedJob(
            a_uims,
            a_sourceBarCode,
            a_targetBarCode,
            a_forced);

    }
    ipc_CATCH_IVD_THROW_CORBA_m;
}

Here is the call graph for this function:

void i_ManagementInterface_i::EnableDebug ( CORBA::Char  a_level,
const char *  a_output,
const char *  a_flags,
CORBA::ULong  a_ivdfsFlags 
)

Definition at line 143 of file i_mif_impl.cpp.

References dbg_NORM, g_cmn, mif_PartMgr::GetAllPart(), ivd_BaseException::GetFriendly(), ipc_EXEC_m, log_DBG_m, log_FUNC_A_m, log_WRN_m, cmn_SysInfo::m_hostName, m_partMgr, m_rm, mps_Online, ipc_Corba::ResolveFSEvtMgr(), ipc_Corba::ResolveLA(), ipc_Corba::ResolveSvc(), cmn_Global::si, and i_Component_i::StartDebug().

                             {

    log_FUNC_A_m(EnableDebug, "level: " << a_level <<
                              " file: " << a_output <<
                              " flags: " << a_flags <<
                              " hsmfs: " << hex << a_ivdfsFlags);

    try {
        // MIF (myself)
        log_DBG_m(dbg_NORM, "StartDebug on MIF");
        try {
            StartDebug(a_level, a_output, a_flags, a_ivdfsFlags);
        }
        catch (...) {
            // ignore - try to do us much as possible
        }

        // RM
        log_DBG_m(dbg_NORM, "StartDebug on RM");
        try {
            m_rm->StartDebug(a_level, a_output, a_flags, a_ivdfsFlags);
        }
        catch (...) {
            // ignore - try to do us much as possible
        }

        // LA
        i_LibrarySeq_t_var libSeq;
        try {
            libSeq = m_rm->SelectAllLibraries();
        }
        catch (...) {
            // ignore - try to do us much as possible
        }

        for (UInt32_t i = 0; i < libSeq->length(); i++) {
            i_LibraryAgent_var iLA;

            try {
                CORBA::Object_var obj = ipc_Corba::ResolveLA(
                                           string(libSeq[i].host),
                                           string(libSeq[i].libraryName),
                                           false);
                iLA = i_LibraryAgent::_narrow(obj);
            }
            catch (...) {
                // ignore error and check next one...
                log_DBG_m(dbg_NORM, "Warning: cannot resolve LM: " <<
                          libSeq[i].libraryName);
                iLA = i_LibraryAgent::_nil();
            }

            if (!CORBA::is_nil(iLA)) {
                log_DBG_m(dbg_NORM, "StartDebug on LM: " <<
                          libSeq[i].libraryName);
                try {
                    iLA->StartDebug(a_level, a_output, a_flags, a_ivdfsFlags);
                }
                catch (...) {
                    // ignore - try to do us much as possible
                }
            }
        }

        // get through list of partitions to get client list & update PM
        map<string, bool> clientList;
        clientList[g_cmn.si.m_hostName] = true; // add myself

        vector<mif_PartEntry> allPart = m_partMgr.GetAllPart();
        for (UInt32_t i=0; i < allPart.size(); ++i) {
            clientList[allPart[i].m_partHost] = true;

            // PM
            if (allPart[i].m_partStatus == mps_Online) {
                log_DBG_m(dbg_NORM, "StartDebug on PM: " <<
                          allPart[i].m_partName);
                try {
                    allPart[i].m_iPM->StartDebug(a_level, a_output, a_flags,
                                                 a_ivdfsFlags);
                }
                catch (...) {
                    // ignore - try to do us much as possible
                }

                // HSM (if running)
                ipc_EXEC_m(
                    i_HSM_var iHSM;
                    try {
                        iHSM = allPart[i].m_iPM->GetHSM();
                    }
                    catch(...) {
                        iHSM = i_HSM::_nil();
                    }

                    if (!CORBA::is_nil(iHSM)) {
                        log_DBG_m(dbg_NORM, "StartDebug on HSM: " <<
                                  allPart[i].m_partName);
                        try {
                            iHSM->StartDebug(a_level, a_output, a_flags,
                                             a_ivdfsFlags);
                        }
                        catch (...) {
                            // ignore - try to do us much as possible
                        }
                    }
                );
            }
        }

        // now go through all clients that have partition configured
        for (map<string, bool>::iterator iter = clientList.begin();
             iter != clientList.end();
             ++iter) {

            // - SVC
            i_Service_var iSVC;
            try {
                CORBA::Object_var obj = ipc_Corba::ResolveSvc(iter->first, false);
                iSVC = i_Service::_narrow(obj);
            }
            catch (...) {
                // ignore error and check next one...
                log_DBG_m(dbg_NORM, "Warning: cannot resolve SVC: " <<
                          iter->first);
                iSVC = i_Service::_nil();
            }

            if (!CORBA::is_nil(iSVC)) {
                log_DBG_m(dbg_NORM, "StartDebug on SVC: " << iter->first);
                try {
                    iSVC->StartDebug(a_level, a_output, a_flags, a_ivdfsFlags);
                }
                catch(...) {
                    // ignore - try to do us much as possible
                }
            }

            // - FSE (all clients)
            i_FsEvMgr_var iFSE;
            try {
                CORBA::Object_var obj = ipc_Corba::ResolveFSEvtMgr(iter->first,
                                                                false);
                iFSE = i_FsEvMgr::_narrow(obj);
            }
            catch (...) {
                // ignore error and check next one...
                log_DBG_m(dbg_NORM, "Warning: cannot resolve FSE: " <<
                          iter->first);
                iFSE = i_FsEvMgr::_nil();
            }

            if (!CORBA::is_nil(iFSE)) {
                log_DBG_m(dbg_NORM, "StartDebug on FSE: " << iter->first);
                try {
                    iFSE->StartDebug(a_level, a_output, a_flags, a_ivdfsFlags);
                }
                catch(...) {
                    // ignore - try to do us much as possible
                }
            }
        }

    }
    catch (const ivd_Exception& ie) {
        log_WRN_m("Can't start debugging: " << ie.GetFriendly() );
    }

}

Here is the call graph for this function:

void i_ManagementInterface_i::EnableDrive ( const char *  driveName,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 236 of file i_mif_drive.cpp.

References log_FUNC_m, log_WriteEvent(), m_rm, and rmdb_DRIVE_ERROR.

                                                      {
    
    log_FUNC_m(EnableDrive);
    
    UInt32_t status(0);
    status = rmdb_DRIVE_ERROR | rmdb_DRIVE_DISABLED;
    try {
        i_Drive_t_var d = m_rm->SelectDrive(a_name);
        if (d->status == 0) {
            ostringstream msg;
            msg << "Drive already enabled." ;
            log_WriteEvent(msg.str(), "DRIVE", 0, string(a_name));
            a_uims->DisplayWarning(msg.str().c_str());
        } 
        else {
            // clear disabled and error flags
            m_rm->DriveStatusClear(a_name, status);
            ostringstream msg;
            msg << "Drive enabled." ;
            log_WriteEvent(msg.str(), "DRIVE", 0, string(a_name));
            a_uims->DisplayMessage(msg.str().c_str());
        }
    }
    ipc_CATCH_IVD_THROW_CORBA_m;
} // i_ManagementInterface_i::EnableDrive()

Here is the call graph for this function:

void i_ManagementInterface_i::EnableLibrary ( const char *  a_name,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 365 of file i_mif_library.cpp.

References dbg_DETAIL, dbg_LOW, dbg_NORM, ivd_BaseException::GetError(), GetLibrary(), ie_MIF_LA_PROBLEM, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ivd_Error, log_DBG_m, log_FUNC_m, log_WriteEvent(), m_rm, ipc_Corba::ResolveLA(), and rmdb_LIBRARY_ERROR.

                                  {
    
    log_FUNC_m(EnableLibrary);
    
    UInt32_t status(0);
    status = rmdb_LIBRARY_ERROR | rmdb_LIBRARY_DISABLED;
    
    try {
        // clear disabled and error flags
        ostringstream msg;
        try {
            ipc_EXEC_m(
                m_rm->LibraryStatusClear(a_name, status);
            );
        } catch (ivd_Exception &e) {
            log_DBG_m(dbg_NORM, e);
            if (e.GetError() == ie_RMDB_NOTFOUND) {
                msg << "Library does not exist. Enable failed";
                log_DBG_m(dbg_LOW,msg.str());
                a_uims->DisplayError(msg.str().c_str());
                return;            
            } else 
                throw;
        }
        //
        // check whether LA is started - if not try to start it
        try {
            i_Library_t_var lib = GetLibrary(a_name);
            try {
                ipc_EXEC_m(
                    CORBA::Object_var obj = 
                        ipc_Corba::ResolveLA(string(lib->host), a_name, false);
                );
            } 
            catch(ivd_Exception) {
                log_DBG_m(dbg_DETAIL, 
                          "LA for library " << a_name << " not accessible.");
                try {
                    log_DBG_m(dbg_DETAIL, "Starting LA for library " << a_name);
                    ipc_EXEC_m(
                        m_rm->StartLA(CORBA::string_dup(a_name));
                    );
                    ipc_EXEC_m(
                        CORBA::Object_var obj = 
                        ipc_Corba::ResolveLA(string(lib->host), a_name, true);
                    );
                }
                catch(ivd_Exception) {
                    throw ivd_Error(ie_MIF_LA_PROBLEM, 
                        "LA for library " + string(a_name) + " not started.");
                }
            }
        }
        catch(ivd_Exception) {
            m_rm->LibraryStatusSet(a_name, rmdb_LIBRARY_ERROR);
            throw ivd_Error(ie_MIF_LA_PROBLEM, "Library not enabled.");
        }
        
        msg << "Library enabled." ;
        log_WriteEvent(msg.str(), "LIBRARY", 0, string(a_name));
        a_uims->DisplayMessage(msg.str().c_str());
    }
    ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

void i_ManagementInterface_i::EnablePartition ( const char *  a_name,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 428 of file i_mif_partition.cpp.

References dbg_NORM, mif_PartMgr::EnablePart(), evt_ERROR, evt_WARNING, ivd_BaseException::GetFriendly(), ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, log_DBG_m, log_FUNC_m, log_WriteEvent(), m_partMgr, m_rm, rmdb_PARTITION_ENABLED, and rmdb_PARTITION_RECOVERY_MODE.

                                                                              {
    log_FUNC_m(EnablePartition);

    try {

        i_Partition_t_var partition;
        ostringstream msg;

        try {
            ipc_EXEC_m(
                partition = m_rm->SelectPartition(a_partName);
                log_DBG_m(dbg_NORM, "MIF: Partition is configured.");
                if (partition->status == rmdb_PARTITION_ENABLED) {
                    msg << "Partition already enabled.";
                    log_WriteEvent(evt_WARNING, msg.str(),
                                   "PARTITION", 0, string(a_partName));
                    a_uims->DisplayWarning(msg.str().c_str());
                    return;
                }
                if (partition->status == rmdb_PARTITION_RECOVERY_MODE) {
                    msg << "Partition is in recovery mode.";
                    log_WriteEvent(evt_WARNING, msg.str(),
                                   "PARTITION", 0, string(a_partName));
                    a_uims->DisplayWarning(msg.str().c_str());
                    return;
                }
            )
        }
        catch (ivd_Exception) {
            log_DBG_m(dbg_NORM, "MIF: Partition is not configured.");
            msg << "Cannot find partition.";
            log_WriteEvent(evt_WARNING, msg.str(),
                           "PARTITION", 0, string(a_partName));
            a_uims->DisplayWarning(msg.str().c_str());
            return;
        }

        //
        // update partition field in RMDB.
        try {
            ipc_EXEC_m(m_rm->EnablePartition(a_partName);)
        } catch (ivd_Exception &e) {
            msg << "Updating Partition Record in RMDB failed. " << e.GetFriendly();
            log_WriteEvent(evt_ERROR, msg.str(),
                           "PARTITION", 0, string(a_partName));
            a_uims->DisplayError(msg.str().c_str());
            return;
        }

        ostringstream sstr;
        sstr << "Partition enabled." ;
        log_WriteEvent(sstr.str(), "PARTITION", 0, string(a_partName));
        a_uims->DisplayMessage(sstr.str().c_str());


        //
        // start PM for this partition and notify the client
        try {
            m_partMgr.EnablePart(a_partName);
            msg << "Partition Manager started." ;
            log_WriteEvent(msg.str(), "PARTITION", 0, string(a_partName));
            a_uims->DisplayMessage(msg.str().c_str());
        }
        catch (ivd_Exception &e) {
            msg << "Starting Partition Manager failed. " << e.GetFriendly();
            log_WriteEvent(evt_ERROR, msg.str(),
                           "PARTITION", 0, string(a_partName));
            a_uims->DisplayError(msg.str().c_str());
        }
    }
    ipc_CATCH_IVD_THROW_CORBA_m
} // i_ManagementInterface_i::EnablePartition()

Here is the call graph for this function:

i_MajorColSeq_t * i_ManagementInterface_i::EnumMajorCollocationId (  ) 

Definition at line 54 of file i_mif_collocation.cpp.

References log_FUNC_m, and m_rm.

                                                                 {
    log_FUNC_m(EnumMajorCollocationId);
    return m_rm->SelectAllMajorCol();
}

i_MinorColSeq_t * i_ManagementInterface_i::EnumMinorCollocationId ( i_ColID_t  a_majColId  ) 

Definition at line 49 of file i_mif_collocation.cpp.

References log_FUNC_m, and m_rm.

                                                                                           {
    log_FUNC_m(EnumMinorCollocationId);
    return m_rm->SelectAllMinorColByMajCol(a_majColId);
}

void i_ManagementInterface_i::FileHistory ( const char *  a_clientHost,
const char *  a_fsID,
CORBA::Boolean  a_byFileName,
const i_FileList_t a_files,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 50 of file i_mif_file.cpp.

References cmn_GetMigFlags(), i_FileHistory_t::dataType, dbg_DETAIL, dbg_NORM, file, i_File_t::fileID, i_FileHistory_t::fileName, i_FileHistory_t::fileSize, g_cmn, ivd_BaseException::GetError(), ivd_MigrationID::GetTime(), ui_ResultPacker::Insert(), ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, iPM, iRM, log_DBG_m, log_FUNC_A_m, cmn_SysInfo::m_serverHost, i_FileHistory_t::migrationID, i_File_t::name, ui_ResultPacker::NewRow(), ipc_Corba::ResolvePMByFSID(), ipc_Corba::ResolvePMByPartID(), ui_ResultPacker::SendResults(), cmn_Global::si, cmn_Time::Time2YMDhms(), uialign_LEFT, and uialign_RIGHT.

                                  {

    log_FUNC_A_m(FileHistory,
        "Client: " << a_clientHost << ", FS/PartitionID:" << a_fsID <<
        " #files:" << a_files.length());

    try {
        i_PartitionManager_var iPM;

        if (a_byFileName) {
            // resolve by FS ID (request by fileName)
            ipc_EXEC_m(
                CORBA::Object_var obj = ipc_Corba::ResolvePMByFSID(
                                 string(a_clientHost), string(a_fsID), false);
                iPM = i_PartitionManager::_narrow(obj);
            );
        }
        else {
            // resolve by partition name (request by fileID)
            ipc_EXEC_m(
                CORBA::Object_var obj = ipc_Corba::ResolvePMByPartID(
                                g_cmn.si.m_serverHost, string(a_fsID), false);

                iPM = i_PartitionManager::_narrow(obj);
            );
        }

        i_FSC_var iFSC;
        i_ResourceManager_var iRM;

        ipc_EXEC_m(
            log_DBG_m(dbg_DETAIL,"Resolving FSC");
            iFSC = iPM->GetFSC();
            log_DBG_m(dbg_DETAIL,"Resolving RM");
            iRM = iPM->GetRM();
        );

        bool header(true);
        ui_ResultPacker result;

        for (UInt32_t i(0); i < a_files.length(); i++) {
            log_DBG_m(dbg_NORM, "Filename:" << a_files[i].name <<
                                " fileID:" << a_files[i].fileID);

            const i_File_t &file = a_files[i];
            i_FileHistoryList_t_var fileHistList;

            if (header) {
                header = false;
                result.NewRow(true);
                result.Insert("FileID");
                result.Insert("MigID");
                result.Insert("Time");
                result.Insert("Size[B]");
                result.Insert("Data");
                result.Insert("FileName");
                result.Insert("MediumBarcode");
            }

            // file has no fileid
            if (file.fileID == 0)  {
                result.NewRow();

                // field FileID
                result.Insert("n/a", uialign_RIGHT);

                // field MigID
                result.Insert("n/a", uialign_RIGHT);

                // field Time
                result.Insert("n/a", uialign_RIGHT);

                // field Size[KB]
                result.Insert("n/a", uialign_RIGHT);

                // field data type
                result.Insert("n/a", uialign_LEFT);

                if (a_byFileName) {
                    result.Insert(file.name);
                }
                else {
                    result.Insert("n/a", uialign_RIGHT);
                }

                // field barcode
                result.Insert("n/a", uialign_LEFT);

                continue;
            }

            ipc_EXEC_m (
                fileHistList = iFSC->GetFileHistory(file.fileID);
            );

            // no valid generations for this file
            if (fileHistList->length() == 0) {
                result.NewRow();
                result.Insert(file.fileID);

                // field MigID
                result.Insert("n/a", uialign_RIGHT);

                // field Time
                result.Insert("n/a", uialign_RIGHT);

                // field Size[KB]
                result.Insert("n/a", uialign_RIGHT);

                // field data type
                result.Insert("n/a", uialign_LEFT);

                if (a_byFileName) {
                    result.Insert(file.name);
                }
                else {
                    result.Insert("n/a", uialign_RIGHT);
                }

                // field barcode
                result.Insert("n/a", uialign_LEFT);

                continue;
            }

            for (UInt32_t j(0); j < fileHistList->length(); j++) {
                i_FileHistory_t &fileHis = fileHistList[j];

                result.NewRow();
                result.Insert(file.fileID);
                result.Insert(fileHis.migrationID);
                ivd_MigrationID migID(fileHis.migrationID);
                result.Insert(migID.GetTime().Time2YMDhms());
                result.Insert(fileHis.fileSize);
                result.Insert(cmn_GetMigFlags((UInt32_t)fileHis.dataType), uialign_LEFT);

                result.Insert(fileHis.fileName);

                i_CopiesPos_v_t_var allCopiesPos;

                try {
                    ipc_EXEC_m (
                        allCopiesPos = iFSC->GetCopiesPos(file.fileID, fileHis.migrationID, fileHis.fileSize);
                    );
                }
                catch (ivd_Error e) {
                    if( e.GetError() == ie_FSC_NOCOPIES ) {
                        result.Insert("n/a"); // barcode
                        continue;
                    }
                    throw;
                }

                string barcodes("");
                for (UInt32_t k(0); k < allCopiesPos->length(); k++)
                    for (UInt32_t l(0); l < allCopiesPos[k].length(); l++) {
                        ipc_EXEC_m (
                            barcodes.append(iRM->SelectMediumByKey(allCopiesPos[k][l].mediumKey)->barcode).append(" ");
                        );
                    }
                if (barcodes.empty())
                    barcodes = "n/a";
                result.Insert(barcodes);
            }
        } //for

        log_DBG_m(dbg_NORM,"packing finished, sending results");

        result.SendResults(a_uims);

    } ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

i_JobID_t i_ManagementInterface_i::FormatAndInitMedium ( i_UIMessageServer_ptr  a_uims,
CORBA::Boolean  a_doFormat,
CORBA::Boolean  a_doInit,
CORBA::Boolean  a_forced,
const char *  a_barcode,
const i_VolNumList_t a_volumes 
)

Definition at line 549 of file i_mif_medium.cpp.

References mif_JobManager::CreateFormatAndInitJob(), i_Job_i::GetJobId(), ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, m_jobMgr, and NULL.

                                     {

    log_FUNC_m(FormatAndInitMedium);

    try {
        i_AdminJob_i * iJob = m_jobMgr.CreateFormatAndInitJob(
                                            a_uims,
                                            a_doFormat,
                                            a_doInit,
                                            a_forced,
                                            a_barcode,
                                            a_volumes );

        if (iJob != NULL) {
            return iJob->GetJobId();
        }
        else {
            return 0;
        }
    }
    ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

i_JobID_t i_ManagementInterface_i::FSCRecover ( const char *  a_partName,
const i_StringList_t a_volumes,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 1402 of file i_mif_partition.cpp.

References dbg_NORM, mif_PartMgr::GetPart(), ie_PRECONDITION, ivd_Error, log_DBG_m, log_FUNC_m, mif_PartEntry::m_iPM, m_partMgr, mif_PartEntry::m_partStatus, and mps_Online.

Referenced by IVDFSRecover().

                                  {

    log_FUNC_m(FSCRecover);

    try {
        mif_PartEntry pe = m_partMgr.GetPart(a_partName);
        if (pe.m_partStatus != mps_Online) {
            throw ivd_Error(ie_PRECONDITION, "Partition not ready - cannot recover FSC.");
        }

        i_HSM_var iHSM;
        try {
           iHSM = pe.m_iPM->GetHSM();
        }
        catch (...) {
            // ignore
        }

        if ( !CORBA::is_nil(iHSM) ) {
            throw ivd_Error(ie_PRECONDITION, "HSMFS mounted - cannot recover FSC.");
        }

        log_DBG_m(dbg_NORM, "MIF: HSM for partition is not running.");
        try {
            a_uims->DisplayMessage("FSC recovery started.");
        } catch (...) {
            //just ignore
        }
        return pe.m_iPM->FSCRecovery(a_volumes, a_uims);
    }
    ipc_CATCH_IVD_THROW_CORBA_m;
} // i_ManagementInterface_i::FSCRecover()

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobList_t * i_ManagementInterface_i::GetAllAdminJobs (  ) 

Definition at line 1068 of file i_mif_job.cpp.

References job_Manager::GetAllJobs(), log_FUNC_m, and m_jobMgr.

Referenced by ListJobs().

                                                      {
    log_FUNC_m(GetAllAdminJobs);

    try {
        return m_jobMgr.GetAllJobs();
    }
    ipc_CATCH_IVD_THROW_CORBA_m;
} // i_ManagementInterface_i::GetAllAdminJobs()

Here is the call graph for this function:

Here is the caller graph for this function:

i_MediumSeq_t * i_ManagementInterface_i::GetAllMedia (  ) 

Definition at line 658 of file i_mif_medium.cpp.

References log_FUNC_m, and m_rm.

                                                    {
    log_FUNC_m(GetAllMedia);
    return m_rm->SelectAllMedia();
}

i_MediaPoolSeq_t * i_ManagementInterface_i::GetAllPools (  ) 

Definition at line 168 of file i_mif_pool.cpp.

References log_FUNC_m, and m_rm.

                                                       {
    log_FUNC_m(GetAllPools);
    return m_rm->SelectAllMediaPools();
}

i_ColInfoList_t * i_ManagementInterface_i::GetCollocationInfo ( const char *  a_clientHost,
const char *  a_partID,
bool  a_byPartName = false 
)

Definition at line 589 of file i_mif_file.cpp.

References dbg_DETAIL, g_cmn, ie_NO_HSM, ie_PRECONDITION, ipc_CATCH_IVD_THROW_CORBA_m, iPM, ivd_Error, log_DBG_m, log_FUNC_m, cmn_SysInfo::m_serverHost, ipc_Corba::ResolvePMByFSID(), ipc_Corba::ResolvePMByPartID(), and cmn_Global::si.

                                                                                                                            {
    log_FUNC_m(GetCollocationInfo);
    try {
        i_PartitionManager_var iPM;
        if (a_byPartName) {
            CORBA::Object_var obj = ipc_Corba::ResolvePMByPartID(
                            g_cmn.si.m_serverHost, string(a_fsID), false);
            iPM = i_PartitionManager::_narrow(obj);
        }
        else {
            CORBA::Object_var obj = ipc_Corba::ResolvePMByFSID(
                            string(a_clientHost), string(a_fsID), false);
            iPM = i_PartitionManager::_narrow(obj);
        }

        log_DBG_m(dbg_DETAIL,"Resolving HSM");
        i_HSM_var iHSM = iPM->GetHSM();
        if (CORBA::is_nil(iHSM)) {
            throw ivd_Error(ie_NO_HSM, "Partition not mounted or no valid HSM reference.");
        }


        // check partition option
        i_ClientConf_t_var clientInfo;
        iHSM->GetCfg(clientInfo);
        if (!clientInfo->CfgMigrateWithCollocation) {
            ostringstream msg;
            msg << "Option 'MigrateWithCollocation' is not enabled. Collocation info could not be set.";
            throw ivd_Error(ie_PRECONDITION, msg.str());
        }

        // get collocation info
        return iHSM->GetCollocationInfo();
    } ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

i_Drive_t * i_ManagementInterface_i::GetDrive ( const char *  a_name  ) 

Definition at line 292 of file i_mif_drive.cpp.

References log_FUNC_A_m, and m_rm.

                                                               {
    log_FUNC_A_m(GetDrive, "a_name:" << a_name);
    return m_rm->SelectDrive(a_name);
}

i_DriveHost_t * i_ManagementInterface_i::GetDriveHost ( const char *  a_driveName,
const char *  driveHost 
)

Definition at line 95 of file i_mif_drivehost.cpp.

References log_FUNC_A_m, and m_rm.

                                                                    {
    log_FUNC_A_m(GetDriveHost,  "a_driveName:" << a_driveName <<
                                " a_driveHost:" << a_driveHost);
    
    return m_rm->SelectDriveHost(a_driveName, a_driveHost);
}

i_StringList_t * i_ManagementInterface_i::GetFSList ( const char *  a_client  ) 

Definition at line 1461 of file i_mif_partition.cpp.

References mif_PartMgr::GetClientFSIDs(), log_FUNC_m, and m_partMgr.

                                                                       {
    log_FUNC_m(GetFSList);

    string host(a_client);
    i_StringList_t_var fsList(new i_StringList_t());

    m_partMgr.GetClientFSIDs(host, fsList);

    return fsList._retn();
}

Here is the call graph for this function:

i_HL7InfoList_t * i_ManagementInterface_i::GetHl7Info ( const char *  a_clientHost,
const char *  a_partID,
bool  a_byPartName 
)

Definition at line 627 of file i_mif_file.cpp.

References dbg_DETAIL, g_cmn, ie_NO_HSM, ie_PRECONDITION, ipc_CATCH_IVD_THROW_CORBA_m, iPM, ivd_Error, log_DBG_m, log_FUNC_m, cmn_SysInfo::m_serverHost, ipc_Corba::ResolvePMByFSID(), ipc_Corba::ResolvePMByPartID(), and cmn_Global::si.

                                                                                                                    {
    log_FUNC_m(GetHl7Info);
    try {
        i_PartitionManager_var iPM;
        if (a_byPartName) {
            CORBA::Object_var obj = ipc_Corba::ResolvePMByPartID(
                            g_cmn.si.m_serverHost, string(a_fsID), false);
            iPM = i_PartitionManager::_narrow(obj);
        }
        else {
            CORBA::Object_var obj = ipc_Corba::ResolvePMByFSID(
                            string(a_clientHost), string(a_fsID), false);
            iPM = i_PartitionManager::_narrow(obj);
        }

        log_DBG_m(dbg_DETAIL,"Resolving HSM");
        i_HSM_var iHSM = iPM->GetHSM();
        if (CORBA::is_nil(iHSM)) {
            throw ivd_Error(ie_NO_HSM, "Partition not mounted or no valid HSM reference.");
        }

        // check partition option
        i_ClientConf_t_var clientInfo;
        iHSM->GetCfg(clientInfo);
        if (!clientInfo->CfgSendHL7Messages) {
            ostringstream msg;
            msg << "Option 'SendHl7Messages' is not enabled. Hl7 info could not be set.";
            throw ivd_Error(ie_PRECONDITION, msg.str());
        }

        // get hl7 info
        return iHSM->GetHL7Info();
    }ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

i_Library_t * i_ManagementInterface_i::GetLibrary ( const char *  a_name  ) 

Definition at line 477 of file i_mif_library.cpp.

References log_FUNC_A_m, and m_rm.

Referenced by EnableLibrary(), and UpdateLibrary().

                                                                  {
    log_FUNC_A_m(GetLibrary,"a_name:" << a_name);
    return m_rm->SelectLibrary(a_name);
}

Here is the caller graph for this function:

i_MediaInfoSeq_t * i_ManagementInterface_i::GetMediaInfo ( const char *  a_partName  ) 

Definition at line 44 of file i_mif_collocation.cpp.

References log_FUNC_m, and m_rm.

                                                                              {
    log_FUNC_m(GetMediaInfo);
    return m_rm->GetMediaInfo(a_partName);
}

i_Medium_t * i_ManagementInterface_i::GetMedium ( const char *  a_barcode  ) 

Definition at line 648 of file i_mif_medium.cpp.

References log_FUNC_A_m, and m_rm.

Referenced by GetMediumByKey().

                                                                    {
    log_FUNC_A_m(GetMedium, "a_barcode:" << a_barcode);
    return m_rm->SelectMedium(a_barcode);
}

Here is the caller graph for this function:

i_Medium_t * i_ManagementInterface_i::GetMediumByKey ( i_DBKey_t  a_mediumKey  ) 

Definition at line 653 of file i_mif_medium.cpp.

References GetMedium(), log_FUNC_A_m, and m_rm.

                                                                         {
    log_FUNC_A_m(GetMedium, "a_mediumKey:" << a_mediumKey);
    return m_rm->SelectMediumByKey(a_mediumKey);
}

Here is the call graph for this function:

i_Medium_t & i_ManagementInterface_i::GetMediumBySlot ( i_Slot_t a_slot,
i_MediumSeq_t a_medSeq 
)

Definition at line 190 of file i_mif_library.cpp.

References dbg_DETAIL, ie_RMDB_ERROR, ivd_Error, i_Slot_t::libraryName, log_DBG_m, log_FUNC_m, ipc_Log::LogMedium(), ipc_Log::LogSlot(), i_Slot_t::slotAddr, and i_Slot_t::slotType.

Referenced by ShowLibraryInventory().

                                                                            {
    log_FUNC_m(GetMediumBySlot);
    
    for (UInt32_t i(0); i < a_medSeq.length(); i++ ) {
        log_DBG_m(dbg_DETAIL,"a_slot "<< ipc_Log::LogSlot(a_slot));
        log_DBG_m(dbg_DETAIL,"medium "<< ipc_Log::LogMedium(a_medSeq[i]));

        if (   (strcmp(a_slot.slotAddr, a_medSeq[i].slotAddr) == 0)
            && (a_slot.slotType == a_medSeq[i].slotType)
            && (strcmp(a_slot.libraryName, a_medSeq[i].libraryName) == 0)) {

            return a_medSeq[i];
        }
    };

    throw ivd_Error(
        ie_RMDB_ERROR,
        "Slot has status rmdb_SLOT_IN_USE, "
        "but there is no medium assigned to it!");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void i_ManagementInterface_i::GetMediumInfo ( const i_Medium_t a_medium,
ui_ResultPacker a_uires,
ui_BitFlag  a_flags 
) [private]

Definition at line 51 of file i_mif_medium.cpp.

References i_Medium_t::barcode, bf_MedBarcode, bf_MedBlockSize, bf_MedCurrentVolume, bf_MedDrvName, bf_MedDSSName, bf_MedIdxOfSysVol, bf_MedKey, bf_MedLibName, bf_MedLocation, bf_MedNumOfVolumes, bf_MedPartitionName, bf_MedPoolName, bf_MedSerialNo, bf_MedSizeOfSysVol, bf_MedSlotAddr, bf_MedSlotType, bf_MedStatus, bf_MedType, i_Medium_t::blockSize, i_Medium_t::currentVolume, dbg_DETAIL, i_Medium_t::diskSubsysName, i_Medium_t::driveName, i_Medium_t::idxOfSysVol, ui_ResultPacker::Insert(), ipc_EXEC_m, ui_BitFlag::IsFlagSet(), i_Medium_t::libraryName, i_Medium_t::location, log_DBG_m, log_FUNC_m, m_rm, i_Medium_t::mediaPoolName, i_Medium_t::mediumKey, i_Medium_t::mediumSerialNo, i_Medium_t::mediumType, ms_FREE, ms_UNINITIALIZED, mt_AIT_5_WORM, mt_DISK, mt_LTO_2, mt_LTO_3_WORM, mt_LTO_4_WORM, mt_LTO_5_WORM, mt_LTO_6_WORM, mt_SAIT_1, mt_UNKNOWN, i_Medium_t::numOfVolumes, i_Medium_t::partitionName, i_Medium_t::sizeOfSysVol, i_Medium_t::slotAddr, i_Medium_t::slotType, i_Medium_t::status, uialign_RIGHT, uires_MEDIATYPE, uires_MEDIUMSTATUS, and uires_SLOTTYPE.

Referenced by ListMedia(), and ListSingleMedium().

                                                            {

    log_FUNC_m(GetMediumInfo);

    if (a_flags.IsFlagSet(bf_MedBarcode))
        a_uires.Insert(a_medium.barcode);

    if (a_flags.IsFlagSet(bf_MedType)) {
        a_uires.Insert(uires_MEDIATYPE,
                       a_medium.mediumType);
    }

    if (a_flags.IsFlagSet(bf_MedPoolName))
        a_uires.Insert(a_medium.mediaPoolName);

    if (a_flags.IsFlagSet(bf_MedLibName))
        a_uires.Insert(a_medium.libraryName);

    if (a_flags.IsFlagSet(bf_MedSlotAddr))
        a_uires.Insert(a_medium.slotAddr);

    if (a_flags.IsFlagSet(bf_MedSlotType))
        a_uires.Insert(uires_SLOTTYPE,
                       a_medium.slotType);

    if (a_flags.IsFlagSet(bf_MedDSSName))
        a_uires.Insert(a_medium.diskSubsysName);

    if (a_flags.IsFlagSet(bf_MedDrvName))
        a_uires.Insert(a_medium.driveName);

    if (a_flags.IsFlagSet(bf_MedStatus)) {

        if (a_medium.status == 0) {
            ipc_EXEC_m(
                i_MediumVolSeq_t_var mv;
                mv = m_rm->SelectAllMediumVolByBarcode(a_medium.barcode);
                if (mv->length() > 0 ) {
                    a_uires.Insert(uires_MEDIUMSTATUS, ms_FREE);
                }
                else {
                    a_uires.Insert(uires_MEDIUMSTATUS, ms_UNINITIALIZED);
                }
            );
        }
        else {
            a_uires.Insert(uires_MEDIUMSTATUS, a_medium.status);
        }
    }

    if (a_flags.IsFlagSet(bf_MedLocation)) {

        ostringstream sstr;
        bool inLib(strlen(a_medium.libraryName) > 0);
        bool inDrv(strlen(a_medium.driveName) > 0);

        if (inLib || inDrv) {
            if (inDrv) {
                sstr << "drv:" << a_medium.driveName;
                if (inLib)
                    sstr << " (";
            }
            if (inLib) {
                sstr << "lib:" << a_medium.libraryName << ":"
                     << a_medium.slotAddr;
            }
            if (inDrv)
                sstr << ")";

            a_uires.Insert(sstr.str());
        }
        else if ( strlen(a_medium.location) > 0 ) {
            a_uires.Insert(a_medium.location);
        }
        else if ( a_medium.mediumType == mt_DISK)
            a_uires.Insert("n/a");
        else if ( a_medium.mediumType == mt_UNKNOWN)
            a_uires.Insert("n/a");
        else
            a_uires.Insert("offline");

    }

    if (a_flags.IsFlagSet(bf_MedSerialNo))
        a_uires.Insert(a_medium.mediumSerialNo);

    if (a_flags.IsFlagSet(bf_MedBlockSize))
        a_uires.Insert(a_medium.blockSize);

    if (a_flags.IsFlagSet(bf_MedNumOfVolumes))
        a_uires.Insert(a_medium.numOfVolumes);

    if (a_flags.IsFlagSet(bf_MedIdxOfSysVol)) {
        if ((a_medium.mediumType == mt_SAIT_1)      ||
            (a_medium.mediumType == mt_AIT_5)       ||
            (a_medium.mediumType == mt_AIT_5_WORM)  ||
            (a_medium.mediumType == mt_LTO_1)       ||
            (a_medium.mediumType == mt_LTO_2)       ||
            (a_medium.mediumType == mt_LTO_3)       ||
            (a_medium.mediumType == mt_LTO_3_WORM)  ||
            (a_medium.mediumType == mt_LTO_4)       ||
            (a_medium.mediumType == mt_LTO_4_WORM)  ||
            (a_medium.mediumType == mt_LTO_5)       ||
            (a_medium.mediumType == mt_LTO_5_WORM)  ||
            (a_medium.mediumType == mt_LTO_6)       ||
            (a_medium.mediumType == mt_LTO_6_WORM)  ||
            (a_medium.mediumType == mt_DISK) ) {
            a_uires.Insert("n/a", uialign_RIGHT);
        } else {
            a_uires.Insert(a_medium.idxOfSysVol);
        }
    }

    if (a_flags.IsFlagSet(bf_MedSizeOfSysVol)) {
        if ((a_medium.mediumType == mt_SAIT_1)      ||
            (a_medium.mediumType == mt_AIT_5)       ||
            (a_medium.mediumType == mt_AIT_5_WORM)  ||
            (a_medium.mediumType == mt_LTO_1)       ||
            (a_medium.mediumType == mt_LTO_2)       ||
            (a_medium.mediumType == mt_LTO_3)       ||
            (a_medium.mediumType == mt_LTO_3_WORM)  ||
            (a_medium.mediumType == mt_LTO_4)       ||
            (a_medium.mediumType == mt_LTO_4_WORM)  ||
            (a_medium.mediumType == mt_LTO_5)       ||
            (a_medium.mediumType == mt_LTO_5_WORM)  ||
            (a_medium.mediumType == mt_LTO_6)       ||
            (a_medium.mediumType == mt_LTO_6_WORM)  ||
            (a_medium.mediumType == mt_DISK)        ||
            (a_medium.idxOfSysVol == 0)) {

            a_uires.Insert("n/a", uialign_RIGHT);
        } else {
            a_uires.Insert(a_medium.sizeOfSysVol);
        }
    }

    if (a_flags.IsFlagSet(bf_MedCurrentVolume)) {
        log_DBG_m(dbg_DETAIL, "med.currentVolume:" << a_medium.currentVolume);
        if (a_medium.currentVolume == -1) {
            a_uires.Insert("n/a");
        } else {
            a_uires.Insert(a_medium.currentVolume);
        }

    }

    if (a_flags.IsFlagSet(bf_MedPartitionName))
        a_uires.Insert(a_medium.partitionName);

    if (a_flags.IsFlagSet(bf_MedKey))
        a_uires.Insert(a_medium.mediumKey);



} // i_ManagementInterface_i::GetMediumInfo()

Here is the call graph for this function:

Here is the caller graph for this function:

i_MediumVol_t * i_ManagementInterface_i::GetMediumVolume ( const char *  a_barcode,
CORBA::Long  a_volNum 
)

Definition at line 192 of file i_mif_mediumvol.cpp.

References log_FUNC_A_m, and m_rm.

Referenced by GetMediumVolumeByUUID().

                                                                    {
    log_FUNC_A_m(GetMediumVolume, "a_barcode:" << a_barcode <<
                                  " a_volNum:" << a_volNum);
    return m_rm->SelectMediumVol(a_barcode, a_volNum);
}

Here is the caller graph for this function:

i_MediumVol_t * i_ManagementInterface_i::GetMediumVolumeByUUID ( const char *  a_uuid  ) 

Definition at line 201 of file i_mif_mediumvol.cpp.

References GetMediumVolume(), log_FUNC_A_m, and m_rm.

                                                                                {

    log_FUNC_A_m(GetMediumVolume, "a_uuid:" << a_uuid);
    return m_rm->SelectMediumVolByUUID(a_uuid);
}

Here is the call graph for this function:

i_Partition_t * i_ManagementInterface_i::GetPartition ( const char *  a_name  ) 

Definition at line 808 of file i_mif_partition.cpp.

References i_Partition_t::fsMountpoint, mif_PartMgr::GetPart(), GetPartitionStatus(), ipc_EXEC_m, log_FUNC_m, m_partMgr, m_rm, and i_Partition_t::status.

                                                                        {
    log_FUNC_m(GetPartition);

    i_Partition_t* part;
    ipc_EXEC_m(
               part = m_rm->SelectPartition(a_name);
    );

    mif_PartEntry pe = m_partMgr.GetPart(a_name);
    ivd_PartitionActivity_e partActivity;
    string partMntPoint;
    ivd_PartitionStatus_e   partStatus = GetPartitionStatus(pe, partMntPoint, part->status, partActivity);
    // Note that part->status and other values are filled in the RMDB query above.
    // see also bugs 7570 and 7641 for details

    part->fsMountpoint = CORBA::string_dup(partMntPoint.c_str());
    return part;
}

Here is the call graph for this function:

i_Partition_t * i_ManagementInterface_i::GetPartitionByUUID ( const char *  a_uuid  ) 

Definition at line 828 of file i_mif_partition.cpp.

References log_FUNC_m, and m_rm.

                                                                              {
    log_FUNC_m(GetPartitionByUUID);
    return m_rm->SelectPartitionByUUID(a_uuid);
}

ivd_PartitionStatus_e i_ManagementInterface_i::GetPartitionStatus ( mif_PartEntry a_pe,
string &  a_mtPoint,
UInt32_t  a_rmdbPartStatus,
ivd_PartitionActivity_e a_activity 
) [private]

Definition at line 64 of file i_mif_partition.cpp.

References dbg_DETAIL, dbg_NORM, ivd_BaseException::GetError(), GetPartitionStatus(), ipc_EXEC_m, log_DBG_m, log_FUNC_m, mif_PartEntry::m_iPM, mif_PartEntry::m_partName, mif_PartEntry::m_partStatus, mps_Disabled, mps_Online, mps_Stopped, and rmdb_PARTITION_REORG_SCAN_INPROG.

          {
    log_FUNC_m(GetPartitionStatus);

    ivd_PartitionStatus_e  status = ps_UNKNOWN;
    a_mtPoint = "<not mounted>";
    a_activity = pa_UNKNOWN;

    bool recovery(false);
    // first check if it is mounted
    switch (a_pe.m_partStatus) {
        case mps_Online:
            {
                try {
                    ipc_EXEC_m(
                        if (a_pe.m_iPM->RecoveryMode()) {
                            status = ps_RECOVERYMODE;
                            recovery = true;
                            a_activity = pa_RECOVERYINPROG;
                        }
                        else if (a_pe.m_iPM->RecoveryNeeded()) {
                            status = ps_RECOVERYMODE;
                            recovery = true;
                            a_activity = pa_RECOVERYPENDING;
                        }
                    );
                    if (recovery == true) {
                        return status;
                    }
                }
                catch (const ivd_Error &e) {
                    // such case should not happen
                    log_DBG_m(dbg_DETAIL, "PM not running. Error: " << e);
                    status = ps_ERROR;
                    a_mtPoint = "<unknown>";
                    a_activity = pa_NOPM;
                    return status;
                }
                i_HSM_var iHSM;

                try {
                    ipc_EXEC_m(iHSM = a_pe.m_iPM->GetHSM(););
                }
                catch (const ivd_Error &e) {
                    if (e.GetError() == ie_LOST_HSM){
                        status = ps_ERROR;
                        a_mtPoint = "<HSM unreachable>";
                        a_activity = pa_HSMUNREACHABLE;
                        return status;
                    }
                    else {
                        log_DBG_m(dbg_DETAIL, "Error while getting a reference to HSM. Error: " << e);
                        a_mtPoint = "<unknown>";
                        return status;
                    }
                }

                if ( CORBA::is_nil(iHSM) ) {
                    log_DBG_m(dbg_NORM, "MIF: HSM for partition "
                                << a_pe.m_partName << " not running.");
                    status = ps_READY;
                    if (a_rmdbPartStatus & rmdb_PARTITION_REORG_SCAN_INPROG) {
                        a_activity = pa_REORGSCANINPROG;
                    }
                    else {
                        a_activity = pa_IDLE;
                    }
                }
                else {
                    i_HsmInfo_t_var hsmInfo;
                    try {
                        ipc_EXEC_m(iHSM->GetInfo(hsmInfo););
                        status = ps_MOUNTED;
                        if (a_rmdbPartStatus & rmdb_PARTITION_REORG_SCAN_INPROG) {
                            a_activity = pa_REORGSCANINPROG;
                        }
                        else {
                            i_JobList_t *jobs = a_pe.m_iPM->GetAllJobs();
                            if (jobs->length() == 0) {
                                a_activity = pa_IDLE;
                            }
                            else {
                                a_activity = pa_JOBSRUNNING;
                            }
                        }
                        a_mtPoint = hsmInfo->mountPoint;
                    }
                    catch (ivd_Error &e) {
                        log_DBG_m(dbg_NORM, e);
                        status = ps_READY;
                        a_activity = pa_MOUNTINPROG;
                        a_mtPoint = "n/a";
                    }
                }
            }
        break;

        case mps_Disabled:
            status = ps_DISABLED;
            a_activity = pa_NOPM;
            break;

        case mps_Stopped:
            status = ps_ERROR;
            a_activity = pa_NOPM;
            break;

    }
    return status;
} // i_ManagementInterface_i::GetPartitionStatus()

Here is the call graph for this function:

ivd_PartitionStatus_e i_ManagementInterface_i::GetPartitionStatus ( mif_PartEntry a_pe,
string &  a_mtPoint 
) [private]

Definition at line 54 of file i_mif_partition.cpp.

Referenced by GetPartition(), GetPartitionStatus(), ListPartitions(), PartitionStatus(), ReportAllPartitions(), and SystemStatus().

      {
    UInt32_t rmdbPartStatus(0);
    ivd_PartitionActivity_e activity;
    return GetPartitionStatus(a_pe, a_mtPoint, rmdbPartStatus, activity);
}

Here is the caller graph for this function:

i_MediaPool_t * i_ManagementInterface_i::GetPool ( const char *  a_name  ) 

Definition at line 162 of file i_mif_pool.cpp.

References log_FUNC_A_m, and m_rm.

                                                                  {
    log_FUNC_A_m(GetPool, "a_name:" << a_name);
    return m_rm->SelectMediaPool(a_name);
}

i_Slot_t * i_ManagementInterface_i::GetSlot ( const char *  a_libraryName,
const char *  a_slotAddr,
CORBA::Long  a_type 
)

Definition at line 101 of file i_mif_slot.cpp.

References log_FUNC_A_m, and m_rm.

                                                             {
    log_FUNC_A_m(GetSlot,   "a_libraryName:" << a_libraryName <<
                            " a_slotAddr:" << a_slotAddr <<
                            " a_type:" << a_type);
    
    return m_rm->SelectSlot(a_slotAddr, a_libraryName, a_type);
}

i_JobID_t i_ManagementInterface_i::IVDFSRecover ( const char *  a_partName,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 1438 of file i_mif_partition.cpp.

References dbg_NORM, FSCRecover(), mif_PartMgr::GetPart(), ie_PRECONDITION, ivd_Error, log_DBG_m, log_FUNC_m, mif_PartEntry::m_iPM, m_partMgr, mif_PartEntry::m_partStatus, and mps_Online.

                                  {

    log_FUNC_m(FSCRecover);

    try {
        mif_PartEntry pe = m_partMgr.GetPart(a_partName);
        if (pe.m_partStatus != mps_Online) {
            throw ivd_Error(ie_PRECONDITION, "Partition not ready - cannot recover HSMFS.");
        }
        log_DBG_m(dbg_NORM, "MIF: HSMFS recovery started.");
        try {
            a_uims->DisplayMessage("HSMFS recovery started.");
        } catch (...) {
            //ignore
        }
        return pe.m_iPM->IVDFSRecover(a_uims);
    }
    ipc_CATCH_IVD_THROW_CORBA_m;
}

Here is the call graph for this function:

void i_ManagementInterface_i::JobInfo ( const char *  a_partName,
i_BitFlag_t  a_jobTypeMask,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 889 of file i_mif_job.cpp.

References mif_PartMgr::GetAllPart(), ui_ResultPacker::GetUIResults(), ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, jt_ADMIN, ListJobs(), log_ERR_m, log_FUNC_m, m_partMgr, mps_Online, and ui_ResultPacker::SendResults().

                                  {
    
    log_FUNC_m(JobInfo);

    try {
        bool found(false);
    
        i_UIMessageServer_var ui = i_UIMessageServer::_duplicate(a_uims);
        string partName(a_partName);
        ui_ResultPacker uires;
        if (partName.empty()){
            vector <mif_PartEntry> allPart = m_partMgr.GetAllPart();
        
            for (UInt32_t i = 0 ; i < allPart.size(); i++ ) {
                if (allPart[i].m_partStatus != mps_Online) 
                    continue; // PM not running -> no jobs
                try {
                    ipc_EXEC_m(
                        ListJobs(   allPart[i].m_partName, 
                                    a_jobTypeMask, 
                                    uires, 
                                    !found);
                    )
                }
                catch (ivd_Exception &e){
                    log_ERR_m(e);
                }
            }
            try {
                ipc_EXEC_m(
                    if ((a_jobTypeMask == 0) || (a_jobTypeMask & jt_ADMIN) != 0 ){
                        string empty("");
                        ListJobs(empty, a_jobTypeMask, uires, !found);
                    }   
                )
            }
            catch (ivd_Exception& e){
                log_ERR_m(e);
            }
        } 
        else {
            ListJobs(partName, a_jobTypeMask, uires, !found);
        }
        
        if (uires.GetUIResults().size() == 0) {
            ui->DisplayMessage("No jobs running.");
        } else {
            uires.SendResults(ui);
        }
    } 
    ipc_CATCH_IVD_THROW_CORBA_m
} //i_ManagementInterface_i::JobInfo

Here is the call graph for this function:

void i_ManagementInterface_i::JobInfoDetail ( i_JobID_t  a_jobId,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 946 of file i_mif_job.cpp.

References ui_ResultPacker::GetUIResults(), ipc_CATCH_IVD_THROW_CORBA_m, ListJob(), and log_FUNC_m.

                                                     {
    
    log_FUNC_m(JobInfoDetail);
    try {
    
        ui_ResultPacker uires;
        ListJob(a_jobId, uires);
        const vector<i_UIResult_t> &result =  uires.GetUIResults();
    
        if (!CORBA::is_nil(a_uims)) {
            i_UIMessageServer_var ui = i_UIMessageServer::_duplicate(a_uims);
            for (UInt32_t i = 0; i < result.size(); i++){
                ui->DisplayResult(result[i]);
            }
        }
    } 
    ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

i_JobID_t i_ManagementInterface_i::LimitedCheckFSCvsMedia ( const i_StringList_t a_barcodes,
const i_VolNumList_t a_volumes,
CORBA::Boolean  a_autoCorrect,
CORBA::Boolean  a_removeMissingOnMedia,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 1336 of file i_mif_partition.cpp.

References dbg_NORM, mif_PartMgr::GetPart(), ie_INVALID_ARG, ie_PRECONDITION, ipc_EXEC_m, ivd_Error, log_DBG_m, log_FUNC_m, mif_PartEntry::m_iPM, m_partMgr, mif_PartEntry::m_partStatus, m_rm, and mps_Online.

                                  {

    log_FUNC_m(LimitedCheckFSCvsIVDFS);

    try {
        i_Medium_t_var firstMedium;
        string targetPartition;
        log_DBG_m(dbg_NORM, "List of barcodes: " << a_barcodes.length());
        for (UInt32_t i = 0; i < a_barcodes.length(); i++) {
            ipc_EXEC_m(

                i_Medium_t_var medium = m_rm->SelectMedium(a_barcodes[i]);
                if (string(medium->partitionName).empty()) {
                    ostringstream sstr;
                    sstr << "Medium: " << a_barcodes[i]
                         << " does not belong to any partition.";
                    throw ivd_Error(ie_INVALID_ARG, sstr.str());
                }
                if (targetPartition.empty()) {
                    targetPartition = string(medium->partitionName);
                    firstMedium = medium;
                }
                else if (targetPartition != string(medium->partitionName)) {
                    ostringstream sstr;
                    sstr << "Medium: " << a_barcodes[i]
                         << " belongs to different partition (" <<  medium->partitionName
                         << ") then precedents (" << targetPartition << ").";
                    throw ivd_Error(ie_INVALID_ARG, sstr.str());
                }
            )
            log_DBG_m(dbg_NORM, setw(4) << i << ". " << a_barcodes[i]);
        }

        log_DBG_m(dbg_NORM, "List of volumes: " << a_volumes.length());
        for (UInt32_t i = 0; i < a_volumes.length(); i++) {
            Int32_t volNum = a_volumes[i];
            log_DBG_m(dbg_NORM, setw(4) << i << ". " << volNum);
            if (volNum > (Int32_t)firstMedium->numOfVolumes) {
                ostringstream sstr;
                sstr << "Volume number: " << volNum
                     << " is greater than number of all volumes on medium: " << firstMedium->barcode
                     << ". numOfVolumes: " << firstMedium->numOfVolumes;
                throw ivd_Error(ie_INVALID_ARG, sstr.str());
            }
            if (volNum == firstMedium->idxOfSysVol) {
                ostringstream sstr;
                sstr << "Cannot check the System Volume: " << volNum
                     << " of medium: " << firstMedium->barcode;
                throw ivd_Error(ie_INVALID_ARG, sstr.str());
            }
        }
        mif_PartEntry pe = m_partMgr.GetPart(string(firstMedium->partitionName));
        if (pe.m_partStatus != mps_Online) {
            throw ivd_Error(ie_PRECONDITION, "Partition not ready - cannot check FSC.");
        }
        return pe.m_iPM->LimitedCheckFSCvsMedia(a_barcodes, a_volumes, a_autoCorrect, a_removeMissingOnMedia, a_uims);
    }
    ipc_CATCH_IVD_THROW_CORBA_m;
} // i_ManagementInterface_i::LimitedCheckFSCvsMedia()

Here is the call graph for this function:

void i_ManagementInterface_i::ListAdminJobs ( ui_ResultPacker a_uires,
bool  printHeader 
)
void i_ManagementInterface_i::ListDriveHosts ( i_UIMessageServer_ptr  a_uims,
CORBA::Long  a_filter 
)

Definition at line 49 of file i_mif_drivehost.cpp.

References bf_DHControlDevice, bf_DHDriveName, bf_DHHost, bf_DriveHostToText(), i_DriveHost_t::controlDevice, i_DriveHost_t::driveName, g_driveHostTable, i_DriveHost_t::host, ui_ResultPacker::Insert(), ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ui_BitFlag::IsFlagSet(), log_FUNC_m, m_rm, ui_ResultPacker::NewRow(), ui_ResultPacker::SendResults(), and cmn_BitFlag_t::val.

                                                                {
    log_FUNC_m(ListDriveHosts);
    ui_BitFlag flags(a_filter);

    ui_ResultPacker result;

    try {
        result.NewRow(true);

        i_DriveHostSeq_t_var driveHostSeq;
        ipc_EXEC_m(driveHostSeq = m_rm->SelectAllDriveHosts(););

        if (driveHostSeq->length() == 0)
            return;

        UInt32_t i = 0;
        while ( g_driveHostTable[i].val != -1){ 
            if (flags.IsFlagSet(g_driveHostTable[i].val)){
                result.Insert(
                    bf_DriveHostToText(static_cast<bf_DriveHost_e>(g_driveHostTable[i].val)));
            }
            i++;
        }

        for (UInt32_t i = 0; i < driveHostSeq->length(); i++) {
            i_DriveHost_t & dh = driveHostSeq[i];

            result.NewRow();

            if (flags.IsFlagSet(bf_DHHost)){
                result.Insert(dh.host);
            }

            if (flags.IsFlagSet(bf_DHDriveName)){
                result.Insert(dh.driveName);
            }
            if (flags.IsFlagSet(bf_DHControlDevice)){
                result.Insert(dh.controlDevice);
            }

    } //for
    result.SendResults(a_uims);
    } ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

void i_ManagementInterface_i::ListDrives ( i_UIMessageServer_ptr  a_uims,
CORBA::Long  a_filter 
)

Definition at line 51 of file i_mif_drive.cpp.

References i_Drive_t::aveSeekTime, bf_DriveToText(), bf_DrvAveSeekTime, bf_DrvCapabilities, bf_DrvCleanNr, bf_DrvControlDevice, bf_DrvDataThroughput, bf_DrvFirmwareRev, bf_DrvHost, bf_DrvIndex, bf_DrvKey, bf_DrvLastClean, bf_DrvLibName, bf_DrvLoadTime, bf_DrvMediaFamily, bf_DrvMediumBarcode, bf_DrvName, bf_DrvOptions, bf_DrvProductID, bf_DrvRewindTime, bf_DrvScsiID, bf_DrvSerialNo, bf_DrvStatus, bf_DrvUnloadTime, bf_DrvUsageCount, bf_DrvVendorID, cmn_Time::c_Time2YMDhms(), i_Drive_t::capabilities, i_Drive_t::cleanNr, i_Drive_t::dataThroughput, dbg_LOW, i_Drive_t::driveIndex, i_Drive_t::driveKey, i_Drive_t::driveName, i_Drive_t::firmwareRev, g_cmn, g_driveTable, ivd_BaseException::GetError(), ui_ResultPacker::Insert(), ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ui_BitFlag::IsFlagSet(), i_Drive_t::lastClean, i_Drive_t::libraryName, i_Drive_t::loadTime, log_DBG_m, log_FUNC_m, cmn_SysInfo::m_hostName, m_rm, i_Drive_t::mediaFamily, ui_ResultPacker::NewRow(), i_Drive_t::options, i_Drive_t::productID, i_Drive_t::rewindTime, i_Drive_t::scsiID, ui_ResultPacker::SendResults(), i_Drive_t::serialNo, cmn_Global::si, i_Drive_t::status, uires_DRIVESTATUS, uires_MEDIAFAMILYTYPE, i_Drive_t::unloadTime, i_Drive_t::usageCount, cmn_BitFlag_t::val, and i_Drive_t::vendorID.

                                                                {
    log_FUNC_m(ListDrives);
/*
/mnt/ivdfs/ivddrive --list
Drive      Family      Library  Host               CtrlDev  Status   Medium
AIT_DRV1   AIT         GTL_AIT  myhost.domain.com  /dev/sg2 online   <empty>
AIT_DRV2   AIT         GTL_AIT  myhost.domain.com  /dev/sg3 in use   000012
LTO_DRV1   LTO-Ultrium GTL_LTO  myhost.domain.com  /dev/sg4 offline  <empty>
VXA_DRV1   VXA         GTL_VXA  myhost.domain.com  /dev/sg5 offline  <empty>
*/
    ui_BitFlag flags(a_filter);

    ui_ResultPacker result;

    try {
        result.NewRow(true);

        i_DriveSeq_t_var driveSeq;
        ipc_EXEC_m(driveSeq = m_rm->SelectAllDrives(););

        if (driveSeq->length() == 0)
            return;

        UInt32_t i = 0;
        while ( g_driveTable[i].val != -1) { 
            if (flags.IsFlagSet(g_driveTable[i].val)) {
                result.Insert(
                    bf_DriveToText(static_cast<bf_Drive_e>(g_driveTable[i].val)));
            }
            i++;
        }
    
        for (UInt32_t i = 0; i < driveSeq->length(); i++) {
            i_Drive_t & drv = driveSeq[i];

            result.NewRow();

            if (flags.IsFlagSet(bf_DrvName)) {
                result.Insert(drv.driveName);
            }

            if (flags.IsFlagSet(bf_DrvMediaFamily)) {
                result.Insert(uires_MEDIAFAMILYTYPE,
                              drv.mediaFamily);
            }
            if (flags.IsFlagSet(bf_DrvLibName)) {
                result.Insert(drv.libraryName);
            }

            i_DriveHost_t_var driveHost;
            bool foundHost(false);
            try {
                ipc_EXEC_m(
                    driveHost = m_rm->SelectDriveHost(
                    drv.driveName, 
                    CORBA::string_dup(g_cmn.si.m_hostName.c_str()));
                );
                foundHost = true;
            } 
            catch (ivd_Error &e) {
                if (e.GetError() == ie_RMDB_NOTFOUND ) {
                    foundHost = false;
                } 
                else {
                    log_DBG_m(dbg_LOW, e);
                    throw;
                }                
            }
            
            if (flags.IsFlagSet(bf_DrvHost)) {
                if (foundHost) {
                    result.Insert(driveHost->host);
                }
                else {
                    result.Insert("n/a");
                }
            }

            if (flags.IsFlagSet(bf_DrvControlDevice)) {
                if (foundHost) {
                    result.Insert(driveHost->controlDevice);
                }
                else {
                    result.Insert("n/a");
                }
            }        

            if (flags.IsFlagSet(bf_DrvStatus)) {
                result.Insert(uires_DRIVESTATUS, drv.status);
            }

            if (flags.IsFlagSet(bf_DrvMediumBarcode)) {
                i_Medium_t_var med;
                try {
                    ipc_EXEC_m(med = m_rm->SelectMediumByDrive(drv.driveName););
                    result.Insert(med->barcode);
                } catch (ivd_Error &e) {
                    if (e.GetError() == ie_RMDB_NOTFOUND ) {
                        result.Insert("<empty>");                    
                    } else {
                        log_DBG_m(dbg_LOW, e);
                        throw;
                    }                
                }
            }
            
            if (flags.IsFlagSet(bf_DrvVendorID)) {
                result.Insert(drv.vendorID);
            }

            if (flags.IsFlagSet(bf_DrvProductID)) {
                result.Insert(drv.productID);
            }

            if (flags.IsFlagSet(bf_DrvSerialNo)) {
                result.Insert(drv.serialNo);
            }

            if (flags.IsFlagSet(bf_DrvFirmwareRev)) {
                result.Insert(drv.firmwareRev);
            }

            if (flags.IsFlagSet(bf_DrvScsiID)) {
                result.Insert(drv.scsiID);
            }

            if (flags.IsFlagSet(bf_DrvIndex)) {
                result.Insert(drv.driveIndex);
            }

            if (flags.IsFlagSet(bf_DrvLoadTime)) {
                result.Insert(drv.loadTime);
            }

            if (flags.IsFlagSet(bf_DrvUnloadTime)) {
                result.Insert(drv.unloadTime);
            }

            if (flags.IsFlagSet(bf_DrvAveSeekTime)) {
                result.Insert(drv.aveSeekTime);
            }

            if (flags.IsFlagSet(bf_DrvRewindTime)) {
                result.Insert(drv.rewindTime);
            }

            if (flags.IsFlagSet(bf_DrvLastClean)) {
                cmn_Time timeInfo(drv.lastClean);

                result.Insert(timeInfo.c_Time2YMDhms());
            }

            if (flags.IsFlagSet(bf_DrvDataThroughput)) {
                result.Insert(drv.dataThroughput);
            }

            if (flags.IsFlagSet(bf_DrvUsageCount)) {
                result.Insert(drv.usageCount);
            }

            if (flags.IsFlagSet(bf_DrvCleanNr)) {
                result.Insert(drv.cleanNr);
            }

            if (flags.IsFlagSet(bf_DrvCapabilities)) {
                result.Insert(drv.capabilities);
            }

            if (flags.IsFlagSet(bf_DrvOptions)) {
                result.Insert(drv.options);
            }

            if (flags.IsFlagSet(bf_DrvKey)) {
                result.Insert(drv.driveKey);
            }
            
        } // for
        result.SendResults(a_uims);
    } ipc_CATCH_IVD_THROW_CORBA_m

    
}  // i_ManagementInterface_i::ListDrives()

Here is the call graph for this function:

void i_ManagementInterface_i::ListJob ( UInt64_t  a_jobId,
ui_ResultPacker a_uires 
)

Definition at line 451 of file i_mif_job.cpp.

References i_Resource_t::barcode, cmn_Num2Str(), dbg_DETAIL, dbg_LOW, dbg_NORM, i_Resource_t::driveKey, job_Manager::FindJob(), mif_PartMgr::GetAllPart(), i_Job_i::GetJob(), ie_DATA_CORRUPTION, ie_JOB_NOT_FOUND, ui_ResultPacker::Insert(), ipc_EXEC_m, ivd_Error, job_MED_PROC, job_NA, job_NOT_STARTED, job_POST_MED_PROC, job_PRE_MED_PROC, job_STARTED, js_ACTIVATING, js_FIN_PROC_MED, js_FIN_READ_FROM_MED, js_FIN_WRITE_TO_MED, js_LOADING, js_NA, js_NOT_STARTED, js_PROC_MED, js_READ_IVDFS, js_READING_FROM_MED, js_READING_FSC, js_READY, js_STARTED, js_UNKNOWN, js_UPD_CHK_FSC, js_UPD_IVDFS, js_WAITING_FOR_SRC, js_WAITING_FOR_SRC_ALLOC, js_WRITE_IVDFS, js_WRITING_TO_MED, jt_ADMIN, jt_BACKUP, jt_MAINT, jt_MIGRATION, jt_RECALL, jt_RECOVERY, jt_REORG, i_Resource_t::load, log_DBG_m, log_ERR_m, log_FUNC_m, ipc_Log::LogJobParams(), ipc_Log::LogResources(), m_jobMgr, m_partMgr, m_rm, ui_ResultPacker::MakeNewBlock(), i_Resource_t::medVolNr, mps_Online, ui_ResultPacker::NewRow(), i_Resource_t::resAssigned, i_Resource_t::resBeaStarted, i_Resource_t::resMedOpComplete, i_Resource_t::resProcessed, i_Resource_t::resRequested, cmn_Time::Time2YMDhms(), uires_JOBSTATUS, uires_JOBTYPE, and WaitingForResStatus().

Referenced by JobInfoDetail().

                                                                               {
    log_FUNC_m(ListJob);

    bool found(false);
    i_Job_var iJob;
   
    // search MIF jobs (admin) 
    try {
        ipc_EXEC_m(
            iJob = m_jobMgr.FindJob(a_jobID)->GetJob();
            found = true;
        )
    }
    catch (ivd_Exception){
        log_DBG_m(dbg_NORM, "could not find Job in  Mif:");
    }

    // search all PM jobs (mig, rcl, check, recovery) 
    if (!found){
        vector<mif_PartEntry> allPart = m_partMgr.GetAllPart();
        for (UInt32_t i = 0; i < allPart.size(); i++){
            if (allPart[i].m_partStatus != mps_Online)
                continue;

            try {
                ipc_EXEC_m(
                    iJob = allPart[i].m_iPM->GetJob(a_jobID);
                    found = true;
                )
            }
            catch (ivd_Exception){
                log_DBG_m(dbg_NORM, "could not find Job in PM:" 
                          << allPart[i].m_partName);
            }
        }
    }
    
    if (!found) {
        throw ivd_Error(ie_JOB_NOT_FOUND, 
                        "Could not find job " + cmn_Num2Str(a_jobID));
    }
    
    
    log_DBG_m(dbg_NORM, "Found job " << a_jobID);
    
    i_JobParams_var jobParam;
    ipc_EXEC_m(jobParam = iJob->GetJobParams();)

    i_ResourceList_t_var jobResources;
    ipc_EXEC_m(jobResources = iJob->GetAllResource();)

    log_DBG_m(dbg_DETAIL,"Processing Job: " << 
        ipc_Log::LogJobParams(jobParam) << 
        endl << ipc_Log::LogResources(jobResources));
    
    

    UInt32_t jobInRM(0);
    i_JobParamsSeq_t_var rmJobParams;
    try {
        ipc_EXEC_m(
            rmJobParams = m_rm->GetJob(jobParam->jobID);
            jobInRM = rmJobParams->length();
        )
    }
    catch (ivd_Exception& e) {
        log_DBG_m(dbg_LOW,e);
    }
    
    log_DBG_m(dbg_DETAIL,"Job has "  << jobParam->copies << "copies" << endl << 
                         jobInRM << " job copies waiting in RM");


    a_uires.NewRow();
    a_uires.Insert("JobID:");
    a_uires.Insert(jobParam->jobID);

    a_uires.NewRow();
    a_uires.Insert("Partition:");
    a_uires.Insert(jobParam->partName);

    a_uires.NewRow();
    a_uires.Insert("Type:");
    a_uires.Insert(uires_JOBTYPE, static_cast<ivd_JobType_e>(jobParam->jobType));

    a_uires.NewRow();
    a_uires.Insert("Priority:");
    if (jobInRM > 0){
        a_uires.Insert((Int64_t)(rmJobParams[0].jobPriority));
        log_DBG_m(dbg_DETAIL,"rmJobParams[0].jobPriority: "  << rmJobParams[0].jobPriority);
    }

    cmn_Time time = jobParam->startTime;
    a_uires.NewRow();
    a_uires.Insert("Started:");
    a_uires.Insert(time.Time2YMDhms());

    a_uires.MakeNewBlock();

    a_uires.NewRow();
    a_uires.NewRow();
    a_uires.Insert("Copy");
    a_uires.Insert("Phase");
    a_uires.Insert("Drive");
    a_uires.Insert("Medium");
    a_uires.Insert("Volume");
    a_uires.Insert("Status");
    
    //reason for waiting
                            
                            

    if  (jobParam->status == job_NOT_STARTED){
        a_uires.NewRow();
        a_uires.Insert(1L);
        a_uires.Insert(jobParam->phase + 1);
        a_uires.Insert("n/a");
        switch (jobParam->jobType){
            case(jt_MIGRATION):
            case(jt_RECALL):
                {
                    a_uires.Insert("n/a");
                    break;
                };
            case (jt_ADMIN):
                {
                    a_uires.Insert("n/a");
                    break;
                };
            default:
                {
                    a_uires.Insert("n/a");
                    break;
                };
        };
        
        a_uires.Insert("n/a");
        a_uires.Insert(uires_JOBSTATUS, js_NOT_STARTED);
    } 
    else if  (jobParam->status == job_STARTED){
        a_uires.NewRow();
        a_uires.Insert(1L);
        a_uires.Insert(jobParam->phase + 1);        
        a_uires.Insert("n/a");
        switch (jobParam->jobType){
            case(jt_MIGRATION):
                {
                    a_uires.Insert("n/a");
                    break;
                };
            case (jt_RECALL):
            case (jt_ADMIN):
                {
                    a_uires.Insert("n/a");
                    break;
                };
            default:
                {
                    a_uires.Insert("n/a");
                    break;
                };
        };
        a_uires.Insert("n/a");
        a_uires.Insert(uires_JOBSTATUS, js_STARTED);
    } 
    else if  (jobParam->status == job_PRE_MED_PROC){
        a_uires.NewRow();
        a_uires.Insert(1L);
        a_uires.Insert(jobParam->phase + 1);
        a_uires.Insert("n/a");
        a_uires.Insert("n/a");
        a_uires.Insert("n/a");
        switch (jobParam->jobType){
            case (jt_MIGRATION):
                {
                    a_uires.Insert(uires_JOBSTATUS, js_READ_IVDFS);
                    break;
                };
            case (jt_MAINT):
                {
                    a_uires.Insert(uires_JOBSTATUS, js_READING_FSC);
                    break;
                };
            case (jt_BACKUP):
            case (jt_RECALL):
            case (jt_RECOVERY):
            case (jt_ADMIN):
            case (jt_REORG):
                {
                    a_uires.Insert(uires_JOBSTATUS, js_STARTED);
                    break;
                };
            default:
                {
                    log_DBG_m(dbg_LOW, "Unknown status of Job:" << 
                        ipc_Log::LogJobParams(jobParam) );
                    a_uires.Insert(uires_JOBSTATUS, js_UNKNOWN);
                };
        }
    } else if (jobParam->status == job_MED_PROC){
        //for each resource one row
        for (UInt32_t copyNum = 0; copyNum < jobResources->length(); copyNum++) {
            a_uires.NewRow();
            a_uires.Insert(copyNum + 1);
            a_uires.Insert(jobParam->phase + 1);
            i_Resource_t& res = jobResources[copyNum];
            i_Drive_t_var drv;
            log_DBG_m(dbg_DETAIL,"Selecting drive " << res.driveKey);
            if (jobResources[copyNum].driveKey > 0){

                ipc_EXEC_m(drv = m_rm->SelectDriveByKey(res.driveKey);)
                    a_uires.Insert(drv->driveName);
            } else {
                a_uires.Insert("n/a");
            }
            if (string(res.barcode).empty()){
                a_uires.Insert("n/a");
                a_uires.Insert("n/a");
            } else {
                a_uires.Insert(res.barcode);
                a_uires.Insert(res.medVolNr);
            }

            if (!res.resRequested){
                if (jobParam->jobType == jt_ADMIN){
                    a_uires.Insert(uires_JOBSTATUS, js_WAITING_FOR_SRC_ALLOC);
                } else if (jobParam->jobType == jt_REORG){
                    a_uires.Insert(uires_JOBSTATUS, js_WAITING_FOR_SRC);
                } else if (jobParam->jobType == jt_RECALL){
                    a_uires.Insert(uires_JOBSTATUS, js_READY);
                }
                
            } else if (res.resRequested && !res.resAssigned){
                a_uires.Insert(WaitingForResStatus(jobParam, jobResources[copyNum], copyNum));
            } else if (res.load && res.resAssigned && !res.resBeaStarted && !res.resProcessed ) {
                a_uires.Insert(uires_JOBSTATUS,js_LOADING);
            } else if (!res.load && res.resAssigned && !res.resBeaStarted && !res.resProcessed ) {
                a_uires.Insert(uires_JOBSTATUS,js_READY);
            } else if (res.resAssigned && res.resBeaStarted && !res.resProcessed) {
                if (jobParam->jobType == jt_RECALL || jobParam->jobType == jt_RECOVERY ) {
                    a_uires.Insert(uires_JOBSTATUS, js_READING_FROM_MED);
                }
                else {
                    a_uires.Insert(uires_JOBSTATUS, js_ACTIVATING);
                }
            } else if ( res.resAssigned   &&
                        (res.resBeaStarted || (jobParam->jobType == jt_BACKUP)) &&
                        res.resProcessed && 
                        !res.resMedOpComplete){
                    switch (jobParam->jobType){
                        case (jt_MIGRATION):
                        case (jt_BACKUP):
                            {
                                a_uires.Insert(uires_JOBSTATUS,js_WRITING_TO_MED);
                                break;
                            };
                        case (jt_RECALL):
                        case (jt_MAINT):
                        case (jt_RECOVERY):
                            {
                                a_uires.Insert(uires_JOBSTATUS,js_READING_FROM_MED);
                                break;
                            };
                        case (jt_ADMIN):
                        case (jt_REORG):
                            {
                                a_uires.Insert(uires_JOBSTATUS,js_PROC_MED);
                                break;
                            };
                        default:
                            {
                                log_DBG_m(dbg_LOW, "Unknown status of Job:" << 
                                    ipc_Log::LogJobParams(jobParam) << 
                                    ipc_Log::LogResources(res) );
                                a_uires.Insert(uires_JOBSTATUS, js_UNKNOWN);
                            };
                    }
                } else if (res.resMedOpComplete){
                        switch (jobParam->jobType){
                            case (jt_MIGRATION):
                            case (jt_BACKUP):
                                {
                                    a_uires.Insert(uires_JOBSTATUS,js_FIN_WRITE_TO_MED);
                                    break;
                                };
                            case (jt_RECALL):
                            case (jt_MAINT):
                            case (jt_RECOVERY):
                                {
                                    a_uires.Insert(uires_JOBSTATUS, js_FIN_READ_FROM_MED);
                                    break;
                                };
                            case (jt_ADMIN):
                            case (jt_REORG):
                                {
                                    a_uires.Insert(uires_JOBSTATUS, js_FIN_PROC_MED);
                                    break;
                                };
                            default:
                                {
                                    log_ERR_m("Unhandled Job Type:" << 
                                        ipc_Log::LogJobParams(jobParam));
                                    a_uires.Insert("n/a");
                                };
                        }
                    } else if (jobParam->jobType == jt_MAINT && res.resMedOpComplete){
                        a_uires.Insert(uires_JOBSTATUS, js_FIN_READ_FROM_MED);
                    } else if (jobParam->jobType == jt_MAINT && !res.resRequested){
                        a_uires.Insert(uires_JOBSTATUS,js_NOT_STARTED);
                    } else {
                        log_DBG_m(dbg_LOW, "Unknown status of Job:" << 
                            ipc_Log::LogJobParams(jobParam) << 
                            ipc_Log::LogResources(res) );
                        a_uires.Insert(uires_JOBSTATUS, js_UNKNOWN);
                    }
        }
    } else if (jobParam->status == job_POST_MED_PROC){
        a_uires.NewRow();
        a_uires.Insert(1L);
        a_uires.Insert(jobParam->phase + 1);
        a_uires.Insert("n/a");
        a_uires.Insert("n/a");
        a_uires.Insert("n/a");

        switch (jobParam->jobType){
            case (jt_MIGRATION):
                {
                    a_uires.Insert(uires_JOBSTATUS,js_UPD_IVDFS);
                    break;
                };
            case (jt_MAINT):
            case (jt_RECOVERY):
                {
                    a_uires.Insert(uires_JOBSTATUS,js_UPD_CHK_FSC);
                    break;
                };
            case (jt_RECALL):
                {
                    a_uires.Insert(uires_JOBSTATUS,js_WRITE_IVDFS);
                    break;
                };
            case (jt_BACKUP):
            case (jt_ADMIN):
            case (jt_REORG):
            default:
                {
                    log_DBG_m(dbg_LOW, "Unknown status of Job:" << 
                        ipc_Log::LogJobParams(jobParam) );
                    a_uires.Insert(uires_JOBSTATUS,js_NA);
                };
        }
    } else if (jobParam->status == job_NA){
        log_ERR_m("Impossible status JOB, job_NA" << 
            ipc_Log::LogJobParams(jobParam));
    } else {
        throw ivd_Error(ie_DATA_CORRUPTION, "Impossible status");
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void i_ManagementInterface_i::ListJobs ( string &  a_partName,
UInt32_t  a_jobTypeMask,
ui_ResultPacker a_uires,
bool  printHeader 
)

Definition at line 85 of file i_mif_job.cpp.

References dbg_DETAIL, dbg_LOW, dbg_NORM, GetAllAdminJobs(), mif_PartMgr::GetPart(), ui_ResultPacker::GetUIResults(), ie_DATA_CORRUPTION, ie_SELECT_ERROR, ui_ResultPacker::Insert(), ipc_EXEC_m, ivd_Error, job_MED_PROC, job_NA, job_NOT_STARTED, job_POST_MED_PROC, job_PRE_MED_PROC, job_STARTED, js_ACTIVATING, js_FIN_PROC_MED, js_FIN_READ_FROM_MED, js_FIN_WRITE_TO_MED, js_LOADING, js_NA, js_NOT_STARTED, js_PROC_MED, js_READ_IVDFS, js_READING_FROM_MED, js_READING_FSC, js_READY, js_STARTED, js_UNKNOWN, js_UPD_CHK_FSC, js_UPD_IVDFS, js_WAITING_FOR_SRC, js_WRITE_IVDFS, js_WRITING_TO_MED, jt_ADMIN, jt_BACKUP, jt_MAINT, jt_MIGRATION, jt_RECALL, jt_RECOVERY, jt_REORG, i_Resource_t::load, log_DBG_m, log_ERR_m, log_FUNC_A_m, ipc_Log::LogJobParams(), ipc_Log::LogResources(), m_partMgr, m_rm, mps_Online, ui_ResultPacker::NewRow(), i_Resource_t::resAssigned, i_Resource_t::resBeaStarted, i_Resource_t::resMedOpComplete, i_Resource_t::resProcessed, i_Resource_t::resRequested, cmn_Time::Time2YMDhms(), uialign_RIGHT, uires_JOBSTATUS, uires_JOBTYPE, and WaitingForResStatus().

Referenced by JobInfo().

                                                         {
    log_FUNC_A_m(ListJobs, "a_partName:" << a_partName <<
        " a_jobTypeMask:" << a_jobTypeMask <<
        " printHeader:" << boolalpha << printHeader );

    i_JobList_t_var jobList;
    try {
        if (!a_partName.empty()) {
            ipc_EXEC_m(
                mif_PartEntry pe = m_partMgr.GetPart(a_partName);
                if (pe.m_partStatus != mps_Online) {
                    throw ivd_Error(ie_SELECT_ERROR, 
                                    "Partition Manager not running");
                }   
                jobList = pe.m_iPM->GetAllJobs();
            )
        } else {
            ipc_EXEC_m ( //get admin jobs from this==MIF
                jobList = this->GetAllAdminJobs();
            )
        }
    } catch (ivd_Exception){
        log_DBG_m(dbg_NORM, "Could not resolve PM:" << a_partName);
        throw;
    };
    
    if ( printHeader && 
        (jobList->length() > 0) && 
        (a_uires.GetUIResults().size() == 0)){

        a_uires.NewRow(true);
        a_uires.Insert("JobID");
        a_uires.Insert("Partition");
        a_uires.Insert("Type");
        a_uires.Insert("Priority");
        a_uires.Insert("Started");
        a_uires.Insert("Status");

    }
    
    log_DBG_m(dbg_DETAIL,"Found " << jobList->length() <<  " jobs running");
    
    for (UInt32_t numOfJobs = 0; numOfJobs < jobList->length(); numOfJobs++) {
        
        i_JobParams_var jobParam;
        try {
            ipc_EXEC_m(
                if (!jobList[numOfJobs]->_is_nil() && 
                    !jobList[numOfJobs]->_non_existent()){

                    jobParam = jobList[numOfJobs]->GetJobParams();
                } else {
                    log_DBG_m(dbg_DETAIL,"Job probably finished meanwhile ");
                    continue;
                }
                
            )
        }
        catch (ivd_Exception& e) {
            log_DBG_m(dbg_DETAIL,"Job probably finished meanwhile " << e);
            continue;
        }
        
        i_ResourceList_t_var jobResources;
        try {
            ipc_EXEC_m(jobResources = jobList[numOfJobs]->GetAllResource();)
        }
        catch (ivd_Exception& e) {
            log_DBG_m(dbg_DETAIL,"Job probably finished meanwhile " << e);
            continue;
        }

        log_DBG_m(dbg_DETAIL,"Processing Job: " <<
                            ipc_Log::LogJobParams(jobParam)<< endl <<
                            ipc_Log::LogResources(jobResources));

        if  ((a_jobTypeMask == 0) || (a_jobTypeMask | jobParam->jobType) ) {
            
            i_JobParamsSeq_t_var rmJobParams;
            UInt32_t jobInRM(0);
            try {
                ipc_EXEC_m( rmJobParams = m_rm->GetJob(jobParam->jobID););
                jobInRM = rmJobParams->length();
            }
            catch (ivd_Exception& e) {
                log_DBG_m(dbg_LOW,e);
            }
            
            log_DBG_m(dbg_DETAIL,"Job has "  << jobParam->copies << 
                                    " copies" << endl << 
                                    jobInRM << " job copies waiting in RM");

            UInt32_t countJobWaitRes = 0;

            if (jobParam->status == job_MED_PROC){
                //for each resource one row
                for (UInt32_t copyNum = 0; copyNum < jobResources->length(); copyNum++) {
                    i_Resource_t& res = jobResources[copyNum];
                    a_uires.NewRow();
                    a_uires.Insert(jobParam->jobID);
                    a_uires.Insert(jobParam->partName);
                    a_uires.Insert(uires_JOBTYPE, jobParam->jobType);

                    if (!res.resRequested && jobParam->jobType == jt_ADMIN){
                        a_uires.Insert("n/a", uialign_RIGHT);
                        cmn_Time time = jobParam->startTime;
                        a_uires.Insert(time.Time2YMDhms());
                        a_uires.Insert(uires_JOBSTATUS, js_WAITING_FOR_SRC);
                        continue;
                    }
                    if (!res.resRequested && jobParam->jobType == jt_REORG){
                        a_uires.Insert("n/a", uialign_RIGHT);
                        cmn_Time time = jobParam->startTime;
                        a_uires.Insert(time.Time2YMDhms());
                        a_uires.Insert(uires_JOBSTATUS, js_WAITING_FOR_SRC);
                        continue;
                    }
                    if (!res.resRequested && jobParam->jobType == jt_MAINT){
                        a_uires.Insert("n/a", uialign_RIGHT);
                        cmn_Time time = jobParam->startTime;
                        a_uires.Insert(time.Time2YMDhms());
                        a_uires.Insert(uires_JOBSTATUS, js_WAITING_FOR_SRC);
                        continue;
                    }
                    if (!res.resRequested && jobParam->jobType == jt_RECALL){
                        a_uires.Insert("n/a", uialign_RIGHT);
                        cmn_Time time = jobParam->startTime;
                        a_uires.Insert(time.Time2YMDhms());
                        a_uires.Insert(uires_JOBSTATUS, js_READY);
                        continue;
                    }
                    if (res.resRequested && !res.resAssigned){
                        log_DBG_m(dbg_DETAIL,"Resource not assigned. Counter for waiting res " << countJobWaitRes);
                        if (countJobWaitRes < jobInRM){
                            log_DBG_m(dbg_DETAIL,"Priority of job" << 
                                rmJobParams[countJobWaitRes].jobID << 
                                "is: " << ((Int64_t)rmJobParams[countJobWaitRes].jobPriority +
                                (Int64_t)rmJobParams[countJobWaitRes].priorityModifier));

                            a_uires.Insert( (Int64_t)rmJobParams[countJobWaitRes].jobPriority +
                                            (Int64_t)rmJobParams[countJobWaitRes].priorityModifier );
                            countJobWaitRes++;
                            
                        } 
                        else {
                            a_uires.Insert("n/a", uialign_RIGHT);
                            log_DBG_m(dbg_LOW,
                                "Found more Jobs with unassigned " <<
                                "resources than job waiting in RM" <<
                                ipc_Log::LogJobParams(jobParam) << endl <<
                                ipc_Log::LogResources(jobResources))
                        }
                        cmn_Time time = jobParam->startTime;
                        a_uires.Insert(time.Time2YMDhms());
                        a_uires.Insert(WaitingForResStatus(jobParam, res, copyNum));
                       
                    } else if (res.load && res.resAssigned && !res.resBeaStarted && !res.resProcessed ) {
                        a_uires.Insert("n/a", uialign_RIGHT);
                        cmn_Time time = jobParam->startTime;
                        a_uires.Insert(time.Time2YMDhms());
                        a_uires.Insert(uires_JOBSTATUS, js_LOADING);
                    } else if (!res.load && res.resAssigned && !res.resBeaStarted && !res.resProcessed ) {
                        a_uires.Insert("n/a", uialign_RIGHT);
                        cmn_Time time = jobParam->startTime;
                        a_uires.Insert(time.Time2YMDhms());
                        a_uires.Insert(uires_JOBSTATUS, js_READY);
                    } else if (res.resAssigned && res.resBeaStarted && !res.resProcessed) {
                        a_uires.Insert("n/a", uialign_RIGHT);
                        cmn_Time time = jobParam->startTime;
                        a_uires.Insert(time.Time2YMDhms());
                        if (jobParam->jobType == jt_RECALL || jobParam->jobType == jt_RECOVERY) {
                            a_uires.Insert(uires_JOBSTATUS, js_READING_FROM_MED);
                        }
                        else {
                            a_uires.Insert(uires_JOBSTATUS, js_ACTIVATING);
                        }
                    } else if ( res.resAssigned   &&
                               (res.resBeaStarted || (jobParam->jobType == jt_BACKUP))  &&
                                res.resProcessed && 
                               !res.resMedOpComplete){
                        a_uires.Insert("n/a", uialign_RIGHT);
                        cmn_Time time = jobParam->startTime;
                        a_uires.Insert(time.Time2YMDhms());
                        switch (jobParam->jobType){
                            case (jt_MIGRATION):
                            case (jt_BACKUP):
                                {
                                    a_uires.Insert(uires_JOBSTATUS, js_WRITING_TO_MED);
                                    break;
                                };
                            case (jt_RECALL):
                            case (jt_RECOVERY):
                                {
                                    a_uires.Insert(uires_JOBSTATUS, js_READING_FROM_MED);
                                    break;
                                };
                            case (jt_ADMIN):
                            case (jt_REORG):
                            case (jt_MAINT):
                                {
                                    a_uires.Insert(uires_JOBSTATUS, js_PROC_MED);
                                    break;
                                };
                            default:
                                {
                                    log_DBG_m(dbg_LOW, "Unknown status of Job:" << 
                                        ipc_Log::LogJobParams(jobParam) << 
                                        ipc_Log::LogResources(res) );
                                    a_uires.Insert(uires_JOBSTATUS, js_UNKNOWN);
                                };
                        }
                    } else if ( res.resMedOpComplete){
                        a_uires.Insert("n/a", uialign_RIGHT);
                        cmn_Time time = jobParam->startTime;
                        a_uires.Insert(time.Time2YMDhms());
                        switch (jobParam->jobType){
                            case (jt_MIGRATION):
                            case (jt_BACKUP):
                                {
                                    a_uires.Insert(uires_JOBSTATUS, js_FIN_WRITE_TO_MED);
                                    break;
                                };
                            case (jt_RECALL):
                            case (jt_MAINT):
                            case (jt_RECOVERY):
                                {
                                    a_uires.Insert(uires_JOBSTATUS, js_FIN_READ_FROM_MED);
                                    break;
                                };
                            case (jt_ADMIN):
                            case (jt_REORG):
                                {
                                    a_uires.Insert(uires_JOBSTATUS, js_FIN_PROC_MED);
                                    break;
                                };
                            default:
                                {
                                    log_DBG_m(dbg_LOW, "Unknown status of Job:" << 
                                        ipc_Log::LogJobParams(jobParam) << 
                                        ipc_Log::LogResources(res) );
                                    a_uires.Insert(uires_JOBSTATUS, js_UNKNOWN);
                                };
                        }
                    } else if (jobParam->jobType == jt_MAINT && res.resMedOpComplete){
                        a_uires.Insert("n/a", uialign_RIGHT);
                        cmn_Time time = jobParam->startTime;
                        a_uires.Insert(time.Time2YMDhms());
                        a_uires.Insert(uires_JOBSTATUS, js_FIN_READ_FROM_MED);
                    } else if (jobParam->jobType == jt_MAINT && !res.resRequested){
                        a_uires.Insert("n/a", uialign_RIGHT);
                        cmn_Time time = jobParam->startTime;
                        a_uires.Insert(time.Time2YMDhms());
                        a_uires.Insert(uires_JOBSTATUS, js_NOT_STARTED);
                    } else {
                        log_DBG_m(dbg_LOW, "Unknown status of Job:" << 
                                    ipc_Log::LogJobParams(jobParam) << 
                                    ipc_Log::LogResources(res) );
                        
                        a_uires.Insert("n/a", uialign_RIGHT);
                        cmn_Time time = jobParam->startTime;
                        a_uires.Insert(time.Time2YMDhms());
                        a_uires.Insert(uires_JOBSTATUS, js_UNKNOWN);
                    }
                }
            } else {
                //just one row if medium processing completed
                a_uires.NewRow();
                a_uires.Insert(jobParam->jobID);
                a_uires.Insert(jobParam->partName);
                a_uires.Insert(uires_JOBTYPE, jobParam->jobType);
                a_uires.Insert("n/a", uialign_RIGHT);
                cmn_Time time = jobParam->startTime;
                a_uires.Insert(time.Time2YMDhms());
                
                if (jobParam->status == job_NOT_STARTED) {
                    a_uires.Insert(uires_JOBSTATUS, js_NOT_STARTED);
                }
                else if (jobParam->status == job_STARTED) {
                    a_uires.Insert(uires_JOBSTATUS, js_STARTED);
                }
                else if (jobParam->status == job_PRE_MED_PROC) {
                    switch (jobParam->jobType) {
                        case (jt_MIGRATION):
                            {
                                a_uires.Insert(uires_JOBSTATUS, js_READ_IVDFS);
                                break;
                            };
                        case (jt_MAINT):
                            {
                                a_uires.Insert(uires_JOBSTATUS, js_READING_FSC);
                                break;
                            };
                        case (jt_BACKUP):
                        case (jt_RECALL):
                        case (jt_RECOVERY):
                        case (jt_ADMIN):
                        case (jt_REORG):
                            {
                                a_uires.Insert(uires_JOBSTATUS, js_STARTED);
                                break;
                            };
                        default:
                            {
                                log_DBG_m(dbg_LOW, "Unknown status of Job:" << 
                                    ipc_Log::LogJobParams(jobParam));
                                a_uires.Insert(uires_JOBSTATUS, js_UNKNOWN);
                            };
                    }
                }
                else if (jobParam->status == job_POST_MED_PROC) {
                    switch (jobParam->jobType) {
                        case (jt_MIGRATION):
                            {
                                a_uires.Insert(uires_JOBSTATUS, js_UPD_IVDFS);
                                break;
                            };
                        
                        case (jt_RECALL):
                            {
                                a_uires.Insert(uires_JOBSTATUS, js_WRITE_IVDFS);
                                break;
                            }
                        case (jt_MAINT):
                        case (jt_RECOVERY):
                            {
                                a_uires.Insert(uires_JOBSTATUS, js_UPD_CHK_FSC);
                                break;
                            }
                        case (jt_BACKUP):
                        case (jt_ADMIN):
                            {
                                log_DBG_m(dbg_LOW, "Unknown status of Job:" << 
                                    ipc_Log::LogJobParams(jobParam) );
                                a_uires.Insert(uires_JOBSTATUS, js_UNKNOWN);
                                break;
                            }
                        default:
                            {
                                log_DBG_m(dbg_LOW, "Unknown status of Job:" << 
                                    ipc_Log::LogJobParams(jobParam) );
                                a_uires.Insert(uires_JOBSTATUS,js_UNKNOWN);
                                break;
                            }
                    }
                    
                }
                else if (jobParam->status == job_NA) {
                    log_ERR_m("Impossible status JOB, job_NA" << 
                                ipc_Log::LogJobParams(jobParam));
                    a_uires.Insert(uires_JOBSTATUS, js_NA);
                }
                else {
                    throw ivd_Error(ie_DATA_CORRUPTION, "Impossible status");
                }
            }
        } //job in mask
    }//for all jobs
}

Here is the call graph for this function:

Here is the caller graph for this function:

void i_ManagementInterface_i::ListLibraries ( i_UIMessageServer_ptr  a_uims,
CORBA::Long  a_filter 
)

Definition at line 224 of file i_mif_library.cpp.

References i_Library_t::auditTime, bf_LibAuditTime, bf_LibCapabilities, bf_LibControlDevice, bf_LibFirmwareRev, bf_LibHost, bf_LibKey, bf_LibLoadNr, bf_LibMediaAccessTime, bf_LibMediaFamily, bf_LibMediaXChgTime, bf_LibName, bf_LibOptions, bf_LibProductID, bf_LibraryToText(), bf_LibScsiID, bf_LibSerialNo, bf_LibStatus, bf_LibType, bf_LibUnloadNr, bf_LibVendorID, cmn_Time::c_Time2YMDhms(), i_Library_t::capabilities, i_Library_t::controlDevice, i_Library_t::firmwareRev, g_libraryTable, i_Library_t::host, ie_MIF_LA_PROBLEM, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ui_BitFlag::IsFlagSet(), ivd_Error, i_Library_t::libraryKey, i_Library_t::libraryName, i_Library_t::libraryType, i_Library_t::loadNr, log_FUNC_m, ls_ERROR, ls_ONLINE, m_rm, i_Library_t::mediaAccessTime, i_Library_t::mediaFamily, i_Library_t::mediaXChgTime, i_Library_t::options, i_Library_t::productID, ipc_Corba::ResolveLA(), rmdb_INIT_LIBRARY_STATUS, i_Library_t::scsiID, i_Library_t::serialNo, i_Library_t::status, uires_LIBRARYSTATUS, uires_LIBRARYTYPE, uires_MEDIAFAMILYTYPE, i_Library_t::unloadNr, cmn_BitFlag_t::val, and i_Library_t::vendorID.

                                                    {
    log_FUNC_m(ListLibraries);

    ui_BitFlag flags(a_filter);

    try {
        i_LibrarySeq_t_var librarySeq;
        ipc_EXEC_m(librarySeq = m_rm->SelectAllLibraries(););
        
        ui_ResultPacker result;

        if (librarySeq->length() > 0) {
            result.NewRow(true);

            UInt32_t i = 0;
            while ( g_libraryTable[i].val != -1) { 
                if (flags.IsFlagSet(g_libraryTable[i].val)) {
                    result.Insert(bf_LibraryToText(
                         static_cast<bf_Library_e>(g_libraryTable[i].val)
                                                  ));
                }
                i++;
            }
        }

        for (UInt32_t i = 0; i < librarySeq->length(); i++) {
            i_Library_t & lib = librarySeq[i];
            
            result.NewRow();
            
            if (flags.IsFlagSet(bf_LibName)) {
                result.Insert(lib.libraryName);
            }
            
            if (flags.IsFlagSet(bf_LibMediaFamily)) {
                result.Insert(uires_MEDIAFAMILYTYPE, lib.mediaFamily);
            }

            if (flags.IsFlagSet(bf_LibType)) {
                result.Insert(uires_LIBRARYTYPE, lib.libraryType);
            }

            if (flags.IsFlagSet(bf_LibHost)) {
                result.Insert(lib.host);
            }

            if (flags.IsFlagSet(bf_LibControlDevice)) {
                result.Insert(lib.controlDevice);
            }

            if (flags.IsFlagSet(bf_LibStatus)) {
                if (lib.status & rmdb_INIT_LIBRARY_STATUS) {
                    try {
                        i_LibraryAgent_var la;
                        ipc_EXEC_m(
                            CORBA::Object_var obj = 
                            ipc_Corba::ResolveLA(string(lib.host),
                                                    string(lib.libraryName),
                                                    false);
                            la = i_LibraryAgent::_narrow(obj);
                        );
                        if (la->_is_nil() || la->_non_existent()) {
                            throw ivd_Error(ie_MIF_LA_PROBLEM);
                        }
                        result.Insert(uires_LIBRARYSTATUS, ls_ONLINE);
                    } 
                    catch(ivd_Exception) {
                        result.Insert(uires_LIBRARYSTATUS, ls_ERROR);
                    }
                }
                else {
                    result.Insert(uires_LIBRARYSTATUS, lib.status);
                }
            }

            if (flags.IsFlagSet(bf_LibProductID)) {
                result.Insert(lib.productID);
            }

            if (flags.IsFlagSet(bf_LibSerialNo)) {
                result.Insert(lib.serialNo);
            }

            if (flags.IsFlagSet(bf_LibVendorID)) {
                result.Insert(lib.vendorID);
            }

            if (flags.IsFlagSet(bf_LibFirmwareRev)) {
                result.Insert(lib.firmwareRev);
            }

            if (flags.IsFlagSet(bf_LibScsiID)) {
                result.Insert(lib.scsiID);
            }

            if (flags.IsFlagSet(bf_LibAuditTime)) {
                cmn_Time timeInfo(lib.auditTime);

                result.Insert(timeInfo.c_Time2YMDhms());
            }

            if (flags.IsFlagSet(bf_LibMediaAccessTime)) {
                cmn_Time timeInfo(lib.mediaAccessTime);

                result.Insert(timeInfo.c_Time2YMDhms());
            }

            if (flags.IsFlagSet(bf_LibMediaXChgTime)) {
                cmn_Time timeInfo(lib.mediaXChgTime);

                result.Insert(timeInfo.c_Time2YMDhms());
            }

            if (flags.IsFlagSet(bf_LibLoadNr)) {
                result.Insert(lib.loadNr);
            }

            if (flags.IsFlagSet(bf_LibUnloadNr)) {
                result.Insert(lib.unloadNr);
            }

            if (flags.IsFlagSet(bf_LibCapabilities)) {
                result.Insert(lib.capabilities);
            }

            if (flags.IsFlagSet(bf_LibOptions)) {
                result.Insert(lib.options);
            }

            if (flags.IsFlagSet(bf_LibKey)) {
                result.Insert(lib.libraryKey);
            }

        } //for
        result.SendResults(a_uims);
    } ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

void i_ManagementInterface_i::ListMedia ( i_UIMessageServer_ptr  a_uims,
CORBA::Long  a_filter 
)

Definition at line 210 of file i_mif_medium.cpp.

References bf_MediumToText(), g_mediumTable, GetMediumInfo(), ui_ResultPacker::Insert(), ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ui_BitFlag::IsFlagSet(), log_FUNC_m, m_rm, ui_ResultPacker::NewRow(), ui_ResultPacker::SendResults(), and cmn_BitFlag_t::val.

                                                            {
    log_FUNC_m(ListMedia);

    ui_BitFlag  flags(a_filter);

    try {
        ui_ResultPacker result;

        i_MediumSeq_t_var medList;
        ipc_EXEC_m(medList = m_rm->SelectAllMedia();)

        // write a header
        if (medList->length() > 0) {
            result.NewRow(true);

            UInt32_t i = 0;
            while ( g_mediumTable[i].val != -1 ) {
                if (flags.IsFlagSet(g_mediumTable[i].val)) {
                    result.Insert(bf_MediumToText(static_cast<bf_Medium_e>(g_mediumTable[i].val)));
                }
                i++;
            }
        }

        for (UInt32_t i = 0; i < medList->length(); ++i) {
            i_Medium_t& med = medList[i];
            result.NewRow();

            GetMediumInfo (med, result, flags);
        }
        result.SendResults(a_uims);

    } ipc_CATCH_IVD_THROW_CORBA_m
} // ::ListMedia()

Here is the call graph for this function:

void i_ManagementInterface_i::ListMediumVolumes ( const char *  a_barcode,
i_UIMessageServer_ptr  a_uims,
CORBA::Long  a_filter 
)

Definition at line 45 of file i_mif_mediumvol.cpp.

References bf_MediaVolToText(), bf_MVAccessNr, bf_MVAccessTime, bf_MVAvailable, bf_MVBarcode, bf_MVInitTime, bf_MVLastVerification, bf_MVNr, bf_MVOwriteNr, bf_MVOwriteTime, bf_MVSize, bf_MVStatus, bf_MVTotalData, bf_MVType, bf_MVUsed, bf_MVUUID, bf_MVValidData, bf_MVWriteNr, bf_MVWriteTime, cmn_Time::c_Time2YMDhms(), dbg_DETAIL, g_mediaVolTable, ui_ResultPacker::Insert(), ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ui_BitFlag::IsFlagSet(), log_DBG_m, log_FUNC_m, ipc_Log::LogMediumVol(), m_rm, ui_ResultPacker::NewRow(), rmdb_MEDVOL_FULL, ui_ResultPacker::SendResults(), uires_VOLTYPE, uires_VOLUMESTATUS, and cmn_BitFlag_t::val.

                                                                    {
    log_FUNC_m(ListMediumVolumes);

    ui_BitFlag  flags(a_filter);

    try {
        ui_ResultPacker result;

        i_MediumVolSeq_t_var medVolList;
        ipc_EXEC_m(
            if (string(a_barcode).empty()) {
                medVolList = m_rm->SelectAllMediumVol();
            } else {
                medVolList = m_rm->SelectAllMediumVolByBarcode(a_barcode);
            }
        )

        if (medVolList->length() == 0){
            ostringstream msg;
            
            if (string(a_barcode).empty()) {
                msg << "No initialized volumes found.";
            } else {
                msg << "No initialized volumes found for medium " << a_barcode << ".";
            }
            
            a_uims->DisplayError(msg.str().c_str());
            return;
        }

        // write a header
        if (medVolList->length() > 0) {
            
            result.NewRow(true);

            UInt32_t i = 0;
            while ( g_mediaVolTable[i].val != -1 ) {
                if (flags.IsFlagSet(g_mediaVolTable[i].val)) {
                    result.Insert(bf_MediaVolToText(static_cast<bf_MediaVol_e>(g_mediaVolTable[i].val)));
                }
                i++;
            }
        }

        for (UInt32_t i = 0; i < medVolList->length(); i++) {
            log_DBG_m(dbg_DETAIL, "Volume: " << 
                ipc_Log::LogMediumVol(medVolList[i]));
            result.NewRow();

            if (flags.IsFlagSet(bf_MVBarcode)) {
                result.Insert(medVolList[i].mediumBarcode);
            }

            if (flags.IsFlagSet(bf_MVNr)) {
                result.Insert(medVolList[i].medVolNr);
            }

            if (flags.IsFlagSet(bf_MVUUID)) {
                result.Insert(medVolList[i].medVolId);
            }

            if (flags.IsFlagSet(bf_MVType)) {
                result.Insert(uires_VOLTYPE,
                              medVolList[i].volType);
            }

            if (flags.IsFlagSet(bf_MVSize)) {
                result.Insert(medVolList[i].volSize);
            }

            if (flags.IsFlagSet(bf_MVAvailable)) {
                Int32_t avail(0);

                if (!(medVolList[i].status & rmdb_MEDVOL_FULL)) {
                    avail = (medVolList[i].volSize * (100L - medVolList[i].volUsed)) / 100;
                }

                result.Insert(avail);
            }

            if (flags.IsFlagSet(bf_MVUsed)) {
                result.Insert(medVolList[i].volUsed);
            }

            if (flags.IsFlagSet(bf_MVStatus)) {
                result.Insert(uires_VOLUMESTATUS, medVolList[i].status);
            }

            if (flags.IsFlagSet(bf_MVAccessNr)) {
                result.Insert(medVolList[i].accessNr);
            }

            if (flags.IsFlagSet(bf_MVWriteNr)) {
                result.Insert(medVolList[i].writeNr);
            }

            if (flags.IsFlagSet(bf_MVOwriteNr)) {
                result.Insert(medVolList[i].owriteNr);
            }

            if (flags.IsFlagSet(bf_MVInitTime)) {
                cmn_Time timeInfo(medVolList[i].initTime);

                result.Insert(timeInfo.c_Time2YMDhms());
            }

            if (flags.IsFlagSet(bf_MVAccessTime)) {
                cmn_Time timeInfo(medVolList[i].accessTime);

                result.Insert(timeInfo.c_Time2YMDhms());
            }

            if (flags.IsFlagSet(bf_MVWriteTime)) {
                cmn_Time timeInfo(medVolList[i].writeTime);

                result.Insert(timeInfo.c_Time2YMDhms());
            }

            if (flags.IsFlagSet(bf_MVOwriteTime)) {
                cmn_Time timeInfo(medVolList[i].owriteTime);

                result.Insert(timeInfo.c_Time2YMDhms());
            }

            if (flags.IsFlagSet(bf_MVLastVerification)) {
                cmn_Time timeInfo(medVolList[i].lastVerification);

                result.Insert(timeInfo.c_Time2YMDhms());
            }
            
            if (flags.IsFlagSet(bf_MVValidData)) {
                result.Insert(medVolList[i].validData);
            }
            
            if (flags.IsFlagSet(bf_MVTotalData)) {
                result.Insert(medVolList[i].totalData);
            }
        } // for (UInt32_t i = 0; ...)

        result.SendResults(a_uims);

    } ipc_CATCH_IVD_THROW_CORBA_m
} // i_ManagementInterface_i::ListMediumVolumes()

Here is the call graph for this function:

void i_ManagementInterface_i::ListPartitions ( i_UIMessageServer_ptr  a_uims,
CORBA::Long  a_filter 
)

Definition at line 180 of file i_mif_partition.cpp.

References bf_Activity, bf_PartFsHost, bf_PartFsID, bf_PartFsMountpoint, bf_PartFsType, bf_PartitionToText(), bf_PartMigIdCount, bf_PartMigIdTime, bf_PartName, bf_PartOptions, bf_PartStatus, bf_PartUUID, g_partitionTable, mif_PartMgr::GetAllPart(), GetPartitionStatus(), ui_ResultPacker::Insert(), ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ui_BitFlag::IsFlagSet(), log_FUNC_m, mif_PartEntry::m_partHost, m_partMgr, mif_PartEntry::m_partName, mif_PartEntry::m_partUUID, m_rm, ui_ResultPacker::NewRow(), ui_ResultPacker::SendResults(), uires_FSTYPE, uires_PARTITIONACTIVITY, uires_PARTITIONOPTIONS, uires_PARTITIONSTATUS, and cmn_BitFlag_t::val.

                                                                 {
    log_FUNC_m(ListPartitions);

    ui_BitFlag  flags(a_filter);

    try {
        ui_ResultPacker result;

        vector<mif_PartEntry> allPart = m_partMgr.GetAllPart();

        if ( !allPart.empty() ) {
            result.NewRow(true);

            UInt32_t i = 0;
            while ( g_partitionTable[i].val != -1 ) {
                if (flags.IsFlagSet(g_partitionTable[i].val)) {
                    result.Insert(bf_PartitionToText(static_cast<bf_Partition_e>(g_partitionTable[i].val)));
                }
                i++;
            }
        }

        for (UInt32_t i = 0; i < allPart.size(); ++i) {
            mif_PartEntry& part = allPart[i];

            i_Partition_t_var rmPart;
            ipc_EXEC_m(
                rmPart = m_rm->SelectPartition(part.m_partName.c_str());
            );

            string partMntPoint;
            ivd_PartitionActivity_e partActivity;
            ivd_PartitionStatus_e   partStatus = GetPartitionStatus(part, partMntPoint, rmPart->status, partActivity);

            result.NewRow();

            if (flags.IsFlagSet(bf_PartName))
                result.Insert(part.m_partName);

            if (flags.IsFlagSet(bf_PartUUID))
                result.Insert(part.m_partUUID);

            if (flags.IsFlagSet(bf_PartStatus))
                result.Insert(uires_PARTITIONSTATUS, static_cast<const UInt64_t>(partStatus));

            if (flags.IsFlagSet(bf_PartFsHost))
                result.Insert(part.m_partHost);

            if (flags.IsFlagSet(bf_PartFsMountpoint))
                result.Insert(partMntPoint);

            if (flags.IsFlagSet(bf_PartFsID))
                result.Insert(rmPart->fsID);

            if (flags.IsFlagSet(bf_PartFsType))
                result.Insert(uires_FSTYPE, rmPart->options);

            if (flags.IsFlagSet(bf_PartOptions))
                result.Insert(uires_PARTITIONOPTIONS, rmPart->options);

            if (flags.IsFlagSet(bf_PartMigIdTime))
                result.Insert(rmPart->migIdTime);

            if (flags.IsFlagSet(bf_PartMigIdCount))
                result.Insert(rmPart->migIdCount);

            if (flags.IsFlagSet(bf_Activity))
                result.Insert(uires_PARTITIONACTIVITY, static_cast<const UInt64_t>(partActivity));
        }

        result.SendResults(a_uims);
    } ipc_CATCH_IVD_THROW_CORBA_m

}  // i_ManagementInterface_i::ListPartitions()

Here is the call graph for this function:

void i_ManagementInterface_i::ListPools ( i_UIMessageServer_ptr  a_uims,
CORBA::Long  a_filter 
)

Definition at line 51 of file i_mif_pool.cpp.

References bf_MediaPoolToText(), bf_MPBlockSize, bf_MPKey, bf_MPMaxMediaAge, bf_MPMaxNrReadWrite, bf_MPMediaFamily, bf_MPName, bf_MPNumOfVolumes, bf_MPPartitionName, bf_MPPartUUID, bf_MPSizeOfSysVol, bf_MPSizeOfVolume, bf_MPSysVolLocation, bf_MPType, bf_MPUUID, i_MediaPool_t::blockSize, g_mediaPoolTable, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ui_BitFlag::IsFlagSet(), log_FUNC_m, m_rm, i_MediaPool_t::maxMediaAge, i_MediaPool_t::maxNrReadWrite, i_MediaPool_t::mediaFamily, i_MediaPool_t::mediaPoolKey, i_MediaPool_t::mediaPoolName, i_MediaPool_t::mediaPoolType, mf_DISK, i_MediaPool_t::numOfVolumes, i_MediaPool_t::partitionUUIDString, i_MediaPool_t::poolUUIDString, i_MediaPool_t::sizeOfSysVol, i_MediaPool_t::sizeOfVolume, i_MediaPool_t::sysVolLocation, uialign_LEFT, uialign_RIGHT, uires_MEDIAFAMILYTYPE, uires_MEDIAPOOLTYPE, uires_NA, uires_SYSVOLLOCATION, and cmn_BitFlag_t::val.

                                                            {
    log_FUNC_m(ListPools);

    ui_BitFlag  flags(a_filter);

    try {
        i_MediaPoolSeq_t_var poolSeq;
        ipc_EXEC_m(poolSeq = m_rm->SelectAllMediaPools(););

        ui_ResultPacker result;

        // write a header
        if (poolSeq->length() > 0) {
            result.NewRow(true);

            UInt32_t i = 0;
            while ( g_mediaPoolTable[i].val != -1 ) {
                if (flags.IsFlagSet(g_mediaPoolTable[i].val)) {
                    result.Insert(bf_MediaPoolToText(static_cast<bf_MediaPool_e>(g_mediaPoolTable[i].val)));
                }
                i++;
            }
        }

        for (UInt32_t i = 0; i < poolSeq->length(); i++) {
            i_MediaPool_t & pool = poolSeq[i];

            result.NewRow();

            if (flags.IsFlagSet(bf_MPName))
                result.Insert(pool.mediaPoolName);

            if (flags.IsFlagSet(bf_MPUUID))
                result.Insert(pool.poolUUIDString);

            if (flags.IsFlagSet(bf_MPMediaFamily))
                result.Insert(uires_MEDIAFAMILYTYPE,
                              pool.mediaFamily);

            if (flags.IsFlagSet(bf_MPType))
                result.Insert(uires_MEDIAPOOLTYPE,
                              static_cast<ivd_PoolType_e>(pool.mediaPoolType));

            if (flags.IsFlagSet(bf_MPPartitionName)) {

                i_PartSeq_t_var partSeq;
                string partUUID(pool.partitionUUIDString);
                string partName("n/a");
                partSeq = m_rm->SelectAllPartition();
                for (UInt32_t i = 0; i < partSeq->length(); i++) {
                    if (partUUID.compare(partSeq[i].partitionUUIDString) == 0) {
                        partName = partSeq[i].partitionName;
                        break;
                    }
                }

                result.Insert(partName, uialign_LEFT);
            }

            if (flags.IsFlagSet(bf_MPPartUUID))
                result.Insert(pool.partitionUUIDString);

            if (flags.IsFlagSet(bf_MPMaxMediaAge))
                result.Insert(pool.maxMediaAge);

            if (flags.IsFlagSet(bf_MPMaxNrReadWrite))
                result.Insert(pool.maxNrReadWrite);

            if (flags.IsFlagSet(bf_MPBlockSize))
                result.Insert(pool.blockSize/1024);

            if (flags.IsFlagSet(bf_MPNumOfVolumes))
                result.Insert(pool.numOfVolumes);

            if (flags.IsFlagSet(bf_MPSizeOfVolume)) {
                if (pool.mediaFamily == mf_DISK) {
                    result.Insert(pool.sizeOfVolume);
                }
                else {
                    result.Insert(uires_NA,
                                  0,
                                  uialign_RIGHT);
                }
            }


            if (flags.IsFlagSet(bf_MPSysVolLocation))
                result.Insert(uires_SYSVOLLOCATION,
                              pool.sysVolLocation);

            if (flags.IsFlagSet(bf_MPSizeOfSysVol)) {
                if (static_cast<ivd_SysVolLocation_e>(pool.sysVolLocation) ==
                    svl_NONE)
                    result.Insert(uires_NA,
                                   0,
                                   uialign_RIGHT);
                else
                    result.Insert(pool.sizeOfSysVol);
            }

            if (flags.IsFlagSet(bf_MPKey))
                result.Insert(pool.mediaPoolKey);

        } // for
        result.SendResults(a_uims);
    } ipc_CATCH_IVD_THROW_CORBA_m

}  // i_ManagementInterface_i::ListPools()

Here is the call graph for this function:

void i_ManagementInterface_i::ListSingleMedium ( const char *  a_barcode,
i_UIMessageServer_ptr  a_uims,
CORBA::Long  a_filter 
)

Definition at line 246 of file i_mif_medium.cpp.

References bf_MediumToText(), dbg_LOW, dbg_NORM, g_mediumTable, ivd_BaseException::GetError(), GetMediumInfo(), ui_ResultPacker::Insert(), ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ui_BitFlag::IsFlagSet(), log_DBG_m, log_FUNC_m, m_rm, ui_ResultPacker::NewRow(), ui_ResultPacker::SendResults(), and cmn_BitFlag_t::val.

                                                            {
    log_FUNC_m(ListSingleMedium);

    ui_BitFlag flags(a_filter);

    try {
        ui_ResultPacker result;
        i_Medium_t* medium;
        ostringstream  msg;

        try {
            ipc_EXEC_m(medium = m_rm->SelectMedium(a_barcode);)
        } catch (ivd_Exception &e) {
            log_DBG_m(dbg_NORM, e);
            if (e.GetError() == ie_RMDB_NOTFOUND) {
                msg << "Medium does not exist.";
                log_DBG_m(dbg_LOW,msg.str());
                a_uims->DisplayError(msg.str().c_str());
                return;
            }
            else {
                throw;
            }
        }
        // write a header
        result.NewRow(true);

        UInt32_t i = 0;
        while ( g_mediumTable[i].val != -1 ) {
            if (flags.IsFlagSet(g_mediumTable[i].val)) {
                result.Insert(bf_MediumToText(static_cast<bf_Medium_e>(g_mediumTable[i].val)));
            }
            i++;
        }

        result.NewRow();

        GetMediumInfo (*medium, result, flags);
        result.SendResults(a_uims);

    } ipc_CATCH_IVD_THROW_CORBA_m
} // ::ListSingleMedium()

Here is the call graph for this function:

void i_ManagementInterface_i::ListSlots ( i_UIMessageServer_ptr  a_uims,
CORBA::Long  a_filter 
)

Definition at line 47 of file i_mif_slot.cpp.

References bf_SlotToText(), bf_SltAddr, bf_SltKey, bf_SltLibName, bf_SltStatus, bf_SltType, g_slotTable, ui_ResultPacker::Insert(), ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ui_BitFlag::IsFlagSet(), i_Slot_t::libraryName, log_FUNC_m, m_rm, ui_ResultPacker::NewRow(), ui_ResultPacker::SendResults(), i_Slot_t::slotAddr, i_Slot_t::slotKey, i_Slot_t::slotType, i_Slot_t::status, uires_SLOTSTATUS, uires_SLOTTYPE, and cmn_BitFlag_t::val.

                                                                                        {
    log_FUNC_m(ListSlots);
    ui_BitFlag flags(a_filter);

    ui_ResultPacker result;

    try {
        result.NewRow(true);

        i_SlotSeq_t_var slotSeq;
        ipc_EXEC_m(slotSeq = m_rm->SelectAllSlots(););

        if (slotSeq->length() == 0)
            return;

        UInt32_t i = 0;
        while ( g_slotTable[i].val != -1) { 
            if (flags.IsFlagSet(g_slotTable[i].val)) {
                result.Insert(
                    bf_SlotToText(static_cast<bf_Slot_e>(g_slotTable[i].val)));
            }
            i++;
        }

        for (UInt32_t i = 0; i < slotSeq->length(); i++) {
            i_Slot_t & slot = slotSeq[i];

            result.NewRow();

            if (flags.IsFlagSet(bf_SltKey)) {
                result.Insert(slot.slotKey);
            }

            if (flags.IsFlagSet(bf_SltLibName)) {
                result.Insert(slot.libraryName);
            }

            if (flags.IsFlagSet(bf_SltAddr)) {
                result.Insert(slot.slotAddr);
            }

            if (flags.IsFlagSet(bf_SltType)) {
                result.Insert(uires_SLOTTYPE, slot.slotType);
            }

            if (flags.IsFlagSet(bf_SltStatus)) {
                result.Insert(uires_SLOTSTATUS, slot.status);
            }

        } //for
        result.SendResults(a_uims);
    } ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

void i_ManagementInterface_i::MakeInventoryHeader ( ui_ResultPacker a_uires  ) 

Definition at line 214 of file i_mif_library.cpp.

References ui_ResultPacker::Insert(), log_FUNC_m, and ui_ResultPacker::NewRow().

Referenced by ShowLibraryInventory().

                                                                          {
    log_FUNC_m(MakeInventoryHeader);
    a_uires.NewRow(true);
    a_uires.Insert("Name");
    a_uires.Insert("Type");
    a_uires.Insert("Status");
    a_uires.Insert("Medium");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void i_ManagementInterface_i::MarkMediumGood ( const char *  a_barcode  ) 

Definition at line 750 of file i_mif_medium.cpp.

References ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, log_WriteEvent(), m_rm, and rmdb_MEDIUM_UNUSABLE.

                                                                  {
    log_FUNC_m(MarkMediumGood);

    try {
        UInt32_t status(0);
        status = rmdb_MEDIUM_UNUSABLE | rmdb_MEDIUM_UNRELIABLE;
        m_rm->MediumStatusClear(a_barcode, status);

        ostringstream msg;
        msg << "Medium marked good." ;
        log_WriteEvent(msg.str(), "MEDIUM", 0, string(a_barcode));
    }
    ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

void i_ManagementInterface_i::MarkMediumOffline ( const char *  a_barcode  ) 

Definition at line 766 of file i_mif_medium.cpp.

References ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, log_WriteEvent(), and m_rm.

                                                                     {
    log_FUNC_m(MarkMediumOffline);

    try {
        UInt32_t status(0);
        status = rmdb_MEDIUM_OFFLINE;

        m_rm->MediumStatusSet(a_barcode, status);

        ostringstream msg;
        msg << "Medium marked offline." ;
        log_WriteEvent(msg.str(), "MEDIUM", 0, string(a_barcode));
    }
    ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

void i_ManagementInterface_i::MarkMediumOnline ( const char *  a_barcode  ) 

Definition at line 783 of file i_mif_medium.cpp.

References ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, log_WriteEvent(), and m_rm.

                                                                    {
    log_FUNC_m(MarkMediumOnline);

    try {
        UInt32_t statusClear(0);
        statusClear = rmdb_MEDIUM_OFFLINE;
        m_rm->MediumStatusClear(a_barcode, statusClear);

        ostringstream msg;
        msg << "Medium marked online." ;
        log_WriteEvent(msg.str(), "MEDIUM", 0, string(a_barcode));
    }
    ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

void i_ManagementInterface_i::MarkMediumUnreliable ( const char *  a_barcode  ) 

Definition at line 729 of file i_mif_medium.cpp.

References ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, log_WriteEvent(), and m_rm.

                                                                        {
    log_FUNC_m(MarkMediumUnreliable);

    try {
        UInt32_t status(0);
        status = rmdb_MEDIUM_UNRELIABLE;

        m_rm->MediumStatusSet(a_barcode, status);

        UInt32_t statusClear(0);
        statusClear = rmdb_MEDIUM_UNUSABLE;
        m_rm->MediumStatusClear(a_barcode, statusClear);

        ostringstream msg;
        msg << "Medium marked unreliable." ;
        log_WriteEvent(msg.str(), "MEDIUM", 0, string(a_barcode));
    }
    ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

void i_ManagementInterface_i::MarkMediumUnusable ( const char *  a_barcode  ) 

Definition at line 709 of file i_mif_medium.cpp.

References ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, log_WriteEvent(), and m_rm.

                                                                      {
    log_FUNC_m(MarkMediumUnusable);

    try {
        UInt32_t status(0);
        status = rmdb_MEDIUM_UNUSABLE;
        m_rm->MediumStatusSet(a_barcode, status);

        UInt32_t statusClear(0);
        statusClear = rmdb_MEDIUM_UNRELIABLE;
        m_rm->MediumStatusClear(a_barcode, statusClear);

        ostringstream msg;
        msg << "Medium marked unusable." ;
        log_WriteEvent(msg.str(), "MEDIUM", 0, string(a_barcode));
    }
    ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

i_Count_t i_ManagementInterface_i::MigrateFile ( const char *  a_clientHost,
const char *  a_fsID,
const i_StringList_t a_files,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 301 of file i_mif_file.cpp.

References dbg_DETAIL, ie_NO_HSM, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, iPM, ivd_Error, log_DBG_m, log_FUNC_A_m, and ipc_Corba::ResolvePMByFSID().

                                                                     {

    log_FUNC_A_m(MigrateFile,
        "Client: " << a_clientHost << ", FSID:" << a_fsID <<
        " #files:" << a_files.length());

    try {
        i_PartitionManager_var iPM;

        CORBA::Object_var obj = ipc_Corba::ResolvePMByFSID(
                         string(a_clientHost), string(a_fsID), false);
        iPM = i_PartitionManager::_narrow(obj);

        ipc_EXEC_m (
            log_DBG_m(dbg_DETAIL,"Resolving HSM");
            i_HSM_var iHSM = iPM->GetHSM();
            if (CORBA::is_nil(iHSM))
                throw ivd_Error(ie_NO_HSM, "Partition not mounted or no valid HSM reference.");

            return iHSM->ForceMigration(a_files, a_uims);
        );

    } ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

void i_ManagementInterface_i::Mount ( const char *  host,
const char *  a_fileUUID,
const char *  a_mountPoint 
)

Definition at line 50 of file i_mif_fs.cpp.

References dbg_DETAIL, evt_ERROR, i_IVD, ie_EXECUTION_ERROR, ipc_EXEC_m, ivd_Error, log_DBG_m, log_FUNC_m, log_WriteEvent(), cmn_Path::RemoveTrailingPathSeparator(), and ipc_Corba::ResolveSvc().

                                                               {

    log_FUNC_m(Mount);
    
    try {
        i_Service_var svc;

    string host (a_host);
    cmn_Path mountPoint(a_mountPoint);
    cmn_Path fileUUID(a_fileUUID);

    mountPoint.RemoveTrailingPathSeparator();
    fileUUID.RemoveTrailingPathSeparator();
    
        try {
            CORBA::Object_var obj = ipc_Corba::ResolveSvc(host.c_str());
            svc = i_Service::_narrow(obj);
        }
        catch (...) {
            string sstr("Cannot resolve client " + host + ". Probably disconnected.");
            log_WriteEvent(evt_ERROR, sstr);
            throw;
        }

        i_StringList_t argSequence;
        argSequence.length(3);
        argSequence[0] = CORBA::string_dup("--mount");


        argSequence[1] = CORBA::string_dup(mountPoint.c_str());
        argSequence[2] = CORBA::string_dup(fileUUID.c_str());


        log_DBG_m(dbg_DETAIL, " Mounting hsmfs on host " << host
                        << " mount point " << mountPoint
                        << " fileSystem ID " << fileUUID);
        int ret(0);
        ipc_EXEC_m(
            ret = svc->Execute(i_IVD, argSequence);
        );
        
        if (ret != 0) {
            log_DBG_m(dbg_DETAIL, "Mount failed.");
            ostringstream msg;
            msg
                << "Mount failed. Exit status was: " << ret << ".";
            throw ivd_Error(ie_EXECUTION_ERROR, msg.str(), true); 
        };
    }
    ipc_CATCH_IVD_THROW_CORBA_m;
}

Here is the call graph for this function:

void i_ManagementInterface_i::PartitionReorgStat ( const char *  a_name,
CORBA::ULong  a_threshold,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 1497 of file i_mif_partition.cpp.

References dbg_DETAIL, mif_PartMgr::GetPart(), ui_ResultPacker::Insert(), ipc_EXEC_m, log_DBG_m, log_FUNC_m, ipc_Log::LogMediumVol(), m_partMgr, m_rm, i_MediumVol_t::mediumBarcode, i_MediumVol_t::medVolNr, ui_ResultPacker::NewRow(), rmdb_MEDVOL_FULL, rmdb_MEDVOL_REORG_SCANNED, rmdb_MEDVOL_USED, rmdb_SYSTEM_VOLUME, ui_ResultPacker::SendResults(), i_MediumVol_t::status, i_MediumVol_t::totalData, uialign_RIGHT, i_MediumVol_t::validData, and i_MediumVol_t::volType.

                                                                               {
    log_FUNC_m(PartitionReorgStat);

    try {
        mif_PartEntry pe = m_partMgr.GetPart(a_name);

        ui_ResultPacker        result;
        i_MediumSeqByVol_t_var allMedVol;
        ipc_EXEC_m(
            allMedVol = m_rm->SelectAllMediumVolByPart(a_name);
        );
        if (allMedVol->length() > 0) {
            // insert header
            result.NewRow(true);
            result.Insert("Barcode");
            result.Insert("VolNum");
            result.Insert("ValidData[MB]");
            result.Insert("Total[MB]");
            result.Insert("SlackSpace[%]");
        }

        for (UInt32_t i = 0; i < allMedVol->length(); i++) {
            for (UInt32_t j = 0; j < allMedVol[i].length(); j++) {

                i_MediumVol_t & mv = allMedVol[i][j];
                log_DBG_m(dbg_DETAIL, ipc_Log::LogMediumVol(mv));

                if (mv.volType == rmdb_SYSTEM_VOLUME) {
                    // do not consider system volume
                    continue;
                }
                if (!(mv.status & (rmdb_MEDVOL_USED | rmdb_MEDVOL_FULL))) {
                    // do not consider empty volume
                    continue;
                }

                UInt32_t slackSpace(0);

                if ((mv.totalData > 0) &&
                    (mv.status & rmdb_MEDVOL_REORG_SCANNED)) {
                    // calculate slackspace only on scanned volumes

                    double temp(mv.validData);
                    slackSpace = 100 -
                        static_cast<UInt32_t>( (100 * temp) / mv.totalData );
                }

                if (slackSpace < a_threshold) {
                    // do not write this to output
                    continue;
                }

                // insert row
                result.NewRow();
                result.Insert(mv.mediumBarcode);
                result.Insert(mv.medVolNr);

                if (mv.status & rmdb_MEDVOL_REORG_SCANNED){
                    // volume is scanned
                    result.Insert(mv.validData);
                    result.Insert(mv.totalData);
                    result.Insert(slackSpace);
                } else {
                    // volume is not scanned
                    result.Insert("n/a", uialign_RIGHT); // for validData
                    if (mv.totalData > 0) {
                        result.Insert(mv.totalData);
                    } else {
                        result.Insert("n/a", uialign_RIGHT); // for totalData
                    }
                    result.Insert("n/a", uialign_RIGHT);// slackSpace
                }
            } // for (UInt32_t j = 0; j < allMedVol[i].length(); j++)
        } // for (UInt32_t i = 0; i < allMedVol->length(); i++)

        result.SendResults(a_uims);
    }
    ipc_CATCH_IVD_THROW_CORBA_m;
} // i_ManagementInterface_i::PartitionReorgStat()

Here is the call graph for this function:

void i_ManagementInterface_i::PartitionStatus ( const char *  a_name,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 257 of file i_mif_partition.cpp.

References ivd_BaseException::GetError(), mif_PartMgr::GetPart(), GetPartitionStatus(), ui_ResultPacker::GetUIResults(), ui_ResultPacker::Insert(), ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, jt_MAINT, jt_MIGRATION, jt_RECALL, jt_RECOVERY, log_FUNC_m, mif_PartEntry::m_iPM, mif_PartEntry::m_partHost, m_partMgr, mif_PartEntry::m_partName, mif_PartEntry::m_partStatus, m_rm, mps_Online, ui_ResultPacker::NewRow(), uires_PARTITIONSTATUS, and usage().

                                                                              {
    log_FUNC_m(PartitionStatus);

    try {
        ui_ResultPacker uires;
        uires.NewRow();

        try {
            mif_PartEntry pe = m_partMgr.GetPart(a_partName);

            uires.Insert("Partition:");
            uires.Insert(pe.m_partName);
            uires.NewRow();

            string partMntPoint;
            ivd_PartitionStatus_e  partStatus = GetPartitionStatus(pe, partMntPoint);

            uires.Insert("Status:");
            uires.Insert(uires_PARTITIONSTATUS, static_cast<const UInt64_t> (partStatus));
            uires.NewRow();

            uires.Insert("Host:");
            uires.Insert(pe.m_partHost);
            uires.NewRow();

            uires.Insert("Mountpoint:");
            uires.Insert(partMntPoint);
            uires.NewRow();

            if (pe.m_partStatus == mps_Online) {
                UInt32_t numOfMigJobs(0);
                UInt32_t numOfRecJobs(0);
                UInt32_t numOfMaintJobs(0);
                UInt32_t numOfRecoveryJobs(0);

                i_JobParamsSeq_t_var jobParams;
                ipc_EXEC_m(jobParams = pe.m_iPM->GetAllJobsParam();)

                for (UInt32_t i(0); i < jobParams->length(); ++i){
                    switch (jobParams[i].jobType){
                        case(jt_MIGRATION):
                            ++numOfMigJobs;
                            break;
                        case(jt_RECALL):
                            ++numOfRecJobs;
                            break;
                        case(jt_MAINT):
                            ++numOfMaintJobs;
                            break;
                        case(jt_RECOVERY):
                            ++numOfRecoveryJobs;
                            break;
                        default: // unhandled jobType;
                            break;
                    }
                }
                uires.Insert("# of Migration Jobs:");
                uires.Insert(numOfMigJobs);
                uires.NewRow();

                uires.Insert("# of Recall Jobs:");
                uires.Insert(numOfRecJobs);
                uires.NewRow();

                uires.Insert("# of Maintenance Jobs:");
                uires.Insert(numOfMaintJobs);
                uires.NewRow();

                uires.Insert("# of Recovery Jobs:");
                uires.Insert(numOfRecoveryJobs);
                uires.NewRow();
            }
        }
        catch (ivd_Exception& e){
            if (e.GetError() == ie_MIF_PARTITION_MGR) {
                ostringstream msg;
                msg << "Could not find partition " << a_partName;
                a_uims->DisplayError(msg.str().c_str());
                return;
            }
            else
                throw;
        }

        // send results
        vector<i_UIResult_t> result = uires.GetUIResults();
        for (UInt32_t i = 0; i < result.size(); i++){
            ipc_EXEC_m(a_uims->DisplayResult(result[i]);)
        }
    }
    ipc_CATCH_IVD_THROW_CORBA_m

    // Get pool information for partition
    try {
        i_PoolInfoSeq_t_var poolInfo;
        ipc_EXEC_m(poolInfo = m_rm->PoolInfo(a_partName);)

        if (poolInfo->length() == 0) {
            // nothing found
            ipc_EXEC_m(
                a_uims->DisplayWarning(
                "No pools or media assigned to partition.");
            )
            return;
        }

        ui_ResultPacker uires;
        uires.NewRow(true); // header
        uires.Insert("Pool");

        uires.Insert("Size[MB]");
        uires.Insert("Avail[MB]");
        uires.Insert("Used[%]");

        uires.Insert("SysSize[MB]");
        uires.Insert("SysAvail[MB]");
        uires.Insert("SysUsed[%]");

        uires.Insert("#Good");
        uires.Insert("#Unreliable");
        uires.Insert("#Unusable");
        uires.Insert("#Offline");
        uires.Insert("#Uninit");

        for (UInt32_t i = 0; i < poolInfo->length(); ++i ){
            uires.NewRow();
            uires.Insert(poolInfo[i].poolName);

            uires.Insert(poolInfo[i].dataSize);
            uires.Insert(poolInfo[i].dataAvailable);

            if (poolInfo[i].dataSize > 0){
                Int32_t usage =
                    static_cast<UInt32_t>(100L - (100L * poolInfo[i].dataAvailable / poolInfo[i].dataSize));

                uires.Insert(usage);
            }
            else {
                uires.Insert(0L);
            }

            uires.Insert(poolInfo[i].sysSize);
            uires.Insert(poolInfo[i].sysAvailable);

            if (poolInfo[i].sysSize > 0){
                Int32_t sysUsage =
                    static_cast<UInt32_t>(100L - (100L * poolInfo[i].sysAvailable / poolInfo[i].sysSize));
                uires.Insert(sysUsage);
            }
            else {
                uires.Insert(0L);
            }

            uires.Insert(poolInfo[i].mediaGood);
            uires.Insert(poolInfo[i].mediaUnreliable);
            uires.Insert(poolInfo[i].mediaUnusable);
            uires.Insert(poolInfo[i].mediaOffline);
            uires.Insert(poolInfo[i].mediaUninitialized);
        }

        // send results
        vector<i_UIResult_t> result = uires.GetUIResults();
        for (UInt32_t i = 0; i < result.size(); i++){
            a_uims->DisplayResult(result[i]);
        }
    }
    ipc_CATCH_IVD_THROW_CORBA_m
} // i_ManagementInterface_i::PartitionStatus()

Here is the call graph for this function:

void i_ManagementInterface_i::PoolReorgStat ( i_UIMessageServer_ptr  a_uims  ) 

Definition at line 563 of file i_mif_pool.cpp.

References ui_ResultPacker::Insert(), ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, log_FUNC_m, m_rm, ui_ResultPacker::NewRow(), rmdb_MEDVOL_REORG_SCANNED, rmdb_SYSTEM_VOLUME, ui_ResultPacker::SendResults(), and uialign_RIGHT.

                                                                        {
    log_FUNC_m(PoolReorgStat);

    try {
        ui_ResultPacker      result;
        i_MediumSeq_t_var    allMedia;
        i_MediaPoolSeq_t_var allPools;

        ipc_EXEC_m( allPools = m_rm->SelectAllMediaPools(); );
        ipc_EXEC_m( allMedia = m_rm->SelectAllMedia(); );

        // write a header
        if (allPools->length() > 0) {
            result.NewRow(true);
            result.Insert("Name");
            result.Insert("NumOfMedia");
            result.Insert("ValidData[MB]");
            result.Insert("Total[MB]");
            result.Insert("SlackSpace[%]");
        }

        i_MediumVolSeq_t_var medVols;

        for (UInt32_t i = 0; i < allPools->length(); i++) {

            UInt32_t validData(0);
            UInt32_t totalData(0);
            UInt32_t numOfMedia(0);

            // insert a new row
            result.NewRow();
            result.Insert(allPools[i].mediaPoolName);

            for (UInt32_t j = 0; j < allMedia->length(); j++) {
                if (strcmp(allPools[i].mediaPoolName, allMedia[j].mediaPoolName)) {
                    // media isn't in current pool
                    continue;
                }
                numOfMedia++;

                ipc_EXEC_m(
                    medVols =
                        m_rm->SelectAllMediumVolByBarcode(allMedia[j].barcode);
                );

                // calculate valid and total data
                for (UInt32_t k = 0; k < medVols->length(); k++) {

                    if (medVols[k].volType == rmdb_SYSTEM_VOLUME) {
                        // skip system volume
                        continue;
                    }

                    if (medVols[k].status & rmdb_MEDVOL_REORG_SCANNED) {
                        validData += medVols[k].validData;
                        totalData += medVols[k].totalData;
                    } else { // for volumes that are not scanned validData = totalData
                        validData += medVols[k].totalData;
                        totalData += medVols[k].totalData;
                    }
                }
            }

            result.Insert(numOfMedia); // NumOfMedia

            // if any media volume scanned
            if (totalData > 0) {
                result.Insert(validData);
                result.Insert(totalData);
                UInt32_t slack(0);
                if (totalData != 0) {
                    double temp(validData);
                    slack = 100 - static_cast<UInt32_t>(((100 * temp)/totalData));
                }
                result.Insert(slack);

            } else {
                result.Insert("n/a", uialign_RIGHT); // validData
                result.Insert("n/a", uialign_RIGHT); // totalData
                result.Insert("n/a", uialign_RIGHT); // slack space
            }
        }
        result.SendResults(a_uims);
    } ipc_CATCH_IVD_THROW_CORBA_m
} // i_ManagementInterface_i::PoolReorgStat()

Here is the call graph for this function:

void i_ManagementInterface_i::RecallFile ( const char *  a_clientHost,
const char *  a_fsID,
CORBA::Boolean  a_byFileName,
const i_FileList_t a_files,
i_MigID_t  a_migID,
const char *  a_into,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 226 of file i_mif_file.cpp.

References dbg_DETAIL, g_cmn, ie_NO_HSM, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, iPM, ivd_Error, log_DBG_m, log_FUNC_A_m, cmn_SysInfo::m_serverHost, ipc_Corba::ResolvePMByFSID(), ipc_Corba::ResolvePMByPartID(), and cmn_Global::si.

                                                      {

    log_FUNC_A_m(RecallFile,
        "Client: " << a_clientHost << ", FS/PartitionID:" << a_fsID <<
        " #files:" << a_files.length());

    try {
        i_PartitionManager_var iPM;

        if (a_byFileName) {
            // resolve by FS ID (request by fileName)
            ipc_EXEC_m(
                CORBA::Object_var obj = ipc_Corba::ResolvePMByFSID(
                                 string(a_clientHost), string(a_fsID), false);
                iPM = i_PartitionManager::_narrow(obj);
            );
        }
        else {
            // resolve by partition name (request by fileID)
            ipc_EXEC_m(
                CORBA::Object_var obj = ipc_Corba::ResolvePMByPartID(
                                g_cmn.si.m_serverHost, string(a_fsID), false);

                iPM = i_PartitionManager::_narrow(obj);
            );
        }

        ipc_EXEC_m (
             log_DBG_m(dbg_DETAIL,"Resolving HSM");
             i_HSM_var iHSM = iPM->GetHSM();
             if (CORBA::is_nil(iHSM))
                 throw ivd_Error(ie_NO_HSM, "Partition not mounted or no valid HSM reference.");
             iHSM->TrigRecall(a_files, a_byFileName, a_migID, a_into, a_uims);
        );

    } ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

i_JobID_t i_ManagementInterface_i::RecreateFriAndMic ( i_UIMessageServer_ptr  a_uims,
CORBA::Boolean  a_fri,
CORBA::Boolean  a_mic,
CORBA::Boolean  a_forced,
const char *  a_barcode,
const i_VolNumList_t a_volumes,
CORBA::Boolean  a_into,
const char *  a_intoPath 
)

Definition at line 576 of file i_mif_medium.cpp.

References mif_JobManager::CreateRecreateFriAndMicJob(), i_Job_i::GetJobId(), log_FUNC_m, m_jobMgr, and NULL.

                                                                               {

    log_FUNC_m(RecreateFriAndMic);

    try {
        i_AdminJob_i * iJob = m_jobMgr.CreateRecreateFriAndMicJob(
                                            a_uims,
                                            a_fri,
                                            a_mic,
                                            a_forced,
                                            a_barcode,
                                            a_volumes,
                                            a_into,
                                            a_intoPath );

        if (iJob != NULL) {
            return iJob->GetJobId();
        }
        else {
            return 0;
        }
    }
    ipc_CATCH_IVD_THROW_CORBA_m;
}

Here is the call graph for this function:

i_Count_t i_ManagementInterface_i::ReleaseFile ( const char *  a_clientHost,
const char *  a_fsID,
const i_StringList_t a_files,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 268 of file i_mif_file.cpp.

References dbg_DETAIL, ie_LOST_HSM, ie_NO_HSM, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, iPM, ivd_Error, log_DBG_m, log_FUNC_A_m, and ipc_Corba::ResolvePMByFSID().

                                  {

    log_FUNC_A_m(ReleaseFile,
        "Client: " << a_clientHost << ", FSID:" << a_fsID <<
        " #files:" << a_files.length());

    try {
        i_PartitionManager_var iPM;
        try {
            CORBA::Object_var obj = ipc_Corba::ResolvePMByFSID(
                            string(a_clientHost), string(a_fsID), false);
            iPM = i_PartitionManager::_narrow(obj);
        }
        catch(ivd_Exception) {
            throw ivd_Error(ie_LOST_HSM,
                            "Partition stopped or no valid HSM reference.");
        }

        ipc_EXEC_m (
            log_DBG_m(dbg_DETAIL,"Resolving HSM");
            i_HSM_var iHSM = iPM->GetHSM();
            if (CORBA::is_nil(iHSM) || iHSM->_non_existent())
                throw ivd_Error(ie_NO_HSM,
                        "Partition not mounted or no valid HSM reference.");

            return iHSM->ForceRelease(a_files);
        );
    } ipc_CATCH_IVD_THROW_CORBA_m
}

Here is the call graph for this function:

void i_ManagementInterface_i::Remove (  )  [virtual]

Reimplemented from i_Component_i.

Definition at line 499 of file i_mif_impl.cpp.

References dbg_LOW, ipc_EXEC_m, log_DBG_m, log_FUNC_m, m_partMgr, and mif_PartMgr::StopAllPart().

                                     {
    log_FUNC_m(Remove);

    try {
        try {
            ipc_EXEC_m(
                m_partMgr.StopAllPart();
            )
        }
        catch (ivd_Exception& e) {
            log_DBG_m(dbg_LOW,"Error when deactivating partition" << e);
        }

        //
        // Do generic cleanup.
        i_Component_i::Remove();
    }
    ipc_CATCH_IVD_THROW_CORBA_m;

} // i_ManagementInterface_i::Remove()

Here is the call graph for this function:

void i_ManagementInterface_i::RemoveDrive ( const char *  a_name  ) 

Definition at line 764 of file i_mif_drive.cpp.

References dbg_LOW, dbg_NORM, ie_RMDB_ERROR, ie_RMDB_NOTFOUND, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ivd_Error, log_DBG_m, log_ERR_m, log_FUNC_m, log_WriteEvent(), m_rm, mif_DRIVE, ipc_Corba::ResolveLA(), and rmdb_DRIVE_IN_USE.

                                                            {
    log_FUNC_m(RemoveDrive);

    try {

        //
        // check if drive is configured.
        i_Drive_t_var d;
        try {
            ipc_EXEC_m(        
                d = m_rm->SelectDrive(CORBA::string_dup(a_name));
                log_DBG_m(dbg_NORM, "MIF: Drive is configured.");
                if (d->status & rmdb_DRIVE_IN_USE)
                    throw ivd_Error(ie_RMDB_ERROR, "Drive is in use. Can not remove.");
            );
        }
        catch (ivd_Exception) {
            // TODO: RMDB could return specific error for not found
            throw ivd_Error(ie_RMDB_NOTFOUND,
                            "Drive not configured: " + string(a_name));
        }
        
        // check if medium is in drive
        i_Medium_t_var med;
        bool driveFull(false);
        try {
            ipc_EXEC_m(
                med = m_rm->SelectMediumByDrive(CORBA::string_dup(a_name) )
            );
            driveFull = true;
        } 
        catch (ivd_Exception) {
            log_DBG_m(dbg_NORM, "No medium in drive");
        }

        //
        // remove drive hosts that belong to this drive.
        i_DriveHostSeq_t_var driveHostSeq;
        ipc_EXEC_m(
            driveHostSeq = m_rm->SelectAllDriveHosts();
        );

        string host;
        if (driveHostSeq->length() > 0) {
            host = driveHostSeq[0].host;
        }
        else {
            log_ERR_m("Drive with no host defined");
            driveFull = false;
        }

        if (driveFull) {
            try {
                ipc_EXEC_m(

                    // unload medium
                    CORBA::Object_var objLA =
                        ipc_Corba::ResolveLA(host, string(d->libraryName));

                    i_LibraryAgent_var iLA = i_LibraryAgent::_narrow(objLA);

                    log_DBG_m(dbg_LOW,"LA unload");
                    iLA->Unload(
                        d->driveIndex,
                        med->slotAddr,
                        med->barcode,
                        // This job ID is used to distinguish
                        // from manual operation by using ivd_la
                        1
                    );
                );
            }
            catch (ivd_Exception &e) {
                log_ERR_m("Medium could not be unloaded." << endl << e);
                try {
                    ipc_EXEC_m(m_rm->MediumUnusable(med->mediumKey));
                    ipc_EXEC_m(m_rm->MediumUnLoaded(    d->libraryName,
                                                        med->barcode,
                                                        med->slotAddr,
                                                        med->slotType));

                    /*void MediumUnLoaded(
                        const char* a_libName, const char* a_medBarcode, 
                        const char* a_slotAddr, i_Type_t a_slotType);*/
                }
                catch (ivd_Error& e) {
                    log_ERR_m("Medium could not be marked unusable." << endl << e)
                }
            }
        }


        for (UInt32_t ct=0; ct<driveHostSeq->length(); ct++) {

            if (strcmp(driveHostSeq[ct].driveName, a_name) == 0) {
                host = driveHostSeq[ct].host;
                try {
                    ipc_EXEC_m(
                        m_rm->RemoveDriveHost(
                            CORBA::string_dup(a_name),
                            CORBA::string_dup(driveHostSeq[ct].host));
                    );
                }
                catch (ivd_Error& e) {
                    log_ERR_m("Could not remove drive host." << endl << e);
                }
            }
        }

        //
        // remove drive entry from RMDB.
        ipc_EXEC_m(
            m_rm->RemoveDrive(CORBA::string_dup(a_name));
            log_DBG_m(dbg_NORM, "MIF: Drive removed from RMDB");
        );
        //
        // remove named drive subdir from configuration repository.
        mif_CfgRep cfgHelp(mif_DRIVE, a_name);
        cfgHelp.RemoveCfg();

        log_DBG_m(dbg_NORM, "Drive configuration removed from CfgDB repository");

        ostringstream eventText;
        eventText << "Removed.";
        //
        // notify jobs in job list about changed resource
        ipc_EXEC_m(
            m_rm->UseNewResource();
        );
        log_WriteEvent(eventText.str(), "DRIVE", 0, a_name);

    }
    ipc_CATCH_IVD_THROW_CORBA_m

} // i_ManagementInterface_i::RemoveDrive()

Here is the call graph for this function:

void i_ManagementInterface_i::RemoveLibrary ( const char *  a_name  ) 

Definition at line 1167 of fil