ArchiveStateUpdater.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright 2005 - 2016 Zarafa and its licensors
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Affero General Public License, version 3,
  6. * as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU Affero General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Affero General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. *
  16. */
  17. #ifndef ARCHIVESTATEUPDATER_H_INCLUDED
  18. #define ARCHIVESTATEUPDATER_H_INCLUDED
  19. #include <kopano/zcdefs.h>
  20. #include "ArchiveStateCollector.h"
  21. namespace KC {
  22. /**
  23. * This class updates the current archive state to the should-be state.
  24. */
  25. class _kc_export ArchiveStateUpdater _kc_final {
  26. public:
  27. typedef ArchiveStateCollector::ArchiveInfo ArchiveInfo;
  28. typedef ArchiveStateCollector::ArchiveInfoMap ArchiveInfoMap;
  29. _kc_hidden static HRESULT Create(const ArchiverSessionPtr &, ECLogger *, const ArchiveInfoMap &, ArchiveStateUpdaterPtr *);
  30. _kc_hidden virtual ~ArchiveStateUpdater(void);
  31. HRESULT UpdateAll(unsigned int ulAttachFlags);
  32. HRESULT Update(const tstring &userName, unsigned int ulAttachFlags);
  33. private:
  34. _kc_hidden ArchiveStateUpdater(const ArchiverSessionPtr &, ECLogger *, const ArchiveInfoMap &);
  35. _kc_hidden HRESULT PopulateUserList(void);
  36. _kc_hidden HRESULT PopulateFromContainer(LPABCONT container);
  37. _kc_hidden HRESULT UpdateOne(const abentryid_t &user_id, const ArchiveInfo &, unsigned int attach_flags);
  38. _kc_hidden HRESULT RemoveImplicit(const entryid_t &store_id, const tstring &usen, const abentryid_t &user_id, const ObjectEntryList &archives);
  39. _kc_hidden HRESULT ParseCoupling(const tstring &coupling, tstring *archive, tstring *folder);
  40. _kc_hidden HRESULT AddCouplingBased(const tstring &user, const std::list<tstring> &couplings, unsigned int attach_flags);
  41. _kc_hidden HRESULT AddServerBased(const tstring &user, const abentryid_t &user_id, const std::list<tstring> &servers, unsigned int attach_flags);
  42. _kc_hidden HRESULT VerifyAndUpdate(const abentryid_t &user_id, const ArchiveInfo &, unsigned int attach_flags);
  43. _kc_hidden HRESULT FindArchiveEntry(const tstring &archive, const tstring &folder, SObjectEntry *obj_entry);
  44. ArchiverSessionPtr m_ptrSession;
  45. ECLogger *m_lpLogger;
  46. ArchiveInfoMap m_mapArchiveInfo;
  47. };
  48. } /* namespace */
  49. #endif // !defined ARCHIVESTATEUPDATER_H_INCLUDED