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"
22 GDESession(const std::string& serverAddress, const Credentials& credentials=Credentials())
23 : _serverAddress(serverAddress), _credentials(credentials)
25 GDESession(const GDESession& x)
26 : _serverAddress(x._serverAddress), _credentials(x._credentials)
30 inline std::string getServerAddress() const { return _serverAddress; }
31 //inline void setServerAddress(const std::string& serverAddress) { this->_serverAddress = serverAddress; }
33 inline const Credentials& getCredentials() const { return _credentials; }
34 //inline void setCredentials(const Credentials& credentials) { this->_credentials = credentials; }
36 std::string getServiceURI(const std::string& serviceName) const;
40 const User createUser(const std::string& name, const std::string& password);
41 bool deleteUser(const User&);
42 const User findUser(const std::string& name);
44 const UserGroup createUserGroup(const std::string& name);
45 bool deleteUserGroup(const UserGroup&);
46 const UserGroup findUserGroup(const std::string& name);
48 bool addToUserGroup(const UserGroup&, const User&);
49 bool removeFromUserGroup(const UserGroup&, const User&);
53 const Study createStudy(const std::string& name);
54 bool deleteStudy(const Study&);
56 bool setStudyState(const Study&, int);
57 const Study readStudy(int);
59 /* AttributesService */
61 const Attribute createAttribute(const std::string& name, const std::string& type, const std::string& value, int groupId, bool mandatory);
62 bool deleteAttribute(const Attribute&);
63 const Attribute readAttribute(int);
65 const AttributeGroup createAttributeGroup(const AttributeGroup& attributeGroup=AttributeGroup());
66 bool deleteAttributeGroup(const AttributeGroup&);
67 const AttributeGroup updateAttributeGroup(const AttributeGroup&);
68 const AttributeGroup readAttributeGroup(int);
72 const Profile createProfile(const Profile&);
73 bool deleteProfile(const Profile&);
74 const Profile readProfile(int);
75 const Profile updateProfile(const Profile&);
77 const ProfileAttribute createProfileAttribute(const std::string& name, const std::string& type, int profileId, bool mandatory);
78 bool deleteProfileAttribute(const ProfileAttribute&);
79 const ProfileAttribute readProfileAttribute(int);
80 const ProfileAttribute updateProfileAttribute(const ProfileAttribute&);
83 std::string _serverAddress;
84 Credentials _credentials;