Leaked source code of windows server 2003
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.

169 lines
6.3 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // Cluster.h
  7. //
  8. // Abstract:
  9. // Definition of the CCluster class.
  10. //
  11. // Author:
  12. // David Potter (davidp) May 13, 1996
  13. //
  14. // Revision History:
  15. //
  16. // Notes:
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #ifndef _CLUSTER_H_
  20. #define _CLUSTER_H_
  21. /////////////////////////////////////////////////////////////////////////////
  22. // Include Files
  23. /////////////////////////////////////////////////////////////////////////////
  24. #ifndef _TREEITEM_
  25. #include "ClusItem.h" // for CClusterItem
  26. #endif
  27. #ifndef _PROPLIST_H_
  28. #include "PropList.h" // for CObjectProperty, CClusPropList
  29. #endif
  30. /////////////////////////////////////////////////////////////////////////////
  31. // Forward Class Declarations
  32. /////////////////////////////////////////////////////////////////////////////
  33. class CCluster;
  34. /////////////////////////////////////////////////////////////////////////////
  35. // External Class Declarations
  36. /////////////////////////////////////////////////////////////////////////////
  37. class CResource;
  38. class CNetworkList;
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CCluster command target
  41. /////////////////////////////////////////////////////////////////////////////
  42. class CCluster : public CClusterItem
  43. {
  44. DECLARE_DYNCREATE(CCluster)
  45. CCluster(void); // protected constructor used by dynamic creation
  46. void Init(
  47. IN OUT CClusterDoc * pdoc,
  48. IN LPCTSTR lpszName,
  49. IN HCLUSTER hOpenedCluster = NULL
  50. );
  51. // Attributes
  52. protected:
  53. CLUSTERVERSIONINFO m_cvi;
  54. CString m_strQuorumResource;
  55. CString m_strQuorumPath;
  56. DWORD m_nMaxQuorumLogSize;
  57. DWORD m_nDefaultNetworkRole;
  58. DWORD m_nQuorumArbitrationTimeMax;
  59. DWORD m_nQuorumArbitrationTimeMin;
  60. BOOL m_bEnableEventLogReplication;
  61. CStringList m_lstrClusterExtensions;
  62. CStringList m_lstrNodeExtensions;
  63. CStringList m_lstrGroupExtensions;
  64. CStringList m_lstrResourceExtensions;
  65. CStringList m_lstrResTypeExtensions;
  66. CStringList m_lstrNetworkExtensions;
  67. CStringList m_lstrNetInterfaceExtensions;
  68. CNetworkList * m_plpciNetworkPriority;
  69. enum
  70. {
  71. epropDefaultNetworkRole = 0,
  72. epropDescription,
  73. epropEnableEventLogReplication,
  74. epropQuorumArbitrationTimeMax,
  75. epropQuorumArbitrationTimeMin,
  76. epropMAX
  77. };
  78. CObjectProperty m_rgProps[epropMAX];
  79. protected:
  80. virtual const CObjectProperty * Pprops(void) const { return m_rgProps; }
  81. virtual DWORD Cprops(void) const { return sizeof(m_rgProps) / sizeof(m_rgProps[0]); }
  82. public:
  83. virtual const CStringList * PlstrExtensions(void) const;
  84. const CLUSTERVERSIONINFO & Cvi(void) const { return m_cvi; }
  85. const CString & StrQuorumResource(void) const { return m_strQuorumResource; }
  86. const CString & StrQuorumPath(void) const { return m_strQuorumPath; }
  87. DWORD NMaxQuorumLogSize(void) const { return m_nMaxQuorumLogSize; }
  88. const CStringList & LstrClusterExtensions(void) const { return m_lstrClusterExtensions; }
  89. const CStringList & LstrNodeExtensions(void) const { return m_lstrNodeExtensions; }
  90. const CStringList & LstrGroupExtensions(void) const { return m_lstrGroupExtensions; }
  91. const CStringList & LstrResourceExtensions(void) const { return m_lstrResourceExtensions; }
  92. const CStringList & LstrResTypeExtensions(void) const { return m_lstrResTypeExtensions; }
  93. const CStringList & LstrNetworkExtensions(void) const { return m_lstrNetworkExtensions; }
  94. const CStringList & LstrNetInterfaceExtensions(void) const { return m_lstrNetInterfaceExtensions; }
  95. const CNetworkList & LpciNetworkPriority(void) const { ASSERT(m_plpciNetworkPriority != NULL); return *m_plpciNetworkPriority; }
  96. // Operations
  97. public:
  98. void SetName(IN LPCTSTR pszName);
  99. void SetDescription(IN LPCTSTR pszDesc);
  100. void SetQuorumResource(
  101. IN LPCTSTR pszResource,
  102. IN LPCTSTR pszQuorumPath,
  103. IN DWORD nMaxLogSize
  104. );
  105. void SetNetworkPriority(IN const CNetworkList & rlpci);
  106. void CollectNetworkPriority(IN OUT CNetworkList * plpci);
  107. void ReadClusterInfo(void);
  108. void ReadClusterExtensions(void);
  109. void ReadNodeExtensions(void);
  110. void ReadGroupExtensions(void);
  111. void ReadResourceExtensions(void);
  112. void ReadResTypeExtensions(void);
  113. void ReadNetworkExtensions(void);
  114. void ReadNetInterfaceExtensions(void);
  115. // Overrides
  116. virtual void Cleanup(void);
  117. virtual void ReadItem(void);
  118. virtual void UpdateState(void);
  119. virtual void Rename(IN LPCTSTR pszName);
  120. virtual BOOL BCanBeEdited(void) const { return TRUE; }
  121. virtual void OnBeginLabelEdit(IN OUT CEdit * pedit);
  122. virtual BOOL BDisplayProperties(IN BOOL bReadOnly = FALSE);
  123. virtual BOOL BIsLabelEditValueValid(IN LPCTSTR pszName);
  124. // ClassWizard generated virtual function overrides
  125. //{{AFX_VIRTUAL(CCluster)
  126. //}}AFX_VIRTUAL
  127. // Implementation
  128. public:
  129. virtual ~CCluster(void);
  130. protected:
  131. // Generated message map functions
  132. //{{AFX_MSG(CCluster)
  133. afx_msg void OnUpdateProperties(CCmdUI* pCmdUI);
  134. //}}AFX_MSG
  135. DECLARE_MESSAGE_MAP()
  136. }; //*** class CCluster
  137. /////////////////////////////////////////////////////////////////////////////
  138. #endif // _CLUSTER_H_