LONG CuDlgIpmPageProcesses::OnUpdateData (WPARAM wParam, LPARAM lParam) { BOOL bOK = FALSE; CPtrList listInfoStruct; LOGPROCESSDATAMIN* pData; LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam; CString strID; CString strPID; CString strType; CString strOpenDB; CString strWrite; CString strForce; CString strWait; CString strBegin; CString strEnd; ASSERT (pUps); switch (pUps->nIpmHint) { case 0: break; default: return 0L; } try { LOGPROCESSDATAMIN structData; CdIpmDoc* pDoc = (CdIpmDoc*)wParam; ResetDisplay(); CaIpmQueryInfo queryInfo(pDoc, OT_MON_LOGPROCESS, pUps, (LPVOID)&structData, sizeof(structData)); bOK = IPM_QueryInfo (&queryInfo, listInfoStruct); if (bOK) { while (!listInfoStruct.IsEmpty()) { pData = (LOGPROCESSDATAMIN*)listInfoStruct.RemoveHead(); GetDisplayInfo (pData, strID, strPID, strType, strOpenDB, strWrite, strForce, strWait, strBegin, strEnd); AddProcess (strID, strPID, strType, strOpenDB, strWrite, strForce, strWait, strBegin, strEnd, pData); } } return 0L; } catch (CMemoryException* e) { theApp.OutOfMemoryMessage(); e->Delete(); } catch (CeIpmException e) { AfxMessageBox (e.GetReason(), MB_ICONEXCLAMATION|MB_OK); } while (!listInfoStruct.IsEmpty()) delete (LOGPROCESSDATAMIN*)listInfoStruct.RemoveHead(); return 0L; }
LONG CuDlgIpmPageLockLists::OnUpdateData (WPARAM wParam, LPARAM lParam) { BOOL bOK = FALSE; CPtrList listInfoStruct; LOCKLISTDATAMIN* pData; LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam; CString strID; CString strSession; CString strCount; CString strLogical; CString strMaxL; CString strStatus; ASSERT (pUps); switch (pUps->nIpmHint) { case 0: case FILTER_SYSTEM_LOCK_LISTS: break; default: return 0L; } try { LOCKLISTDATAMIN structData; CdIpmDoc* pDoc = (CdIpmDoc*)wParam; ResetDisplay(); CaIpmQueryInfo queryInfo(pDoc, OT_MON_LOCKLIST, pUps, (LPVOID)&structData, sizeof(structData)); bOK = IPM_QueryInfo (&queryInfo, listInfoStruct); if (bOK) { while (!listInfoStruct.IsEmpty()) { pData = (LOCKLISTDATAMIN*)listInfoStruct.RemoveHead(); GetDisplayInfo (pData, strID, strSession, strCount, strLogical, strMaxL, strStatus); AddLockList (strID, strSession, strCount, strLogical, strMaxL, strStatus, pData); } } return 0L; } catch (CMemoryException* e) { MessageBeep (-1); theApp.OutOfMemoryMessage (); e->Delete(); } catch (CeIpmException e) { AfxMessageBox (e.GetReason(), MB_ICONEXCLAMATION|MB_OK); } while (!listInfoStruct.IsEmpty()) delete (LOCKLISTDATAMIN*)listInfoStruct.RemoveHead(); return 0L; }
LONG CuDlgReplicationServerPageAssignment::OnUpdateData (WPARAM wParam, LPARAM lParam) { LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam; CPtrList listInfoStruct; switch (pUps->nIpmHint) { case 0: break; default: return 0L; } ASSERT (pUps); try { REPLICSERVERDATAMIN RepSvrdta = *((LPREPLICSERVERDATAMIN)pUps->pStruct); // // Empty the control: m_cListCtrl.DeleteAllItems(); CdIpmDoc* pIpmDoc = (CdIpmDoc*)wParam; CaIpmQueryInfo queryInfo(pIpmDoc, OT_MON_REPLIC_CDDS_ASSIGN,pUps); queryInfo.SetNode((LPCTSTR)RepSvrdta.LocalDBNode); queryInfo.SetDatabase ((LPCTSTR)RepSvrdta.LocalDBName); BOOL bOK = IPM_QueryInfo (&queryInfo, listInfoStruct); if (bOK) { POSITION pos = listInfoStruct.GetHeadPosition(); while (pos != NULL) { REPLICCDDSASSIGNDATAMIN* pCdds = (REPLICCDDSASSIGNDATAMIN*)listInfoStruct.GetNext(pos); AddItem (pCdds); } } } catch (CMemoryException* e) { theApp.OutOfMemoryMessage(); e->Delete(); } catch (CeIpmException e) { AfxMessageBox (e.GetReason(), MB_ICONEXCLAMATION|MB_OK); } while (!listInfoStruct.IsEmpty()) delete (REPLICCDDSASSIGNDATAMIN*)listInfoStruct.RemoveHead(); return 0L; }
BOOL IPM_BuildItemPath (CdIpmDoc* pDoc, CTypedPtrList<CObList, CuIpmTreeFastItem*>& listItemPath) { ASSERT(!pDoc->GetSelectKey().IsEmpty()); if (pDoc->GetSelectKey().IsEmpty()) return FALSE; BOOL bOK = FALSE; int nLevel = 0; int nParent0type = 0; int nObjectType = 0; CString strParent0 = _T(""); CString strStaticParent = _T(""); CStringArray& arrayItemPath = pDoc->GetItemPath(); void* pStructParent = NULL; int narrayItemPathSize = arrayItemPath.GetSize(); ASSERT(narrayItemPathSize >= 1); if (narrayItemPathSize < 1) return FALSE; CString strObject = arrayItemPath.GetAt(0); // // Default (from old class CuIpmObjDesc in vdba): BOOL bObjectNeedsNameCheck = FALSE; BOOL bObjectHasStaticBranch= TRUE; BOOL bStaticParentNeedsNameCheck= FALSE; if (pDoc->GetSelectKey().CompareNoCase (_T("SERVER")) == 0) { // // Old class CuIpmObjDesc_SERVER in vdba (no overwrite the 3 default booleans above. nObjectType = OT_MON_SERVER; } else if (pDoc->GetSelectKey().CompareNoCase (_T("SESSION")) == 0) { // // Old class CuIpmObjDesc_SESSION in vdba (no overwrite the 3 default booleans above. nLevel = 1; // Parent is the SERVER. EX: ii\ingres\158 nParent0type = OT_MON_SERVER; nObjectType = OT_MON_SESSION; ASSERT(narrayItemPathSize >= 2); if (narrayItemPathSize < 2) return FALSE; strParent0 = arrayItemPath.GetAt(0); strObject = arrayItemPath.GetAt(1); } else if (pDoc->GetSelectKey().CompareNoCase (_T("REPLICSERVER")) == 0) { // // Old class CuIpmObjDesc_REPLICSERVER in vdba (overwrite the 2 default booleans above. bStaticParentNeedsNameCheck = TRUE; bObjectHasStaticBranch = FALSE; nLevel = 1; // Parent is the database name nParent0type = OT_DATABASE; nObjectType = OT_MON_REPLIC_SERVER; ASSERT(narrayItemPathSize >= 1); if (narrayItemPathSize < 1) return FALSE; strStaticParent = _T("Replication"); strParent0 = arrayItemPath.GetAt(0); if (narrayItemPathSize > 1) strObject = arrayItemPath.GetAt(1); } else if (pDoc->GetSelectKey().CompareNoCase (_T("LOGINFO")) == 0) { // // Old class CuIpmObjDesc_LOGINFO in vdba (overwrite the 1 default boolean above. bObjectNeedsNameCheck = TRUE; strObject.LoadString(IDS_TM_LOGINFO); // "Log information" } if (nLevel > 0) { ASSERT (nParent0type); ASSERT (!strParent0.IsEmpty()); // Static parent if (bStaticParentNeedsNameCheck) { // // Only for replication: listItemPath.AddTail(new CaTreeItemPath(TRUE, nParent0type, NULL, TRUE, strStaticParent)); } else { listItemPath.AddTail(new CaTreeItemPath(TRUE, nParent0type)); } int reqSize = IPM_StructSize(nParent0type); CPtrList listInfoStruct; IPMUPDATEPARAMS ups; memset (&ups, 0, sizeof(ups)); CaIpmQueryInfo queryInfo(pDoc, nParent0type, &ups, (LPVOID)NULL, reqSize); queryInfo.SetReportError(FALSE); bOK = IPM_QueryInfo (&queryInfo, listInfoStruct); if (bOK) { POSITION p = NULL, pos = listInfoStruct.GetHeadPosition(); while (pos != NULL) { p = pos; LPVOID pObject = listInfoStruct.GetNext(pos); if (MatchedStruct (nParent0type, strParent0, pObject)) { pStructParent = pObject; listInfoStruct.RemoveAt (p); listItemPath.AddTail(new CaTreeItemPath(FALSE, nParent0type, pObject)); // non-static break; } } while (!listInfoStruct.IsEmpty()) delete listInfoStruct.RemoveHead(); } if (!pStructParent) return FALSE; } // // Object itself: if (strObject.IsEmpty()) return bOK; if (bObjectNeedsNameCheck) { listItemPath.AddTail(new CaTreeItemPath(TRUE, nObjectType, NULL, TRUE, strObject)); // Root item bOK = TRUE; } else { if (bObjectHasStaticBranch) listItemPath.AddTail(new CaTreeItemPath(TRUE, nObjectType)); // static int reqSize = IPM_StructSize(nObjectType); CPtrList listInfoStruct; IPMUPDATEPARAMS ups; memset (&ups, 0, sizeof(ups)); ups.nType = nParent0type; ups.pStruct = pStructParent; ups.pSFilter= NULL; CaIpmQueryInfo queryInfo(pDoc, nObjectType, &ups, (LPVOID)NULL, reqSize); queryInfo.SetReportError(FALSE); BOOL bHasObjects = IPM_QueryInfo (&queryInfo, listInfoStruct); if (bHasObjects) { #if !defined (_IGNORE_NOT_MATCHED_ITEM) bOK = FALSE; #endif POSITION p = NULL, pos = listInfoStruct.GetHeadPosition(); while (pos != NULL) { p = pos; LPVOID pObject = listInfoStruct.GetNext(pos); if (MatchedStruct (nObjectType, strObject, pObject)) { bOK = TRUE; listInfoStruct.RemoveAt (p); listItemPath.AddTail(new CaTreeItemPath(FALSE, nObjectType, pObject)); // non-static break; } } while (!listInfoStruct.IsEmpty()) delete listInfoStruct.RemoveHead(); } } return bOK; }