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.

154 lines
4.9 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // EvictCleanup.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CEvictCleanup
  10. // class. This class handles is used to clean up a node after it has been
  11. // evicted from a cluster.
  12. //
  13. // Documentation:
  14. // TODO: fill in pointer to external documentation
  15. //
  16. // Implementation Files:
  17. // EvictCleanup.cpp
  18. //
  19. // Maintained By:
  20. // Galen Barbee (GalenB) 04-AUG-2000
  21. //
  22. //////////////////////////////////////////////////////////////////////////////
  23. // Make sure that this file is included only once per compile path.
  24. #pragma once
  25. //////////////////////////////////////////////////////////////////////////////
  26. // Include Files
  27. //////////////////////////////////////////////////////////////////////////////
  28. // For IUnknown
  29. #include <unknwn.h>
  30. // For IClusCfgEvictCleanup
  31. #include <ClusCfgServer.h>
  32. // For ILogger
  33. #include <ClusCfgClient.h>
  34. //////////////////////////////////////////////////////////////////////////////
  35. //++
  36. //
  37. // class CEvictCleanup
  38. //
  39. // Description:
  40. // This class handles is used to clean up a node after it has been
  41. // evicted from a cluster.
  42. //
  43. //--
  44. //////////////////////////////////////////////////////////////////////////////
  45. class CEvictCleanup
  46. : public IClusCfgEvictCleanup
  47. , public IClusCfgCallback
  48. {
  49. private:
  50. //////////////////////////////////////////////////////////////////////////
  51. // Private data
  52. //////////////////////////////////////////////////////////////////////////
  53. // IUnknown
  54. LONG m_cRef; // Reference counter.
  55. // IClusCfgCallback
  56. BSTR m_bstrNodeName; // Name of the local node.
  57. ILogger * m_plLogger; // ILogger for doing logging.
  58. //////////////////////////////////////////////////////////////////////////
  59. // Private member functions
  60. //////////////////////////////////////////////////////////////////////////
  61. // Second phase of a two phase constructor.
  62. HRESULT
  63. HrInit( void );
  64. // Instruct the SCM to stop a service
  65. DWORD
  66. DwStopService(
  67. const WCHAR * pcszServiceNameIn
  68. , ULONG ulQueryIntervalMilliSecIn = 500
  69. , ULONG cQueryCountIn = 10
  70. );
  71. // Wrap logging to the logger object.
  72. void
  73. LogMsg( LPCWSTR pszLogMsgIn, ... );
  74. //
  75. // Private constructors, destructor and assignment operator.
  76. // All of these methods are private for two reasons:
  77. // 1. Lifetimes of objects of this class are controlled by S_HrCreateInstance and Release.
  78. // 2. Copying of an object of this class is prohibited.
  79. //
  80. // Default constructor.
  81. CEvictCleanup( void );
  82. // Destructor.
  83. ~CEvictCleanup( void );
  84. // Copy constructor.
  85. CEvictCleanup( const CEvictCleanup & );
  86. // Assignment operator.
  87. CEvictCleanup & operator =( const CEvictCleanup & );
  88. public:
  89. //////////////////////////////////////////////////////////////////////////
  90. // IUnknown methods
  91. //////////////////////////////////////////////////////////////////////////
  92. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  93. STDMETHOD_( ULONG, AddRef )( void );
  94. STDMETHOD_( ULONG, Release )( void );
  95. //////////////////////////////////////////////////////////////////////////
  96. // IClusCfgEvictCleanup methods
  97. //////////////////////////////////////////////////////////////////////////
  98. // Performs the clean up actions on the local node after it has been
  99. // evicted from a cluster
  100. STDMETHOD( CleanupLocalNode )( DWORD dwDelayIn );
  101. // Performs the clean up actions on a remote node after it has been
  102. // evicted from a cluster
  103. STDMETHOD( CleanupRemoteNode )( const WCHAR * pcszEvictedNodeNameIn, DWORD dwDelayIn );
  104. //////////////////////////////////////////////////////////////////////////
  105. // IClusCfgCallback methods
  106. //////////////////////////////////////////////////////////////////////////
  107. STDMETHOD( SendStatusReport )(
  108. LPCWSTR pcszNodeNameIn
  109. , CLSID clsidTaskMajorIn
  110. , CLSID clsidTaskMinorIn
  111. , ULONG ulMinIn
  112. , ULONG ulMaxIn
  113. , ULONG ulCurrentIn
  114. , HRESULT hrStatusIn
  115. , LPCWSTR pcszDescriptionIn
  116. , FILETIME * pftTimeIn
  117. , LPCWSTR pcszReference
  118. );
  119. //////////////////////////////////////////////////////////////////////////
  120. // Other public methods
  121. //////////////////////////////////////////////////////////////////////////
  122. // Create an instance of this class.
  123. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  124. }; //*** class CEvictCleanup