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.

345 lines
7.6 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved.
  3. Module Name:
  4. hsmacrsc.cpp
  5. Abstract:
  6. This component represents the actions that can be performed by a job
  7. on a resource either before or after the scan.
  8. Author:
  9. Ronald G. White [ronw] 14-Aug-1997
  10. Revision History:
  11. --*/
  12. #include "resource.h" // main symbols
  13. #include "wsb.h"
  14. #ifndef _HSMACRSC_
  15. #define _HSMACRSC_
  16. // Abstract Classes
  17. /*++
  18. Class Name:
  19. CHsmActionOnResource
  20. Class Description:
  21. An abstract class that represents an action that can be performed
  22. on a resource. Specific actions are implemented as subclasses
  23. of this object.
  24. --*/
  25. class CHsmActionOnResource :
  26. public CWsbObject,
  27. public IHsmActionOnResource
  28. {
  29. public:
  30. // IPersistStream
  31. public:
  32. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* /*pSize*/) {
  33. return(E_NOTIMPL); }
  34. STDMETHOD(Load)(IStream* pStream);
  35. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  36. // IWsbTestable
  37. STDMETHOD(Test)(USHORT * /*passed*/, USHORT* /*failed*/) {
  38. return(E_NOTIMPL); }
  39. // IHsmAction
  40. STDMETHOD(GetName)(OLECHAR** pName, ULONG bufferSize);
  41. protected:
  42. ULONG m_nameId;
  43. };
  44. /*++
  45. Class Name:
  46. CHsmActionOnResourcePost
  47. Class Description:
  48. An abstract class that represents an action that can be performed
  49. on a resource after a job. Specific actions are implemented as subclasses
  50. of this object.
  51. --*/
  52. class CHsmActionOnResourcePost :
  53. public CHsmActionOnResource,
  54. public IHsmActionOnResourcePost
  55. {
  56. public:
  57. };
  58. /*++
  59. Class Name:
  60. CHsmActionOnResourcePre
  61. Class Description:
  62. An abstract class that represents an action that can be performed
  63. on a resource before a job starts. Specific actions are implemented as subclasses
  64. of this object.
  65. --*/
  66. class CHsmActionOnResourcePre :
  67. public CHsmActionOnResource,
  68. public IHsmActionOnResourcePre
  69. {
  70. public:
  71. };
  72. /*++
  73. Class Name:
  74. CHsmActionOnResourcePreScan
  75. Class Description:
  76. An abstract class that represents an action that can be performed
  77. on a resource before scanning for a job starts. Specific actions are implemented as subclasses
  78. of this object.
  79. --*/
  80. class CHsmActionOnResourcePreScan :
  81. public CHsmActionOnResource,
  82. public IHsmActionOnResourcePreScan
  83. {
  84. public:
  85. };
  86. // Concrete Classes : Inheriting from CHsmActionOnResource
  87. /*++
  88. Class Name:
  89. CHsmActionOnResourcePostValidate
  90. Class Description:
  91. A class that represents the action required by the resource after
  92. a Validate job ends.
  93. --*/
  94. class CHsmActionOnResourcePostValidate :
  95. public CHsmActionOnResourcePost,
  96. public CComCoClass<CHsmActionOnResourcePostValidate,&CLSID_CHsmActionOnResourcePostValidate>
  97. {
  98. public:
  99. CHsmActionOnResourcePostValidate() {}
  100. BEGIN_COM_MAP(CHsmActionOnResourcePostValidate)
  101. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  102. COM_INTERFACE_ENTRY(IPersistStream)
  103. COM_INTERFACE_ENTRY(IHsmActionOnResource)
  104. COM_INTERFACE_ENTRY(IHsmActionOnResourcePost)
  105. COM_INTERFACE_ENTRY(IWsbCollectable)
  106. END_COM_MAP()
  107. DECLARE_REGISTRY_RESOURCEID(IDR_CHsmActionOnResourcePostValidate)
  108. // CComObjectRoot
  109. public:
  110. STDMETHOD(FinalConstruct)(void);
  111. // IPersist
  112. public:
  113. STDMETHOD(GetClassID)(LPCLSID pClsid);
  114. // IHsmActionOnResource
  115. public:
  116. STDMETHOD(Do)(IHsmJobWorkItem* pWorkItem, HSM_JOB_STATE state);
  117. };
  118. /*++
  119. Class Name:
  120. CHsmActionOnResourcePreValidate
  121. Class Description:
  122. A class that represents the action required by the resource before
  123. a Validate job starts.
  124. --*/
  125. class CHsmActionOnResourcePreValidate :
  126. public CHsmActionOnResourcePre,
  127. public CComCoClass<CHsmActionOnResourcePreValidate,&CLSID_CHsmActionOnResourcePreValidate>
  128. {
  129. public:
  130. CHsmActionOnResourcePreValidate() {}
  131. BEGIN_COM_MAP(CHsmActionOnResourcePreValidate)
  132. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  133. COM_INTERFACE_ENTRY(IPersistStream)
  134. COM_INTERFACE_ENTRY(IHsmActionOnResource)
  135. COM_INTERFACE_ENTRY(IHsmActionOnResourcePre)
  136. COM_INTERFACE_ENTRY(IWsbCollectable)
  137. END_COM_MAP()
  138. DECLARE_REGISTRY_RESOURCEID(IDR_CHsmActionOnResourcePreValidate)
  139. // CComObjectRoot
  140. public:
  141. STDMETHOD(FinalConstruct)(void);
  142. // IPersist
  143. public:
  144. STDMETHOD(GetClassID)(LPCLSID pClsid);
  145. // IHsmActionOnResource
  146. public:
  147. STDMETHOD(Do)(IHsmJobWorkItem* pWorkItem, IHsmJobDef* pJobDef);
  148. };
  149. /*++
  150. Class Name:
  151. CHsmActionOnResourcePostUnmanage
  152. Class Description:
  153. A class that represents the action required by the resource after
  154. a Unmanage job ends.
  155. --*/
  156. class CHsmActionOnResourcePostUnmanage :
  157. public CHsmActionOnResourcePost,
  158. public CComCoClass<CHsmActionOnResourcePostUnmanage,&CLSID_CHsmActionOnResourcePostUnmanage>
  159. {
  160. public:
  161. CHsmActionOnResourcePostUnmanage() {}
  162. BEGIN_COM_MAP(CHsmActionOnResourcePostUnmanage)
  163. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  164. COM_INTERFACE_ENTRY(IPersistStream)
  165. COM_INTERFACE_ENTRY(IHsmActionOnResource)
  166. COM_INTERFACE_ENTRY(IHsmActionOnResourcePost)
  167. COM_INTERFACE_ENTRY(IWsbCollectable)
  168. END_COM_MAP()
  169. DECLARE_REGISTRY_RESOURCEID(IDR_CHsmActionOnResourcePostUnmanage)
  170. // CComObjectRoot
  171. public:
  172. STDMETHOD(FinalConstruct)(void);
  173. // IPersist
  174. public:
  175. STDMETHOD(GetClassID)(LPCLSID pClsid);
  176. // IHsmActionOnResource
  177. public:
  178. STDMETHOD(Do)(IHsmJobWorkItem* pWorkItem, HSM_JOB_STATE state);
  179. };
  180. /*++
  181. Class Name:
  182. CHsmActionOnResourcePreUnmanage
  183. Class Description:
  184. A class that represents the action required by the resource before
  185. an Unmanage job ends.
  186. --*/
  187. class CHsmActionOnResourcePreUnmanage :
  188. public CHsmActionOnResourcePre,
  189. public CComCoClass<CHsmActionOnResourcePreUnmanage,&CLSID_CHsmActionOnResourcePreUnmanage>
  190. {
  191. public:
  192. CHsmActionOnResourcePreUnmanage() {}
  193. BEGIN_COM_MAP(CHsmActionOnResourcePreUnmanage)
  194. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  195. COM_INTERFACE_ENTRY(IPersistStream)
  196. COM_INTERFACE_ENTRY(IHsmActionOnResource)
  197. COM_INTERFACE_ENTRY(IHsmActionOnResourcePre)
  198. COM_INTERFACE_ENTRY(IWsbCollectable)
  199. END_COM_MAP()
  200. DECLARE_REGISTRY_RESOURCEID(IDR_CHsmActionOnResourcePreUnmanage)
  201. // CComObjectRoot
  202. public:
  203. STDMETHOD(FinalConstruct)(void);
  204. // IPersist
  205. public:
  206. STDMETHOD(GetClassID)(LPCLSID pClsid);
  207. // IHsmActionOnResource
  208. public:
  209. STDMETHOD(Do)(IHsmJobWorkItem* pWorkItem, IHsmJobDef* pJobDef);
  210. };
  211. /*++
  212. Class Name:
  213. CHsmActionOnResourcePreScanUnmanage
  214. Class Description:
  215. A class that represents the action required by the resource before
  216. scanning for an Unmanage job ends.
  217. --*/
  218. class CHsmActionOnResourcePreScanUnmanage :
  219. public CHsmActionOnResourcePreScan,
  220. public CComCoClass<CHsmActionOnResourcePreScanUnmanage,&CLSID_CHsmActionOnResourcePreScanUnmanage>
  221. {
  222. public:
  223. CHsmActionOnResourcePreScanUnmanage() {}
  224. BEGIN_COM_MAP(CHsmActionOnResourcePreScanUnmanage)
  225. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  226. COM_INTERFACE_ENTRY(IPersistStream)
  227. COM_INTERFACE_ENTRY(IHsmActionOnResource)
  228. COM_INTERFACE_ENTRY(IHsmActionOnResourcePreScan)
  229. COM_INTERFACE_ENTRY(IWsbCollectable)
  230. END_COM_MAP()
  231. DECLARE_REGISTRY_RESOURCEID(IDR_CHsmActionOnResourcePreScanUnmanage)
  232. // CComObjectRoot
  233. public:
  234. STDMETHOD(FinalConstruct)(void);
  235. // IPersist
  236. public:
  237. STDMETHOD(GetClassID)(LPCLSID pClsid);
  238. // IHsmActionOnResourcePreScan
  239. public:
  240. STDMETHOD(Do)(IFsaResource* pFsaResource, IHsmSession* pSession);
  241. };
  242. #endif // _HSMACRSC_