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.

367 lines
8.5 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. lmoreple.hxx
  7. Class declarations for the REPL_EDIR_BASE and REPL_EDIR_x classes.
  8. REPL_EDIR_BASE is an abstract superclass that contains common methods
  9. and data members shared between the REPL_EDIR_x classes.
  10. The REPL_EDIR_x classes each represent a different info-level "view"
  11. of an exported directory in the Replicator's export path.
  12. The classes are structured as follows:
  13. LOC_LM_OBJ
  14. |
  15. \---REPL_DIR_BASE
  16. |
  17. +---REPL_EDIR_BASE
  18. |
  19. \---REPL_EDIR_0
  20. |
  21. \---REPL_EDIR_1
  22. |
  23. \---REPL_EDIR_2
  24. FILE HISTORY:
  25. KeithMo 20-Feb-1992 Created for the Server Manager.
  26. */
  27. #ifndef _LMOREPLE_HXX_
  28. #define _LMOREPLE_HXX_
  29. #include "lmorepld.hxx"
  30. /*************************************************************************
  31. NAME: REPL_EDIR_BASE
  32. SYNOPSIS: Abstract superclass for the Replicator Export Directory
  33. classes.
  34. INTERFACE: REPL_EDIR_BASE - Class constructor.
  35. ~REPL_EDIR_BASE - Class destructor.
  36. PARENT: REPL_DIR_BASE
  37. HISTORY:
  38. KeithMo 20-Feb-1992 Created for the Server Manager.
  39. **************************************************************************/
  40. DLL_CLASS REPL_EDIR_BASE : public REPL_DIR_BASE
  41. {
  42. protected:
  43. //
  44. // These virtual callbacks are called by NEW_LM_OBJ to
  45. // invoke any necessary NetReplExportDir{Get,Set}Info API.
  46. //
  47. virtual APIERR I_GetInfo( VOID );
  48. virtual APIERR I_WriteInfo( VOID );
  49. //
  50. // This virtual callback is invoked by NEW_LM_OBJ to
  51. // delete an existing object. This method will invoke
  52. // the NetReplExportDirDel API.
  53. //
  54. virtual APIERR I_Delete( UINT nForce );
  55. //
  56. // This virtual callback is invoked by NEW_LM_OBJ to
  57. // create a new object. This method will invoke the
  58. // NetReplExportDirAdd API.
  59. //
  60. virtual APIERR I_WriteNew( VOID );
  61. //
  62. // This virtual helper is called by I_WriteInfo and
  63. // I_WriteNew to setup the necessary data structures
  64. // before the network API is invoked.
  65. //
  66. virtual APIERR W_Write( VOID ) = 0;
  67. //
  68. // This private virtual callback extracts & caches any
  69. // data from an API buffer which must be "persistant".
  70. //
  71. virtual APIERR W_CacheApiData( const BYTE * pbBuffer ) = 0;
  72. //
  73. // This method will invoke the appropriate number of
  74. // NetReplExportDirLock() & NetReplExportDirUnlock() API
  75. // as required by the current lock bias (as stored in
  76. // REPL_DIR_BASE).
  77. //
  78. APIERR W_AdjustLocks( VOID );
  79. //
  80. // Since this is an abstract superclass, its constructor
  81. // is protected.
  82. //
  83. REPL_EDIR_BASE( const TCHAR * pszServerName,
  84. const TCHAR * pszDirName );
  85. public:
  86. ~REPL_EDIR_BASE( VOID );
  87. }; // class REPL_EDIR_BASE
  88. /*************************************************************************
  89. NAME: REPL_EDIR_0
  90. SYNOPSIS: Info-level 0 Replicator Export Directory class.
  91. INTERFACE: REPL_EDIR_0 - Class constructor.
  92. ~REPL_EDIR_0 - Class destructor.
  93. PARENT: REPL_EDIR_BASE
  94. HISTORY:
  95. KeithMo 20-Feb-1992 Created for the Server Manager.
  96. **************************************************************************/
  97. DLL_CLASS REPL_EDIR_0 : public REPL_EDIR_BASE
  98. {
  99. private:
  100. //
  101. // This helper function is called by I_WriteInfo and
  102. // I_WriteNew to setup the REPL_EDIR_INFO_0 structure.
  103. //
  104. virtual APIERR W_Write( VOID );
  105. protected:
  106. //
  107. // This virtual callback is called by I_CreateNew to
  108. // initialize the data members for a new object. This
  109. // method must always invoke its parent method before
  110. // anything else. This method does not invoke any
  111. // network API.
  112. //
  113. virtual APIERR W_CreateNew( VOID );
  114. //
  115. // This private virtual callback extracts & caches any
  116. // data from an API buffer which must be "persistant".
  117. //
  118. virtual APIERR W_CacheApiData( const BYTE * pbBuffer );
  119. public:
  120. //
  121. // Usual constructor/destructor goodies.
  122. //
  123. REPL_EDIR_0( const TCHAR * pszServerName,
  124. const TCHAR * pszDirName );
  125. ~REPL_EDIR_0( VOID );
  126. }; // class REPL_EDIR_0
  127. /*************************************************************************
  128. NAME: REPL_EDIR_1
  129. SYNOPSIS: Info-level 1 Replicator Export Directory class.
  130. INTERFACE: REPL_EDIR_1 - Class constructor.
  131. ~REPL_EDIR_1 - Class destructor.
  132. QueryIntegrity - Returns the directory integrity.
  133. SetIntegrity - Sets the directory integrity.
  134. QueryExtent - Returns the directory extent.
  135. SetExtent - Sets the directory extent.
  136. PARENT: REPL_EDIR_0
  137. HISTORY:
  138. KeithMo 20-Feb-1992 Created for the Server Manager.
  139. **************************************************************************/
  140. DLL_CLASS REPL_EDIR_1 : public REPL_EDIR_0
  141. {
  142. private:
  143. //
  144. // These data members cache the values retrieved
  145. // from the REPL_EDIR_INFO_1 structure.
  146. //
  147. ULONG _lIntegrity;
  148. ULONG _lExtent;
  149. //
  150. // This helper function is called by I_WriteInfo and
  151. // I_WriteNew to setup the REPL_EDIR_INFO_1 structure.
  152. //
  153. virtual APIERR W_Write( VOID );
  154. protected:
  155. //
  156. // This virtual callback is called by I_CreateNew to
  157. // initialize the data members for a new object. This
  158. // method must always invoke its parent method before
  159. // anything else. This method does not invoke any
  160. // network API.
  161. //
  162. virtual APIERR W_CreateNew( VOID );
  163. //
  164. // This private virtual callback extracts & caches any
  165. // data from an API buffer which must be "persistant".
  166. //
  167. virtual APIERR W_CacheApiData( const BYTE * pbBuffer );
  168. public:
  169. //
  170. // Usual constructor/destructor goodies.
  171. //
  172. REPL_EDIR_1( const TCHAR * pszServerName,
  173. const TCHAR * pszDirName );
  174. ~REPL_EDIR_1( VOID );
  175. //
  176. // Accessor methods.
  177. //
  178. ULONG QueryIntegrity( VOID ) const
  179. { return _lIntegrity; }
  180. VOID SetIntegrity( ULONG lIntegrity )
  181. { _lIntegrity = lIntegrity; }
  182. ULONG QueryExtent( VOID ) const
  183. { return _lExtent; }
  184. VOID SetExtent( ULONG lExtent )
  185. { _lExtent = lExtent; }
  186. }; // class REPL_EDIR_1
  187. /*************************************************************************
  188. NAME: REPL_EDIR_2
  189. SYNOPSIS: Info-level 2 Replicator Export Directory class.
  190. INTERFACE: REPL_EDIR_2 - Class constructor.
  191. ~REPL_EDIR_2 - Class destructor.
  192. QueryLockCount - Returns the directory lock count.
  193. SetLockCount - Sets the directory lock count.
  194. QueryLockTime - Returns the number of seconds
  195. since the directory was last
  196. locked.
  197. SetLockTime - Sets the lock time.
  198. PARENT: REPL_EDIR_1
  199. HISTORY:
  200. KeithMo 20-Feb-1992 Created for the Server Manager.
  201. **************************************************************************/
  202. DLL_CLASS REPL_EDIR_2 : public REPL_EDIR_1
  203. {
  204. private:
  205. //
  206. // These data members cache the values retrieved
  207. // from the REPL_EDIR_INFO_2 structure.
  208. //
  209. ULONG _lLockCount;
  210. ULONG _lLockTime;
  211. //
  212. // This helper function is called by I_WriteInfo and
  213. // I_WriteNew to setup the REPL_EDIR_INFO_2 structure.
  214. //
  215. virtual APIERR W_Write( VOID );
  216. protected:
  217. //
  218. // This virtual callback is called by I_CreateNew to
  219. // initialize the data members for a new object. This
  220. // method must always invoke its parent method before
  221. // anything else. This method does not invoke any
  222. // network API.
  223. //
  224. virtual APIERR W_CreateNew( VOID );
  225. //
  226. // This private virtual callback extracts & caches any
  227. // data from an API buffer which must be "persistant".
  228. //
  229. virtual APIERR W_CacheApiData( const BYTE * pbBuffer );
  230. //
  231. // Since the lock count & lock time are not dynamically
  232. // settable, their set methods are protected.
  233. //
  234. VOID SetLockCount( ULONG lLockCount )
  235. { _lLockCount = lLockCount; }
  236. VOID SetLockTime( ULONG lLockTime )
  237. { _lLockTime = lLockTime; }
  238. public:
  239. //
  240. // Usual constructor/destructor goodies.
  241. //
  242. REPL_EDIR_2( const TCHAR * pszServerName,
  243. const TCHAR * pszDirName );
  244. ~REPL_EDIR_2( VOID );
  245. //
  246. // Accessor methods.
  247. //
  248. ULONG QueryLockCount( VOID ) const
  249. { return _lLockCount; }
  250. ULONG QueryLockTime( VOID ) const
  251. { return _lLockTime; }
  252. }; // class REPL_EDIR_2
  253. #endif // _LMOREPLE_HXX_