]> SALOME platform Git repositories - modules/gde.git/blob - projects/GDE_API_CPP/api/src/GDESession.hpp
Salome HOME
FileService
[modules/gde.git] / projects / GDE_API_CPP / api / src / GDESession.hpp
1 #ifndef GDE_SESSION_HPP
2 #define GDE_SESSION_HPP
3
4 #include "Credentials.hpp"
5 #include "User.hpp"
6 #include "UserGroup.hpp"
7 #include "Study.hpp"
8 #include "Attribute.hpp"
9 #include "AttributeGroup.hpp"
10 #include "Profile.hpp"
11 #include "ProfileAttribute.hpp"
12 #include "File.hpp"
13
14 #include <string>
15 #include <vector>
16
17 namespace gde {
18
19   class GDESession {
20
21   public:
22
23     GDESession(const std::string& serverAddress, const Credentials& credentials=Credentials())
24       : _serverAddress(serverAddress), _credentials(credentials)
25     {}
26     GDESession(const GDESession& x)
27       : _serverAddress(x._serverAddress), _credentials(x._credentials)
28     {}
29     ~GDESession() {}
30
31     inline std::string getServerAddress() const { return _serverAddress; }
32     //inline void setServerAddress(const std::string& serverAddress) { this->_serverAddress = serverAddress; }
33
34     inline const Credentials& getCredentials() const { return _credentials; }
35     //inline void setCredentials(const Credentials& credentials) { this->_credentials = credentials; }
36
37     std::string getServiceURI(const std::string& serviceName) const;
38
39     /* UserService */
40
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);
44
45     const UserGroup createUserGroup(const std::string& name);
46     bool deleteUserGroup(const UserGroup&);
47     const UserGroup findUserGroup(const std::string& name);
48
49     bool addToUserGroup(const UserGroup&, const User&);
50     bool removeFromUserGroup(const UserGroup&, const User&);
51
52     /* StudyService */
53
54     const Study createStudy(const std::string& name);
55     bool deleteStudy(const Study&);
56
57     bool setStudyState(const Study&, int);
58     const Study readStudy(int);
59
60     /* AttributesService */
61
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);
65
66     const AttributeGroup createAttributeGroup(const AttributeGroup& attributeGroup=AttributeGroup());
67     bool deleteAttributeGroup(const AttributeGroup&);
68     const AttributeGroup updateAttributeGroup(const AttributeGroup&);
69     const AttributeGroup readAttributeGroup(int);
70
71     /* ProfilesService */
72
73     const Profile createProfile(const Profile&);
74     bool deleteProfile(const Profile&);
75     const Profile readProfile(int);
76     const Profile updateProfile(const Profile&);
77
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&);
82
83     /* FileService */
84
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);
90
91   private:
92     std::string _serverAddress;
93     Credentials _credentials;
94
95   };
96
97 };
98
99 #endif