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.

74 lines
2.0 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // FILE
  4. //
  5. // pollseg.h
  6. //
  7. // SYNOPSIS
  8. //
  9. // Declares the class PollSegment.
  10. //
  11. // MODIFICATION HISTORY
  12. //
  13. // 06/10/1998 Original version.
  14. //
  15. ///////////////////////////////////////////////////////////////////////////////
  16. #ifndef _POLLSEG_H_
  17. #define _POLLSEG_H_
  18. #if _MSC_VER >= 1000
  19. #pragma once
  20. #endif
  21. #include <nocopy.h>
  22. class LDAPConnection;
  23. class LDAPServer;
  24. ///////////////////////////////////////////////////////////////////////////////
  25. //
  26. // CLASS
  27. //
  28. // PollSegment
  29. //
  30. // DESCRIPTION
  31. //
  32. // Represents a segment of the Active Directory namespace that can be
  33. // periodically polled for changes.
  34. //
  35. ///////////////////////////////////////////////////////////////////////////////
  36. class PollSegment : NonCopyable
  37. {
  38. public:
  39. PollSegment() throw ();
  40. ~PollSegment() throw ();
  41. // Defines a segment of the Active Directory namespace to be polled.
  42. DWORD initialize(PCWSTR pszHostName,
  43. PCWSTR pszBaseDN,
  44. ULONG ulScope) throw ();
  45. // Frees any resources and prepares the object for reuse. It is not
  46. // mandatory to call this method since it will also be invoked from the
  47. // destructor.
  48. void finalize() throw ();
  49. // Returns TRUE if any objects in the segment have changed since the last
  50. // call to initialize() or hasChanged(). There are no error conditions; when
  51. // in doubt, the method always returns TRUE.
  52. BOOL hasChanged() throw ();
  53. protected:
  54. // Searches a given server for changes.
  55. ULONG conductPoll(LDAPConnection* cxn) throw ();
  56. // Reads the highestCommittedUsn attribute of a server.
  57. static DWORDLONG readHighestCommittedUsn(LDAPConnection* cxn) throw ();
  58. LDAPServer* server; // Server being polled.
  59. PWSTR base; // DN of the root of the segment.
  60. ULONG scope; // Scope of the segment (from winldap.h).
  61. DWORDLONG highestUsnSeen; // Highest USN seen from lastServer.
  62. };
  63. #endif // _POLLSEG_H_