From f2f1d5b1da4f985bcbb0c075cf42efcacecae2a6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 3 Jul 2009 17:23:37 +0200 Subject: =?UTF-8?q?Timestamps=20f=C3=BCr=20Benutzercache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/UserCache.h | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'src/Common/UserCache.h') diff --git a/src/Common/UserCache.h b/src/Common/UserCache.h index 548be2e..0fe26be 100644 --- a/src/Common/UserCache.h +++ b/src/Common/UserCache.h @@ -24,7 +24,7 @@ #include -#include +#include namespace Mad { namespace Common { @@ -40,32 +40,35 @@ class UserCache : public UserBackend, private boost::noncopyable { boost::shared_ptr backend; - boost::shared_mutex mutex; + boost::recursive_mutex mutex; boost::shared_ptr > users; boost::shared_ptr > userNames; Core::Exception userException; + boost::posix_time::ptime userTime; boost::shared_ptr > groups; boost::shared_ptr > groupNames; Core::Exception groupException; + boost::posix_time::ptime groupTime; boost::shared_ptr > userGroups; boost::shared_ptr > groupUsers; Core::Exception userGroupException; + boost::posix_time::ptime userGroupTime; protected: - virtual boost::shared_ptr > getUserList() throw(Core::Exception); - virtual boost::shared_ptr getUserInfo(unsigned long uid) throw(Core::Exception); - virtual boost::shared_ptr getUserInfoByName(const std::string &name) throw(Core::Exception); - virtual boost::shared_ptr > getUserGroupList(unsigned long uid) throw(Core::Exception); + virtual boost::shared_ptr > getUserList(boost::posix_time::ptime *timestamp) throw(Core::Exception); + virtual boost::shared_ptr getUserInfo(unsigned long uid, boost::posix_time::ptime *timestamp) throw(Core::Exception); + virtual boost::shared_ptr getUserInfoByName(const std::string &name, boost::posix_time::ptime *timestamp) throw(Core::Exception); + virtual boost::shared_ptr > getUserGroupList(unsigned long uid, boost::posix_time::ptime *timestamp) throw(Core::Exception); - virtual boost::shared_ptr > getGroupList() throw(Core::Exception); - virtual boost::shared_ptr getGroupInfo(unsigned long gid) throw(Core::Exception); - virtual boost::shared_ptr getGroupInfoByName(const std::string &name) throw(Core::Exception); - virtual boost::shared_ptr > getGroupUserList(unsigned long gid) throw(Core::Exception); + virtual boost::shared_ptr > getGroupList(boost::posix_time::ptime *timestamp) throw(Core::Exception); + virtual boost::shared_ptr getGroupInfo(unsigned long gid, boost::posix_time::ptime *timestamp) throw(Core::Exception); + virtual boost::shared_ptr getGroupInfoByName(const std::string &name, boost::posix_time::ptime *timestamp) throw(Core::Exception); + virtual boost::shared_ptr > getGroupUserList(unsigned long gid, boost::posix_time::ptime *timestamp) throw(Core::Exception); - virtual boost::shared_ptr > getFullUserGroupList() throw(Core::Exception); + virtual boost::shared_ptr > getFullUserGroupList(boost::posix_time::ptime *timestamp) throw(Core::Exception); virtual void setPassword(unsigned long uid, const std::string &password) throw(Core::Exception) { backend->setPassword(uid, password); @@ -75,7 +78,9 @@ class UserCache : public UserBackend, private boost::noncopyable { backend->addUser(userInfo); } - UserCache(Application *application0, boost::shared_ptr backend0) : application(application0), backend(backend0) {} + UserCache(Application *application0, boost::shared_ptr backend0) : application(application0), backend(backend0), + userTime(boost::posix_time::not_a_date_time), groupTime(boost::posix_time::not_a_date_time), + userGroupTime(boost::posix_time::not_a_date_time) {} }; } -- cgit v1.2.3