summaryrefslogtreecommitdiffstats
path: root/src/main/thrift
diff options
context:
space:
mode:
authorSimon Rettberg2015-06-05 11:25:50 +0200
committerSimon Rettberg2015-06-05 11:25:50 +0200
commit693392fe6c0022e7ec5060192ee322c7753b0d90 (patch)
tree855245927778c6b069714909929684d1da7d449f /src/main/thrift
parentCleanup thrift shandling stuff (diff)
downloadmaster-sync-shared-693392fe6c0022e7ec5060192ee322c7753b0d90.tar.gz
master-sync-shared-693392fe6c0022e7ec5060192ee322c7753b0d90.tar.xz
master-sync-shared-693392fe6c0022e7ec5060192ee322c7753b0d90.zip
Changes for Dozmod v1.1
Diffstat (limited to 'src/main/thrift')
-rw-r--r--src/main/thrift/bwlp.thrift242
-rw-r--r--src/main/thrift/imagemaster.thrift162
-rw-r--r--src/main/thrift/sat.thrift104
3 files changed, 242 insertions, 266 deletions
diff --git a/src/main/thrift/bwlp.thrift b/src/main/thrift/bwlp.thrift
new file mode 100644
index 0000000..4d2a588
--- /dev/null
+++ b/src/main/thrift/bwlp.thrift
@@ -0,0 +1,242 @@
+/**
+ * Define some namespace/package name for our stuff
+ */
+namespace java org.openslx.bwlp.thrift.iface
+
+typedef i64 int
+
+typedef string ID
+typedef string Token
+typedef string UUID
+typedef string UserID
+typedef i64 UnixTimestamp
+
+// ################# ENUM ################
+
+enum AuthorizationError {
+ GENERIC_ERROR,
+ NOT_AUTHENTICATED,
+ NO_PERMISSION
+}
+
+enum AuthenticationError {
+ GENERIC_ERROR,
+ INVALID_CREDENTIALS,
+ ACCOUNT_SUSPENDED,
+ INVALID_ORGANIZATION,
+ INVALID_KEY,
+ CHALLENGE_FAILED,
+ BANNED_NETWORK
+}
+
+enum ImageDataError {
+ INVALID_DATA,
+ UNKNOWN_IMAGE
+}
+
+enum UploadError {
+ INVALID_CRC,
+ BROKEN_BLOCK,
+ GENERIC_ERROR,
+ INVALID_METADATA,
+ ALREADY_COMPLETE
+}
+
+// ############## STRUCT ###############
+
+struct UserInfo {
+ 1: string userId,
+ 2: string firstName,
+ 3: string lastName,
+ 4: string eMail,
+ 5: string organizationId
+}
+
+struct OrganizationData {
+ 1: string organizationId,
+ 2: string displayName,
+ 3: string ecpUrl,
+ 4: list<string> suffixList,
+}
+
+struct SessionData {
+ 1: ID sessionId,
+ 2: Token authToken,
+ 3: string serverAddress
+}
+
+struct ServerSessionData {
+ 1: ID sessionId
+}
+
+struct OperatingSystem {
+ 1: i32 osId,
+ 2: string osName,
+ 3: map<string, string> virtualizerOsId,
+ 4: string architecture,
+}
+
+struct ImagePermission {
+ 1: bool read
+ 2: bool write
+ 3: bool admin
+ 4: bool link
+}
+
+struct LecturePermission {
+ 1: bool write
+ 2: bool admin
+}
+
+struct ImageBaseData {
+ 1: UUID imageBaseId,
+ 3: string imageName,
+ 10: string description,
+ 5: i32 osId,
+ 6: UnixTimestamp createTime,
+ 7: UnixTimestamp updateTime,
+ 9: string isTemplate,
+}
+struct ImagePermissionCombined {
+ 1: Image image,
+ 2: ImagePermission permission,
+}
+
+struct Lecture {
+ 1: optional UUID lectureId,
+ 2: string lectureName,
+ 3: string isActive,
+ 4: UnixTimestamp startTime,
+ 5: UnixTimestamp endTime,
+ 6: UnixTimestamp lastUsed,
+ 7: string description,
+ 8: UUID imageId
+}
+struct LecturePermissionCombined {
+ 1: Lecture lecture,
+ 2: LecturePermission permission,
+}
+
+struct TransferInformation {
+ 1: string token,
+ 2: i32 plainPort,
+ 3: i32 sslPort,
+}
+
+// ############ EXCEPTION ######################
+
+exception TUploadFinishException {
+ 1: string reason,
+}
+
+exception TUploadRejectedException {
+ 1: string reason,
+}
+
+exception TAuthorizationException {
+ 1: AuthorizationError number,
+ 2: string message
+}
+
+exception TAuthenticationException {
+ 1: AuthenticationError number,
+ 2: string message
+}
+
+exception TInvalidTokenException {
+}
+
+exception TImageDataException {
+ 1: ImageDataError number,
+ 2: string message
+}
+
+exception TDownloadRejectedException {
+ 1: UploadError number,
+ 2: string message
+}
+
+// #############################################
+
+service SatelliteServer {
+ int getVersion(),
+
+ // File transfer related
+ TransferInformation requestUpload(1: string userToken, 2: i64 fileSize, 3: list<binary> blockHashes)
+ throws (1:TUploadRejectedException rejection),
+ void cancelUpload(1: string uploadToken),
+ TransferInformation requestDownload(1: string userToken, 2: string imageId),
+ void cancelDownload(1: string downloadToken),
+
+ // Authentication
+ bool authenticated(1: Token userToken),
+ bool setSessionInvalid(1: Token userToken),
+
+ // Misc
+ list<OperatingSystem> getOperatingSystems(),
+ list<string> getAllOrganizations(1: Token userToken),
+
+ // Image related
+ string finishImageUpload(1: string imageName, 2: string description, 10: bool license, 11: bool internet, 17: int shareMode, 18: string os, 22: Token uploadToken)
+ throws (1:TUploadFinishException failure),
+ list<ImagePermissionCombined> getImageList(1: Token userToken),
+ ImagePermissionCombined getImageData(1: UUID imageId, 3: Token userToken),
+ bool updateImageData(1: Token userToken, 9: Image image),
+
+ // Lecture related
+ bool writeLecture(1: Token userToken, 2: Lecture lecture),
+ list<Lecture> getLectureList(1: Token userToken),
+ Lecture getLectureData(1: UUID lectureId, 2: Token userToken),
+ bool deleteImage(1: string id, 2: string version, 3: string token),
+ bool connectedToLecture(1: string id, 2: string version, 3: string token),
+ bool deleteLecture(1: string lectureId, 2: string token),
+ bool checkUser(1: string username, 2: string token),
+ bool writeImagePermissions(1: Token userToken, 2: UUID imageId, 3: list<ImagePermission> permissions),
+ bool writeLecturePermissions(1: Token userToken, 2: UUID lectureId, 3: list<LecturePermission> permissions),
+ map<UserID, UserInfo> getImagePermissions(1: Token userToken, 2: UUID imageId),
+ map<UserID, UserInfo> getLecturePermissions(1: Token userToken, 2: UUID lectureId),
+ void deleteAllAdditionalImagePermissions(1: UUID imageID, 2: Token userToken),
+ void deleteAllAdditionalLecturePermissions(1: UUID lectureID, 2: Token userToken),
+}
+
+// Central master server
+
+service MasterServer {
+
+/*
+ * Client (User's Desktop App) calls
+ */
+ bool ping(),
+
+ SessionData authenticate(1:string login, 2:string password) throws (1:AuthenticationException failure),
+
+ list<OrganizationData> getOrganizations(),
+
+ list<UserInfo> findUser(1:ID sessionId, 2:string organizationId, 3:string searchTerm) throws (1:AuthorizationException failure),
+
+ list<ImageData> getPublicImages(1:ID sessionId, 2:i32 page) throws (1:AuthorizationException failure),
+
+ list<OperatingSystem> getOperatingSystems(),
+
+/*
+ * Server (Satellite) calls
+ */
+ UserInfo getUserFromToken(1:Token token) throws (1:InvalidTokenException failure),
+
+ bool isServerAuthenticated(1:string serverSessionId),
+
+ binary startServerAuthentication(1:string organization) throws (1: AuthenticationException failure),
+
+ ServerSessionData serverAuthenticate(1:string organizationId, 2:binary challengeResponse) throws (1:AuthenticationException failure),
+
+ UploadData submitImage(1:ID serverSessionId, 2:ImageData imageDescription, 3:list<i32> crcSums) throws (1:AuthorizationException failure, 2: ImageDataException failure2, 3: UploadException failure3),
+
+ DownloadData getImage(2:ID serverSessionId, 1:UUID uuid) throws (1:AuthorizationException failure, 2: ImageDataException failure2),
+
+ bool publishUser(1:ID serverSessionId, 2:UserInfo user) throws (1:AuthorizationException failure),
+
+ bool registerSatellite(1:string organizationId, 2:string address, 3:string modulus, 4:string exponent),
+
+ bool updateSatelliteAddress(1:ID serverSessionId, 2:string address),
+
+}
diff --git a/src/main/thrift/imagemaster.thrift b/src/main/thrift/imagemaster.thrift
deleted file mode 100644
index 7d7b39e..0000000
--- a/src/main/thrift/imagemaster.thrift
+++ /dev/null
@@ -1,162 +0,0 @@
-/**
- * Define some namespace/package name for our stuff
- */
-
-namespace java org.openslx.imagemaster.thrift.iface
-namespace php testing
-
-typedef string ID
-typedef string Token
-typedef string UUID
-typedef i64 UnixTimestamp
-
-enum AuthorizationError {
- GENERIC_ERROR,
- NOT_AUTHENTICATED,
- NO_PERMISSION
-}
-
-enum AuthenticationError {
- GENERIC_ERROR,
- INVALID_CREDENTIALS,
- ACCOUNT_SUSPENDED,
- INVALID_ORGANIZATION,
- INVALID_KEY,
- CHALLENGE_FAILED,
- BANNED_NETWORK
-}
-
-enum ImageDataError {
- INVALID_DATA,
- UNKNOWN_IMAGE
-}
-
-enum UploadError {
- INVALID_CRC,
- BROKEN_BLOCK,
- GENERIC_ERROR,
- INVALID_METADATA,
- ALREADY_COMPLETE
-}
-
-exception AuthorizationException {
- 1: AuthorizationError number,
- 2: string message
-}
-
-exception AuthenticationException {
- 1: AuthenticationError number,
- 2: string message
-}
-
-exception InvalidTokenException {
-}
-
-exception ImageDataException {
- 1: ImageDataError number,
- 2: string message
-}
-
-exception UploadException {
- 1: UploadError number,
- 2: string message
-}
-
-exception DownloadException {
- 1: UploadError number,
- 2: string message
-}
-
-struct UserInfo {
- 1: string userId,
- 2: string firstName,
- 3: string lastName,
- 4: string eMail,
- 5: string organizationId
-}
-
-struct OrganizationData {
- 1: string organizationId,
- 2: string displayName,
- 3: string ecpUrl,
- 4: list<string> suffixList,
-}
-
-struct SessionData {
- 1: ID sessionId,
- 2: Token authToken,
- 3: string serverAddress
-}
-
-struct UploadData {
- 1: string token,
- 2: i32 port
-}
-
-struct DownloadData {
- 1: string token,
- 2: i32 port,
- 3: list<i32> crcSums
-}
-
-struct ServerSessionData {
- 1: ID sessionId
-}
-
-struct ImageData {
- 1: UUID uuid,
- 2: i32 revision,
- 3: string title,
- 4: UnixTimestamp createTime,
- 5: UnixTimestamp updateTime,
- 6: string ownerLogin,
- 7: i32 operatingSystem,
- 8: bool isValid,
- 9: bool isDeleted,
- // 10: deleted, do not reuse!
- 11: string description,
- 12: i64 fileSize,
-}
-
-service ImageServer {
-
-/*
- * Client calls
- */
- bool ping(),
-
- SessionData authenticate(1:string login, 2:string password) throws (1:AuthenticationException failure),
-
- list<OrganizationData> getOrganizations(),
-
- list<UserInfo> findUser(1:ID sessionId, 2:string organizationId, 3:string searchTerm) throws (1:AuthorizationException failure),
-
- list<ImageData> getPublicImages(1:ID sessionId, 2:i32 page) throws (1:AuthorizationException failure),
-
-/*
- * Server calls
- */
- UserInfo getUserFromToken(1:Token token) throws (1:InvalidTokenException failure),
-
- bool isServerAuthenticated(1:string serverSessionId),
-
- binary startServerAuthentication(1:string organization) throws (1: AuthenticationException failure),
-
- ServerSessionData serverAuthenticate(1:string organizationId, 2:binary challengeResponse) throws (1:AuthenticationException failure),
-
- UploadData submitImage(1:ID serverSessionId, 2:ImageData imageDescription, 3:list<i32> crcSums) throws (1:AuthorizationException failure, 2: ImageDataException failure2, 3: UploadException failure3),
-
- DownloadData getImage(2:ID serverSessionId, 1:UUID uuid) throws (1:AuthorizationException failure, 2: ImageDataException failure2),
-
- bool publishUser(1:ID serverSessionId, 2:UserInfo user) throws (1:AuthorizationException failure),
-
- bool registerSatellite(1:string organizationId, 2:string address, 3:string modulus, 4:string exponent),
-
- bool updateSatelliteAddress(1:ID serverSessionId, 2:string address),
-
-/*
- * Local interfacing
- */
- ServerSessionData addSession(1:string localPassword, 2:UserInfo userInfo),
-
-}
diff --git a/src/main/thrift/sat.thrift b/src/main/thrift/sat.thrift
deleted file mode 100644
index 1a731ab..0000000
--- a/src/main/thrift/sat.thrift
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * Define some namespace/package name for our stuff
- */
-namespace java org.openslx.sat.thrift.iface
-
-typedef i64 int
-
-struct User{
- 1: string userName,
- 2: string password,
- 3: string path,
-}
-
-struct Image{
- 1: string id,
- 2: string version,
- 3: string imageName,
- 4: string licenseRestriction,
- 5: string osName,
- 6: string lectureName,
- 7: string updateTime,
- 8: string userData,
- 9: string isTemplate,
- 10: string description,
- 11: string imageSize,
-}
-struct Lecture{
- 1: string id,
- 2: string lecturename,
- 3: string isActive,
- 4: string starttime,
- 5: string endtime,
- 6: string lastused,
- 7: string desc,
- 8: string imagename,
- 9: string username,
-}
-struct Person{
- 1: string userID,
- 2: string Nachname,
- 3: string Vorname,
- 4: string mail,
- 5: bool image_read
- 6: bool image_write
- 7: bool image_admin
- 8: bool image_link
- 9: bool lecture_read
- 10: bool lecture_write
- 11: bool lecture_admin
-}
-service Server{
- int getVersion(),
- User getFtpUser(1: string token),
- bool authenticated(1: string token),
- bool setSessionInvalid(1: string token),
- int DeleteFtpUser(1: string user, 2: string token),
- string getPathOfImage(1: string image_id, 2: string version, 3: string token),
- string setInstitution(1: string university, 2:string token),
- bool writeVLdata(1: string imagename, 2: string desc, 8: string Tel, 9: string Fak, 10: bool license, 11: bool internet, 12: int ram, 13: int cpu, 14: string imagePath, 15: bool isTemplate, 16: i64 filesize, 17: int shareMode, 18: string os, 19: string uid, 20:string token, 21: string userID),
- list<Image> getImageListPermissionWrite(1: string userID, 2: string token),
- list<Image> getImageListPermissionRead(1: string userID, 2: string token),
- list<Image> getImageListPermissionLink(1: string userID, 2: string token),
- list<Image> getImageListPermissionAdmin(1: string userID, 2: string token),
- list<Image> getImageListAllTemplates(1: string token),
- list<Image> getImageList(1: string userID, 2: string token),
- list<Lecture> getLectureList(1: string token),
- list<Lecture> getLectureListPermissionRead(1: string token),
- list<Lecture> getLectureListPermissionWrite(1: string token),
- list<Lecture> getLectureListPermissionAdmin(1: string token),
- list<string> getAllOS(1: string token),
- list<string> getAllUniversities(1: string token),
- map<string,string> getPersonData(1: string Vorname, 2: string Nachname, 3: string token),
- map<string,string> getItemOwner(1: string itemID, 2: string token),
- void setPerson(1: string userID, 2: string token, 3: string institution),
- bool writeLecturedata(1: string name, 2: string shortdesc, 3: string desc, 4: string startDate, 5: string endDate, 6: bool isActive, 7: string imagename, 8: string token, 13: string Tel, 14: string Fak, 16: string lectureID, 17: string university),
- bool startFileCopy(1: string file, 2:string token),
- map<string,string> getImageData(1: string imageid, 2: string imageversion, 3: string token),
- map<string,string> getLectureData(1: string lectureid, 2: string token),
- bool updateImageData(1: string name, 2: string newName, 3: string desc, 4: string image_path, 5: bool license, 6: bool internet, 7: int ram, 8: int cpu, 9: string id, 10: string version, 11: bool isTemplate, 12: i64 filesize, 13: int shareMode, 14: string os, 15: string token),
- bool deleteImageData(1: string id, 2: string version, 3: string token),
- bool updateLecturedata(1: string name, 2: string newName, 3: string shortdesc, 4: string desc, 5: string startDate, 6: string endDate, 7: bool isActive, 8: string imageid, 9: string imageversion, 10: string token, 15: string Tel, 16: string Fak, 17: string id, 18: string university),
- bool deleteImageServer(1: string id, 2: string version, 3: string token),
- bool deleteImageByPath(1: string image_path),
- bool connectedToLecture(1: string id, 2: string version, 3: string token),
- bool deleteLecture(1: string id, 2: string token, 3: string university),
- bool checkUser(1: string username, 2: string token),
- bool createUser(1: string token, 2: string university),
- bool writeImageRights(1: string imagename, 2: string token, 3: string role, 4: string university, 5: string userID),
- bool writeAdditionalImageRights(1: string imageName, 2: string userID, 3: bool isRead, 4: bool isWrite, 5: bool isLinkAllowed, 6: bool isAdmin, 7: string token),
- bool writeLectureRights(1: string lectureID, 2: string role, 3: string token, 4: string university, 5: string userID),
- bool writeAdditionalLectureRights(1: string lectureName, 2: string userID, 3: bool isRead, 4: bool isWrite, 5: bool isAdmin, 6: string token),
- list<Person>getAllOtherSatelliteUsers(1: list<string> userID, 2: string token),
- list<Person>getPermissionForUserAndImage(1: string token, 2: string imageID, 3: string userID),
- list<string>getAdditionalImageContacts(1: string imageID, 2: string token),
- list<Person>getPermissionForUserAndLecture(1: string token, 2: string lectureID, 3: string userID),
- void deleteAllAdditionalImagePermissions(1: string imageID, 2:string token, 3: string userID),
- void deleteAllAdditionalLecturePermissions(1: string lectureID, 2: string token, 3: string userID),
- string getOsNameForGuestOs(1: string guestOS, 2: string token),
- bool userIsImageAdmin(1: string imageID, 2: string token, 3: string userID),
- bool userIsLectureAdmin(1: string userID, 2: string lectureID, 3: string token),
- string createRandomUUID(1: string token),
- string getInstitutionByID(1: string institutionID)
-
-}