summaryrefslogtreecommitdiffstats
path: root/src/main/thrift
diff options
context:
space:
mode:
authorSimon Rettberg2014-06-30 16:34:05 +0200
committerSimon Rettberg2014-06-30 16:34:05 +0200
commite3e21cc1eb4c33c76d2c0195067c3d72b78b79f8 (patch)
treefad34ea7e7c336a9a1d7306c417974a093678354 /src/main/thrift
downloadmaster-sync-shared-e3e21cc1eb4c33c76d2c0195067c3d72b78b79f8.tar.gz
master-sync-shared-e3e21cc1eb4c33c76d2c0195067c3d72b78b79f8.tar.xz
master-sync-shared-e3e21cc1eb4c33c76d2c0195067c3d72b78b79f8.zip
Initial Commit
Diffstat (limited to 'src/main/thrift')
-rw-r--r--src/main/thrift/imagemaster.thrift119
1 files changed, 119 insertions, 0 deletions
diff --git a/src/main/thrift/imagemaster.thrift b/src/main/thrift/imagemaster.thrift
new file mode 100644
index 0000000..7986d4c
--- /dev/null
+++ b/src/main/thrift/imagemaster.thrift
@@ -0,0 +1,119 @@
+/**
+ * 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 Date
+
+enum AuthorizationError {
+ GENERIC_ERROR,
+ NOT_AUTHENTICATED,
+ NO_PERMISSION
+}
+
+enum AuthenticationError {
+ GENERIC_ERROR,
+ INVALID_CREDENTIALS,
+ ACCOUNT_SUSPENDED,
+ BANNED_NETWORK
+}
+
+enum ServerAuthenticationError {
+ GENERIC_ERROR,
+ INVALID_ORGANIZATION,
+ BANNED_NETWORK
+}
+
+enum ImageDataError {
+ INVALID_DATA,
+ UNKNOWN_IMAGE
+}
+
+exception AuthorizationException {
+ 1: AuthorizationError number,
+ 2: string message
+}
+
+exception AuthenticationException {
+ 1: AuthenticationError number,
+ 2: string message
+}
+
+exception InvalidTokenException {
+}
+
+exception ServerAuthenticationException {
+ 1: ServerAuthenticationError number,
+ 2: string message
+}
+
+exception ImageDataException {
+ 1: ImageDataError number,
+ 2: string message
+}
+
+struct UserInfo {
+ 1: string userId,
+ 2: string firstName,
+ 3: string lastName,
+ 4: string eMail
+}
+
+struct SessionData {
+ 1: ID sessionId,
+ 2: Token authToken,
+ 3: string serverAddress
+}
+
+struct FtpCredentials {
+ 1: string username,
+ 2: string password,
+ 3: string filename
+}
+
+struct ServerSessionData {
+ 1: ID sessionId
+}
+
+struct ImageData {
+ 1: UUID uuid,
+ 2: i32 imageVersion,
+ 3: string imageName,
+ 4: Date imageCreateTime,
+ 5: Date imageUpdateTime,
+ 6: string imageOwner,
+ 7: string conentOperatingSystem,
+ 8: bool statusIsValid,
+ 9: bool statusIsDeleted,
+ 10: string imageShortDescription,
+ 11: string imageLongDescription,
+ 12: i64 fileSize
+}
+
+service ImageServer {
+
+ bool ping(),
+
+ SessionData authenticate(1:string username, 2:string password) throws (1:AuthenticationException failure),
+
+ UserInfo getUserFromToken(1:Token token) throws (1:InvalidTokenException failure),
+
+ string startServerAuthentication(1:string organization) throws (1: ServerAuthenticationException failure),
+
+ ServerSessionData serverAuthenticate(1:string organization, 2:binary challengeResponse) throws (1:ServerAuthenticationException failure),
+
+ FtpCredentials submitImage(1:string serverSessionId, 2:ImageData imageDescription) throws (1:AuthorizationException failure, 2: ImageDataException failure2),
+
+ bool finishedUpload(1:string ftpUser, 2:ImageData imageDescription) throws (1: ImageDataException failure),
+
+ FtpCredentials getImage(1:UUID uuid, 2:string serverSessionId) throws (1:AuthorizationException failure, 2: ImageDataException failure2),
+
+ bool finishedDownload(1:string ftpUser)
+
+}
+