summaryrefslogtreecommitdiffstats
path: root/src/Common/UserDBBackend.h
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-07-15 23:11:54 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-07-15 23:11:54 +0200
commitcaeb73a2cdf6db24490bbe3657372fb1ba52b78e (patch)
treeadf4f812f7a18fe35d8bc49cb7b1ef6e8ea513a8 /src/Common/UserDBBackend.h
parent5c18630e1c81ac5267c9356e27c1a8f81b4ef6f7 (diff)
downloadmad-caeb73a2cdf6db24490bbe3657372fb1ba52b78e.tar
mad-caeb73a2cdf6db24490bbe3657372fb1ba52b78e.zip
UserManager überarbeitet
UserConfigBackend eingeführt
Diffstat (limited to 'src/Common/UserDBBackend.h')
-rw-r--r--src/Common/UserDBBackend.h137
1 files changed, 137 insertions, 0 deletions
diff --git a/src/Common/UserDBBackend.h b/src/Common/UserDBBackend.h
new file mode 100644
index 0000000..5267ef3
--- /dev/null
+++ b/src/Common/UserDBBackend.h
@@ -0,0 +1,137 @@
+/*
+ * UserDBBackend.h
+ *
+ * Copyright (C) 2008 Matthias Schiffer <matthias@gamezock.de>
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MAD_SERVER_USERDBBACKEND_H_
+#define MAD_SERVER_USERDBBACKEND_H_
+
+#include <config.h>
+
+#include <Core/Exception.h>
+
+#include "UserInfo.h"
+#include "GroupInfo.h"
+
+#include <map>
+#include <set>
+#include <string>
+
+#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <boost/smart_ptr.hpp>
+
+
+namespace Mad {
+namespace Common {
+
+class UserCache;
+class UserManager;
+
+class UserDBBackend {
+ protected:
+ friend class UserCache;
+ friend class UserManager;
+
+ UserDBBackend() {}
+
+ virtual boost::shared_ptr<const std::map<unsigned long, UserInfo> > getUserList(boost::posix_time::ptime *timestamp _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+ virtual boost::shared_ptr<const UserInfo> getUserInfo(unsigned long uid _UNUSED_PARAMETER_, boost::posix_time::ptime *timestamp _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+ virtual boost::shared_ptr<const UserInfo> getUserInfoByName(const std::string &name _UNUSED_PARAMETER_, boost::posix_time::ptime *timestamp _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+ virtual boost::shared_ptr<const std::set<unsigned long> > getUserGroupList(unsigned long uid _UNUSED_PARAMETER_, boost::posix_time::ptime *timestamp _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+
+ virtual boost::shared_ptr<const std::map<unsigned long, GroupInfo> > getGroupList(boost::posix_time::ptime *timestamp _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+ virtual boost::shared_ptr<const GroupInfo> getGroupInfo(unsigned long gid _UNUSED_PARAMETER_, boost::posix_time::ptime *timestamp _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+ virtual boost::shared_ptr<const GroupInfo> getGroupInfoByName(const std::string &name _UNUSED_PARAMETER_, boost::posix_time::ptime *timestamp _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+
+ virtual boost::shared_ptr<const std::set<unsigned long> > getGroupUserList(unsigned long gid _UNUSED_PARAMETER_, boost::posix_time::ptime *timestamp _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+ virtual boost::shared_ptr<const std::multimap<unsigned long, unsigned long> > getFullUserGroupList(boost::posix_time::ptime *timestamp _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+
+ virtual void setPassword(unsigned long uid _UNUSED_PARAMETER_, const std::string &password _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+
+ virtual void addUser(const UserInfo &userInfo _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+ virtual void updateUser(unsigned long uid _UNUSED_PARAMETER_, const UserInfo &userInfo _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+ virtual void deleteUser(unsigned long uid _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+
+ virtual void addGroup(const GroupInfo &groupInfo _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+ virtual void updateGroup(unsigned long gid _UNUSED_PARAMETER_, const GroupInfo &groupInfo _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+ virtual void deleteGroup(unsigned long gid _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+ virtual void addUserToGroup(unsigned long uid _UNUSED_PARAMETER_, unsigned long gid _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+ virtual void deleteUserFromGroup(unsigned long uid _UNUSED_PARAMETER_, unsigned long gid _UNUSED_PARAMETER_) throw(Core::Exception) {
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+ }
+
+ public:
+ virtual ~UserDBBackend() {}
+
+ virtual const std::string& getName() = 0;
+};
+
+}
+}
+
+#endif /* MAD_SERVER_USERDBBACKEND_H_ */