1 #ifndef GDE_SESSION_HPP
2 #define GDE_SESSION_HPP
4 #include "Credentials.hpp"
6 #include "UserGroup.hpp"
8 #include "Attribute.hpp"
9 #include "AttributeGroup.hpp"
10 #include "Profile.hpp"
11 #include "ProfileAttribute.hpp"
23 GDESession(const std::string& serverAddress, const Credentials& credentials=Credentials())
24 : _serverAddress(serverAddress), _credentials(credentials)
26 GDESession(const GDESession& x)
27 : _serverAddress(x._serverAddress), _credentials(x._credentials)
31 inline std::string getServerAddress() const { return _serverAddress; }
32 //inline void setServerAddress(const std::string& serverAddress) { this->_serverAddress = serverAddress; }
34 inline const Credentials& getCredentials() const { return _credentials; }
35 //inline void setCredentials(const Credentials& credentials) { this->_credentials = credentials; }
37 std::string getServiceURI(const std::string& serviceName) const;
41 const User createUser(const std::string& name, const std::string& password);
42 bool deleteUser(const User&);
43 const User findUser(const std::string& name);
45 const UserGroup createUserGroup(const std::string& name);
46 bool deleteUserGroup(const UserGroup&);
47 const UserGroup findUserGroup(const std::string& name);
49 bool addToUserGroup(const UserGroup&, const User&);
50 bool removeFromUserGroup(const UserGroup&, const User&);
54 const Study createStudy(const std::string& name);
55 bool deleteStudy(const Study&);
57 bool setStudyState(const Study&, int);
58 const Study readStudy(int);
60 /* AttributesService */
62 const Attribute createAttribute(const std::string& name, const std::string& type, const std::string& value, int groupId, bool mandatory);
63 bool deleteAttribute(const Attribute&);
64 const Attribute readAttribute(int);
66 const AttributeGroup createAttributeGroup(const AttributeGroup& attributeGroup=AttributeGroup());
67 bool deleteAttributeGroup(const AttributeGroup&);
68 const AttributeGroup updateAttributeGroup(const AttributeGroup&);
69 const AttributeGroup readAttributeGroup(int);
73 const Profile createProfile(const Profile&);
74 bool deleteProfile(const Profile&);
75 const Profile readProfile(int);
76 const Profile updateProfile(const Profile&);
78 const ProfileAttribute createProfileAttribute(const std::string& name, const std::string& type, int profileId, bool mandatory);
79 bool deleteProfileAttribute(const ProfileAttribute&);
80 const ProfileAttribute readProfileAttribute(int);
81 const ProfileAttribute updateProfileAttribute(const ProfileAttribute&);
85 const File createFile(const std::string& name);
86 bool deleteFile(const File&);
87 const File updateFile(const File&);
88 const File readFile(int fileId);
89 const File findByName(const std::string& name);
92 std::string _serverAddress;
93 Credentials _credentials;