Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

238 lines
7.9 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // Node.h
  7. //
  8. // Description:
  9. // Definition of the CClusterNode class.
  10. //
  11. // Implementation File:
  12. // Node.cpp
  13. //
  14. // Maintained By:
  15. // David Potter (davidp) May 3, 1996
  16. //
  17. // Revision History:
  18. //
  19. // Notes:
  20. //
  21. /////////////////////////////////////////////////////////////////////////////
  22. #ifndef _NODE_H_
  23. #define _NODE_H_
  24. /////////////////////////////////////////////////////////////////////////////
  25. // Forward Class Declarations
  26. /////////////////////////////////////////////////////////////////////////////
  27. class CClusterNode;
  28. class CNodeList;
  29. /////////////////////////////////////////////////////////////////////////////
  30. // External Class Declarations
  31. /////////////////////////////////////////////////////////////////////////////
  32. /////////////////////////////////////////////////////////////////////////////
  33. // Type Definitions
  34. /////////////////////////////////////////////////////////////////////////////
  35. /////////////////////////////////////////////////////////////////////////////
  36. // Include Files
  37. /////////////////////////////////////////////////////////////////////////////
  38. #ifndef _TREEITEM_H_
  39. #include "ClusItem.h" // for CClusterItem
  40. #endif
  41. #ifndef _GROUP_H_
  42. #include "Group.h" // for CGroupList
  43. #endif
  44. #ifndef _RES_H_
  45. #include "Res.h" // for CResourceList
  46. #endif
  47. #ifndef _NETIFACE_H_
  48. #include "NetIFace.h" // for CNetInterfaceList
  49. #endif
  50. #ifndef _PROPLIST_H_
  51. #include "PropList.h" // for CObjectProperty, CClusPropList
  52. #endif
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CClusterNode command target
  55. /////////////////////////////////////////////////////////////////////////////
  56. class CClusterNode : public CClusterItem
  57. {
  58. DECLARE_DYNCREATE(CClusterNode)
  59. CClusterNode(void); // protected constructor used by dynamic creation
  60. void Init(IN OUT CClusterDoc * pdoc, IN LPCTSTR lpszName);
  61. // Attributes
  62. protected:
  63. HNODE m_hnode;
  64. CLUSTER_NODE_STATE m_cns;
  65. DWORD m_nNodeHighestVersion;
  66. DWORD m_nNodeLowestVersion;
  67. DWORD m_nMajorVersion;
  68. DWORD m_nMinorVersion;
  69. DWORD m_nBuildNumber;
  70. CString m_strCSDVersion;
  71. CGroupList * m_plpcigrpOnline;
  72. CResourceList * m_plpciresOnline;
  73. CNetInterfaceList * m_plpciNetInterfaces;
  74. enum
  75. {
  76. epropName = 0,
  77. epropDescription,
  78. epropNodeHighestVersion,
  79. epropNodeLowestVersion,
  80. epropMajorVersion,
  81. epropMinorVersion,
  82. epropBuildNumber,
  83. epropCSDVersion,
  84. epropMAX
  85. };
  86. CObjectProperty m_rgProps[epropMAX];
  87. public:
  88. HNODE Hnode(void) const { return m_hnode; }
  89. CLUSTER_NODE_STATE Cns(void) const { return m_cns; }
  90. DWORD NNodeHighestVersion(void) const { return m_nNodeHighestVersion; }
  91. DWORD NNodeLowestVersion(void) const { return m_nNodeLowestVersion; }
  92. DWORD NMajorVersion(void) const { return m_nMajorVersion; }
  93. DWORD NMinorVersion(void) const { return m_nMinorVersion; }
  94. DWORD NBuildNumber(void) const { return m_nBuildNumber; }
  95. const CString & StrCSDVersion(void) const { return m_strCSDVersion; }
  96. const CGroupList & LpcigrpOnline(void) const { ASSERT(m_plpcigrpOnline != NULL); return *m_plpcigrpOnline; }
  97. const CResourceList & LpciresOnline(void) const { ASSERT(m_plpciresOnline != NULL); return *m_plpciresOnline; }
  98. const CNetInterfaceList & LpciNetInterfaces(void) const { ASSERT(m_plpciNetInterfaces != NULL); return *m_plpciNetInterfaces; }
  99. void GetStateName(OUT CString & rstrState) const;
  100. // void Delete(void);
  101. // Operations
  102. public:
  103. void ReadExtensions(void);
  104. void AddActiveGroup(IN OUT CGroup * pciGroup);
  105. void AddActiveResource(IN OUT CResource * pciResource);
  106. void AddNetInterface(IN OUT CNetInterface * pciNetIFace);
  107. void RemoveActiveGroup(IN OUT CGroup * pciGroup);
  108. void RemoveActiveResource(IN OUT CResource * pciResource);
  109. void RemoveNetInterface(IN OUT CNetInterface * pciNetIFace);
  110. void SetDescription(IN const CString & rstrDesc, IN BOOL bValidateOnly = FALSE);
  111. void UpdateResourceTypePossibleOwners( void );
  112. // Overrides
  113. public:
  114. virtual void Cleanup(void);
  115. virtual void ReadItem(void);
  116. virtual void UpdateState(void);
  117. virtual BOOL BGetColumnData(IN COLID colid, OUT CString & rstrText);
  118. virtual BOOL BDisplayProperties(IN BOOL bReadOnly = FALSE);
  119. // Drag & Drop
  120. virtual BOOL BCanBeDropTarget(IN const CClusterItem * pci) const;
  121. virtual void DropItem(IN OUT CClusterItem * pci);
  122. virtual const CStringList * PlstrExtensions(void) const;
  123. #ifdef _DISPLAY_STATE_TEXT_IN_TREE
  124. virtual void GetTreeName(OUT CString & rstrName) const;
  125. #endif
  126. // ClassWizard generated virtual function overrides
  127. //{{AFX_VIRTUAL(CClusterNode)
  128. public:
  129. virtual void OnFinalRelease();
  130. //}}AFX_VIRTUAL
  131. virtual LRESULT OnClusterNotify(IN OUT CClusterNotify * pnotify);
  132. protected:
  133. virtual const CObjectProperty * Pprops(void) const { return m_rgProps; }
  134. virtual DWORD Cprops(void) const { return sizeof(m_rgProps) / sizeof(CObjectProperty); }
  135. virtual DWORD DwSetCommonProperties(IN const CClusPropList & rcpl, IN BOOL bValidateOnly = FALSE);
  136. // Implementation
  137. public:
  138. virtual ~CClusterNode(void);
  139. protected:
  140. CTreeItem * m_ptiActiveGroups;
  141. CTreeItem * m_ptiActiveResources;
  142. BOOL
  143. FCanBeEvicted( void );
  144. protected:
  145. // Generated message map functions
  146. //{{AFX_MSG(CClusterNode)
  147. afx_msg void OnUpdatePauseNode(CCmdUI* pCmdUI);
  148. afx_msg void OnUpdateResumeNode(CCmdUI* pCmdUI);
  149. afx_msg void OnUpdateEvictNode(CCmdUI* pCmdUI);
  150. afx_msg void OnUpdateStartService(CCmdUI* pCmdUI);
  151. afx_msg void OnUpdateStopService(CCmdUI* pCmdUI);
  152. afx_msg void OnUpdateProperties(CCmdUI* pCmdUI);
  153. afx_msg void OnCmdPauseNode();
  154. afx_msg void OnCmdResumeNode();
  155. afx_msg void OnCmdEvictNode();
  156. afx_msg void OnCmdStartService();
  157. afx_msg void OnCmdStopService();
  158. //}}AFX_MSG
  159. DECLARE_MESSAGE_MAP()
  160. #ifdef _CLUADMIN_USE_OLE_
  161. DECLARE_OLECREATE(CClusterNode)
  162. // Generated OLE dispatch map functions
  163. //{{AFX_DISPATCH(CClusterNode)
  164. // NOTE - the ClassWizard will add and remove member functions here.
  165. //}}AFX_DISPATCH
  166. DECLARE_DISPATCH_MAP()
  167. DECLARE_INTERFACE_MAP()
  168. #endif // _CLUADMIN_USE_OLE_
  169. }; //*** class CClusterNode
  170. /////////////////////////////////////////////////////////////////////////////
  171. // CNodeList
  172. /////////////////////////////////////////////////////////////////////////////
  173. class CNodeList : public CClusterItemList
  174. {
  175. public:
  176. CClusterNode * PciNodeFromName(
  177. IN LPCTSTR pszName,
  178. OUT POSITION * ppos = NULL
  179. )
  180. {
  181. return (CClusterNode *) PciFromName(pszName, ppos);
  182. }
  183. }; //*** class CNodeList
  184. /////////////////////////////////////////////////////////////////////////////
  185. // Global Functions
  186. /////////////////////////////////////////////////////////////////////////////
  187. //void DeleteAllItemData(IN OUT CNodeList & rlp);
  188. #ifdef _DEBUG
  189. class CTraceTag;
  190. extern CTraceTag g_tagNode;
  191. extern CTraceTag g_tagNodeNotify;
  192. #endif
  193. /////////////////////////////////////////////////////////////////////////////
  194. #endif // _NODE_H_