From e90286005f1cbedc77bfff91f867cb6aec25a595 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 11 Sep 2014 15:04:50 +0200 Subject: oops --- dozentenmodul/Dozentenmodul/forms-1.3.0-src.zip | Bin 158058 -> 0 bytes dozentenmodul/Dozentenmodul/forms-1.3.0.jar | Bin 123351 -> 0 bytes dozentenmodul/Dozentenmodul/pom.xml | 203 - .../src/main/java/auth/Authentification.java | 12 - .../src/main/java/config/config_file.java | 121 - .../src/main/java/ftp/DownloadTask.java | 117 - .../src/main/java/ftp/FTPException.java | 8 - .../src/main/java/ftp/FTPUtility.java | 199 - .../src/main/java/ftp/UploadTask.java | 108 - .../java/gui/image/CreateImageAllgemein_GUI.java | 464 - .../java/gui/image/CreateImageFreigabe_GUI.java | 258 - .../java/gui/image/CreateImageTechnisch_GUI.java | 473 - .../src/main/java/gui/image/DeleteImage_GUI.java | 1180 - .../java/gui/image/EditImageAllgemein_GUI.java | 531 - .../main/java/gui/image/EditImageFreigabe_GUI.java | 256 - .../java/gui/image/EditImageTechnisch_GUI.java | 518 - .../main/java/gui/image/FTPCreateUploader_GUI.java | 659 - .../main/java/gui/image/FTPEditDownloader_GUI.java | 590 - .../main/java/gui/image/FTPEditUploader_GUI.java | 664 - .../java/gui/image/FTPSearchDownloader_GUI.java | 635 - .../java/gui/image/PermissionCreateImage_GUI.java | 552 - .../java/gui/image/PermissionEditImage_GUI.java | 504 - .../main/java/gui/image/SearchEditImage_GUI.java | 1055 - .../src/main/java/gui/image/SearchImage_GUI.java | 963 - .../src/main/java/gui/intro/About_GUI.java | 97 - .../src/main/java/gui/intro/BillOfRights_GUI.java | 241 - .../src/main/java/gui/intro/Login_GUI.java | 434 - .../src/main/java/gui/intro/MainMenue_GUI.java | 606 - .../src/main/java/gui/intro/VmWareLink_GUI.java | 274 - .../gui/lecture/CreateLectureAllgemein_GUI.java | 579 - .../java/gui/lecture/CreateLectureLink_GUI.java | 1013 - .../main/java/gui/lecture/DeleteLecture_GUI.java | 720 - .../java/gui/lecture/EditLectureAllgemein_GUI.java | 594 - .../main/java/gui/lecture/EditLectureLink_GUI.java | 1020 - .../java/gui/lecture/EditLectureSearch_GUI.java | 824 - .../gui/lecture/PermissionCreateLecture_GUI.java | 546 - .../gui/lecture/PermissionEditLecture_GUI.java | 494 - .../main/java/gui/lecture/SearchLecture_GUI.java | 627 - .../Dozentenmodul/src/main/java/models/Client.java | 18 - .../Dozentenmodul/src/main/java/models/Image.java | 203 - .../src/main/java/models/ImageRights.java | 45 - .../src/main/java/models/Lecture.java | 141 - .../src/main/java/models/LectureRights.java | 37 - .../Dozentenmodul/src/main/java/models/Links.java | 31 - .../Dozentenmodul/src/main/java/models/Search.java | 46 - .../src/main/java/models/SessionData.java | 32 - .../src/main/java/models/Version.java | 24 - .../Dozentenmodul/src/main/java/models/person.java | 131 - .../Dozentenmodul/src/main/java/models/user.java | 23 - .../org/eclipse/wb/swt/SWTResourceManager.java | 447 - .../main/java/thrift/MasterThriftConnection.java | 43 - .../src/main/java/thrift/ThriftConnection.java | 53 - .../src/main/java/util/GuiOrganizer.java | 19 - .../src/main/java/util/OpenLinks.java | 25 - .../resources/img/Image_zu_Veranstaltung_HDD.png | Bin 34300 -> 0 bytes .../src/main/resources/img/Logo_bwLehrpool.png | Bin 29052 -> 0 bytes .../main/resources/img/e4_n_imgs2_bwl_vmc_v2.png | Bin 39124 -> 0 bytes .../src/test/java/bwlehrpool/AppTest.java | 38 - dozentenmodul/forms-1.3.0-src.zip | Bin 0 -> 158058 bytes dozentenmodul/forms-1.3.0.jar | Bin 0 -> 123351 bytes dozentenmodul/pom.xml | 203 + .../src/main/java/auth/Authentification.java | 12 + .../src/main/java/config/config_file.java | 121 + dozentenmodul/src/main/java/ftp/DownloadTask.java | 117 + dozentenmodul/src/main/java/ftp/FTPException.java | 8 + dozentenmodul/src/main/java/ftp/FTPUtility.java | 199 + dozentenmodul/src/main/java/ftp/UploadTask.java | 108 + .../java/gui/image/CreateImageAllgemein_GUI.java | 464 + .../java/gui/image/CreateImageFreigabe_GUI.java | 258 + .../java/gui/image/CreateImageTechnisch_GUI.java | 473 + .../src/main/java/gui/image/DeleteImage_GUI.java | 1180 + .../java/gui/image/EditImageAllgemein_GUI.java | 531 + .../main/java/gui/image/EditImageFreigabe_GUI.java | 256 + .../java/gui/image/EditImageTechnisch_GUI.java | 518 + .../main/java/gui/image/FTPCreateUploader_GUI.java | 659 + .../main/java/gui/image/FTPEditDownloader_GUI.java | 590 + .../main/java/gui/image/FTPEditUploader_GUI.java | 664 + .../java/gui/image/FTPSearchDownloader_GUI.java | 635 + .../java/gui/image/PermissionCreateImage_GUI.java | 552 + .../java/gui/image/PermissionEditImage_GUI.java | 504 + .../main/java/gui/image/SearchEditImage_GUI.java | 1055 + .../src/main/java/gui/image/SearchImage_GUI.java | 963 + .../src/main/java/gui/intro/About_GUI.java | 97 + .../src/main/java/gui/intro/BillOfRights_GUI.java | 241 + .../src/main/java/gui/intro/Login_GUI.java | 434 + .../src/main/java/gui/intro/MainMenue_GUI.java | 606 + .../src/main/java/gui/intro/VmWareLink_GUI.java | 274 + .../gui/lecture/CreateLectureAllgemein_GUI.java | 579 + .../java/gui/lecture/CreateLectureLink_GUI.java | 1013 + .../main/java/gui/lecture/DeleteLecture_GUI.java | 720 + .../java/gui/lecture/EditLectureAllgemein_GUI.java | 594 + .../main/java/gui/lecture/EditLectureLink_GUI.java | 1020 + .../java/gui/lecture/EditLectureSearch_GUI.java | 824 + .../gui/lecture/PermissionCreateLecture_GUI.java | 546 + .../gui/lecture/PermissionEditLecture_GUI.java | 494 + .../main/java/gui/lecture/SearchLecture_GUI.java | 627 + dozentenmodul/src/main/java/models/Client.java | 18 + dozentenmodul/src/main/java/models/Image.java | 203 + .../src/main/java/models/ImageRights.java | 45 + dozentenmodul/src/main/java/models/Lecture.java | 141 + .../src/main/java/models/LectureRights.java | 37 + dozentenmodul/src/main/java/models/Links.java | 31 + dozentenmodul/src/main/java/models/Search.java | 46 + .../src/main/java/models/SessionData.java | 32 + dozentenmodul/src/main/java/models/Version.java | 24 + dozentenmodul/src/main/java/models/person.java | 131 + dozentenmodul/src/main/java/models/user.java | 23 + .../org/eclipse/wb/swt/SWTResourceManager.java | 447 + .../main/java/thrift/MasterThriftConnection.java | 43 + .../src/main/java/thrift/ThriftConnection.java | 53 + dozentenmodul/src/main/java/util/GuiOrganizer.java | 19 + dozentenmodul/src/main/java/util/OpenLinks.java | 25 + .../resources/img/Image_zu_Veranstaltung_HDD.png | Bin 0 -> 34300 bytes .../src/main/resources/img/Logo_bwLehrpool.png | Bin 0 -> 29052 bytes .../main/resources/img/e4_n_imgs2_bwl_vmc_v2.png | Bin 0 -> 39124 bytes .../src/test/java/bwlehrpool/AppTest.java | 38 + dozentenmodulserver/Dozentenmodulserver/pom.xml | 116 - .../src/main/java/models/Configuration.java | 39 - .../src/main/java/server/BinaryListener.java | 48 - .../src/main/java/server/Image.java | 1188 - .../src/main/java/server/Lecture.java | 1188 - .../src/main/java/server/Server.java | 27824 ------------------- .../src/main/java/server/ServerHandler.java | 547 - .../src/main/java/server/StartServer.java | 75 - .../src/main/java/server/TBinaryProtocolSafe.java | 123 - .../src/main/java/server/User.java | 588 - .../Dozentenmodulserver/src/main/java/sql/SQL.java | 1013 - .../src/main/java/util/XMLCreator.java | 230 - .../src/test/java/bwlehrpool/AppTest.java | 38 - .../Dozentenmodulserver/thrift/server.thrift | 61 - dozentenmodulserver/pom.xml | 116 + .../src/main/java/models/Configuration.java | 39 + .../src/main/java/server/BinaryListener.java | 48 + .../src/main/java/server/Image.java | 1188 + .../src/main/java/server/Lecture.java | 1188 + .../src/main/java/server/Server.java | 27824 +++++++++++++++++++ .../src/main/java/server/ServerHandler.java | 547 + .../src/main/java/server/StartServer.java | 75 + .../src/main/java/server/TBinaryProtocolSafe.java | 123 + dozentenmodulserver/src/main/java/server/User.java | 588 + dozentenmodulserver/src/main/java/sql/SQL.java | 1013 + .../src/main/java/util/XMLCreator.java | 230 + .../src/test/java/bwlehrpool/AppTest.java | 38 + dozentenmodulserver/thrift/server.thrift | 61 + 144 files changed, 52573 insertions(+), 52573 deletions(-) delete mode 100644 dozentenmodul/Dozentenmodul/forms-1.3.0-src.zip delete mode 100644 dozentenmodul/Dozentenmodul/forms-1.3.0.jar delete mode 100644 dozentenmodul/Dozentenmodul/pom.xml delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/auth/Authentification.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/config/config_file.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/ftp/DownloadTask.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/ftp/FTPException.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/ftp/FTPUtility.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/ftp/UploadTask.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/intro/About_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/intro/Login_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/models/Client.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/models/Image.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/models/ImageRights.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/models/Lecture.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/models/LectureRights.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/models/Links.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/models/Search.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/models/SessionData.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/models/Version.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/models/person.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/models/user.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/org/eclipse/wb/swt/SWTResourceManager.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/thrift/MasterThriftConnection.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/thrift/ThriftConnection.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/util/GuiOrganizer.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/java/util/OpenLinks.java delete mode 100644 dozentenmodul/Dozentenmodul/src/main/resources/img/Image_zu_Veranstaltung_HDD.png delete mode 100644 dozentenmodul/Dozentenmodul/src/main/resources/img/Logo_bwLehrpool.png delete mode 100644 dozentenmodul/Dozentenmodul/src/main/resources/img/e4_n_imgs2_bwl_vmc_v2.png delete mode 100644 dozentenmodul/Dozentenmodul/src/test/java/bwlehrpool/AppTest.java create mode 100644 dozentenmodul/forms-1.3.0-src.zip create mode 100644 dozentenmodul/forms-1.3.0.jar create mode 100644 dozentenmodul/pom.xml create mode 100644 dozentenmodul/src/main/java/auth/Authentification.java create mode 100644 dozentenmodul/src/main/java/config/config_file.java create mode 100644 dozentenmodul/src/main/java/ftp/DownloadTask.java create mode 100644 dozentenmodul/src/main/java/ftp/FTPException.java create mode 100644 dozentenmodul/src/main/java/ftp/FTPUtility.java create mode 100644 dozentenmodul/src/main/java/ftp/UploadTask.java create mode 100644 dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/intro/About_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/intro/Login_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java create mode 100644 dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java create mode 100644 dozentenmodul/src/main/java/models/Client.java create mode 100644 dozentenmodul/src/main/java/models/Image.java create mode 100644 dozentenmodul/src/main/java/models/ImageRights.java create mode 100644 dozentenmodul/src/main/java/models/Lecture.java create mode 100644 dozentenmodul/src/main/java/models/LectureRights.java create mode 100644 dozentenmodul/src/main/java/models/Links.java create mode 100644 dozentenmodul/src/main/java/models/Search.java create mode 100644 dozentenmodul/src/main/java/models/SessionData.java create mode 100644 dozentenmodul/src/main/java/models/Version.java create mode 100644 dozentenmodul/src/main/java/models/person.java create mode 100644 dozentenmodul/src/main/java/models/user.java create mode 100644 dozentenmodul/src/main/java/org/eclipse/wb/swt/SWTResourceManager.java create mode 100644 dozentenmodul/src/main/java/thrift/MasterThriftConnection.java create mode 100644 dozentenmodul/src/main/java/thrift/ThriftConnection.java create mode 100644 dozentenmodul/src/main/java/util/GuiOrganizer.java create mode 100644 dozentenmodul/src/main/java/util/OpenLinks.java create mode 100644 dozentenmodul/src/main/resources/img/Image_zu_Veranstaltung_HDD.png create mode 100644 dozentenmodul/src/main/resources/img/Logo_bwLehrpool.png create mode 100644 dozentenmodul/src/main/resources/img/e4_n_imgs2_bwl_vmc_v2.png create mode 100644 dozentenmodul/src/test/java/bwlehrpool/AppTest.java delete mode 100644 dozentenmodulserver/Dozentenmodulserver/pom.xml delete mode 100644 dozentenmodulserver/Dozentenmodulserver/src/main/java/models/Configuration.java delete mode 100644 dozentenmodulserver/Dozentenmodulserver/src/main/java/server/BinaryListener.java delete mode 100644 dozentenmodulserver/Dozentenmodulserver/src/main/java/server/Image.java delete mode 100644 dozentenmodulserver/Dozentenmodulserver/src/main/java/server/Lecture.java delete mode 100644 dozentenmodulserver/Dozentenmodulserver/src/main/java/server/Server.java delete mode 100644 dozentenmodulserver/Dozentenmodulserver/src/main/java/server/ServerHandler.java delete mode 100644 dozentenmodulserver/Dozentenmodulserver/src/main/java/server/StartServer.java delete mode 100644 dozentenmodulserver/Dozentenmodulserver/src/main/java/server/TBinaryProtocolSafe.java delete mode 100644 dozentenmodulserver/Dozentenmodulserver/src/main/java/server/User.java delete mode 100644 dozentenmodulserver/Dozentenmodulserver/src/main/java/sql/SQL.java delete mode 100644 dozentenmodulserver/Dozentenmodulserver/src/main/java/util/XMLCreator.java delete mode 100644 dozentenmodulserver/Dozentenmodulserver/src/test/java/bwlehrpool/AppTest.java delete mode 100644 dozentenmodulserver/Dozentenmodulserver/thrift/server.thrift create mode 100644 dozentenmodulserver/pom.xml create mode 100644 dozentenmodulserver/src/main/java/models/Configuration.java create mode 100644 dozentenmodulserver/src/main/java/server/BinaryListener.java create mode 100644 dozentenmodulserver/src/main/java/server/Image.java create mode 100644 dozentenmodulserver/src/main/java/server/Lecture.java create mode 100644 dozentenmodulserver/src/main/java/server/Server.java create mode 100644 dozentenmodulserver/src/main/java/server/ServerHandler.java create mode 100644 dozentenmodulserver/src/main/java/server/StartServer.java create mode 100644 dozentenmodulserver/src/main/java/server/TBinaryProtocolSafe.java create mode 100644 dozentenmodulserver/src/main/java/server/User.java create mode 100644 dozentenmodulserver/src/main/java/sql/SQL.java create mode 100644 dozentenmodulserver/src/main/java/util/XMLCreator.java create mode 100644 dozentenmodulserver/src/test/java/bwlehrpool/AppTest.java create mode 100644 dozentenmodulserver/thrift/server.thrift diff --git a/dozentenmodul/Dozentenmodul/forms-1.3.0-src.zip b/dozentenmodul/Dozentenmodul/forms-1.3.0-src.zip deleted file mode 100644 index b7673afc..00000000 Binary files a/dozentenmodul/Dozentenmodul/forms-1.3.0-src.zip and /dev/null differ diff --git a/dozentenmodul/Dozentenmodul/forms-1.3.0.jar b/dozentenmodul/Dozentenmodul/forms-1.3.0.jar deleted file mode 100644 index 3e705ffe..00000000 Binary files a/dozentenmodul/Dozentenmodul/forms-1.3.0.jar and /dev/null differ diff --git a/dozentenmodul/Dozentenmodul/pom.xml b/dozentenmodul/Dozentenmodul/pom.xml deleted file mode 100644 index d78eb1d0..00000000 --- a/dozentenmodul/Dozentenmodul/pom.xml +++ /dev/null @@ -1,203 +0,0 @@ - - 4.0.0 - - bwlehrpool - dozmod-client - 1.0-SNAPSHOT - jar - - DozMod-Client - http://maven.apache.org - - - UTF-8 - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - - maven-assembly-plugin - - - package - - single - - - - - - - gui.intro.Login_GUI - - - - jar-with-dependencies - - - - - org.apache.maven.plugins - maven-shade-plugin - - - package - - shade - - - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - true - - - gui.intro.Login_GUI - - - - - - - - - - - - mac - - - mac os x - - - - org.eclipse.swt.carbon - macosx - - - - windows - - - windows - - - - org.eclipse.swt.org.eclipse.swt.win32.win32.x86.4.3.swt - org.eclipse.swt.win32.win32.x86 - - - - linux_64 - - - linux - amd64 - - - - org.eclipse.swt.org.eclipse.swt.gtk.linux.x86_64.4.3.swt - org.eclipse.swt.gtk.linux.x86_64 - - - - - - - - org.eclipse.jface - text - 3.3.0-v20070606-0010 - - - org.apache.thrift - libthrift - 0.9.1 - compile - - - commons-io - commons-io - 2.4 - compile - - - commons-net - commons-net - 3.3 - compile - - - com.toedter - jcalendar - 1.4 - compile - - - net.sourceforge.jdatepicker - jdatepicker - 1.3.2 - compile - - - ${swt.groupId} - ${swt.artifactId} - 4.3 - - - - log4j - log4j - 1.2.17 - compile - - - org.ini4j - ini4j - 0.5.2 - compile - - - org.slf4j - slf4j-log4j12 - 1.5.8 - compile - - - org.openslx.bwlp - master-sync-shared - 1.0-SNAPSHOT - compile - - - bwlehrpool - dms - 1.0-SNAPSHOT - - - junit - junit - 3.8.1 - test - - - - diff --git a/dozentenmodul/Dozentenmodul/src/main/java/auth/Authentification.java b/dozentenmodul/Dozentenmodul/src/main/java/auth/Authentification.java deleted file mode 100644 index d242c01e..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/auth/Authentification.java +++ /dev/null @@ -1,12 +0,0 @@ -package auth; - -import org.openslx.imagemaster.thrift.iface.UserInfo; - -public class Authentification { - - public boolean auth(String username, String pass) - { - return false; - - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/config/config_file.java b/dozentenmodul/Dozentenmodul/src/main/java/config/config_file.java deleted file mode 100644 index 754e67a9..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/config/config_file.java +++ /dev/null @@ -1,121 +0,0 @@ -package config; - -import java.io.File; -import java.io.IOException; - -import org.ini4j.Wini; - -public class config_file { - - private String configPath = null; - - public boolean createConfig() throws IOException{ - - // Unterscheide zwischen Windows/Unix - String OSName = System.getProperty("os.name").toLowerCase(); - System.out.println("Machine's OS: " + OSName); - if (OSName.contains("windows")) - { - // Windows machine. Use the environment variable 'APPDATA' which - // should point to a path similar to: - // C:\Users\\AppData\Roaming - String appDataPath = System.getenv("APPDATA"); - if (!appDataPath.isEmpty()) - { - System.out.println("APPDATA: " + appDataPath); - configPath = appDataPath + "\\bwSuite\\config.ini"; - } - else - { - // APPDATA was empty, let's build it ourselves... - System.out.println("APPDATA ist leer."); - configPath = System.getProperty("user.home") + "\\AppData\\Roaming\\bwSuite\\config.ini" - - } - - } - else if (OSName.contains("linux")) - { - configPath=System.getProperty("user.home") + "/.config/bwSuite/config.ini"; - - } - - if (configPath == null) - { - System.out.println("Config file path could not be determined."); - } - //config_file="C:\\Users\\"+System.getProperty("user.name")+"\\AppData\\Roaming\\bwLehrpoolSuite"; - //File fuer den Ordner erzeugen - File configFile=new File(configPath); - Wini ini; - - //Pruefen ob Ordner schon existiert - if(!configFile.exists()) - { - System.out.println("Ordner \"bwLehrpoolSuite\" exisitiert nicht - lege ihn jetzt an."); - //Wenn nicht erzeuge Ordner - if (!configFile.getParentFile().mkdirs()) - { - System.out.print("Konnte Verzeichnisstruktur nicht erstellen: " + configFile.getParentFile()); - System.out.println(" - keine weitere Aktion"); - // jetzt nichts mehr - } - - //Erzeuge eine neue Datei - configFile.createNewFile(); - ini=new Wini(configFile); - - //Wenn in die Datei geschrieben werden kann - if(configFile.canWrite()==true) - { - System.out.println("Erzeuge \"config.ini.\""); - //Schreibe Config - ini.put("main", "BillOfRights", false); - ini.put("main", "vmware", false); - ini.put("main", "Benutzername speichern", false); - ini.put("main", "Benutzername", ""); - ini.put("main", "Letzter Downloadpfad", ""); - ini.put("main", "Letzter Uploadpfad", ""); - ini.store(); - - return true; - } else { - System.out.println("Konnte \"config.ini\" nicht anlegen - keine weitere Aktion."); - } - - } - else - { - System.out.println("Ordner \"bwLehrpoolSuite\" existiert bereits - keine weitere Aktion."); - //Wenn Ordner schon existiert, pruefe ob Datei existiert - if(!configFile.exists()) - { - System.out.println("\"config.ini\" existiert nicht - lege jetzt an."); - //Wenn nicht, erzeuge diese - configFile.createNewFile(); - ini=new Wini(configFile); - - if(configFile.canWrite()==true) - { - System.out.println("Schreibe jetzt \"config.ini\"."); - //Schreibe Konfig in File - ini.put("main", "BillOfRights",false); - ini.put("main", "vmware", false); - ini.put("main", "Benutzername speichern", false); - ini.put("main", "Benutzername", ""); - ini.put("main", "Letzter Downloadpfad", ""); - ini.put("main", "Letzter Uploadpfad", ""); - ini.store(); - - return true; - } else { - System.out.println("Kann \"config.ini\" nicht schreiben - keine weitere Aktion."); - } - } else { - System.out.println("\"config.ini\" existiert bereits - keine weitere Aktion."); - } - } - return true; - - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/ftp/DownloadTask.java b/dozentenmodul/Dozentenmodul/src/main/java/ftp/DownloadTask.java deleted file mode 100644 index 5592adba..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/ftp/DownloadTask.java +++ /dev/null @@ -1,117 +0,0 @@ -package ftp; - -import gui.image.FTPEditDownloader_GUI; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.InputStream; - -import javax.swing.JOptionPane; -import javax.swing.SwingWorker; - -/** - * Execute file download in a background thread and update the progress. - * - * @author www.codejava.net - * - */ -public class DownloadTask extends SwingWorker { - - private static final int BUFFER_SIZE = 4096; - - private String host; - private int port; - private String username; - private String password; - private String downloadPath; - private String saveDir; - private int percentCompleted; - - public DownloadTask(String host, int port, String username, - String password, String downloadPath, String saveDir) { - this.host = host; - this.port = port; - this.username = username; - this.password = password; - this.downloadPath = downloadPath; - this.saveDir = saveDir; - - } - - /** - * Executed in background thread - */ - @Override - protected Void doInBackground() throws Exception { - FTPUtility util = new FTPUtility(host, port, username, password); - try { - util.connect(); - - byte[] buffer = new byte[BUFFER_SIZE]; - int bytesRead = -1; - long totalBytesRead = 0; - percentCompleted = 0; - long start = System.nanoTime(); - final double NANOS_PER_SECOND = 1000000000.0; - final double BYTES_PER_MIB = 1024 * 1024; - long fileSize = util.getFileSize(downloadPath); - // gui.setFileSize(fileSize); - - String fileName = new File(downloadPath).getName(); - - File downloadFile = new File(saveDir + File.separator + fileName); - FileOutputStream outputStream = new FileOutputStream(downloadFile); - - util.downloadFile(downloadPath); - InputStream inputStream = util.getInputStream(); - - while ((bytesRead = inputStream.read(buffer)) != -1 - && isCancelled() == false) { - outputStream.write(buffer, 0, bytesRead); - totalBytesRead += bytesRead; - // System.out.println(totalBytesRead); - double speed = NANOS_PER_SECOND / BYTES_PER_MIB - * totalBytesRead / (System.nanoTime() - start + 1); - percentCompleted = (int) (totalBytesRead * 100 / fileSize); - setProgress(percentCompleted); - firePropertyChange("speed", 0, speed); - firePropertyChange("filesize", 0, fileSize); - firePropertyChange("bytesread", 0, totalBytesRead); - - } - - outputStream.close(); - - util.finish(); - } catch (FTPException ex) { - JOptionPane.showMessageDialog(null, - "Error downloading file: " + ex.getMessage(), "Error", - JOptionPane.ERROR_MESSAGE); - ex.printStackTrace(); - setProgress(0); - cancel(true); - } finally { - util.disconnect(); - } - - return null; - } - - /** - * Executed in Swing's event dispatching thread - */ - @Override - protected void done() { - if (!isCancelled() && percentCompleted==100) { - System.out.println("Datei erfolgreich heruntergeladen"); - JOptionPane.showMessageDialog(null, - "Datei erfolgreich heruntergeladen.", "Message", - JOptionPane.INFORMATION_MESSAGE); - } else if(!isCancelled() && percentCompleted != 100){ - System.out.println("Datein wurde unvollständig heruntergeladen"); - JOptionPane.showMessageDialog(null, - "Datei wurde unvollständig heruntergeladen. Bitte wiederholen.", "Message", - JOptionPane.INFORMATION_MESSAGE); - } - } -} \ No newline at end of file diff --git a/dozentenmodul/Dozentenmodul/src/main/java/ftp/FTPException.java b/dozentenmodul/Dozentenmodul/src/main/java/ftp/FTPException.java deleted file mode 100644 index bc3193e0..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/ftp/FTPException.java +++ /dev/null @@ -1,8 +0,0 @@ -package ftp; - -@SuppressWarnings("serial") -public class FTPException extends Exception { - public FTPException(String message) { - super(message); - } -} \ No newline at end of file diff --git a/dozentenmodul/Dozentenmodul/src/main/java/ftp/FTPUtility.java b/dozentenmodul/Dozentenmodul/src/main/java/ftp/FTPUtility.java deleted file mode 100644 index beae3f34..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/ftp/FTPUtility.java +++ /dev/null @@ -1,199 +0,0 @@ -package ftp; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.SocketException; -import java.security.NoSuchAlgorithmException; - -import javax.swing.JOptionPane; - -import models.Image; - -import org.apache.commons.net.ftp.FTP; -import org.apache.commons.net.ftp.FTPFile; -import org.apache.commons.net.ftp.FTPReply; -import org.apache.commons.net.ftp.FTPSClient; - -/** - * A utility class that provides functionality for downloading files from a FTP - * server. - * - * @author www.codejava.net - * - */ -public class FTPUtility { - - // FTP server information - private String host; - private int port; - private String username; - private String password; - - private FTPSClient ftpClient = new FTPSClient(); - private int replyCode; - - private InputStream inputStream; - private OutputStream outputStream; - - public FTPUtility(String host, int port, String user, String pass) { - this.host = host; - this.port = port; - this.username = user; - this.password = pass; - } - - /** - * Connect and login to the server. - * - * @throws FTPException - * @throws NoSuchAlgorithmException - */ - public void connect() throws FTPException, NoSuchAlgorithmException { - try { - ftpClient.connect(host, port); - replyCode = ftpClient.getReplyCode(); - if (!FTPReply.isPositiveCompletion(replyCode)) { - throw new FTPException("FTP serve refused connection."); - } - - boolean logged = ftpClient.login(username, password); - if (!logged) { - // failed to login - ftpClient.execPROT("P"); - ftpClient.disconnect(); - throw new FTPException("Could not login to the server."); - } - - ftpClient.enterLocalPassiveMode(); - - } catch (IOException ex) { - throw new FTPException("I/O error: " + ex.getMessage()); - } - } - - /** - * Gets size (in bytes) of the file on the server. - * - * @param filePath - * Path of the file on server - * @return file size in bytes - * @throws FTPException - */ - public long getFileSize(String filePath) throws FTPException { - try { - FTPFile file = ftpClient.mlistFile(filePath); - if (file == null) { - throw new FTPException("The file may not exist on the server!"); - } - return file.getSize(); - } catch (IOException ex) { - throw new FTPException("Could not determine size of the file: " - + ex.getMessage()); - } - } - - /** - * Start downloading a file from the server - * - * @param downloadPath - * Full path of the file on the server - * @throws FTPException - * if client-server communication error occurred - */ - public void downloadFile(String downloadPath) throws FTPException { - try { - - boolean success = ftpClient.setFileType(FTP.BINARY_FILE_TYPE); - if (!success) { - throw new FTPException("Could not set binary file type."); - } - - inputStream = ftpClient.retrieveFileStream(downloadPath); - - if (inputStream == null) { - throw new FTPException( - "Could not open input stream. The file may not exist on the server."); - } - } catch (IOException ex) { - throw new FTPException("Error downloading file: " + ex.getMessage()); - } - } - - /** - * Start uploading a file to the server - * - * @param uploadFile - * the file to be uploaded - * @param destDir - * destination directory on the server where the file is stored - * @throws FTPException - * if client-server communication error occurred - */ - public void uploadFile(File uploadFile, String destDir) throws FTPException { - try { - boolean success = ftpClient.changeWorkingDirectory(destDir); - if (!success) { - throw new FTPException("Could not change working directory to " - + destDir + ". The directory may not exist."); - } - - success = ftpClient.setFileType(FTP.BINARY_FILE_TYPE); - if (!success) { - throw new FTPException("Could not set binary file type."); - } - - outputStream = ftpClient.storeFileStream(Image.image.getNewName()); - - // ftpClient.rename(uploadFile.getName(), ); - } catch (IOException ex) { - throw new FTPException("Error uploading file: " + ex.getMessage()); - } - } - - /** - * Write an array of bytes to the output stream. - */ - public void writeFileBytes(byte[] bytes, int offset, int length) - throws IOException { - outputStream.write(bytes, offset, length); - } - - /** - * Complete the download operation. - */ - public void finish() throws IOException { - inputStream.close(); - ftpClient.completePendingCommand(); - } - - /** - * Log out and disconnect from the server - */ - public void disconnect() throws FTPException { - if (ftpClient.isConnected()) { - try { - if (!ftpClient.logout()) { - throw new FTPException("Could not log out from the server"); - } - ftpClient.disconnect(); - } catch (IOException ex) { - throw new FTPException("Error disconnect from the server: " - + ex.getMessage()); - } - } - } - - /** - * Return InputStream of the remote file on the server. - */ - public InputStream getInputStream() { - return inputStream; - } - - public OutputStream getOutputStream() { - return outputStream; - } - -} \ No newline at end of file diff --git a/dozentenmodul/Dozentenmodul/src/main/java/ftp/UploadTask.java b/dozentenmodul/Dozentenmodul/src/main/java/ftp/UploadTask.java deleted file mode 100644 index e7ebe43b..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/ftp/UploadTask.java +++ /dev/null @@ -1,108 +0,0 @@ -package ftp; - -import java.io.File; -import java.io.FileInputStream; - -import javax.swing.JOptionPane; -import javax.swing.SwingWorker; - -import models.Image; - -/** - * Executes the file upload in a background thread and updates progress to - * listeners that implement the java.beans.PropertyChangeListener interface. - * - * @author www.codejava.net - * - */ -public class UploadTask extends SwingWorker { - private static final int BUFFER_SIZE = 4096; - - private String host; - private int port; - private String username; - private String password; - private String destDir; - private File uploadFile; - private int percentCompleted; - - public UploadTask(String host, int port, String username, String password, - String destDir, File uploadFile) { - this.host = host; - this.port = port; - this.username = username; - this.password = password; - this.destDir = destDir; - this.uploadFile = uploadFile; - - } - - /** - * Executed in background thread - */ - @Override - protected Void doInBackground() throws Exception { - FTPUtility util = new FTPUtility(host, port, username, password); - try { - util.connect(); - util.uploadFile(uploadFile, destDir); - - FileInputStream inputStream = new FileInputStream(uploadFile); - byte[] buffer = new byte[BUFFER_SIZE]; - int bytesRead = -1; - int i = 0; - long totalBytesRead = 0; - percentCompleted = 0; - long fileSize = uploadFile.length(); - Image.image.setFilesize(fileSize); - long start = System.nanoTime(); - final double NANOS_PER_SECOND = 1000000000.0; - final double BYTES_PER_MIB = 1024 * 1024; - while ((bytesRead = inputStream.read(buffer)) != -1 - && isCancelled() == false) { - util.writeFileBytes(buffer, 0, bytesRead); - totalBytesRead += bytesRead; - percentCompleted = (int) (totalBytesRead * 100 / fileSize); - double speed = NANOS_PER_SECOND / BYTES_PER_MIB - * totalBytesRead / (System.nanoTime() - start + 1); - setProgress(percentCompleted); - firePropertyChange("speed", 0, speed); - firePropertyChange("filesize", 0, fileSize); - firePropertyChange("bytesread", 0, totalBytesRead); - } - - inputStream.close(); - - util.finish(); - } catch (FTPException ex) { - JOptionPane.showMessageDialog(null, - "Error uploading file: " + ex.getMessage(), "Error", - JOptionPane.ERROR_MESSAGE); - ex.printStackTrace(); - setProgress(0); - cancel(true); - } finally { - util.disconnect(); - } - - return null; - } - - /** - * Executed in Swing's event dispatching thread - */ - @Override - protected void done() { - if (!isCancelled() && percentCompleted==100) { - System.out.println("Datei erfolgreich hochgeladen"); - JOptionPane.showMessageDialog(null, - "Datei erfolgreich hochgeladen.", "Message", - JOptionPane.INFORMATION_MESSAGE); - } else if(!isCancelled() && percentCompleted != 100){ - System.out.println("Datein wurde unvollständig hochgeladen"); - JOptionPane.showMessageDialog(null, - "Datei wurde unvollständig hochgeladen. Bitte wiederholen.", "Message", - JOptionPane.INFORMATION_MESSAGE); - } - } -} \ No newline at end of file diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java deleted file mode 100644 index 06835167..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java +++ /dev/null @@ -1,464 +0,0 @@ -package gui.image; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JSeparator; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; - -import models.Image; -import models.Links; -import models.person; -import util.GuiOrganizer; -import util.OpenLinks; -import javax.swing.JScrollPane; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; - - -@SuppressWarnings("serial") -public class CreateImageAllgemein_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - private JTextField Vorname; - private JTextField Nachname; - private JTextField Hochschule; - private JTextField EMail; - private JTextField imagename; - private JTextArea textAreadesc; - private boolean textfieldsHaveContent = false; // no textfield is empty - private boolean descriptionLengthOK = false; //description may not be longer than 254 chars - private boolean nameIsOK = false; // imagename only contains letters - private final int MAX_DESCRIPTION_LENGTH = 254; - private JTextArea txtrGebenSieBitte_1; - - /** - * Create the dialog. - */ - public CreateImageAllgemein_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - // Beendet das Fenster auf X - System.exit(0); - } - - @Override - public void windowOpened(WindowEvent arg0) { - imagename.requestFocusInWindow(); - } - }); - // Verhindert das Vergroessern des Fensters - setResizable(false); - - try { - // setzt das Look & Feel - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog(null, - e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - // Setzt den Titel - setTitle("bwLehrpool Suite - Image erzeugen"); - // Zentriert das Fenster - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Eingabe Ihrer Daten"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("Geben Sie hier bitte einen sprechenden Imagenamen sowie Ihre Kontaktdaten an"); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 493); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 66, 557, 369); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JLabel label = new JLabel("Vorname: *"); - label.setBackground(SystemColor.menu); - label.setBounds(10, 245, 125, 20); - panel_1.add(label); - - Vorname = new JTextField(); - Vorname.setEnabled(false); - Vorname.setEditable(false); - Vorname.setBackground(Color.WHITE); - Vorname.setText(person.verantwortlicher.getVorname()); - Vorname.setColumns(10); - Vorname.setBounds(145, 245, 350, 20); - panel_1.add(Vorname); - - JLabel label_7 = new JLabel("Nachname: *"); - label_7.setBackground(SystemColor.menu); - label_7.setBounds(10, 276, 125, 20); - panel_1.add(label_7); - - Nachname = new JTextField(); - Nachname.setEnabled(false); - Nachname.setEditable(false); - Nachname.setBackground(Color.WHITE); - Nachname.setText(person.verantwortlicher.getName()); - Nachname.setColumns(10); - Nachname.setBounds(145, 276, 350, 20); - panel_1.add(Nachname); - - JLabel label_8 = new JLabel("Hochschule: *"); - label_8.setBackground(SystemColor.menu); - label_8.setBounds(10, 307, 125, 20); - panel_1.add(label_8); - - Hochschule = new JTextField(); - Hochschule.setEnabled(false); - Hochschule.setEditable(false); - Hochschule.setBackground(Color.WHITE); - Hochschule.setText(person.verantwortlicher.getHochschule()); - Hochschule.setColumns(10); - Hochschule.setBounds(145, 307, 350, 20); - panel_1.add(Hochschule); - - JLabel label_9 = new JLabel("E-Mail: *"); - label_9.setBackground(SystemColor.menu); - label_9.setBounds(10, 338, 125, 20); - panel_1.add(label_9); - - EMail = new JTextField(); - EMail.setEnabled(false); - EMail.setEditable(false); - EMail.setBackground(Color.WHITE); - EMail.setText(person.verantwortlicher.getEMail()); - EMail.setColumns(10); - EMail.setBounds(145, 338, 350, 20); - panel_1.add(EMail); - - JLabel lblImagename = new JLabel("Imagename: *"); - lblImagename.setBackground(SystemColor.menu); - lblImagename.setBounds(10, 23, 125, 20); - panel_1.add(lblImagename); - - imagename = new JTextField(); - imagename.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - textAreadesc.requestFocusInWindow(); - } - }); - imagename.setBackground(Color.WHITE); - imagename.setText((String) null); - imagename.setColumns(10); - imagename.setBounds(145, 23, 350, 20); - imagename.setText(Image.image.getImagename()); // null am Anfang, aber - // speichert die - // Eingabe, wenn man - // zurueck kommt zur - // Seite - panel_1.add(imagename); - - JTextArea txtrGebenSieBitte = new JTextArea(); - txtrGebenSieBitte.setEditable(false); - txtrGebenSieBitte.setBackground(SystemColor.menu); - txtrGebenSieBitte.setLineWrap(true); - txtrGebenSieBitte.setFont(new Font("Tahoma", Font.PLAIN, 12)); - txtrGebenSieBitte - .setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an.\r\nDieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\""); - txtrGebenSieBitte.setBounds(145, 48, 350, 49); - panel_1.add(txtrGebenSieBitte); - - JLabel lblBeschreibung = new JLabel("Beschreibung: *"); - lblBeschreibung.setBackground(SystemColor.menu); - lblBeschreibung.setBounds(10, 110, 125, 20); - panel_1.add(lblBeschreibung); - - JScrollPane scrollPane = new JScrollPane(); - scrollPane.setBounds(145, 110, 350, 60); - panel_1.add(scrollPane); - - textAreadesc = new JTextArea(); - textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); - textAreadesc.setLineWrap(true); - textAreadesc.setText((String) null); - textAreadesc.setText(Image.image.getDesc());// null am Anfang, aber - // speichert die Eingabe, - // wenn man zurueck kommt - // zur Seite - - scrollPane.setViewportView(textAreadesc); - - txtrGebenSieBitte_1 = new JTextArea(); - txtrGebenSieBitte_1 - .setText("Geben Sie bitte eine Beschreibung f\u00FCr das Image an.\r\nDiese soll jedoch recht spezifisch gehalten werden.\r\nBeispiel: \"Java-Enticklung mit eclipse und MySQL\""); - txtrGebenSieBitte_1.setLineWrap(true); - txtrGebenSieBitte_1.setFont(new Font("Tahoma", Font.PLAIN, 12)); - txtrGebenSieBitte_1.setEditable(false); - txtrGebenSieBitte_1.setBackground(SystemColor.menu); - txtrGebenSieBitte_1.setBounds(145, 177, 350, 49); - panel_1.add(txtrGebenSieBitte_1); - - JPanel panel = new JPanel(); - panel.setBounds(10, 402, 577, 33); - contentPanel.add(panel); - panel.setLayout(null); - panel.setBorder(new EmptyBorder(5, 5, 5, 5)); - panel.setBackground(SystemColor.menu); - - JLabel lblPflichtfelder = new JLabel("* Pflichtfelder"); - lblPflichtfelder.setBounds(10, 442, 136, 14); - contentPanel.add(lblPflichtfelder); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - // oeffnet das Hauptmenue - CreateImageAllgemein_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Image"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 45, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(133, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Neu"); - lblNewLabel_1.setBounds(146, 11, 46, 14); - contentPanel.add(lblNewLabel_1); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton backButton = new JButton("Zur\u00FCck"); - backButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - Image.image.setImagename(imagename.getText()); - Image.image.setDesc(textAreadesc.getText()); - MainMenue_GUI sr = new MainMenue_GUI(); - sr.setVisible(true); - dispose(); - } - }); - backButton.setActionCommand("Cancel"); - buttonPane.add(backButton); - } - { - JButton continueButton = new JButton("Weiter"); - continueButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - // Prueft die Eingabe und leitet weiter zur naechsten - // Seite - if (checkContent() == true - && checkNameIsLettersOrNumbers() == true && descriptionLenghtOK() == true) { - // Schreibt die Daten in das Model - Image.image.setImagename(imagename.getText()); - Image.image.setDesc(textAreadesc.getText()); - // Info - System.out - .println("Alle Eingaben in Ordnung. Imagename= \"" - + Image.image.getImagename() - + "\", Imagebeschreibung=\"" - + Image.image.getDesc()+"\""); - CreateImageTechnisch_GUI ea = new CreateImageTechnisch_GUI(); - ea.setVisible(true); - dispose(); - } else { - - } - } - }); - continueButton.setActionCommand("OK"); - buttonPane.add(continueButton); - getRootPane().setDefaultButton(continueButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); - getContentPane().add(separator_1); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - OpenLinks open = new OpenLinks(); - URI windows; - try { - windows = new URI(Links.getFAQ()); - open.openWebpage(windows); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - OpenLinks open = new OpenLinks(); - URI windows; - try { - windows = new URI(Links.getOTRS()); - open.openWebpage(windows); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem menuItem = new JMenuItem("About"); - menuItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(menuItem); - - }// end main - - public boolean checkNameIsLettersOrNumbers() { - nameIsOK = false; - - // only allow letter from alphabet and numbers - if (imagename.getText().matches("[a-zA-Z0-9]+")) { - nameIsOK = true; - } else { - JOptionPane - .showMessageDialog( - null, - "Der Imagename darf keine Leer- oder Sonderzeichen enthalten.", - "Unerlaubte Zeichen", - JOptionPane.INFORMATION_MESSAGE); - }// if - - return nameIsOK; - }// end nameIsOK - - public boolean checkContent() { - textfieldsHaveContent = false; - - // check if any textfield is empty - if (imagename.getText().isEmpty() == false - && textAreadesc.getText().isEmpty() == false - && Vorname.getText().isEmpty() == false - && Nachname.getText().isEmpty() == false - && Hochschule.getText().isEmpty() == false - && EMail.getText().isEmpty() == false) { - // all textfields have content - textfieldsHaveContent = true; - } else { - JOptionPane - .showMessageDialog(null, - "Bitte geben Sie alle notwendigen Daten an!", - "Daten unvollst\u00e4ndig", - JOptionPane.INFORMATION_MESSAGE); - }// end if - - return textfieldsHaveContent; - }// end checkContent - - public boolean descriptionLenghtOK(){ - descriptionLengthOK=false; - - //max length is 254 chars - if (textAreadesc.getText().length() >= MAX_DESCRIPTION_LENGTH) { - descriptionLengthOK=false; - JOptionPane - .showMessageDialog(null, - "Die Beschreibung darf max 254 Zeichen enthalten. Aktuell enthält sie "+textAreadesc.getText().length()+".", - "Beschreibung zu umfangreich", - JOptionPane.INFORMATION_MESSAGE); - }else { - descriptionLengthOK=true; - - } - - return descriptionLengthOK; - }// enddescriptionLenghtOK() -}// end Class diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java deleted file mode 100644 index dea785d3..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java +++ /dev/null @@ -1,258 +0,0 @@ -package gui.image; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.ButtonGroup; -import javax.swing.DefaultComboBoxModel; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JSeparator; -import javax.swing.JTextPane; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; - -import models.Image; -import models.Links; -import util.GuiOrganizer; -import util.OpenLinks; - -@SuppressWarnings("serial") -public class CreateImageFreigabe_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - private final ButtonGroup buttonGrouplicense = new ButtonGroup(); - private final ButtonGroup buttonGroupInternet = new ButtonGroup(); - JComboBox comboBox; - - /** - * Create the dialog. - */ - public CreateImageFreigabe_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - System.exit(0); - } - }); - setResizable(false); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - setTitle("bwLehrpool Suite - Image erzeugen"); - - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Image Freigabe"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("W\u00E4hlen Sie bitte hier die von Ihnen gew\u00FCnschte Freigabe f\u00FCr Ihr Image aus."); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 493); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Freigabe", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 51, 557, 124); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JLabel lblNewLabel_2 = new JLabel("Freigabemodus:"); - lblNewLabel_2.setBounds(10, 55, 250, 20); - panel_1.add(lblNewLabel_2); - - comboBox = new JComboBox(); - comboBox.setModel(new DefaultComboBoxModel(new String[] { - "Lokal (Eigene Hochschule)", - "\u00D6ffentlich (Alle Hochschulen)" })); - comboBox.setSelectedIndex(0); - comboBox.setBounds(270, 55, 250, 20); - panel_1.add(comboBox); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - - CreateImageFreigabe_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Image"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 45, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(133, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Neu"); - lblNewLabel_1.setBounds(146, 11, 46, 14); - contentPanel.add(lblNewLabel_1); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton cancelButton = new JButton("Zur\u00FCck"); - cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - Image.image.setShareMode(comboBox.getSelectedIndex()); - CreateImageTechnisch_GUI sr = new CreateImageTechnisch_GUI(); - sr.setVisible(true); - dispose(); - } - }); - cancelButton.setActionCommand("OK"); - buttonPane.add(cancelButton); - // getRootPane().setDefaultButton(cancelButton); - } - { - JButton continueButton = new JButton("Weiter"); - continueButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - Image.image.setShareMode(comboBox.getSelectedIndex()); - PermissionCreateImage_GUI ea = new PermissionCreateImage_GUI(); - ea.setVisible(true); - dispose(); - - } - }); - continueButton.setActionCommand("Cancel"); - buttonPane.add(continueButton); - getRootPane().setDefaultButton(continueButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); - getContentPane().add(separator_1); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - JMenuItem menuItem = new JMenuItem("About"); - menuItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(menuItem); - - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java deleted file mode 100644 index a6b19c6c..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java +++ /dev/null @@ -1,473 +0,0 @@ -package gui.image; - - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.List; - -import javax.swing.ButtonGroup; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JSeparator; -import javax.swing.JSpinner; -import javax.swing.JTextArea; -import javax.swing.JTextPane; -import javax.swing.SpinnerNumberModel; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; - -import models.Image; -import models.Links; -import server.Server.Client; -import thrift.ThriftConnection; -import util.GuiOrganizer; -import util.OpenLinks; -import javax.swing.JComboBox; - -import org.apache.thrift.TException; - -@SuppressWarnings("serial") -public class CreateImageTechnisch_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - JSpinner spinnerCPU; - JSpinner spinnerRam; - //JRadioButton rdbtnlicenseJa; - //JRadioButton rdbtnlicenseNein; - //JRadioButton rdbtnInternetJa; - //JRadioButton rdbtnInternetNein; - //JRadioButton radioButtonVorlageJa; - //JRadioButton radioButtonVorlageNein; - private JCheckBox chckbxIsTemplate; - private JCheckBox chckbxIsLicensed; - private JCheckBox chckbxIsInternetBlocked; - JComboBox comboBox; - private final ButtonGroup buttonGrouplicense = new ButtonGroup(); - private final ButtonGroup buttonGroupInternet = new ButtonGroup(); - private final ButtonGroup buttonGroupVorlage = new ButtonGroup(); - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); - - - /** - * Create the dialog. - */ - public CreateImageTechnisch_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - System.exit(0); - } - }); - setResizable(false); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - setTitle("bwLehrpool Suite - Image erzeugen"); - - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Eingabe technischer Daten"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie.setText("Geben Sie hier bitte einige technische Daten ein"); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 531); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Informationen zum Image", TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 36, 557, 166); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - - JLabel lblInternetIstInnerhalb = new JLabel("Internet ist f\u00FCr dieses Image gesperrt:"); - lblInternetIstInnerhalb.setBounds(10, 106, 250, 20); - panel_1.add(lblInternetIstInnerhalb); - - JButton btnInternetSettings = new JButton("Einstellungen..."); - btnInternetSettings.setEnabled(false); - btnInternetSettings.setBounds(439, 105, 108, 23); - panel_1.add(btnInternetSettings); - - - JLabel lblNewLabel_2 = new JLabel("Image enth\u00E4lt lizenzpflichtige Software:"); - lblNewLabel_2.setBounds(10, 78, 250, 20); - panel_1.add(lblNewLabel_2); - - chckbxIsTemplate = new JCheckBox(""); - chckbxIsTemplate.setBounds(266, 50, 97, 23); - panel_1.add(chckbxIsTemplate); - - chckbxIsLicensed = new JCheckBox(""); - chckbxIsLicensed.setSelected(true); - chckbxIsLicensed.setBounds(266, 76, 97, 23); - panel_1.add(chckbxIsLicensed); - - chckbxIsInternetBlocked = new JCheckBox(""); - chckbxIsInternetBlocked.setBounds(266, 104, 97, 23); - panel_1.add(chckbxIsInternetBlocked); - - JLabel lblLizenzserverEintragen = new JLabel("Lizenzserver eintragen:"); - lblLizenzserverEintragen.setBounds(10, 133, 250, 20); - panel_1.add(lblLizenzserverEintragen); - - JButton btnLicenseServer = new JButton("Server-Adresse..."); - btnLicenseServer.setEnabled(false); - btnLicenseServer.setBounds(266, 132, 157, 23); - panel_1.add(btnLicenseServer); - - JLabel lblImageIstEine = new JLabel("Image ist eine Vorlage:"); - lblImageIstEine.setBounds(10, 52, 250, 20); - panel_1.add(lblImageIstEine); - - - JLabel lblBetriebssystem = new JLabel("Betriebssystem:"); - lblBetriebssystem.setBounds(10, 21, 250, 20); - panel_1.add(lblBetriebssystem); - - if (Image.image.isVorlage() == true) { - //radioButtonVorlageJa.setSelected(true); - chckbxIsTemplate.setSelected(true); - } else { - //radioButtonVorlageNein.setSelected(true); - chckbxIsTemplate.setSelected(false); - } - - if(Image.image.isInternet() == true ){ - chckbxIsInternetBlocked.setSelected(true); - } else { - chckbxIsInternetBlocked.setSelected(false); - } - - /* TODO deprecated, as checked is default in new image - if (Image.image.isLicensed() == true) { - //rdbtnlicenseJa.setSelected(true); - chckbxIsLicensed.setSelected(true); - chckbxIsLicensed.isSelected(); - } else { - //rdbtnlicenseNein.setSelected(true); - chckbxIsLicensed.setSelected(false); - } - */ - - comboBox = new JComboBox(); - try { - List os=client.getAllOS(); - - for(int i=0; i"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Image"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 45, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(133, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Neu"); - lblNewLabel_1.setBounds(146, 11, 46, 14); - contentPanel.add(lblNewLabel_1); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton cancelButton = new JButton("Zur\u00FCck"); - cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - if(chckbxIsInternetBlocked.isSelected()==true) - { - Image.image.setInternet(true); - } - else - { - Image.image.setInternet(false); - } - - if(chckbxIsLicensed.isSelected()==true) - { - Image.image.setLicensed(true); - } - else - { - Image.image.setLicensed(false); - } - - if(chckbxIsTemplate.isSelected() == true){ - Image.image.setVorlage(true); - } else { - Image.image.setVorlage(false); - } - - Image.image.setCpu(Integer.valueOf(spinnerCPU.getValue().toString()).intValue()); - Image.image.setRam(Integer.valueOf(spinnerRam.getValue().toString()).intValue()); - Image.image.setOS(comboBox.getSelectedItem().toString()); - CreateImageAllgemein_GUI sr=new CreateImageAllgemein_GUI(); - sr.setVisible(true); - dispose(); - } - }); - cancelButton.setActionCommand("OK"); - buttonPane.add(cancelButton); - //getRootPane().setDefaultButton(cancelButton); - } - { - JButton continueButton = new JButton("Weiter"); - continueButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - if(chckbxIsInternetBlocked.isSelected()==true) - { - Image.image.setInternet(true); - } - else - { - Image.image.setInternet(false); - } - - if(chckbxIsLicensed.isSelected()==true) - { - Image.image.setLicensed(true); - } - else - { - Image.image.setLicensed(false); - } - if(chckbxIsTemplate.isSelected()==true) - { - Image.image.setVorlage(true); - } - else - { - Image.image.setVorlage(false); - } - Image.image.setCpu(Integer.valueOf(spinnerCPU.getValue().toString()).intValue()); - Image.image.setRam(Integer.valueOf(spinnerRam.getValue().toString()).intValue()); - Image.image.setOS(comboBox.getSelectedItem().toString()); - System.out.println("Betriebssystem: "+Image.image.getOS()+", istVorlage: "+Image.image.isVorlage()+", Lizenzpflichtig: "+Image.image.isLicensed()+", Internetsperre: "+Image.image.isInternet()+", CPU: "+Image.image.getCpu()+", RAM: "+Image.image.getRam()); - CreateImageFreigabe_GUI ea=new CreateImageFreigabe_GUI(); - ea.setVisible(true); - dispose(); - - } - }); - continueButton.setActionCommand("Cancel"); - buttonPane.add(continueButton); - getRootPane().setDefaultButton(continueButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); - getContentPane().add(separator_1); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem menuItem = new JMenuItem("About"); - menuItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(menuItem); - - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java deleted file mode 100644 index 3b4cc3ba..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java +++ /dev/null @@ -1,1180 +0,0 @@ -package gui.image; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.HeadlessException; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JScrollPane; -import javax.swing.JSeparator; -import javax.swing.JTabbedPane; -import javax.swing.JTable; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.ListSelectionModel; -import javax.swing.RowFilter; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableModel; -import javax.swing.table.TableRowSorter; - -import models.Links; -import models.person; - -import org.apache.thrift.TException; - -import server.Server.Client; -import thrift.ThriftConnection; -import util.GuiOrganizer; -import util.OpenLinks; -import javax.swing.JTextArea; - -@SuppressWarnings("serial") -public class DeleteImage_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - JLabel labelName; - JLabel labelUpdate; - JLabel labelVerantwortlicher; - JLabel labelWeitereVerantwortliche; - JLabel labelVorlage; - JLabel labelLizenzSoftware; - JLabel labelInternet; - JLabel labelRam; - JLabel labelCPU; - JLabel labelID; - JLabel labelVersion; - JTextArea textAreadesc; - private JLabel labelOS; - String[] result; - JRadioButton rdbtnInternetJa; - JRadioButton rdbtnInternetNein; - JComboBox comboBox; - JTable tableAllImages; - JTable tablemyImages; - JTable tablePublicVorlagen; - private JTextField textFieldName; - JTabbedPane tabbedPane; - boolean activeSearch = false; - String[] titles = { "Name", "Lizenzpflichtig", "OS", "Veranstaltung", - "Verantwortlicher", "Letztes Update", "ID", "Version", "Template" }; // Angezeigt - // werden - // aber - // nur - // Name - // (0), - // OS - // (2), - // Verantwortlicher - // (4), - // Letztes - // Update - // (5) - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); - final DefaultTableModel modelAll = new DefaultTableModel(titles, 0) { - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0) { - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final DefaultTableModel modelPublicVorlagen = new DefaultTableModel(titles, - 0) { - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final TableRowSorter rowSorterAll = new TableRowSorter( - modelAll); - final TableRowSorter rowSorterMyImages = new TableRowSorter( - modelMyImages); - final TableRowSorter rowSorterPublicVorlagen = new TableRowSorter( - modelPublicVorlagen); - private JLabel lblBeschreibung_1; - private JTextField textField; - - /** - * Create the dialog. - */ - public DeleteImage_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - // Beendet die Anwendung nach klick auf X - con.closeThriftConnection(); - System.exit(0); - } - - @Override - public void windowOpened(WindowEvent arg0) { - initTableModel(modelAll); - initTableModel(modelMyImages); - initTableModel(modelPublicVorlagen); - - // auszublendende Angaben - // 1=Lizenzpflichtig - // 3=Veranstaltung - // 6=ID - // 7=Version - // 8=Template - tablemyImages.getColumnModel().getColumn(1).setWidth(0); - tablemyImages.getColumnModel().getColumn(1).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(3).setWidth(0); - tablemyImages.getColumnModel().getColumn(3).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(3).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(8).setWidth(0); - tablemyImages.getColumnModel().getColumn(8).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(6).setWidth(0); - tablemyImages.getColumnModel().getColumn(6).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(7).setWidth(0); - tablemyImages.getColumnModel().getColumn(7).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0); - - tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(1) - .setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(1) - .setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(3).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(3) - .setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(3) - .setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(8) - .setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(8) - .setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(6) - .setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(6) - .setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(7) - .setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(7) - .setMaxWidth(0); - - tableAllImages.getColumnModel().getColumn(1).setWidth(0); - tableAllImages.getColumnModel().getColumn(1).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(3).setWidth(0); - tableAllImages.getColumnModel().getColumn(3).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(3).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(8).setWidth(0); - tableAllImages.getColumnModel().getColumn(8).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(6).setWidth(0); - tableAllImages.getColumnModel().getColumn(6).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(7).setWidth(0); - tableAllImages.getColumnModel().getColumn(7).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0); - // bis hier - textFieldName.requestFocusInWindow(); - } - }); - // Verhindert das Vergroessern Des Fensters - setResizable(false); - - try { - // Setzt das Look & Feel auf System - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - // Setzt den Fenstertitel - setTitle("bwLehrpool Suite - Image l\u00F6schen"); - // Zentriert das Fenster in die Bildmitte - setBounds(0, 0, 918, 722); - GuiOrganizer.centerGUI(this); - - final DefaultTableModel model = new DefaultTableModel(titles, 0); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 892, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel( - "Zu l\u00F6schendes Image w\u00E4hlen"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("W\u00E4hlen Sie bitte aus der unten stehenden Liste das zu l\u00F6schende Image aus."); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 531); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 49, 557, 98); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JLabel lblNewLabel_2 = new JLabel("Name:"); - lblNewLabel_2.setBounds(10, 30, 80, 20); - panel_1.add(lblNewLabel_2); - - JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:"); - lblInternetIstInnerhalb.setBounds(10, 58, 80, 20); - panel_1.add(lblInternetIstInnerhalb); - - textFieldName = new JTextField(); - // Key Listener der Tastatureingabe registriert - textFieldName.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - // Textfield eingabe auslesen - String stext = textFieldName.getText(); - - // Wenn Textfield nicht leer - if (stext != "") { - activeSearch = true; - // Filtere nach der Eingabe - rowSorterAll.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - - } else { - activeSearch = false; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - username, 4)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - "true", 8)); - rowSorterAll.setRowFilter(null); - } - } - }); - - textFieldName.setBounds(96, 30, 166, 20); - panel_1.add(textFieldName); - textFieldName.setColumns(10); - - comboBox = new JComboBox(); - try { - // Holt sich eine Liste aller verf\u00FCgbaren Betriebssysteme vom - // Server - List list = client.getAllOS(); - // Leeres Item hinzufuegen - comboBox.addItem(""); - for (int i = 0; i < list.size(); i++) { - // Hinzufuegen der verfuegbaren Betriebssysteme - comboBox.addItem(list.get(i)); - } - } catch (TException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - JOptionPane.showMessageDialog(null, - e2.getCause() + "\n" + e2.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - // Registriert Auswahlaenderungen der Box - comboBox.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - // Prueft das die Auswahl nicht leer ist - if (comboBox.getSelectedItem().toString() != "") { - activeSearch = true; - rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox - .getSelectedItem().toString(), 2)); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - comboBox.getSelectedItem().toString(), 2)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - comboBox.getSelectedItem().toString(), 2)); - } else { - activeSearch = false; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - username, 4)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - "true", 8)); - rowSorterAll.setRowFilter(null); - } - } - - }); - comboBox.setBounds(96, 58, 166, 20); - panel_1.add(comboBox); - - lblBeschreibung_1 = new JLabel("Beschreibung:"); - lblBeschreibung_1.setBounds(291, 30, 80, 20); - panel_1.add(lblBeschreibung_1); - - textField = new JTextField(); - textField.setColumns(10); - textField.setBounds(381, 30, 166, 20); - panel_1.add(textField); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - - // oeffnet das Hauuetmenue - con.closeThriftConnection(); - - // oeffnet das Hauuetmenue - - DeleteImage_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Image"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 45, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(115, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Imageauswahl"); - lblNewLabel_1.setBounds(128, 11, 85, 14); - contentPanel.add(lblNewLabel_1); - - tabbedPane = new JTabbedPane(JTabbedPane.TOP); - tabbedPane.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent arg0) { - // System.out.println(tabbedPane.getSelectedIndex()); - if (tabbedPane.getSelectedIndex() == 0 && activeSearch == false) { - - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - username, 4)); - } else if (tabbedPane.getSelectedIndex() == 1 - && activeSearch == false) { - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - "true", 8)); - } else if (tabbedPane.getSelectedIndex() == 2 - && activeSearch == false) { - rowSorterAll.setRowFilter(null); - } - - } - }); - - tabbedPane.setBounds(10, 158, 557, 339); - contentPanel.add(tabbedPane); - - JScrollPane scrollPaneMyImage = new JScrollPane(); - tablemyImages = new JTable(); - tablemyImages.getSelectionModel().addListSelectionListener( - new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { - String imageid = modelMyImages.getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 6) - .toString(); - // System.out.println(imageid); - String version = modelMyImages.getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 7) - .toString(); - // System.out.println(version); - writeImageData(imageid, version); - } - }); - tablemyImages.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - tablemyImages.setModel(modelMyImages); - tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit(); - tablemyImages.setRowSorter(rowSorterMyImages); - - scrollPaneMyImage.setViewportView(tablemyImages); - tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null); - - JScrollPane scrollPaneCoopImages = new JScrollPane(); - JTable tableCoopImages = new JTable(); - tableCoopImages.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - tableCoopImages.setModel(model); - tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit(); - - JScrollPane scrollPanePublicVorlagen = new JScrollPane(); - tablePublicVorlagen = new JTable(); - tablePublicVorlagen.getSelectionModel().addListSelectionListener( - new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { - String imageid = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 6) - .toString(); - // System.out.println(imageid); - String version = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 7) - .toString(); - // System.out.println(version); - writeImageData(imageid, version); - } - }); - tablePublicVorlagen.setModel(modelPublicVorlagen); - tablePublicVorlagen - .setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - - tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit(); - tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen); - scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen); - tabbedPane.addTab("Vorlagen", null, scrollPanePublicVorlagen, null); - - JScrollPane scrollPaneAllImages = new JScrollPane(); - tableAllImages = new JTable(); - tableAllImages.getSelectionModel().addListSelectionListener( - new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { - - String imageid = modelAll.getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 6) - .toString(); - // System.out.println(imageid); - String version = modelAll.getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 7) - .toString(); - // System.out.println(version); - writeImageData(imageid, version); - - } - }); - tableAllImages.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - tableAllImages.setModel(modelAll); - tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit(); - tableAllImages.setRowSorter(rowSorterAll); - - scrollPaneAllImages.setViewportView(tableAllImages); - tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); - - scrollPaneCoopImages.setViewportView(tableCoopImages); - tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages, null); - tabbedPane.setEnabledAt(3, false); - - JButton btnDelete = new JButton("L\u00F6schen"); - btnDelete.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - - String imageid = ""; - String imageversion = ""; - int eingabe; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - if (tablemyImages.getSelectedRowCount() != 0) { - - // frage, soll das selektierte Daten geloescht werden? - eingabe = JOptionPane.showConfirmDialog(null, - "Wollen Sie diese Daten l\u00f6schen?", - "L\u00f6schen?", JOptionPane.YES_NO_OPTION); - - if (eingabe == JOptionPane.YES_OPTION) { - - imageid = modelMyImages.getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 6) - .toString(); - - imageversion = modelMyImages.getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 7) - .toString(); - - // TODO - // Image darf nur geloescht werden, wenn keine - // Veranstaltung mehr auf das Image verweist. - // Unbdingt abfragen! - - try { - if (!client.connectedToLecture(imageid, - imageversion)) { - // System.out.println(imageid); - // System.out.println(imageversion); - try { - client.deleteImageServer(imageid, - imageversion); - if (client.deleteImageData(imageid, - imageversion)) { - // if (client.deleteImageServer(imageid - // ,imageversion)) { - - DeleteImage_GUI di = new DeleteImage_GUI(); - di.setVisible(true); - dispose(); - - /* - * } else { - * - * JOptionPane.showConfirmDialog(null, - * "Loeschen vom Server hat leider nicht geklappt!!" - * , imageversion, - * JOptionPane.OK_CANCEL_OPTION); } - */ - - } else { - - JOptionPane - .showConfirmDialog( - null, - "L\u00f6schen von der DB hat leider nicht geklappt!!", - "Fehler", - JOptionPane.INFORMATION_MESSAGE); - } - } catch (HeadlessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog( - null, - e.getCause() + "\n" - + e.getStackTrace(), - "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog( - null, - e.getCause() + "\n" - + e.getStackTrace(), - "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - - } else { - - JOptionPane - .showMessageDialog( - null, - "Image kann nicht gel\u00f6scht werden, da mindestens eine Veranstaltung mit diesem Image verlinkt ist.", - "Verlinkung vorhanden", - JOptionPane.INFORMATION_MESSAGE); - } - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog(null, e.getCause() - + "\n" + e.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } - } - - } else if (tablePublicVorlagen.getSelectedRowCount() != 0 - && modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 4) - .equals(username)) { - - // frage, soll das selektierte Daten geloescht werden? - eingabe = JOptionPane.showConfirmDialog(null, - "Wollen Sie diese Daten l\u00f6schen?", - "L\u00f6schen?", JOptionPane.YES_NO_OPTION); - - if (eingabe == JOptionPane.YES_OPTION) { - - imageid = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 6) - .toString(); - - imageversion = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 7) - .toString(); - - // TODO - // Image darf nur geloescht werden, wenn keine - // Veranstaltung mehr auf das Image verweist. - // Unbdingt abfragen! - - try { - if (!client.connectedToLecture(imageid, - imageversion)) { - // System.out.println(imageid); - // System.out.println(imageversion); - try { - client.deleteImageServer(imageid, - imageversion); - if (client.deleteImageData(imageid, - imageversion)) { - // if (client.deleteImageServer(imageid - // ,imageversion)) { - - DeleteImage_GUI di = new DeleteImage_GUI(); - di.setVisible(true); - dispose(); - - /* - * } else { - * - * JOptionPane.showConfirmDialog(null, - * "Loeschen vom Server hat leider nicht geklappt!!" - * , imageversion, - * JOptionPane.OK_CANCEL_OPTION); } - */ - - } else { - - JOptionPane - .showConfirmDialog( - null, - "L\u00f6schen von der DB hat leider nicht geklappt!!", - "Fehler", - JOptionPane.INFORMATION_MESSAGE); - } - } catch (HeadlessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog( - null, - e.getCause() + "\n" - + e.getStackTrace(), - "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog( - null, - e.getCause() + "\n" - + e.getStackTrace(), - "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - - } else { - - JOptionPane - .showMessageDialog( - null, - "Image kann nicht gel\u00f6scht werden, da mindestens eine Veranstaltung mit diesem Image verlinkt ist.", - "Verlinkung vorhanden", - JOptionPane.INFORMATION_MESSAGE); - } - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog(null, e.getCause() - + "\n" + e.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } - } - - } else if (tableAllImages.getSelectedRowCount() != 0 - && modelAll.getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 4).equals( - username)) { - - // frage, soll das selektierte Daten geloescht werden? - eingabe = JOptionPane.showConfirmDialog(null, - "Wollen Sie diese Daten l\u00f6schen?", - "L\u00f6schen?", JOptionPane.YES_NO_OPTION); - - if (eingabe == JOptionPane.YES_OPTION) { - - imageid = modelAll.getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 6) - .toString(); - - imageversion = modelAll.getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 7) - .toString(); - - // TODO - // Image darf nur geloescht werden, wenn keine - // Veranstaltung mehr auf das Image verweist. - // Unbdingt abfragen! - - try { - if (!client.connectedToLecture(imageid, - imageversion)) { - // System.out.println(imageid); - // System.out.println(imageversion); - try { - client.deleteImageServer(imageid, - imageversion); - if (client.deleteImageData(imageid, - imageversion)) { - // if (client.deleteImageServer(imageid - // ,imageversion)) { - - DeleteImage_GUI di = new DeleteImage_GUI(); - di.setVisible(true); - dispose(); - - /* - * } else { - * - * JOptionPane.showConfirmDialog(null, - * "Loeschen vom Server hat leider nicht geklappt!!" - * , imageversion, - * JOptionPane.OK_CANCEL_OPTION); } - */ - - } else { - - JOptionPane - .showConfirmDialog( - null, - "L\u00f6schen von der DB hat leider nicht geklappt!!", - "Fehler", - JOptionPane.INFORMATION_MESSAGE); - } - } catch (HeadlessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog( - null, - e.getCause() + "\n" - + e.getStackTrace(), - "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog( - null, - e.getCause() + "\n" - + e.getStackTrace(), - "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - - } else { - - JOptionPane - .showMessageDialog( - null, - "Image kann nicht gel\u00f6scht werden, da mindestens eine Veranstaltung mit diesem Image verlinkt ist.", - "Verlinkung vorhanden", - JOptionPane.INFORMATION_MESSAGE); - } - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog(null, e.getCause() - + "\n" + e.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } - } - - } else { - - JOptionPane.showMessageDialog(null, - "Bitte w\u00e4hlen Sie ein eigenes Image aus", - "Message", JOptionPane.INFORMATION_MESSAGE); - } - - } - }); - btnDelete.setBounds(449, 508, 118, 23); - contentPanel.add(btnDelete); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 902, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton okButton = new JButton("Zur\u00FCck"); - okButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - // oeffnet das Hauptmen\u00FC - con.closeThriftConnection(); - - // oeffnet das Hauptmenue - - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - dispose(); - } - }); - okButton.setActionCommand("OK"); - buttonPane.add(okButton); - getRootPane().setDefaultButton(okButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 79, 912, 1); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 912, 2); - getContentPane().add(separator_1); - - JPanel panel = new JPanel(); - panel.setLayout(null); - panel.setBorder(new TitledBorder(null, "Detailinformationen", - - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel.setBackground(SystemColor.menu); - panel.setBounds(586, 85, 316, 531); - getContentPane().add(panel); - - JLabel lblName = new JLabel("Name:"); - lblName.setBounds(10, 87, 130, 14); - panel.add(lblName); - - labelName = new JLabel(""); - labelName.setBounds(10, 102, 296, 14); - panel.add(labelName); - - JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); - lblVerantwortlicher.setBounds(10, 259, 130, 14); - panel.add(lblVerantwortlicher); - - labelOS = new JLabel(""); - labelOS.setBounds(10, 216, 296, 14); - panel.add(labelOS); - - JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:"); - lblWeitereVerantwortliche.setBounds(10, 202, 130, 14); - panel.add(lblWeitereVerantwortliche); - - labelVerantwortlicher = new JLabel(""); - labelVerantwortlicher.setBounds(10, 272, 296, 14); - panel.add(labelVerantwortlicher); - - JLabel label = new JLabel("Weitere Verantwortliche:"); - label.setBounds(10, 284, 130, 14); - panel.add(label); - - labelWeitereVerantwortliche = new JLabel(""); - labelWeitereVerantwortliche.setBounds(10, 297, 296, 14); - panel.add(labelWeitereVerantwortliche); - - labelUpdate = new JLabel(""); - labelUpdate.setBounds(10, 245, 296, 14); - panel.add(labelUpdate); - - JLabel lblLetztesUpdate = new JLabel("Letztes Update:"); - lblLetztesUpdate.setBounds(10, 231, 130, 14); - panel.add(lblLetztesUpdate); - - JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:"); - lblImageIstVorlage.setBounds(10, 336, 130, 14); - panel.add(lblImageIstVorlage); - - labelVorlage = new JLabel(""); - labelVorlage.setBounds(10, 350, 296, 14); - panel.add(labelVorlage); - - labelLizenzSoftware = new JLabel(""); - labelLizenzSoftware.setBounds(10, 383, 296, 14); - panel.add(labelLizenzSoftware); - - JLabel lblLizenzpflichtigeSoftware = new JLabel( - "Lizenzpflichtige Software:"); - lblLizenzpflichtigeSoftware.setBounds(10, 367, 130, 14); - panel.add(lblLizenzpflichtigeSoftware); - - JLabel lblInternet = new JLabel("Internetsperre vorhanden:"); - lblInternet.setBounds(10, 400, 130, 14); - panel.add(lblInternet); - - labelInternet = new JLabel(""); - labelInternet.setBounds(10, 417, 296, 14); - panel.add(labelInternet); - - JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:"); - lblEmpfehlungRam.setBounds(10, 432, 130, 14); - panel.add(lblEmpfehlungRam); - - labelRam = new JLabel(""); - labelRam.setBounds(10, 455, 296, 14); - panel.add(labelRam); - - JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:"); - lblEmpfehlungCpu.setBounds(10, 469, 130, 14); - panel.add(lblEmpfehlungCpu); - - labelCPU = new JLabel(""); - labelCPU.setBounds(10, 487, 296, 14); - panel.add(labelCPU); - - JLabel lblTechnischeDaten = new JLabel("Technische Daten:"); - lblTechnischeDaten.setBounds(10, 322, 296, 14); - panel.add(lblTechnischeDaten); - - JLabel lblId = new JLabel("ID:"); - lblId.setBounds(10, 23, 296, 14); - panel.add(lblId); - - labelID = new JLabel(""); - labelID.setBounds(10, 37, 296, 14); - panel.add(labelID); - - labelVersion = new JLabel(""); - labelVersion.setBounds(10, 73, 296, 14); - panel.add(labelVersion); - - JLabel lblVersion = new JLabel("Version:"); - lblVersion.setBounds(10, 57, 296, 14); - panel.add(lblVersion); - - JLabel lblBeschreibung = new JLabel("Beschreibung:"); - lblBeschreibung.setBounds(10, 119, 130, 14); - panel.add(lblBeschreibung); - - JScrollPane scrollPane = new JScrollPane(); - scrollPane.setBounds(10, 135, 296, 65); - panel.add(scrollPane); - - textAreadesc = new JTextArea(); - textAreadesc.setEditable(false); - textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); - textAreadesc.setLineWrap(true); - textAreadesc.setBackground(SystemColor.menu); - scrollPane.setViewportView(textAreadesc); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem menuItem = new JMenuItem("About"); - menuItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(menuItem); - - } - - // Initiale Beffuelung eines Table models - public DefaultTableModel initTableModel(DefaultTableModel model) { - List images; - try { - // Hole eine Liste der Images - images = client.getImageList(); - - Iterator i = images.iterator(); - - int x = 0; - SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); - while (i.hasNext()) { - - // System.out.println(out.format(in.parse(images.get(x).updateTime))); - - // erzeuge Objekte fuer die Tabelle - Object[] obj = { images.get(x).getImageName(), - images.get(x).getLicenseRestriction(), - images.get(x).getOsName(), - images.get(x).getLectureName(), - images.get(x).getUserData(), - out.format(in.parse(images.get(x).updateTime)), - images.get(x).id, images.get(x).getVersion(), - images.get(x).getIsTemplate() }; - // Fuege diese Objekte der Tabelle hinzu - model.addRow(obj); - x++; - i.next(); - - } - - return model; - } catch (TException | ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane.showMessageDialog(null, - e1.getCause() + "\n" + e1.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - return model; - } - - public void writeImageData(String id, String version) { - try { - SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); - Map res = client.getImageData(id, version); - labelName.setText(res.get("name")); - labelOS.setText(res.get("os")); - labelUpdate.setText(out.format(in.parse(res.get("lastupdate")))); - labelVerantwortlicher.setText(res.get("owner")); - labelWeitereVerantwortliche.setText("Noch nicht Verf�gbar"); - if (res.get("template").equals("true")) { - labelVorlage.setText("Ja"); - } else { - labelVorlage.setText("Nein"); - } - if (res.get("license").equals("1")) { - labelLizenzSoftware.setText("Ja"); - } else { - labelLizenzSoftware.setText("Nein"); - } - if (res.get("internet").equals("1")) { - labelInternet.setText("Ja"); - } else { - labelInternet.setText("Nein"); - } - labelRam.setText(res.get("ram")); - labelCPU.setText(res.get("cpu")); - labelID.setText(res.get("id")); - labelVersion.setText(res.get("version")); - textAreadesc.setText(res.get("desc")); - } catch (TException | ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java deleted file mode 100644 index 4c6e5629..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java +++ /dev/null @@ -1,531 +0,0 @@ -package gui.image; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Map; - -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JSeparator; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; - -import models.Image; -import models.Links; -import models.person; - -import org.apache.thrift.TException; - -import server.Server.Client; -import thrift.ThriftConnection; -import util.GuiOrganizer; -import util.OpenLinks; -import javax.swing.JScrollPane; - -@SuppressWarnings("serial") -public class EditImageAllgemein_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - private JTextField Vorname; - private JTextField Nachname; - private JTextField Hochschule; - private JTextField EMail; - private JTextField imagename; - private JTextArea textAreadesc; - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); - private JPanel panel_2; - private JLabel lblNewLabel; - private JTextPane txtpnBitteWhlenSie; - private JPanel buttonPane; - private JButton backButton; - private JButton okButton; - private boolean textfieldsHaveContent = false; //no textfield is empty - private boolean nameIsOK = false; //imagename only contains letters - private boolean descriptionLengthOK = false; //description may not be longer than MAX_DESCRIPTION_LENGTH - private final int MAX_DESCRIPTION_LENGTH = 254; - - /** - * Create the dialog. - */ - public EditImageAllgemein_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - // Beendet die Anwendung bei einem Klick auf das X - con.closeThriftConnection(); - System.exit(0); - } - }); - // Verhindert das vergroessern des Fensters - setResizable(false); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - // Setzt den Fenstertitel - setTitle("bwLehrpool Suite - Image bearbeiten"); - - // Zentriert das Fenster in der Bildmitte - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - initData(); - getContentPane().setLayout(null); - { - panel_2 = new JPanel(); - panel_2.setBackground(SystemColor.menu); - panel_2.setBounds(10, 11, 577, 57); - getContentPane().add(panel_2); - panel_2.setLayout(null); - { - lblNewLabel = new JLabel("Bearbeiten Ihrer Daten"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel_2.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an"); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel_2.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 493); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 66, 557, 369); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JLabel label = new JLabel("Vorname: *"); - label.setBackground(SystemColor.menu); - label.setBounds(10, 245, 125, 20); - panel_1.add(label); - - Vorname = new JTextField(); - Vorname.setEditable(false); - Vorname.setEnabled(false); - Vorname.setBackground(Color.WHITE); - Vorname.setText(person.verantwortlicher.getVorname()); - Vorname.setColumns(10); - Vorname.setBounds(145, 245, 350, 20); - panel_1.add(Vorname); - - JLabel label_7 = new JLabel("Nachname: *"); - label_7.setBackground(SystemColor.menu); - label_7.setBounds(10, 276, 125, 20); - panel_1.add(label_7); - - Nachname = new JTextField(); - Nachname.setEnabled(false); - Nachname.setEditable(false); - Nachname.setBackground(Color.WHITE); - Nachname.setText(person.verantwortlicher.getName()); - Nachname.setColumns(10); - Nachname.setBounds(145, 276, 350, 20); - panel_1.add(Nachname); - - JLabel label_8 = new JLabel("Hochschule: *"); - label_8.setBackground(SystemColor.menu); - label_8.setBounds(10, 307, 125, 20); - panel_1.add(label_8); - - Hochschule = new JTextField(); - Hochschule.setEnabled(false); - Hochschule.setEditable(false); - Hochschule.setBackground(Color.WHITE); - Hochschule.setText(person.verantwortlicher.getHochschule()); - Hochschule.setColumns(10); - Hochschule.setBounds(145, 307, 350, 20); - panel_1.add(Hochschule); - - JLabel label_9 = new JLabel("E-Mail: *"); - label_9.setBackground(SystemColor.menu); - label_9.setBounds(10, 338, 125, 20); - panel_1.add(label_9); - - EMail = new JTextField(); - EMail.setEnabled(false); - EMail.setEditable(false); - EMail.setBackground(Color.WHITE); - EMail.setText(person.verantwortlicher.getEMail()); - EMail.setColumns(10); - EMail.setBounds(145, 338, 350, 20); - panel_1.add(EMail); - - JLabel lblImagename = new JLabel("Imagename: *"); - lblImagename.setBackground(SystemColor.menu); - lblImagename.setBounds(10, 23, 125, 20); - panel_1.add(lblImagename); - - imagename = new JTextField(); - imagename - .setToolTipText("Bitte geben Sie hier den Namen des Image ein, z.B. \"Programmieren\"."); - imagename.setBackground(Color.WHITE); - imagename.setText(Image.image.getImagename()); - imagename.setColumns(10); - imagename.setBounds(145, 23, 350, 20); - panel_1.add(imagename); - - JTextArea txtrGebenSieBitte = new JTextArea(); - txtrGebenSieBitte.setBackground(SystemColor.menu); - txtrGebenSieBitte.setLineWrap(true); - txtrGebenSieBitte.setFont(new Font("Tahoma", Font.PLAIN, 12)); - txtrGebenSieBitte - .setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an.\r\nDieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\""); - txtrGebenSieBitte.setBounds(145, 48, 350, 55); - panel_1.add(txtrGebenSieBitte); - - JLabel lblBeschreibung = new JLabel("Beschreibung: *"); - lblBeschreibung.setBackground(SystemColor.menu); - lblBeschreibung.setBounds(10, 110, 125, 20); - panel_1.add(lblBeschreibung); - - JScrollPane scrollPane = new JScrollPane(); - scrollPane.setBounds(145, 110, 350, 60); - panel_1.add(scrollPane); - - textAreadesc = new JTextArea(); - textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); - textAreadesc.setLineWrap(true); - textAreadesc.setText((String) null); - textAreadesc.setText(Image.image.getDesc());// null am Anfang, aber - // speichert die Eingabe, - // wenn man zurueck kommt - // zur Seite - scrollPane.setViewportView(textAreadesc); - - JTextArea textArea = new JTextArea(); - textArea.setText("Geben Sie bitte eine Beschreibung für das Image an.\r\nDiese soll jedoch recht spezifisch gehalten werden.\r\nBeispiel: \"Java-Enticklung mit eclipse und MySQL\""); - textArea.setLineWrap(true); - textArea.setFont(new Font("Tahoma", Font.PLAIN, 12)); - textArea.setEditable(false); - textArea.setBackground(SystemColor.menu); - textArea.setBounds(145, 177, 350, 49); - panel_1.add(textArea); - - JPanel panel = new JPanel(); - panel.setBounds(10, 402, 577, 33); - contentPanel.add(panel); - panel.setLayout(null); - panel.setBorder(new EmptyBorder(5, 5, 5, 5)); - panel.setBackground(SystemColor.menu); - - JLabel lblPflichtfelder = new JLabel("* Pflichtfelder"); - lblPflichtfelder.setBounds(10, 442, 136, 14); - contentPanel.add(lblPflichtfelder); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - // Durch den Klick auf Button Hauptmenpue wird dieses Fenster - // unsichtbar und das Hauptmenue sichtbar - - EditImageAllgemein_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Image"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 45, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(133, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Bearbeiten"); - lblNewLabel_1.setBounds(146, 11, 71, 14); - contentPanel.add(lblNewLabel_1); - { - buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - backButton = new JButton("Zur\u00FCck"); - backButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - // Setzen der Eingabe im Model, dadurch bleiben die - // Daten bei einem erneuten Aufruf verfuegbar - // Image.image.setImagename(imagename.getText()); - - SearchEditImage_GUI se = new SearchEditImage_GUI(); - se.setVisible(true); - dispose(); - } - }); - backButton.setActionCommand("CANCEL"); - buttonPane.add(backButton); - - } - { - okButton = new JButton("Weiter"); - okButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - // Prueft die Eingabe und leitet weiter zur naechsten - // Seite - if (checkContent() == true && checkNameIsLettersOrNumbers() == true && descriptionLenghtOK()== true) { - - // setze Namen, egal ob alt oder nicht - Image.image.setImagename(imagename.getText()); - Image.image.setDesc(textAreadesc.getText()); - // Info - System.out - .println("Alle Eingaben in Ordnung. Imagename= \"" - + Image.image.getImagename() - + "\", Imagebeschreibung=\"" - + Image.image.getDesc()+"\""); - - - EditImageTechnisch_GUI ea = new EditImageTechnisch_GUI(); - ea.setVisible(true); - dispose(); - - } else { - - }// end else - } - }); - - okButton.setActionCommand("OK"); - buttonPane.add(okButton); - getRootPane().setDefaultButton(okButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); - getContentPane().add(separator_1); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem menuItem = new JMenuItem("About"); - menuItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(menuItem); - // setFocusTraversalPolicy(new FocusTraversalOnArray(new - // Component[]{getContentPane(), panel_2, lblNewLabel, - // txtpnBitteWhlenSie, contentPanel, panel_1, label, Vorname, label_7, - // Nachname, label_8, Hochschule, label_9, EMail, lblImagename, - // imagename, txtrGebenSieBitte, panel, lblPflichtfelder, lblHauptmen, - // label_1, lblVlimage, label_2, lblNewLabel_1, buttonPane, backButton, - // okButton, separator, separator_1, menuBar, mnNewMenu_1, mntmFaq, - // mntmOtrs})); - - } - - public void initData() { - try { - - Map map = client.getImageData( - Image.image.getImageId(), Image.image.getVersion()); - if (map.get("internet").equals("0")) { - Image.image.setInternet(false); - } else { - Image.image.setInternet(true); - } - if (map.get("license").equals("0")) { - Image.image.setLicensed(false); - } else { - Image.image.setLicensed(true); - } - System.out.println(map.get("template")); - if (map.get("template").equals("false")) { - Image.image.setVorlage(false); - } else { - Image.image.setVorlage(true); - } - Image.image.setImagename(map.get("name")); - Image.image.setRam(Integer.parseInt(map.get("ram"))); - Image.image.setCpu(Integer.parseInt(map.get("cpu"))); - Image.image.setImagepath(map.get("path")); - Image.image.setDesc(map.get("desc")); - Image.image.setFilesize(Long.parseLong(map.get("filesize"))); - int mode=0; - if(map.get("shareMode").equals("only_local")){ - mode=0; - } - else - { - mode=1; - } - Image.image.setShareMode(mode); - Image.image.setOS(map.get("os")); - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog(null, - e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - }//end initData() - - public boolean checkNameIsLettersOrNumbers() { - nameIsOK = false; - - //only allow letter from alphabet and nothing else - if (imagename.getText().matches("[a-zA-Z0-9]+")) { - nameIsOK = true; - } else { - JOptionPane - .showMessageDialog( - null, - "Der Imagename darf keine Leer- oder Sonderzeichen enthalten.", - "Unerlaubte Zeichen", - JOptionPane.INFORMATION_MESSAGE); - }// if - - return nameIsOK; - }// end nameIsOK - - public boolean checkContent(){ - textfieldsHaveContent=false; - - //check if any textfield is empty - if(imagename.getText().isEmpty() == false - && textAreadesc.getText().isEmpty() == false - && Vorname.getText().isEmpty() == false - && Nachname.getText().isEmpty() == false - && Hochschule.getText().isEmpty() == false - && EMail.getText().isEmpty() == false) { - //all textfields have content - textfieldsHaveContent = true; - } else { - JOptionPane - .showMessageDialog( - null, - "Bitte geben Sie alle notwendigen Daten an!", - "Daten unvollst\u00e4ndig", - JOptionPane.INFORMATION_MESSAGE); - }//end if - - return textfieldsHaveContent; - }//end checkContent - - public boolean descriptionLenghtOK(){ - descriptionLengthOK=false; - - //max length is 254 chars - if (textAreadesc.getText().length() >= MAX_DESCRIPTION_LENGTH) { - descriptionLengthOK=false; - JOptionPane - .showMessageDialog(null, - "Die Beschreibung darf max 254 Zeichen enthalten. Aktuell enthält sie "+textAreadesc.getText().length()+".", - "Beschreibung zu umfangreich", - JOptionPane.INFORMATION_MESSAGE); - }else { - descriptionLengthOK=true; - - } - - return descriptionLengthOK; - }// enddescriptionLenghtOK() - -}//end class diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java deleted file mode 100644 index 147900fe..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java +++ /dev/null @@ -1,256 +0,0 @@ -package gui.image; - - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.ButtonGroup; -import javax.swing.DefaultComboBoxModel; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JSeparator; -import javax.swing.JTextPane; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; - -import models.Image; -import models.Links; -import util.GuiOrganizer; -import util.OpenLinks; - -@SuppressWarnings("serial") -public class EditImageFreigabe_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - private final ButtonGroup buttonGrouplicense = new ButtonGroup(); - private final ButtonGroup buttonGroupInternet = new ButtonGroup(); - JComboBox comboBox; - - /** - * Create the dialog. - */ - public EditImageFreigabe_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - System.exit(0); - } - }); - setResizable(false); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - setTitle("bwLehrpool Suite - Image erzeugen"); - - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Image Freigabe"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie.setText("W\u00E4hlen Sie bitte hier die von Ihnen gew\u00FCnschte Freigabe f\u00FCr Ihr Image aus."); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 493); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Freigabe", TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 51, 557, 124); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JLabel lblNewLabel_2 = new JLabel("Freigabemodus:"); - lblNewLabel_2.setBounds(10, 55, 250, 20); - panel_1.add(lblNewLabel_2); - - comboBox = new JComboBox(); - comboBox.setModel(new DefaultComboBoxModel(new String[] {"Lokal (Eigene Hochschule)", "\u00D6ffentlich (Alle Hochschulen)"})); - comboBox.setSelectedIndex(Image.image.getShareMode()); - comboBox.setBounds(270, 55, 250, 20); - panel_1.add(comboBox); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - - EditImageFreigabe_GUI.this.setVisible(false); - MainMenue_GUI main=new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Image"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 45, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(133, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Neu"); - lblNewLabel_1.setBounds(146, 11, 46, 14); - contentPanel.add(lblNewLabel_1); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton cancelButton = new JButton("Zur\u00FCck"); - cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - Image.image.setShareMode(comboBox.getSelectedIndex()); - EditImageTechnisch_GUI sr=new EditImageTechnisch_GUI(); - sr.setVisible(true); - dispose(); - } - }); - cancelButton.setActionCommand("OK"); - buttonPane.add(cancelButton); - //getRootPane().setDefaultButton(cancelButton); - } - { - JButton continueButton = new JButton("Weiter"); - continueButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - Image.image.setShareMode(comboBox.getSelectedIndex()); - PermissionEditImage_GUI ea=new PermissionEditImage_GUI(); - ea.setVisible(true); - dispose(); - - } - }); - continueButton.setActionCommand("Cancel"); - buttonPane.add(continueButton); - getRootPane().setDefaultButton(continueButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); - getContentPane().add(separator_1); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java deleted file mode 100644 index 5da9259e..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java +++ /dev/null @@ -1,518 +0,0 @@ -package gui.image; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.List; - - -import javax.swing.ButtonGroup; -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JSeparator; -import javax.swing.JSpinner; -import javax.swing.JTextArea; -import javax.swing.JTextPane; -import javax.swing.SpinnerNumberModel; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; - -import server.Server.Client; -import thrift.ThriftConnection; -import util.GuiOrganizer; -import util.OpenLinks; -import models.Image; -import models.Links; -import javax.swing.JComboBox; - -import org.apache.thrift.TException; -import javax.swing.JCheckBox; - -@SuppressWarnings("serial") -public class EditImageTechnisch_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - JSpinner spinnerCPU; - JSpinner spinnerRam; - //JRadioButton rdbtnlicenseJa; - //JRadioButton rdbtnlicenseNein; - //JRadioButton rdbtnInternetJa; - //JRadioButton rdbtnInternetNein; - //JRadioButton radioButtonVorlageJa; - //JRadioButton radioButtonVorlageNein; - private JCheckBox chckbxIsTemplate; - private JCheckBox chckbxIsLicensed; - private JCheckBox chckbxIsInternetBlocked; - private final ButtonGroup buttonGrouplicense = new ButtonGroup(); - private final ButtonGroup buttonGroupInternet = new ButtonGroup(); - private final ButtonGroup buttonGroupVorlage = new ButtonGroup(); - JComboBox comboBox; - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); - - /** - * Create the dialog. - */ - public EditImageTechnisch_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - // Beendet die Anwendung bei Klick auf das X - - System.exit(0); - } - - }); - // Verhindert das Vergroe�ern des Fensters - setResizable(false); - - try { - // setzt das Look & Feel - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - // Setzt den Titel des Fensters - setTitle("bwLehrpool Suite - Image bearbeiten"); - // Zentriert das Fenster - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Eingabe technischer Daten"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("Geben Sie hier bitte einige technische Daten ein."); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 532); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Informationen zum Image", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 25, 557, 167); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JLabel lblNewLabel_2 = new JLabel( - "Image enth\u00E4lt lizenzpflichtige Software:"); - lblNewLabel_2.setBounds(10, 77, 250, 20); - panel_1.add(lblNewLabel_2); - - chckbxIsTemplate = new JCheckBox(""); - chckbxIsTemplate.setBounds(266, 50, 97, 23); - panel_1.add(chckbxIsTemplate); - - chckbxIsLicensed = new JCheckBox(""); - chckbxIsLicensed.setBounds(266, 76, 97, 23); - panel_1.add(chckbxIsLicensed); - - chckbxIsInternetBlocked = new JCheckBox(""); - chckbxIsInternetBlocked.setBounds(266, 104, 97, 23); - panel_1.add(chckbxIsInternetBlocked); - - //rdbtnlicenseJa = new JRadioButton("Ja"); - //rdbtnlicenseJa.setSelected(true); - //buttonGrouplicense.add(rdbtnlicenseJa); - //rdbtnlicenseJa.setBounds(266, 76, 109, 23); - //panel_1.add(rdbtnlicenseJa); - - //rdbtnlicenseNein = new JRadioButton("Nein"); - //buttonGrouplicense.add(rdbtnlicenseNein); - //rdbtnlicenseNein.setBounds(377, 76, 53, 23); - //panel_1.add(rdbtnlicenseNein); - - - JLabel lblInternetIstInnerhalb = new JLabel( - "Internet ist innerhalb des Image gesperrt:"); - lblInternetIstInnerhalb.setBounds(10, 105, 250, 20); - panel_1.add(lblInternetIstInnerhalb); - - /*rdbtnInternetJa = new JRadioButton("Ja"); - buttonGroupInternet.add(rdbtnInternetJa); - rdbtnInternetJa.setBounds(266, 104, 109, 23); - panel_1.add(rdbtnInternetJa); - - rdbtnInternetNein = new JRadioButton("Nein"); - rdbtnInternetNein.setSelected(true); - buttonGroupInternet.add(rdbtnInternetNein); - rdbtnInternetNein.setBounds(377, 104, 53, 23); - panel_1.add(rdbtnInternetNein); - */ - JLabel label = new JLabel("Lizenzserver eintragen:"); - label.setBounds(10, 134, 250, 20); - panel_1.add(label); - - JButton button = new JButton("Server-Adresse..."); - button.setEnabled(false); - button.setBounds(266, 133, 157, 23); - panel_1.add(button); - - JLabel label_4 = new JLabel("Image ist eine Vorlage:"); - label_4.setBounds(10, 51, 250, 20); - panel_1.add(label_4); - - //radioButtonVorlageJa = new JRadioButton("Ja"); - //buttonGroupVorlage.add(radioButtonVorlageJa); - //radioButtonVorlageJa.setBounds(266, 50, 41, 23); - //panel_1.add(radioButtonVorlageJa); - - //radioButtonVorlageNein = new JRadioButton("Nein"); - //radioButtonVorlageNein.setSelected(true); - //buttonGroupVorlage.add(radioButtonVorlageNein); - //radioButtonVorlageNein.setBounds(377, 50, 46, 23); - //panel_1.add(radioButtonVorlageNein); - - JLabel lblBetriebssystem = new JLabel("Betriebssystem:"); - lblBetriebssystem.setBounds(10, 26, 250, 20); - panel_1.add(lblBetriebssystem); - - comboBox = new JComboBox(); - try { - List os=client.getAllOS(); - for(int i=0;i"); - label_1.setBounds(69, 0, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Image"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 0, 45, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(133, 0, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Neu"); - lblNewLabel_1.setBounds(146, 0, 46, 14); - contentPanel.add(lblNewLabel_1); - - JPanel panel_2 = new JPanel(); - panel_2.setLayout(null); - panel_2.setBorder(new TitledBorder(null, - "Empfehlung bez\u00fcglich Ressourcen", TitledBorder.LEADING, - TitledBorder.TOP, null, null)); - panel_2.setBackground(SystemColor.menu); - panel_2.setBounds(10, 203, 557, 329); - contentPanel.add(panel_2); - - JTextArea txtrHinweisSolltenSie = new JTextArea(); - txtrHinweisSolltenSie.setBackground(SystemColor.menu); - txtrHinweisSolltenSie.setFont(new Font("Tahoma", Font.PLAIN, 13)); - txtrHinweisSolltenSie - .setText("Hinweis: Sollten Sie keine Software einsetzen, die viele Ressourcen ben\u00F6tigt,\r\nk\u00F6nnen Sie sich an den Beispielwerten orientieren."); - txtrHinweisSolltenSie.setBounds(10, 43, 537, 55); - panel_2.add(txtrHinweisSolltenSie); - - JLabel lblNewLabel_3 = new JLabel( - "Wie viel Arbeitsspeicher empfehlen Sie f\u00FCr das Image:"); - lblNewLabel_3.setBounds(10, 109, 280, 20); - panel_2.add(lblNewLabel_3); - - JLabel lblMindestens = new JLabel("mindestens"); - lblMindestens.setBounds(315, 109, 60, 20); - panel_2.add(lblMindestens); - - spinnerRam = new JSpinner(); - spinnerRam.setModel(new SpinnerNumberModel(1, 1, 8, 1)); - spinnerRam.setBounds(385, 106, 29, 20); - spinnerRam.setValue(Image.image.getRam()); - panel_2.add(spinnerRam); - - JLabel lblGbyte = new JLabel("GByte"); - lblGbyte.setBounds(424, 109, 46, 20); - panel_2.add(lblGbyte); - - JTextArea txtrBeispielWindows = new JTextArea(); - txtrBeispielWindows - .setText("Beispiel:\r\nWindows 7 32/64 Bit: 2 GByte\r\nLinux/Unix 32/64 Bit: 1 GByte"); - txtrBeispielWindows.setFont(new Font("Tahoma", Font.PLAIN, 11)); - txtrBeispielWindows.setBackground(SystemColor.menu); - txtrBeispielWindows.setBounds(20, 129, 280, 55); - panel_2.add(txtrBeispielWindows); - - JTextArea txtrBeispielWindows_1 = new JTextArea(); - txtrBeispielWindows_1 - .setText("Beispiel:\r\nWindows 7 32/64 Bit: 1 Kern\r\nLinux/Unix 32/64 Bit: 1 Kern"); - txtrBeispielWindows_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); - txtrBeispielWindows_1.setBackground(SystemColor.menu); - txtrBeispielWindows_1.setBounds(20, 244, 280, 55); - panel_2.add(txtrBeispielWindows_1); - - JLabel lblWieVieleCpus = new JLabel( - "Wie viele CPUs empfehlen Sie f\u00FCr das Image:"); - lblWieVieleCpus.setBounds(10, 219, 280, 20); - panel_2.add(lblWieVieleCpus); - - JLabel label_3 = new JLabel("mindestens"); - label_3.setBounds(315, 219, 60, 20); - panel_2.add(label_3); - - spinnerCPU = new JSpinner(); - spinnerCPU.setModel(new SpinnerNumberModel(1, 1, 4, 1)); - spinnerCPU.setBounds(385, 216, 29, 20); - spinnerCPU.setValue(Image.image.getCpu()); - panel_2.add(spinnerCPU); - - JLabel lblKerne = new JLabel("Kerne"); - lblKerne.setBounds(424, 219, 46, 20); - panel_2.add(lblKerne); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton okButton = new JButton("Zur\u00FCck"); - okButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - // Setzt die Imagewerte in das Model - Image.image.setCpu(Integer.valueOf( - spinnerCPU.getValue().toString()).intValue()); - Image.image.setRam(Integer.valueOf( - spinnerRam.getValue().toString()).intValue()); - if (chckbxIsInternetBlocked.isSelected() == true) { - Image.image.setInternet(true); - } else { - Image.image.setInternet(false); - } - - if (chckbxIsLicensed.isSelected() == true) { - Image.image.setLicensed(true); - } else { - Image.image.setLicensed(false); - } - - if (chckbxIsTemplate.isSelected() == true) { - Image.image.setVorlage(true); - } else { - Image.image.setVorlage(false); - } - - Image.image.setOS(comboBox.getSelectedItem().toString()); - // oeffnet das vorherige Fenster - EditImageAllgemein_GUI ei = new EditImageAllgemein_GUI(); - ei.setVisible(true); - dispose(); - } - }); - okButton.setActionCommand("OK"); - buttonPane.add(okButton); - getRootPane().setDefaultButton(okButton); - } - { - JButton cancelButton = new JButton("Weiter"); - cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - Image.image.setCpu(Integer.valueOf( - spinnerCPU.getValue().toString()).intValue()); - Image.image.setRam(Integer.valueOf( - spinnerRam.getValue().toString()).intValue()); - if (chckbxIsInternetBlocked.isSelected() == true) { - Image.image.setInternet(true); - } else { - Image.image.setInternet(false); - } - - if (chckbxIsLicensed.isSelected() == true) { - Image.image.setLicensed(true); - } else { - Image.image.setLicensed(false); - } - - if (chckbxIsTemplate.isSelected() == true) { - Image.image.setVorlage(true); - } else { - Image.image.setVorlage(false); - } - - Image.image.setOS(comboBox.getSelectedItem().toString()); - System.out.println("Betriebssystem: "+Image.image.getOS()+", istVorlage: "+Image.image.isVorlage()+", Lizenzpflichtig: "+Image.image.isLicensed()+", Internetsperre: "+Image.image.isInternet()+", CPU: "+Image.image.getCpu()+", RAM: "+Image.image.getRam()); - // oeffnet das naechste Fenster - EditImageFreigabe_GUI ea=new EditImageFreigabe_GUI(); - ea.setVisible(true); - dispose(); - - } - }); - cancelButton.setActionCommand("Cancel"); - buttonPane.add(cancelButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); - getContentPane().add(separator_1); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java deleted file mode 100644 index a9461bb4..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java +++ /dev/null @@ -1,659 +0,0 @@ -package gui.image; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; - -import javax.swing.JButton; -import javax.swing.JFileChooser; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JProgressBar; -import javax.swing.JSeparator; -import javax.swing.JTextPane; -import javax.swing.SwingConstants; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; - -import models.Image; -import models.Links; -import models.SessionData; -import models.person; - -import org.apache.thrift.TException; -import org.ini4j.InvalidFileFormatException; -import org.ini4j.Wini; - -import server.Server.Client; -import thrift.ThriftConnection; -import util.GuiOrganizer; -import util.OpenLinks; -import ftp.UploadTask; -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -@SuppressWarnings("serial") -public class FTPCreateUploader_GUI extends JFrame implements - PropertyChangeListener { - - @SuppressWarnings("unused") - private JPanel contentPane; - private final JPanel contentPanel = new JPanel(); - JLabel lblPath; - JProgressBar progressBar; - String host = SessionData.session.getServerAdress(); - int port = 21; - server.User user; - String filename = ""; - File uploadFile; - static String arg = ""; - UploadTask task; - JLabel UpSpeed; - JLabel labelfertig; - JLabel labelfilesize; - JLabel labelZeit; - JLabel labelverbleibend; - JFileChooser fc; - long filesize; - double speed; - long bytesread; - boolean taskrun = false; - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); - JButton finishButton = new JButton("Fertigstellen"); - JButton btnUploadStarten = new JButton("Upload auf Server starten"); - JButton btnZurck = new JButton("Zur\u00FCck"); - int progress = 0; // progress of upload - private boolean isCurrentlyLoading = false; // currently up or downloading - // file - - /** - * Create the frame. - */ - public FTPCreateUploader_GUI() { - - final Object[] options = { "Beenden", "Abbrechen" }; - - addWindowListener(new WindowAdapter() { - - @Override - public void windowClosing(WindowEvent arg0) { - - if (taskrun == true) { - // check if user wants to quit. - int choice = JOptionPane - .showOptionDialog( - null, - "Aktuell ist ein Upload aktiv. Wollen Sie diesen Abbrechen und das Programm beenden?", - "Upload aktiv", - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE, null, - options, options[1]); - // 0=beenden, 1=abbrechen - if (choice == 0) { - try { - client.DeleteFtpUser(user.userName); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - task.cancel(true); - con.closeThriftConnection(); - System.exit(0); - }// end if choice - } else { - // no upload running, close window - System.exit(0); - }// end if taskrun - }// end window closing - }); - setResizable(false); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog(null, - e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - - // filename=name; - setBackground(Color.WHITE); - setTitle("Dozentenmodul - Image erzeugen"); - // Aktion die beim Schliessen durchgefuehrt werden soll - setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); - - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(new BorderLayout()); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel, BorderLayout.CENTER); - contentPanel.setLayout(null); - { - JButton btnSpeicherortAuswhlen = new JButton("Image ausw\u00E4hlen"); - btnSpeicherortAuswhlen.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - try { - Wini ini = new Wini( - new File( - "C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - fc = new JFileChooser(ini.get("main", - "Letzter Uploadpfad", String.class)); - } catch (InvalidFileFormatException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } catch (IOException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - - fc.setFileSelectionMode(JFileChooser.FILES_ONLY); - - fc.showOpenDialog(getParent()); - File file = fc.getSelectedFile(); - // check if a file is selected and exists - if (file != null) { - // file selected - uploadFile = file; - filename = uploadFile.getName(); - lblPath.setText(file.getAbsolutePath()); - } else { - // no file selected - lblPath.setText(""); - }// end if - } - }); - - btnSpeicherortAuswhlen.setBounds(102, 124, 173, 23); - btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP); - contentPanel.add(btnSpeicherortAuswhlen); - } - lblPath = new JLabel(""); - try { - Wini ini = new Wini(new File("C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - lblPath.setText(ini.get("main", "Letzter Uploadpfad", String.class)); - } catch (InvalidFileFormatException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } catch (IOException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - - lblPath.addPropertyChangeListener(new PropertyChangeListener() { - public void propertyChange(PropertyChangeEvent arg0) { - if (lblPath.getText() == null) { - // wenn leer, dann upload button nicht freigeben - btnUploadStarten.setEnabled(false); - btnUploadStarten.setText("Bitte warten"); - } else if (lblPath.getText().endsWith(".vmdk")) { - // wenn leer, dann upload button freigeben - btnUploadStarten.setEnabled(true); - btnUploadStarten.setText("Upload auf Server starten"); - } - } - }); - lblPath.setHorizontalAlignment(SwingConstants.LEFT); - lblPath.setBounds(102, 158, 485, 23); - contentPanel.add(lblPath); - - btnUploadStarten.setEnabled(false); - btnUploadStarten.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - buttonUploadActionPerformed(arg0); - - } - }); - - btnUploadStarten.setBounds(102, 200, 173, 23); - contentPanel.add(btnUploadStarten); - - progressBar = new JProgressBar(0, 100); - progressBar.setStringPainted(true); - - progressBar.setBounds(102, 234, 485, 30); - contentPanel.add(progressBar); - - JLabel lblUploadgeschwindigkeit = new JLabel("Uploadgeschwindigkeit:"); - lblUploadgeschwindigkeit.setBounds(102, 275, 141, 14); - contentPanel.add(lblUploadgeschwindigkeit); - - JLabel label_1 = new JLabel("Fertig:"); - label_1.setBounds(102, 325, 46, 14); - contentPanel.add(label_1); - - labelfertig = new JLabel("0"); - labelfertig.setHorizontalAlignment(SwingConstants.LEFT); - labelfertig.setBounds(183, 325, 108, 14); - contentPanel.add(labelfertig); - - UpSpeed = new JLabel("0"); - UpSpeed.setHorizontalAlignment(SwingConstants.LEFT); - UpSpeed.setBounds(374, 275, 117, 14); - contentPanel.add(UpSpeed); - - JLabel label_4 = new JLabel("von:"); - label_4.setBounds(318, 325, 46, 14); - contentPanel.add(label_4); - - labelfilesize = new JLabel("0"); - labelfilesize.setHorizontalAlignment(SwingConstants.LEFT); - labelfilesize.setBounds(374, 325, 117, 14); - contentPanel.add(labelfilesize); - - JLabel label_6 = new JLabel("Verbleibend:"); - label_6.setBounds(102, 350, 71, 14); - contentPanel.add(label_6); - - JLabel label_7 = new JLabel("Gesch\u00E4tzte Verbleibende Zeit:"); - label_7.setBounds(102, 300, 150, 14); - contentPanel.add(label_7); - - labelZeit = new JLabel("0"); - labelZeit.setHorizontalAlignment(SwingConstants.LEFT); - labelZeit.setBounds(374, 300, 117, 14); - contentPanel.add(labelZeit); - - labelverbleibend = new JLabel("0"); - labelverbleibend.setHorizontalAlignment(SwingConstants.LEFT); - labelverbleibend.setBounds(183, 350, 108, 14); - contentPanel.add(labelverbleibend); - - JPanel panel = new JPanel(); - panel.setLayout(null); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); - contentPanel.add(panel); - - JLabel lblUploadIhresImage = new JLabel("Upload Ihres Image"); - lblUploadIhresImage.setFont(new Font("Tahoma", Font.BOLD, 18)); - lblUploadIhresImage.setBounds(10, 11, 509, 22); - panel.add(lblUploadIhresImage); - - JTextPane txtpnFhreSieBitte = new JTextPane(); - txtpnFhreSieBitte - .setText("F\u00FChre Sie bitte die folgenden 3 Schritte aus um Ihr Image auf unseren Server zu laden."); - txtpnFhreSieBitte.setEditable(false); - txtpnFhreSieBitte.setBackground(SystemColor.menu); - txtpnFhreSieBitte.setBounds(10, 36, 509, 32); - panel.add(txtpnFhreSieBitte); - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 79, 597, 2); - contentPanel.add(separator); - - JLabel lblNewLabel_1 = new JLabel("Hauptmen\u00FC"); - lblNewLabel_1.setForeground(Color.BLUE); - lblNewLabel_1.setBounds(20, 88, 61, 20); - contentPanel.add(lblNewLabel_1); - - JLabel label_3 = new JLabel(">"); - label_3.setBounds(80, 91, 14, 14); - contentPanel.add(label_3); - - JLabel lblVlimage = new JLabel("Image"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(91, 88, 46, 20); - contentPanel.add(lblVlimage); - - JLabel label_5 = new JLabel(">"); - label_5.setBounds(139, 91, 14, 14); - contentPanel.add(label_5); - - JLabel lblNeubearbeiten = new JLabel("Neu"); - lblNeubearbeiten.setBounds(149, 91, 108, 14); - contentPanel.add(lblNeubearbeiten); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); - contentPanel.add(separator_1); - - JLabel lblSchritt_1 = new JLabel("Schritt 1:"); - lblSchritt_1.setBounds(24, 128, 57, 14); - contentPanel.add(lblSchritt_1); - - JLabel lblSchritt_2 = new JLabel("Schritt 2:"); - lblSchritt_2.setBounds(24, 204, 57, 14); - contentPanel.add(lblSchritt_2); - - JLabel lblSchritt_3 = new JLabel("Schritt 3:"); - lblSchritt_3.setBounds(20, 423, 57, 14); - contentPanel.add(lblSchritt_3); - - JLabel lblKlickenSieAuf = new JLabel( - "Klicken Sie auf \"Fertigstellen\"."); - lblKlickenSieAuf.setBounds(98, 423, 241, 14); - contentPanel.add(lblKlickenSieAuf); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBackground(UIManager.getColor("Button.background")); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane, BorderLayout.SOUTH); - { - finishButton.setEnabled(false); - finishButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - writeData(); - try { - Wini ini = new Wini( - new File( - "C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - - // check if path has content, then write to file - if (lblPath.getText().contains("\\") == true) { - System.out.println("Hole Infos aus Label: " - + lblPath.getText()); - ini.put("main", - "Letzter Uploadpfad", - lblPath.getText().substring( - 0, - lblPath.getText().lastIndexOf( - "\\"))); - ini.store(); - } else { - System.out.println("Mache nix"); - }// end if - } catch (InvalidFileFormatException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } catch (IOException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - dispose(); - MainMenue_GUI m = new MainMenue_GUI(); - m.setVisible(true); - if (taskrun == true) { - try { - client.DeleteFtpUser(user.userName); - - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane.showMessageDialog( - null, - e1.getCause() + "\n" - + e1.getStackTrace(), - "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - task.cancel(true); - } - - } - }); - - btnZurck.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - // check if loading file or not - if (isCurrentlyLoading() == true) { - int choice = JOptionPane - .showOptionDialog( - null, - "Nicht abgeschlossene Uploads werden beendet. Trotzdem zurück gehen?", - "Warnung", - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE, null, - options, options[1]); - // 0=beenden, 1=abbrechen - if (choice == 0) { - try { - client.DeleteFtpUser(user.userName); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - task.cancel(true); - // not loading files, go back one page - dispose(); - PermissionCreateImage_GUI m = new PermissionCreateImage_GUI(); - m.setVisible(true); - - }// end if choice - } else { - dispose(); - PermissionCreateImage_GUI m = new PermissionCreateImage_GUI(); - m.setVisible(true); - }// end else - }// end action - }); - btnZurck.setActionCommand("Cancel"); - buttonPane.add(btnZurck); - finishButton.setActionCommand("Cancel"); - buttonPane.add(finishButton); - } - } - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu menu = new JMenu("Hilfe"); - menuBar.add(menu); - - JMenuItem menuItem = new JMenuItem("FAQ"); - menuItem.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - OpenLinks open = new OpenLinks(); - URI windows; - try { - windows = new URI(Links.getFAQ()); - open.openWebpage(windows); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - - menu.add(menuItem); - - JMenuItem menuItem_1 = new JMenuItem("OTRS"); - menuItem_1.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - OpenLinks open = new OpenLinks(); - URI windows; - try { - windows = new URI(Links.getOTRS()); - open.openWebpage(windows); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - menu.add(menuItem_1); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - menu.add(mntmAbout); - setVisible(true); - - } - - private void buttonUploadActionPerformed(ActionEvent event) { - - progressBar.setValue(0); - btnUploadStarten.setEnabled(false); // verhindert einen weiteren klick - btnUploadStarten.setText("Bitte warten"); - - try { - System.out.println("Getting FTP User"); - user = client.getFtpUser(); - System.out.println("FTP name: " + user.userName); - System.out.println("FTP path: " + user.path); - System.out.println("FTP pass: " + user.password); - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog(null, - e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - DateFormat formatter = new SimpleDateFormat("yyyMMddhhmmss"); - - System.out.println("Setting new Name: " + formatter.format(new Date()) - + "_" + person.verantwortlicher.getHochschule() + "_" - + person.verantwortlicher.getUsername() + "_" - + Image.image.getImagename() + ".vmdk"); - Image.image.setNewName(formatter.format(new Date()) + "_" - + person.verantwortlicher.getHochschule() + "_" - + person.verantwortlicher.getUsername() + "_" - + Image.image.getImagename() + ".vmdk"); - System.out.println("Uploading to host: " + host); - - task = new UploadTask(host, port, user.userName, user.password, - user.path + "temp/", uploadFile); - - task.addPropertyChangeListener(this); - task.execute(); - taskrun = true; - - } - - public void propertyChange(PropertyChangeEvent arg0) { - progress = 0; - if ("progress" == arg0.getPropertyName()) { - progress = (Integer) arg0.getNewValue(); - progressBar.setValue(progress); - - } - - // Fertigstellen erlauben wenn upload abgeschlossen - if (isCurrentlyLoading() == false) { - // isCurrentlyLoading(); - finishButton.setEnabled(true); - } else { - finishButton.setEnabled(false); - } - - if ("speed" == arg0.getPropertyName()) { - speed = (double) arg0.getNewValue(); - // if(speed<=1){ - - UpSpeed.setText(String.valueOf(speed).substring(0, - String.valueOf(speed).lastIndexOf(".") + 3) - + " MB/s"); - - } - if ("bytesread" == arg0.getPropertyName()) { - bytesread = (long) arg0.getNewValue(); - labelfertig.setText((bytesread / 1024 / 1024) + " MB"); - labelverbleibend - .setText(((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) - + " MB"); - - labelZeit - .setText(String - .valueOf( - ((((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + 1) - .substring( - 0, - String.valueOf( - (((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) - .lastIndexOf(".")) - + " Minuten"); - - } - if ("filesize" == arg0.getPropertyName()) { - filesize = (long) arg0.getNewValue(); - labelfilesize.setText((filesize / 1024 / 1024) + " MB"); - - } - - } - - public boolean writeData() { - - try { - - client.writeVLdata(Image.image.getImagename(), - Image.image.getDesc(), - person.verantwortlicher.getUsername(), - person.verantwortlicher.getVorname(), - person.verantwortlicher.getName(), - person.verantwortlicher.getHochschule(), - person.verantwortlicher.getEMail(), - person.verantwortlicher.getTel(), - person.verantwortlicher.getFakultaet(), - Image.image.isLicensed(), Image.image.isInternet(), - Image.image.getRam(), Image.image.getCpu(), "temp/" - + Image.image.getNewName(), - Image.image.isVorlage(), Image.image.getFilesize(), - Image.image.getShareMode(), Image.image.getOS()); - - client.startFileCopy(Image.image.getNewName()); - - client.writeImageRights(Image.image.getImagename(), - person.verantwortlicher.getUsername(), - person.verantwortlicher.getName(), - person.verantwortlicher.getVorname(), - person.verantwortlicher.getEMail(), - person.verantwortlicher.getHochschule(), - person.verantwortlicher.getRole()); - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog(null, - e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - return false; - } - return true; - - }// end writeData() - - public boolean isCurrentlyLoading() { - isCurrentlyLoading = false; - - if (labelverbleibend.getText().equals("0 MB") - || labelverbleibend.getText().equals("0")) { - isCurrentlyLoading = false; - } else { - isCurrentlyLoading = true; - } - - return isCurrentlyLoading; - }// end isCurrentlyLoading() - -}// end class \ No newline at end of file diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java deleted file mode 100644 index 013c2774..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java +++ /dev/null @@ -1,590 +0,0 @@ -package gui.image; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.JButton; -import javax.swing.JFileChooser; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JProgressBar; -import javax.swing.JSeparator; -import javax.swing.JTextPane; -import javax.swing.SwingConstants; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; - -import models.Image; -import models.Links; -import models.SessionData; - -import org.apache.thrift.TException; -import org.ini4j.InvalidFileFormatException; -import org.ini4j.Wini; - -import server.Server.Client; -import server.User; -import thrift.ThriftConnection; -import util.GuiOrganizer; -import util.OpenLinks; -import ftp.DownloadTask; -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -@SuppressWarnings("serial") -public class FTPEditDownloader_GUI extends JFrame implements - PropertyChangeListener { - - @SuppressWarnings("unused") - private JPanel contentPane; - private final JPanel contentPanel = new JPanel(); - JLabel lblPath; - JLabel downspeed; - User user; - JProgressBar progressBar; - String host = SessionData.session.getServerAdress(); - int port = 21; - String downloadFile = ""; - static String arg = ""; - DownloadTask task; - JLabel lblBytesread; - JLabel lblNewLabel_3; - JLabel labelVerbleibend; - JFileChooser fc; - long filesize; - double speed; - int progress = 0; // progress of download - long bytesread; - JLabel labelZeit; - boolean taskrun = false; - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); - JButton btnZurck = new JButton("Zur\u00FCck"); - JButton btnDownloadStarten = new JButton("Download starten"); - private JLabel lblAnleitung; - private boolean isCurrentlyLoading = false; // currently up or downloading - // file - - /** - * Create the frame. - */ - public FTPEditDownloader_GUI() { - - final Object[] options = { "Beenden", "Abbrechen" }; - - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent e) { - if (taskrun == true) { - // check if user wants to quit. - int choice = JOptionPane - .showOptionDialog( - null, - "Aktuell ist ein Download aktiv. Wollen Sie diesen Abbrechen und das Programm beenden?", - "Upload aktiv", - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE, null, - options, options[1]); - // 0=beenden, 1=abbrechen - if (choice == 0) { - try { - client.DeleteFtpUser(user.userName); - con.closeThriftConnection(); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - task.cancel(true); - System.exit(0); - }// end if coice - } else { - // no download running, close window - System.exit(0); - }// end if taskrun - }// end window closing - }); - setResizable(false); - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - setBackground(Color.WHITE); - setTitle("Dozentenmodul - Image herunterladen"); - // Aktion die beim Schliessen durchgefuehrt werden soll - setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); - - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(new BorderLayout()); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel, BorderLayout.CENTER); - contentPanel.setLayout(null); - { - JButton btnSpeicherortAuswhlen = new JButton( - "Speicherort ausw\u00E4hlen"); - btnSpeicherortAuswhlen.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - - try { - Wini ini = new Wini( - new File( - "C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - System.out.println("FileChooser Pfad: " - + ini.get("main", "Letzter Downloadpfad", - String.class)); - fc = new JFileChooser(ini.get("main", - "Letzter Downloadpfad", String.class)); - fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - - fc.showOpenDialog(getParent()); - } catch (InvalidFileFormatException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } catch (IOException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - - File dir = fc.getSelectedFile(); - // check if directory is selected - if (dir != null) { - // is selected - lblPath.setText(dir.getAbsolutePath()); - } else { - // no directory selected - lblPath.setText(""); - }// end if - } - }); - - btnSpeicherortAuswhlen.setBounds(102, 124, 173, 23); - btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP); - contentPanel.add(btnSpeicherortAuswhlen); - } - - lblPath = new JLabel(""); - try { - Wini ini = new Wini(new File("C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - lblPath.setText(ini.get("main", "Letzter Downloadpfad", - String.class)); - } catch (InvalidFileFormatException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } catch (IOException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - lblPath.addPropertyChangeListener(new PropertyChangeListener() { - public void propertyChange(PropertyChangeEvent arg0) { - if (lblPath.getText() == null) { - // wenn leer, dann upload button nicht freigeben - btnDownloadStarten.setEnabled(false); - btnDownloadStarten.setText("Bitte warten"); - } else { - // wenn leer, dann upload button freigeben - btnDownloadStarten.setEnabled(true); - btnDownloadStarten.setText("Download starten"); - } - } - }); - lblPath.setBounds(102, 158, 485, 23); - contentPanel.add(lblPath); - - btnDownloadStarten.setEnabled(false); - btnDownloadStarten.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - buttonDownloadActionPerformed(arg0); - } - }); - - btnDownloadStarten.setBounds(102, 200, 173, 23); - contentPanel.add(btnDownloadStarten); - - progressBar = new JProgressBar(0, 100); - progressBar.setStringPainted(true); - - progressBar.setBounds(102, 234, 485, 30); - contentPanel.add(progressBar); - - JLabel lblDownloadgeschwindigkeit = new JLabel( - "Downloadgeschwindigkeit:"); - lblDownloadgeschwindigkeit.setBounds(102, 275, 141, 14); - contentPanel.add(lblDownloadgeschwindigkeit); - - downspeed = new JLabel("0"); - downspeed.setBounds(374, 275, 117, 14); - contentPanel.add(downspeed); - - JLabel lblFertig = new JLabel("Fertig:"); - lblFertig.setBounds(102, 325, 46, 14); - contentPanel.add(lblFertig); - - lblBytesread = new JLabel("0"); - lblBytesread.setBounds(183, 325, 108, 14); - contentPanel.add(lblBytesread); - - JLabel lblVon = new JLabel("von:"); - lblVon.setBounds(318, 325, 46, 14); - contentPanel.add(lblVon); - - lblNewLabel_3 = new JLabel("0"); - lblNewLabel_3.setBounds(374, 325, 117, 14); - contentPanel.add(lblNewLabel_3); - - JLabel lblMbVerbleibend = new JLabel("Verbleibend:"); - lblMbVerbleibend.setBounds(102, 350, 71, 14); - contentPanel.add(lblMbVerbleibend); - - labelVerbleibend = new JLabel("0"); - labelVerbleibend.setBounds(183, 350, 108, 14); - contentPanel.add(labelVerbleibend); - - JLabel lblGeschtzteVerbleibendeZeit = new JLabel( - "Gesch\u00E4tzte Verbleibende Zeit:"); - lblGeschtzteVerbleibendeZeit.setBounds(102, 300, 150, 14); - contentPanel.add(lblGeschtzteVerbleibendeZeit); - - labelZeit = new JLabel("0"); - labelZeit.setBounds(374, 300, 117, 14); - contentPanel.add(labelZeit); - - JPanel panel = new JPanel(); - panel.setLayout(null); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 24, 577, 57); - contentPanel.add(panel); - - JLabel lblImageDownloader = new JLabel("Image Downloader"); - lblImageDownloader.setFont(new Font("Tahoma", Font.BOLD, 18)); - lblImageDownloader.setBounds(10, 11, 509, 22); - panel.add(lblImageDownloader); - - JTextPane txtpnWhlenSieEinen = new JTextPane(); - txtpnWhlenSieEinen - .setText("W\u00E4hlen Sie einen Ort aus, um das von Ihnen gw\u00E4hlte Image erunter zu laden."); - txtpnWhlenSieEinen.setEditable(false); - txtpnWhlenSieEinen.setBackground(SystemColor.menu); - txtpnWhlenSieEinen.setBounds(10, 36, 509, 32); - panel.add(txtpnWhlenSieEinen); - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 88, 597, 2); - contentPanel.add(separator); - - JLabel label_1 = new JLabel("Hauptmen\u00FC"); - label_1.setForeground(Color.BLUE); - label_1.setBounds(20, 92, 61, 20); - contentPanel.add(label_1); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(80, 95, 14, 14); - contentPanel.add(label_2); - - JLabel label_3 = new JLabel("Image"); - label_3.setForeground(Color.BLUE); - label_3.setBounds(91, 92, 46, 20); - contentPanel.add(label_3); - - JLabel label_4 = new JLabel(">"); - label_4.setBounds(139, 95, 14, 14); - contentPanel.add(label_4); - - JLabel label_5 = new JLabel("Neu/Bearbeiten"); - label_5.setBounds(149, 95, 108, 14); - contentPanel.add(label_5); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(-10, 648, 597, 2); - contentPanel.add(separator_1); - - JLabel lblSchritt = new JLabel("Schritt 1:"); - lblSchritt.setBounds(24, 128, 57, 14); - contentPanel.add(lblSchritt); - - JLabel lblSchritt_1 = new JLabel("Schritt 2:"); - lblSchritt_1.setBounds(24, 204, 57, 14); - contentPanel.add(lblSchritt_1); - - JLabel lblSchritt_3 = new JLabel("Schritt 3:"); - lblSchritt_3.setBounds(20, 423, 57, 14); - contentPanel.add(lblSchritt_3); - - JLabel lblKlickenSieAuf = new JLabel( - "Klicken Sie auf \"Fertigstellen\"."); - lblKlickenSieAuf.setBounds(102, 423, 241, 14); - contentPanel.add(lblKlickenSieAuf); - - JMenuBar menuBar = new JMenuBar(); - menuBar.setBounds(0, 0, 597, 21); - contentPanel.add(menuBar); - - JMenu menu = new JMenu("Hilfe"); - menuBar.add(menu); - - JMenuItem menuItem = new JMenuItem("FAQ"); - menuItem.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - OpenLinks open = new OpenLinks(); - URI windows; - try { - windows = new URI(Links.getFAQ()); - open.openWebpage(windows); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - - menu.add(menuItem); - - JMenuItem menuItem_1 = new JMenuItem("OTRS"); - menuItem_1.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - OpenLinks open = new OpenLinks(); - URI windows; - try { - windows = new URI(Links.getOTRS()); - open.openWebpage(windows); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - - menu.add(menuItem_1); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - menu.add(mntmAbout); - - lblAnleitung = new JLabel( - "Anleitung zum erstellen einer virtuellen Maschine herunterladen"); - lblAnleitung.setForeground(Color.BLUE); - lblAnleitung.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - OpenLinks open = new OpenLinks(); - - URI anleitung; - try { - anleitung = new URI(Links.getAnleitungVMDK()); - open.openWebpage(anleitung); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - lblAnleitung.setBounds(102, 448, 311, 14); - contentPanel.add(lblAnleitung); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBackground(UIManager.getColor("Button.background")); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane, BorderLayout.SOUTH); - { - btnZurck.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - // check if loading file or not - if (isCurrentlyLoading() == true) { - int choice = JOptionPane - .showOptionDialog( - null, - "Nicht abgeschlossene Uploads werden beendet. Trotzdem zurück gehen?", - "Warnung", - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE, null, - options, options[1]); - // 0=beenden, 1=abbrechen - if (choice == 0) { - task.cancel(true); - try { - client.DeleteFtpUser(user.userName); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - try { - Wini ini = new Wini( - new File( - "C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - ini.put("main", "Letzter Downloadpfad", - lblPath.getText()); - ini.store(); - } catch (InvalidFileFormatException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } catch (IOException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - // go back one page - SearchEditImage_GUI se = new SearchEditImage_GUI(); - se.setVisible(true); - dispose(); - }// end choice - - } else { - - try { - Wini ini = new Wini( - new File( - "C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - ini.put("main", "Letzter Downloadpfad", - lblPath.getText()); - ini.store(); - } catch (InvalidFileFormatException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } catch (IOException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - // go back one page - SearchEditImage_GUI se = new SearchEditImage_GUI(); - se.setVisible(true); - dispose(); - - }// end else - - } - }); - btnZurck.setActionCommand("Cancel"); - buttonPane.add(btnZurck); - } - } - setVisible(true); - - } - - private void buttonDownloadActionPerformed(ActionEvent event) { - - progressBar.setValue(0); - btnDownloadStarten.setEnabled(false); // verhindert schnellen zweiten - // Klick - btnDownloadStarten.setText("Bitte warten"); - try { - user = client.getFtpUser(); - - downloadFile = user.path - + "/" - + client.getPathOfImage(Image.image.getImageId(), - Image.image.getVersion()); - - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog(null, - e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - - task = new DownloadTask(host, port, user.userName, user.password, - downloadFile, lblPath.getText()); - task.addPropertyChangeListener(this); - task.execute(); - taskrun = true; - - } - - public void propertyChange(PropertyChangeEvent arg0) { - - progress = 0; - if ("progress" == arg0.getPropertyName()) { - progress = (Integer) arg0.getNewValue(); - progressBar.setValue(progress); - } - - if ("speed" == arg0.getPropertyName()) { - speed = (double) arg0.getNewValue(); - - downspeed.setText(String.valueOf(speed).substring(0, - String.valueOf(speed).lastIndexOf(".") + 3) - + " MB/s"); - - } - if ("bytesread" == arg0.getPropertyName()) { - bytesread = (long) arg0.getNewValue(); - lblBytesread.setText((bytesread / 1024 / 1024) + " MB"); - labelVerbleibend - .setText(((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) - + " MB"); - - labelZeit - .setText(String - .valueOf( - ((((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + 1) - .substring( - 0, - String.valueOf( - (((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) - .lastIndexOf(".")) - + " Minuten"); - - } - if ("filesize" == arg0.getPropertyName()) { - filesize = (long) arg0.getNewValue(); - lblNewLabel_3.setText((filesize / 1024 / 1024) + " MB"); - - } - - }// end PropertyChange() - - public boolean isCurrentlyLoading() { - isCurrentlyLoading = false; - - if (labelVerbleibend.getText().equals("0 MB") || labelVerbleibend.getText().equals("0")) { - isCurrentlyLoading = false; - } else { - isCurrentlyLoading = true; - } - System.out.println("isCurrentlyLoading="+isCurrentlyLoading); - return isCurrentlyLoading; - }// end isCurrentlyLoading() - -}// end class diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java deleted file mode 100644 index 5d679ea5..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java +++ /dev/null @@ -1,664 +0,0 @@ -package gui.image; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; - -import javax.swing.JButton; -import javax.swing.JFileChooser; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JProgressBar; -import javax.swing.JSeparator; -import javax.swing.JTextPane; -import javax.swing.SwingConstants; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; - -import models.Image; -import models.Links; -import models.SessionData; -import models.person; - -import org.apache.thrift.TException; -import org.ini4j.InvalidFileFormatException; -import org.ini4j.Wini; - -import server.Server.Client; -import thrift.ThriftConnection; -import util.GuiOrganizer; -import util.OpenLinks; -import ftp.UploadTask; -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -@SuppressWarnings("serial") -public class FTPEditUploader_GUI extends JFrame implements - PropertyChangeListener { - - @SuppressWarnings("unused") - private JPanel contentPane; - private final JPanel contentPanel = new JPanel(); - JLabel lblPath; - JProgressBar progressBar; - String host = SessionData.session.getServerAdress(); - int port = 21; - server.User user; - String filename = ""; - File uploadFile; - static String arg = ""; - UploadTask task; - JLabel UpSpeed; - JLabel labelfertig; - JLabel labelfilesize; - JLabel labelZeit; - JLabel labelverbleibend; - JFileChooser fc; - long filesize; - double speed; - long bytesread; - boolean fileupload = false; - boolean taskrun = false; - int progress = 0; - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); - JButton btnUploadStarten = new JButton("Upload auf Server starten"); - JButton btnSpeicherortAuswhlen = new JButton("Image ausw\u00E4hlen"); - JButton finishButton = new JButton("Fertigstellen"); - JButton btnZurck = new JButton("Zur\u00FCck"); - private boolean isCurrentlyLoading = false; // currently up or downloading - // file - - /** - * Create the frame. - */ - public FTPEditUploader_GUI() { - - final Object[] options = { "Beenden", "Abbrechen" }; - - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - - if (taskrun == true) { - // check if user wants to quit. - int choice = JOptionPane - .showOptionDialog( - null, - "Aktuell ist ein Upload aktiv. Wollen Sie diesen Abbrechen und das Programm beenden?", - "Upload aktiv", - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE, null, - options, options[1]); - // 0=beenden, 1=abbrechen - if (choice == 0) { - try { - client.DeleteFtpUser(user.userName); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - task.cancel(true); - con.closeThriftConnection(); - System.exit(0); - }// end if choice - } else { - // no upload running, close window - System.exit(0); - }// end if taskrun - }// end window closing - }); - setResizable(false); - // Aktion die beim Schliessen durchgefuehrt werden soll - setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - // filename=name; - setBackground(Color.WHITE); - setTitle("Dozentenmodul - Image bearbeiten"); - - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(new BorderLayout()); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel, BorderLayout.CENTER); - contentPanel.setLayout(null); - { - - btnSpeicherortAuswhlen.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - try { - Wini ini = new Wini( - new File( - "C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - fc = new JFileChooser(ini.get("main", - "Letzter Uploadpfad", String.class)); - } catch (InvalidFileFormatException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } catch (IOException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - - fc.setFileSelectionMode(JFileChooser.FILES_ONLY); - - fc.showOpenDialog(getParent()); - File file = fc.getSelectedFile(); - // check if a file is selected and exists - if (file != null) { - // file selected - uploadFile = file; - filename = uploadFile.getName(); - lblPath.setText(file.getAbsolutePath()); - } else { - // no file selected - lblPath.setText(""); - }// end if - } - }); - - btnSpeicherortAuswhlen.setBounds(102, 124, 173, 23); - btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP); - contentPanel.add(btnSpeicherortAuswhlen); - } - - lblPath = new JLabel(""); - try { - Wini ini = new Wini(new File("C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - lblPath.setText(ini.get("main", "Letzter Uploadpfad", String.class)); - } catch (InvalidFileFormatException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } catch (IOException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - lblPath.addPropertyChangeListener(new PropertyChangeListener() { - public void propertyChange(PropertyChangeEvent arg0) { - if (lblPath.getText().isEmpty()) { - // wenn leer, dann upload button nicht freigeben - btnUploadStarten.setEnabled(false); - btnUploadStarten.setText("Bitte warten"); - } else if (lblPath.getText().endsWith(".vmdk")) { - // wenn leer, dann upload button freigeben - btnUploadStarten.setEnabled(true); - btnUploadStarten.setText("Upload auf Server starten"); - } - } - }); - lblPath.setBounds(102, 158, 485, 23); - contentPanel.add(lblPath); - - btnUploadStarten.setEnabled(false); - btnUploadStarten.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - buttonUploadActionPerformed(arg0); - - } - }); - - btnUploadStarten.setBounds(102, 200, 173, 23); - contentPanel.add(btnUploadStarten); - - progressBar = new JProgressBar(0, 100); - progressBar.setStringPainted(true); - - progressBar.setBounds(102, 234, 485, 30); - contentPanel.add(progressBar); - - JLabel lblUploadgeschwindigkeit = new JLabel("Uploadgeschwindigkeit:"); - lblUploadgeschwindigkeit.setBounds(102, 275, 141, 14); - contentPanel.add(lblUploadgeschwindigkeit); - - JLabel label_1 = new JLabel("Fertig:"); - label_1.setBounds(102, 325, 46, 14); - contentPanel.add(label_1); - - labelfertig = new JLabel("0"); - labelfertig.setBounds(183, 325, 108, 14); - contentPanel.add(labelfertig); - - UpSpeed = new JLabel("0"); - UpSpeed.setBounds(374, 275, 117, 14); - contentPanel.add(UpSpeed); - - JLabel label_4 = new JLabel("von:"); - label_4.setBounds(318, 325, 46, 14); - contentPanel.add(label_4); - - labelfilesize = new JLabel("0"); - labelfilesize.setBounds(374, 325, 117, 14); - contentPanel.add(labelfilesize); - - JLabel label_6 = new JLabel("Verbleibend:"); - label_6.setBounds(102, 350, 71, 14); - contentPanel.add(label_6); - - JLabel label_7 = new JLabel("Gesch\u00E4tzte Verbleibende Zeit:"); - label_7.setBounds(102, 300, 150, 14); - contentPanel.add(label_7); - - labelZeit = new JLabel("0"); - labelZeit.setBounds(374, 300, 117, 14); - contentPanel.add(labelZeit); - - labelverbleibend = new JLabel("0"); - labelverbleibend.setBounds(183, 350, 108, 14); - contentPanel.add(labelverbleibend); - - JPanel panel = new JPanel(); - panel.setLayout(null); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); - contentPanel.add(panel); - - JLabel lblUploadIhresImage = new JLabel("Upload Ihres Image"); - lblUploadIhresImage.setFont(new Font("Tahoma", Font.BOLD, 18)); - lblUploadIhresImage.setBounds(10, 11, 509, 22); - panel.add(lblUploadIhresImage); - - JTextPane txtpnFhreSieBitte = new JTextPane(); - txtpnFhreSieBitte - .setText("F\u00FChre Sie bitte die folgenden 3 Schritte aus um Ihr Image auf unseren Server zu laden."); - txtpnFhreSieBitte.setEditable(false); - txtpnFhreSieBitte.setBackground(SystemColor.menu); - txtpnFhreSieBitte.setBounds(10, 36, 509, 32); - panel.add(txtpnFhreSieBitte); - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 79, 597, 2); - contentPanel.add(separator); - - JLabel lblNewLabel_1 = new JLabel("Hauptmen\u00FC"); - lblNewLabel_1.setForeground(Color.BLUE); - lblNewLabel_1.setBounds(20, 88, 61, 20); - contentPanel.add(lblNewLabel_1); - - JLabel label_3 = new JLabel(">"); - label_3.setBounds(80, 91, 14, 14); - contentPanel.add(label_3); - - JLabel lblVlimage = new JLabel("Image"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(91, 88, 46, 20); - contentPanel.add(lblVlimage); - - JLabel label_5 = new JLabel(">"); - label_5.setBounds(139, 91, 14, 14); - contentPanel.add(label_5); - - JLabel lblNeubearbeiten = new JLabel("Bearbeiten"); - lblNeubearbeiten.setBounds(149, 91, 108, 14); - contentPanel.add(lblNeubearbeiten); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); - contentPanel.add(separator_1); - - JLabel lblSchritt_1 = new JLabel("Schritt 1:"); - lblSchritt_1.setBounds(24, 128, 57, 14); - contentPanel.add(lblSchritt_1); - - JLabel lblSchritt_2 = new JLabel("Schritt 2:"); - lblSchritt_2.setBounds(24, 204, 57, 14); - contentPanel.add(lblSchritt_2); - - JLabel label = new JLabel("Schritt 3:"); - label.setBounds(20, 423, 57, 14); - contentPanel.add(label); - - JLabel label_2 = new JLabel("Klicken Sie auf \"Fertigstellen\"."); - label_2.setBounds(98, 423, 241, 14); - contentPanel.add(label_2); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBackground(UIManager.getColor("Button.background")); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane, BorderLayout.SOUTH); - { - - // finishButton.setEnabled(false); - finishButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - updateData(); - try { - Wini ini = new Wini( - new File( - "C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - - // check if path has content, then write to file - if (lblPath.getText().contains("\\") == true) { - System.out.println("Hole Infos aus Label: " - + lblPath.getText()); - ini.put("main", - "Letzter Uploadpfad", - lblPath.getText().substring( - 0, - lblPath.getText().lastIndexOf( - "\\"))); - ini.store(); - } else { - System.out.println("Mache nix"); - }// end if - } catch (InvalidFileFormatException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } catch (IOException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - dispose(); - MainMenue_GUI m = new MainMenue_GUI(); - m.setVisible(true); - - if (taskrun == true) { - try { - client.DeleteFtpUser(user.userName); - - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane.showMessageDialog( - null, - e1.getCause() + "\n" - + e1.getStackTrace(), - "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - task.cancel(true); - } - - } - }); - btnZurck.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - - // check if loading file or not - if (isCurrentlyLoading() == true) { - int choice = JOptionPane - .showOptionDialog( - null, - "Nicht abgeschlossene Uploads werden beendet. Trotzdem zurück gehen?", - "Warnung", - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE, null, - options, options[1]); - // 0=beenden, 1=abbrechen - if (choice == 0) { - try { - client.DeleteFtpUser(user.userName); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - task.cancel(true); - // not loading files, go back one page - dispose(); - PermissionEditImage_GUI ei = new PermissionEditImage_GUI(); - ei.setVisible(true); - - }// end if coice - } else { - dispose(); - PermissionEditImage_GUI ei = new PermissionEditImage_GUI(); - ei.setVisible(true); - }// end else - }// end action - }); - - btnZurck.setActionCommand("Cancel"); - buttonPane.add(btnZurck); - finishButton.setActionCommand("Cancel"); - buttonPane.add(finishButton); - } - } - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu menu = new JMenu("Hilfe"); - menuBar.add(menu); - - JMenuItem menuItem = new JMenuItem("FAQ"); - menuItem.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - - menu.add(menuItem); - - JMenuItem menuItem_1 = new JMenuItem("OTRS"); - menuItem_1.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - - menu.add(menuItem_1); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - menu.add(mntmAbout); - setVisible(true); - - } - - private void buttonUploadActionPerformed(ActionEvent event) { - fileupload = true; - progressBar.setValue(0); - btnUploadStarten.setEnabled(false); // verhindert einen weiteren klick - btnUploadStarten.setText("Bitte warten"); - - try { - user = client.getFtpUser(); - System.out.println("FTP name: " + user.userName); - System.out.println("FTP path: " + user.path); - System.out.println("FTP pass: " + user.password); - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog(null, - e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - DateFormat formatter = new SimpleDateFormat("yyyMMddhhmmss"); - - System.out.println("Setting new Name: " + formatter.format(new Date()) - + "_" + person.verantwortlicher.getHochschule() + "_" - + person.verantwortlicher.getUsername() + "_" - + Image.image.getImagename() + ".vmdk"); - Image.image.setNewName(formatter.format(new Date()) + "_" - + person.verantwortlicher.getHochschule() + "_" - + person.verantwortlicher.getUsername() + "_" - + Image.image.getImagename() + ".vmdk"); - task = new UploadTask(host, port, user.userName, user.password, - user.path + "temp/", uploadFile); - - task.addPropertyChangeListener(this); - task.execute(); - taskrun = true; - - } - - public void propertyChange(PropertyChangeEvent arg0) { - // set progressbar - if ("progress" == arg0.getPropertyName()) { - progress = (Integer) arg0.getNewValue(); - progressBar.setValue(progress); - } - - // Fertigstellen erlauben wenn upload abgeschlossen - if (isCurrentlyLoading() == true) { - finishButton.setEnabled(false); - } else { - finishButton.setEnabled(true); - } - - if ("speed" == arg0.getPropertyName()) { - speed = (double) arg0.getNewValue(); - // if(speed<=1){ - - UpSpeed.setText(String.valueOf(speed).substring(0, - String.valueOf(speed).lastIndexOf(".") + 3) - + " MB/s"); - - } - if ("bytesread" == arg0.getPropertyName()) { - bytesread = (long) arg0.getNewValue(); - labelfertig.setText((bytesread / 1024 / 1024) + " MB"); - labelverbleibend - .setText(((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) - + " MB"); - - labelZeit - .setText(String - .valueOf( - ((((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + 1) - .substring( - 0, - String.valueOf( - (((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) - .lastIndexOf(".")) - + " Minuten"); - - } - if ("filesize" == arg0.getPropertyName()) { - filesize = (long) arg0.getNewValue(); - labelfilesize.setText((filesize / 1024 / 1024) + " MB"); - - } - - } - - public boolean updateData() { - - try { - System.out.println("NewName=" + Image.image.getNewName()); - System.out.println("OldName=" + Image.image.getImagename()); - if (Image.image.getNewName() != null) { - client.updateImageData(Image.image.getImagename(), - Image.image.getImagename(), Image.image.getDesc(), - Image.image.getImagepath(), Image.image.isLicensed(), - Image.image.isInternet(), Image.image.getRam(), - Image.image.getCpu(), Image.image.getImageId(), - Image.image.getVersion(), Image.image.isVorlage(), - Image.image.getFilesize(), Image.image.getShareMode(), - Image.image.getOS()); - if (fileupload == true) { - client.startFileCopy(Image.image.getNewName()); - } - - } else { - - client.updateImageData(Image.image.getImagename(), - Image.image.getImagename(), Image.image.getDesc(), - "temp/" + Image.image.getNewName(), - Image.image.isLicensed(), Image.image.isInternet(), - Image.image.getRam(), Image.image.getCpu(), - Image.image.getImageId(), Image.image.getVersion(), - Image.image.isVorlage(), Image.image.getFilesize(), - Image.image.getShareMode(), Image.image.getOS()); - - if (fileupload == true) { - client.startFileCopy(Image.image.getNewName()); - } - } - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog(null, - e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - return false; - } - return true; - - } - - public boolean isCurrentlyLoading() { - isCurrentlyLoading = false; - - if (labelverbleibend.getText().equals("0 MB") - || labelverbleibend.getText().equals("0")) { - isCurrentlyLoading = false; - } else { - isCurrentlyLoading = true; - } - return isCurrentlyLoading; - }// end isCurrentlyLoading() - -}// end class \ No newline at end of file diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java deleted file mode 100644 index c3041e41..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java +++ /dev/null @@ -1,635 +0,0 @@ -package gui.image; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.JButton; -import javax.swing.JFileChooser; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JProgressBar; -import javax.swing.JSeparator; -import javax.swing.JTextPane; -import javax.swing.SwingConstants; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; - -import models.Image; -import models.Links; -import models.SessionData; - -import org.apache.thrift.TException; -import org.ini4j.InvalidFileFormatException; -import org.ini4j.Wini; - -import server.Server.Client; -import server.User; -import thrift.ThriftConnection; -import util.GuiOrganizer; -import util.OpenLinks; -import ftp.DownloadTask; -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -@SuppressWarnings("serial") -public class FTPSearchDownloader_GUI extends JFrame implements - PropertyChangeListener { - - @SuppressWarnings("unused") - private JPanel contentPane; - private final JPanel contentPanel = new JPanel(); - JLabel lblPath; - JLabel downspeed; - User user; - JProgressBar progressBar; - String host = SessionData.session.getServerAdress(); - int port = 21; - String downloadFile = ""; - static String arg = ""; - DownloadTask task; - JLabel lblBytesread; - JLabel lblNewLabel_3; - JLabel labelVerbleibend; - JFileChooser fc; - long filesize; - double speed; - int progress = 0; // progress of download - long bytesread; - JLabel labelZeit; - boolean taskrun = false; - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); - JButton btnZurck = new JButton("Zur\u00FCck"); - JButton btnDownloadStarten = new JButton("Download starten"); - JButton btnMainMenu = new JButton("Hauptmen\u00FC"); - private JLabel lblAnleitung; - private boolean isCurrentlyLoading = false; // currently up or downloading - // file - - /** - * Create the frame. - */ - public FTPSearchDownloader_GUI() { - - final Object[] options = { "Beenden", "Abbrechen" }; - - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent e) { - if (taskrun == true) { - // check if user wants to quit. - int choice = JOptionPane - .showOptionDialog( - null, - "Aktuell ist ein Download aktiv. Wollen Sie diesen Abbrechen und das Programm beenden?", - "Upload aktiv", - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE, null, - options, options[1]); - // 0=beenden, 1=abbrechen - if (choice == 0) { - - try { - client.DeleteFtpUser(user.userName); - con.closeThriftConnection(); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - task.cancel(true); - - System.exit(0); - }// end if choice - } else { - // no download running, close window - System.exit(0); - }// end if taskrun - }// end window closing - }); - setResizable(false); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - setBackground(Color.WHITE); - setTitle("Dozentenmodul - Image herunterladen"); - // Aktion die beim Schliessen durchgefuehrt werden soll - setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(new BorderLayout()); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel, BorderLayout.CENTER); - contentPanel.setLayout(null); - { - JButton btnSpeicherortAuswhlen = new JButton( - "Speicherort ausw\u00E4hlen"); - btnSpeicherortAuswhlen.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - try { - Wini ini = new Wini( - new File( - "C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - System.out.println("FileChooser Pfad: " - + ini.get("main", "Letzter Downloadpfad", - String.class)); - fc = new JFileChooser(ini.get("main", - "Letzter Downloadpfad", String.class)); - fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - - fc.showOpenDialog(getParent()); - } catch (InvalidFileFormatException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } catch (IOException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - - File dir = fc.getSelectedFile(); - // check if directory is selected - if (dir != null) { - // is selected - lblPath.setText(dir.getAbsolutePath()); - } else { - // no directory selected - lblPath.setText(""); - }// end if - } - }); - - btnSpeicherortAuswhlen.setBounds(102, 124, 173, 23); - btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP); - contentPanel.add(btnSpeicherortAuswhlen); - } - - lblPath = new JLabel(""); - try { - Wini ini = new Wini(new File("C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - lblPath.setText(ini.get("main", "Letzter Downloadpfad", - String.class)); - } catch (InvalidFileFormatException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } catch (IOException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - lblPath.addPropertyChangeListener(new PropertyChangeListener() { - public void propertyChange(PropertyChangeEvent arg0) { - if (lblPath.getText() == null) { - // wenn leer, dann upload button nicht freigeben - btnDownloadStarten.setEnabled(false); - btnDownloadStarten.setText("Bitte warten"); - } else { - // wenn leer, dann upload button nicht freigeben - btnDownloadStarten.setEnabled(true); - btnDownloadStarten.setText("Download starten"); - } - } - }); - lblPath.setBounds(102, 158, 485, 23); - contentPanel.add(lblPath); - - btnDownloadStarten.setEnabled(false); - btnDownloadStarten.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - buttonDownloadActionPerformed(arg0); - } - }); - - btnDownloadStarten.setBounds(102, 200, 173, 23); - contentPanel.add(btnDownloadStarten); - - progressBar = new JProgressBar(0, 100); - progressBar.setStringPainted(true); - - progressBar.setBounds(102, 234, 485, 30); - contentPanel.add(progressBar); - - JLabel lblDownloadgeschwindigkeit = new JLabel( - "Downloadgeschwindigkeit:"); - lblDownloadgeschwindigkeit.setBounds(102, 275, 141, 14); - contentPanel.add(lblDownloadgeschwindigkeit); - - downspeed = new JLabel("0"); - downspeed.setBounds(374, 275, 117, 14); - contentPanel.add(downspeed); - - JLabel lblFertig = new JLabel("Fertig:"); - lblFertig.setBounds(102, 325, 46, 14); - contentPanel.add(lblFertig); - - lblBytesread = new JLabel("0"); - lblBytesread.setBounds(183, 325, 108, 14); - contentPanel.add(lblBytesread); - - JLabel lblVon = new JLabel("von:"); - lblVon.setBounds(318, 325, 46, 14); - contentPanel.add(lblVon); - - lblNewLabel_3 = new JLabel("0"); - lblNewLabel_3.setBounds(374, 325, 117, 14); - contentPanel.add(lblNewLabel_3); - - JLabel lblMbVerbleibend = new JLabel("Verbleibend:"); - lblMbVerbleibend.setBounds(102, 350, 71, 14); - contentPanel.add(lblMbVerbleibend); - - labelVerbleibend = new JLabel("0"); - labelVerbleibend.setBounds(183, 350, 108, 14); - contentPanel.add(labelVerbleibend); - - JLabel lblGeschtzteVerbleibendeZeit = new JLabel( - "Gesch\u00E4tzte Verbleibende Zeit:"); - lblGeschtzteVerbleibendeZeit.setBounds(102, 300, 150, 14); - contentPanel.add(lblGeschtzteVerbleibendeZeit); - - labelZeit = new JLabel("0"); - labelZeit.setBounds(374, 300, 117, 14); - contentPanel.add(labelZeit); - - JPanel panel = new JPanel(); - panel.setLayout(null); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 24, 577, 57); - contentPanel.add(panel); - - JLabel lblImageDownloader = new JLabel("Image Downloader"); - lblImageDownloader.setFont(new Font("Tahoma", Font.BOLD, 18)); - lblImageDownloader.setBounds(10, 11, 509, 22); - panel.add(lblImageDownloader); - - JTextPane txtpnWhlenSieEinen = new JTextPane(); - txtpnWhlenSieEinen - .setText("W\u00E4hlen Sie einen Ort aus, um das von Ihnen gw\u00E4hlte Image erunter zu laden."); - txtpnWhlenSieEinen.setEditable(false); - txtpnWhlenSieEinen.setBackground(SystemColor.menu); - txtpnWhlenSieEinen.setBounds(10, 36, 509, 32); - panel.add(txtpnWhlenSieEinen); - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 88, 597, 2); - contentPanel.add(separator); - - JLabel label_1 = new JLabel("Hauptmen\u00FC"); - label_1.setForeground(Color.BLUE); - label_1.setBounds(20, 92, 61, 20); - contentPanel.add(label_1); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(80, 95, 14, 14); - contentPanel.add(label_2); - - JLabel label_3 = new JLabel("Image"); - label_3.setForeground(Color.BLUE); - label_3.setBounds(91, 92, 46, 20); - contentPanel.add(label_3); - - JLabel label_4 = new JLabel(">"); - label_4.setBounds(139, 95, 14, 14); - contentPanel.add(label_4); - - JLabel label_5 = new JLabel("Neu/Bearbeiten"); - label_5.setBounds(149, 95, 108, 14); - contentPanel.add(label_5); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(-10, 648, 597, 2); - contentPanel.add(separator_1); - - JLabel lblSchritt = new JLabel("Schritt 1:"); - lblSchritt.setBounds(24, 128, 57, 14); - contentPanel.add(lblSchritt); - - JLabel lblSchritt_1 = new JLabel("Schritt 2:"); - lblSchritt_1.setBounds(24, 204, 57, 14); - contentPanel.add(lblSchritt_1); - - JLabel lblSchritt_3 = new JLabel("Schritt 3:"); - lblSchritt_3.setBounds(20, 423, 57, 14); - contentPanel.add(lblSchritt_3); - - JLabel lblKlickenSieAuf = new JLabel( - "Klicken Sie auf \"Fertigstellen\"."); - lblKlickenSieAuf.setBounds(102, 423, 241, 14); - contentPanel.add(lblKlickenSieAuf); - - JMenuBar menuBar = new JMenuBar(); - menuBar.setBounds(0, 0, 597, 21); - contentPanel.add(menuBar); - - JMenu menu = new JMenu("Hilfe"); - menuBar.add(menu); - - JMenuItem menuItem = new JMenuItem("FAQ"); - menuItem.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - - menu.add(menuItem); - - JMenuItem menuItem_1 = new JMenuItem("OTRS"); - menuItem_1.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - - menu.add(menuItem_1); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - menu.add(mntmAbout); - - lblAnleitung = new JLabel( - "Anleitung zum erstellen einer virtuellen Maschine herunterladen"); - lblAnleitung.setForeground(Color.BLUE); - lblAnleitung.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - OpenLinks open = new OpenLinks(); - - URI anleitung; - try { - anleitung = new URI(Links.getAnleitungVMDK()); - open.openWebpage(anleitung); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - lblAnleitung.setBounds(102, 448, 311, 14); - contentPanel.add(lblAnleitung); - - { - JPanel buttonPane = new JPanel(); - buttonPane.setBackground(UIManager.getColor("Button.background")); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane, BorderLayout.SOUTH); - { - btnZurck.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - // check if loading file or not - if (isCurrentlyLoading() == true) { - int choice = JOptionPane - .showOptionDialog( - null, - "Nicht abgeschlossene Uploads werden beendet. Trotzdem zurück gehen?", - "Warnung", - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE, null, - options, options[1]); - // 0=beenden, 1=abbrechen - if (choice == 0) { - task.cancel(true); - try { - client.DeleteFtpUser(user.userName); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - try { - Wini ini = new Wini( - new File( - "C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - ini.put("main", "Letzter Downloadpfad", - lblPath.getText()); - ini.store(); - } catch (InvalidFileFormatException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } catch (IOException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - // go back one page - SearchImage_GUI si = new SearchImage_GUI(); - si.setVisible(true); - dispose(); - }// end choice - - } else { - - try { - Wini ini = new Wini( - new File( - "C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - ini.put("main", "Letzter Downloadpfad", - lblPath.getText()); - ini.store(); - } catch (InvalidFileFormatException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } catch (IOException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - // go back one page - SearchImage_GUI si = new SearchImage_GUI(); - si.setVisible(true); - dispose(); - }// end else - }//end action - }); - btnZurck.setActionCommand("Cancel"); - buttonPane.add(btnZurck); - } - - btnMainMenu.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - try { - Wini ini = new Wini( - new File( - "C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - ini.put("main", "Letzter Downloadpfad", - lblPath.getText()); - ini.store(); - } catch (InvalidFileFormatException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } catch (IOException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - MainMenue_GUI mm = new MainMenue_GUI(); - mm.setVisible(true); - dispose(); - } - }); - btnMainMenu.setActionCommand("Cancel"); - buttonPane.add(btnMainMenu); - } - setVisible(true); - - } - - private void buttonDownloadActionPerformed(ActionEvent event) { - - progressBar.setValue(0); - btnDownloadStarten.setEnabled(false); // verhindert schnellen zweiten - // Klick - btnDownloadStarten.setText("Bitte warten"); - try { - user = client.getFtpUser(); - - downloadFile = user.path - + "/" - + client.getPathOfImage(Image.image.getImageId(), - Image.image.getVersion()); - - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog(null, - e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - - task = new DownloadTask(host, port, user.userName, user.password, - downloadFile, lblPath.getText()); - task.addPropertyChangeListener(this); - task.execute(); - taskrun = true; - - } - - public void propertyChange(PropertyChangeEvent arg0) { - - progress = 0; - if ("progress" == arg0.getPropertyName()) { - progress = (Integer) arg0.getNewValue(); - progressBar.setValue(progress); - } - - // Button zum Fertigstellen freischalten, wenn 100% erreicht sind - if (isCurrentlyLoading() == true) { - // not uploading currently - btnMainMenu.setEnabled(false); - } else { - // currently uploading, don't let user interact - btnMainMenu.setEnabled(true); - } - - if ("speed" == arg0.getPropertyName()) { - speed = (double) arg0.getNewValue(); - // if(speed<=1){ - - downspeed.setText(String.valueOf(speed).substring(0, - String.valueOf(speed).lastIndexOf(".") + 3) - + " MB/s"); - - } - if ("bytesread" == arg0.getPropertyName()) { - bytesread = (long) arg0.getNewValue(); - lblBytesread.setText((bytesread / 1024 / 1024) + " MB"); - labelVerbleibend - .setText(((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) - + " MB"); - - labelZeit - .setText(String - .valueOf( - ((((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + 1) - .substring( - 0, - String.valueOf( - (((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) - .lastIndexOf(".")) - + " Minuten"); - - } - if ("filesize" == arg0.getPropertyName()) { - filesize = (long) arg0.getNewValue(); - lblNewLabel_3.setText((filesize / 1024 / 1024) + " MB"); - - } - - } - - public boolean isCurrentlyLoading() { - isCurrentlyLoading = false; - - if (labelVerbleibend.getText().equals("0 MB") || labelVerbleibend.getText().equals("0")) { - isCurrentlyLoading = false; - } else { - isCurrentlyLoading = true; - } - return isCurrentlyLoading; - }// end isCurrentlyLoading() - -}// end class \ No newline at end of file diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java deleted file mode 100644 index d2b0dada..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java +++ /dev/null @@ -1,552 +0,0 @@ -package gui.image; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Checkbox; -import java.awt.Color; -import java.awt.Component; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.AbstractButton; -import javax.swing.ButtonGroup; -import javax.swing.DefaultComboBoxModel; -import javax.swing.Icon; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JSeparator; -import javax.swing.JTextPane; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; -import javax.swing.table.DefaultTableCellRenderer; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.JTableHeader; -import javax.swing.table.TableCellEditor; -import javax.swing.table.TableCellRenderer; -import javax.swing.table.TableColumn; -import javax.swing.table.TableColumnModel; - -import models.Image; -import models.Links; -import util.GuiOrganizer; -import util.OpenLinks; -import javax.swing.JTable; -import javax.swing.JScrollPane; -import javax.swing.ScrollPaneConstants; -import javax.swing.JTextField; - -import org.eclipse.jface.viewers.CheckboxCellEditor; - -import java.awt.Choice; - -@SuppressWarnings("serial") -public class PermissionCreateImage_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - private JTable table; - private Class[] classes; - Object[] titles = { "Name", "Read", "Write", "Link allowed","Admin"}; - - final DefaultTableModel model = new DefaultTableModel(titles, 0) { - - public boolean isCellEditable(int rowIndex, int mColIndex) { - if (mColIndex >= 1) { - return true; - } - return false; - } - - public Class getColumnClass(int c) { - switch (c) { - case 0: - return String.class; - default: - return Boolean.class; - } - } - - }; - private JTextField textField; - private JLabel lblRead; - private JLabel lblWrite; - private JLabel lblAdmin; - private JLabel lblLinkallowed; - private JLabel lblReadDesc; - private JLabel lblWriteDesc; - private JLabel lblAdminDesc; - private JLabel lblLinkallowedDesc; - private JCheckBox chckbxFrAlleSichtbar; - private JLabel lblFuerAlleSichtbar; - - public PermissionCreateImage_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - System.exit(0); - } - }); - setResizable(false); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - setTitle("bwLehrpool Suite - Image erzeugen"); - - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel( - "Image Berechtigungen (Nur zur Veranschaulichung)"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("Definieren Sie hier bitte die gew\u00FCnschten Berechtigungen f\u00FCr ihr Image"); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 531); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Berechtigungen", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 228, 557, 292); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JScrollPane scrollPane = new JScrollPane(); - scrollPane - .setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - scrollPane.setBounds(10, 21, 537, 260); - panel_1.add(scrollPane); - - table = new JTable(); - table.setModel(model); - table.setSelectionForeground(Color.WHITE); - Object[] rowdata = { "Max Mustermann", new Boolean(false), - new Boolean(false), new Boolean(false), new Boolean(false), - new Boolean(false) }; - model.addRow(rowdata); - - TableCellRenderer rend = table.getTableHeader().getDefaultRenderer(); - - TableColumn tc1 = table.getColumnModel().getColumn(1); - tc1.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc1.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc1.setHeaderRenderer(new CheckBoxHeader(new MyItemListener1(), - (String) titles[1])); - - TableColumn tc2 = table.getColumnModel().getColumn(2); - tc2.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc2.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc2.setHeaderRenderer(new CheckBoxHeader(new MyItemListener2(), - (String) titles[2])); - - TableColumn tc3 = table.getColumnModel().getColumn(3); - tc3.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc3.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc3.setHeaderRenderer(new CheckBoxHeader(new MyItemListener3(), - (String) titles[3])); - - TableColumn tc4 = table.getColumnModel().getColumn(4); - tc4.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc4.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc4.setHeaderRenderer(new CheckBoxHeader(new MyItemListener4(), - (String) titles[4])); - - /* - TableColumn tc5 = table.getColumnModel().getColumn(5); - tc5.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc5.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc5.setHeaderRenderer(new CheckBoxHeader(new MyItemListener5(), - (String) titles[5])); - */ - scrollPane.setViewportView(table); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - - PermissionCreateImage_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Image"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 45, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(133, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Berechtigung"); - lblNewLabel_1.setBounds(146, 11, 80, 14); - contentPanel.add(lblNewLabel_1); - - JLabel lblName = new JLabel("Name:"); - lblName.setBounds(10, 36, 46, 20); - contentPanel.add(lblName); - - textField = new JTextField(); - textField.setBounds(69, 36, 171, 20); - contentPanel.add(textField); - textField.setColumns(10); - - JLabel lblHochschule = new JLabel("Hochschule:"); - lblHochschule.setBounds(275, 36, 80, 20); - contentPanel.add(lblHochschule); - - JComboBox comboBox = new JComboBox(); - comboBox.setModel(new DefaultComboBoxModel(new String[] { - "Hochschule Offenburg", "Hochschule Reutlingen", - "Universit\u00E4t Freiburg" })); - comboBox.setBounds(365, 36, 202, 20); - contentPanel.add(comboBox); - - JPanel panel_2 = new JPanel(); - panel_2.setBackground(SystemColor.menu); - panel_2.setBorder(new TitledBorder(null, "Beschreibung", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_2.setBounds(10, 67, 557, 150); - contentPanel.add(panel_2); - panel_2.setLayout(null); - - lblRead = new JLabel("Read"); - lblRead.setBounds(20, 18, 90, 20); - panel_2.add(lblRead); - - lblWrite = new JLabel("Write"); - lblWrite.setBounds(20, 38, 90, 20); - panel_2.add(lblWrite); - - lblAdmin = new JLabel("Admin"); - lblAdmin.setBounds(20, 78, 90, 20); - panel_2.add(lblAdmin); - - lblLinkallowed = new JLabel("Link allowed"); - lblLinkallowed.setBounds(20, 58, 90, 20); - panel_2.add(lblLinkallowed); - - lblReadDesc = new JLabel( - "Image lesen und starten, in Suchfenster und VMchooser sichtbar."); - lblReadDesc.setBounds(120, 18, 427, 20); - panel_2.add(lblReadDesc); - - lblWriteDesc = new JLabel( - "Image anpassen und überschrieben, jedoch nicht löschen."); - lblWriteDesc.setBounds(120, 38, 380, 20); - panel_2.add(lblWriteDesc); - - lblAdminDesc = new JLabel( - "Volle Rechte: read, write, löschen, Link_allowed und
Berechtigungen für andere Benutzer festlegen."); - lblAdminDesc.setBounds(120, 78, 380, 40); - panel_2.add(lblAdminDesc); - - lblLinkallowedDesc = new JLabel( - "Erzeugung einer Veranstaltung auf ein Image ist erlaubt."); - lblLinkallowedDesc.setBounds(120, 58, 380, 20); - panel_2.add(lblLinkallowedDesc); - - chckbxFrAlleSichtbar = new JCheckBox(""); - chckbxFrAlleSichtbar.setBounds(115, 119, 21, 23); - panel_2.add(chckbxFrAlleSichtbar); - - lblFuerAlleSichtbar = new JLabel("Für alle sichtbar"); - lblFuerAlleSichtbar.setBounds(20, 120, 90, 20); - panel_2.add(lblFuerAlleSichtbar); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton cancelButton = new JButton("Zur\u00FCck"); - cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - CreateImageFreigabe_GUI sr = new CreateImageFreigabe_GUI(); - sr.setVisible(true); - dispose(); - } - }); - cancelButton.setActionCommand("OK"); - buttonPane.add(cancelButton); - // getRootPane().setDefaultButton(cancelButton); - } - { - JButton continueButton = new JButton("Weiter"); - continueButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - FTPCreateUploader_GUI ea = new FTPCreateUploader_GUI(); - ea.setVisible(true); - dispose(); - - } - }); - continueButton.setActionCommand("Cancel"); - buttonPane.add(continueButton); - getRootPane().setDefaultButton(continueButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); - getContentPane().add(separator_1); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - } - - class MyItemListener1 implements ItemListener { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) - return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for (int x = 0, y = table.getRowCount(); x < y; x++) { - table.setValueAt(new Boolean(checked), x, 1); - } - } - } - - class MyItemListener2 implements ItemListener { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) - return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for (int x = 0, y = table.getRowCount(); x < y; x++) { - table.setValueAt(new Boolean(checked), x, 2); - } - } - } - - class MyItemListener3 implements ItemListener { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) - return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for (int x = 0, y = table.getRowCount(); x < y; x++) { - table.setValueAt(new Boolean(checked), x, 3); - } - } - } - - class MyItemListener4 implements ItemListener { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) - return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for (int x = 0, y = table.getRowCount(); x < y; x++) { - table.setValueAt(new Boolean(checked), x, 4); - } - } - } - - class MyItemListener5 implements ItemListener { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) - return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for (int x = 0, y = table.getRowCount(); x < y; x++) { - table.setValueAt(new Boolean(checked), x, 5); - } - } - } -} - -class CheckBoxHeader extends JCheckBox implements TableCellRenderer, - MouseListener { - protected CheckBoxHeader rendererComponent; - protected int column; - protected boolean mousePressed = false; - - public CheckBoxHeader(ItemListener itemListener, String text) { - rendererComponent = this; - rendererComponent.addItemListener(itemListener); - rendererComponent.setText(text); - } - - public Component getTableCellRendererComponent(JTable table, Object value, - boolean isSelected, boolean hasFocus, int row, int column) { - if (table != null) { - JTableHeader header = table.getTableHeader(); - if (header != null) { - rendererComponent.setForeground(header.getForeground()); - rendererComponent.setBackground(header.getBackground()); - rendererComponent.setFont(header.getFont()); - rendererComponent.setBorder(header.getBorder()); - header.addMouseListener(rendererComponent); - } - } - setColumn(column); - // rendererComponent.setText("Check All"); - // setBorder(UIManager.getBorder("TableHeader.cellBorder")); - - return rendererComponent; - } - - protected void setColumn(int column) { - this.column = column; - } - - public int getColumn() { - return column; - } - - protected void handleClickEvent(MouseEvent e) { - if (mousePressed) { - mousePressed = false; - JTableHeader header = (JTableHeader) (e.getSource()); - JTable tableView = header.getTable(); - TableColumnModel columnModel = tableView.getColumnModel(); - int viewColumn = columnModel.getColumnIndexAtX(e.getX()); - int column = tableView.convertColumnIndexToModel(viewColumn); - - if (viewColumn == this.column && e.getClickCount() == 1 - && column != -1) { - doClick(); - } - } - } - - public void mouseClicked(MouseEvent e) { - handleClickEvent(e); - ((JTableHeader) e.getSource()).repaint(); - } - - public void mousePressed(MouseEvent e) { - mousePressed = true; - } - - public void mouseReleased(MouseEvent e) { - } - - public void mouseEntered(MouseEvent e) { - } - - public void mouseExited(MouseEvent e) { - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java deleted file mode 100644 index 4d780e8f..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java +++ /dev/null @@ -1,504 +0,0 @@ -package gui.image; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Checkbox; -import java.awt.Color; -import java.awt.Component; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.AbstractButton; -import javax.swing.ButtonGroup; -import javax.swing.DefaultComboBoxModel; -import javax.swing.Icon; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JSeparator; -import javax.swing.JTextPane; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; -import javax.swing.table.DefaultTableCellRenderer; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.JTableHeader; -import javax.swing.table.TableCellEditor; -import javax.swing.table.TableCellRenderer; -import javax.swing.table.TableColumn; -import javax.swing.table.TableColumnModel; - -import models.Image; -import models.Links; -import util.GuiOrganizer; -import util.OpenLinks; -import javax.swing.JTable; -import javax.swing.JScrollPane; -import javax.swing.ScrollPaneConstants; -import javax.swing.JTextField; - -import org.eclipse.jface.viewers.CheckboxCellEditor; - -import java.awt.Choice; - -@SuppressWarnings("serial") -public class PermissionEditImage_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - private JTable table; - private Class[] classes; - Object[] titles = { "Name", "Read", "Write", "Link allowed","Admin"}; - - final DefaultTableModel model = new DefaultTableModel(titles, 0) { - - public boolean isCellEditable(int rowIndex, int mColIndex) { - if (mColIndex >= 1) { - return true; - } - return false; - } - - public Class getColumnClass(int c) { - switch (c) { - case 0: - return String.class; - default: - return Boolean.class; - } - } - - }; - private JTextField textField; - private JLabel lblLinkAllowed; - private JLabel label_5; - private JLabel label_6; - private JLabel label_7; - - public PermissionEditImage_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - System.exit(0); - } - }); - setResizable(false); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - setTitle("bwLehrpool Suite - Image erzeugen"); - - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel( - "Image Berechtigungen (Nur zur Veranschaulichung)"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("Definieren Sie hier bitte die gew\u00FCnschten Berechtigungen f\u00FCr Ihr Image"); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 531); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Berechtigungen", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 228, 557, 292); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JScrollPane scrollPane = new JScrollPane(); - scrollPane - .setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - scrollPane.setBounds(10, 21, 537, 260); - panel_1.add(scrollPane); - - table = new JTable(); - table.setModel(model); - table.setSelectionForeground(Color.WHITE); - Object[] rowdata = { "Max Mustermann", new Boolean(false), - new Boolean(false), new Boolean(false), new Boolean(false) }; - model.addRow(rowdata); - - TableCellRenderer rend = table.getTableHeader().getDefaultRenderer(); - - TableColumn tc1 = table.getColumnModel().getColumn(1); - tc1.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc1.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc1.setHeaderRenderer(new CheckBoxHeader(new MyItemListener1(), - (String) titles[1])); - - TableColumn tc2 = table.getColumnModel().getColumn(2); - tc2.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc2.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc2.setHeaderRenderer(new CheckBoxHeader(new MyItemListener2(), - (String) titles[2])); - - TableColumn tc3 = table.getColumnModel().getColumn(3); - tc3.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc3.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc3.setHeaderRenderer(new CheckBoxHeader(new MyItemListener3(), - (String) titles[3])); - - TableColumn tc4 = table.getColumnModel().getColumn(4); - tc4.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc4.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc4.setHeaderRenderer(new CheckBoxHeader(new MyItemListener4(), - (String) titles[4])); - /* - TableColumn tc5 = table.getColumnModel().getColumn(5); - tc5.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc5.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc5.setHeaderRenderer(new CheckBoxHeader(new MyItemListener5(), - (String) titles[5])); - */ - scrollPane.setViewportView(table); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - - PermissionEditImage_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Image"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 45, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(133, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Berechtigung"); - lblNewLabel_1.setBounds(146, 11, 80, 14); - contentPanel.add(lblNewLabel_1); - - JLabel lblName = new JLabel("Name:"); - lblName.setBounds(10, 36, 46, 20); - contentPanel.add(lblName); - - textField = new JTextField(); - textField.setBounds(69, 36, 171, 20); - contentPanel.add(textField); - textField.setColumns(10); - - JLabel lblHochschule = new JLabel("Hochschule:"); - lblHochschule.setBounds(275, 36, 80, 20); - contentPanel.add(lblHochschule); - - JComboBox comboBox = new JComboBox(); - comboBox.setModel(new DefaultComboBoxModel(new String[] { - "Hochschule Offenburg", "Hochschule Reutlingen", - "Universit\u00E4t Freiburg" })); - comboBox.setBounds(365, 36, 202, 20); - contentPanel.add(comboBox); - - JPanel panel = new JPanel(); - panel.setBounds(10, 67, 557, 150); - contentPanel.add(panel); - panel.setLayout(null); - panel.setBorder(new TitledBorder(null, "Beschreibung", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel.setBackground(SystemColor.menu); - - JLabel label = new JLabel("Read"); - label.setBounds(20, 18, 90, 20); - panel.add(label); - - JLabel label_3 = new JLabel("Write"); - label_3.setBounds(20, 38, 90, 20); - panel.add(label_3); - - JLabel lblImageLesenUnd = new JLabel( - "Image lesen und starten, in Suchfenster und VMchooser sichtbar."); - lblImageLesenUnd.setBounds(120, 18, 380, 20); - panel.add(lblImageLesenUnd); - - JLabel lblImageAnpassenUnd = new JLabel( - "Image anpassen und \u00DCberschrieben, jedoch nicht l\u00F6schen."); - lblImageAnpassenUnd.setBounds(120, 38, 380, 20); - panel.add(lblImageAnpassenUnd); - - lblLinkAllowed = new JLabel("Link"); - lblLinkAllowed.setBounds(20, 58, 90, 20); - panel.add(lblLinkAllowed); - - label_5 = new JLabel("Admin"); - label_5.setBounds(20, 78, 90, 20); - panel.add(label_5); - - label_6 = new JLabel("Erzeugung einer Veranstaltung auf ein Image ist erlaubt."); - label_6.setBounds(120, 58, 380, 20); - panel.add(label_6); - - label_7 = new JLabel("Volle Rechte: read, write, l\u00F6schen, Link_allowed und
Berechtigungen f\u00FCr andere Benutzer festlegen."); - label_7.setBounds(120, 78, 380, 40); - panel.add(label_7); - - JLabel label_4 = new JLabel("F\u00FCr alle sichtbar"); - label_4.setBounds(20, 120, 90, 20); - panel.add(label_4); - - JCheckBox checkBox = new JCheckBox(""); - checkBox.setBounds(115, 120, 21, 23); - panel.add(checkBox); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton cancelButton = new JButton("Zur\u00FCck"); - cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - EditImageFreigabe_GUI sr = new EditImageFreigabe_GUI(); - sr.setVisible(true); - dispose(); - } - }); - cancelButton.setActionCommand("OK"); - buttonPane.add(cancelButton); - // getRootPane().setDefaultButton(cancelButton); - } - { - JButton continueButton = new JButton("Weiter"); - continueButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - FTPEditUploader_GUI ea = new FTPEditUploader_GUI(); - ea.setVisible(true); - dispose(); - - } - }); - continueButton.setActionCommand("Cancel"); - buttonPane.add(continueButton); - getRootPane().setDefaultButton(continueButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); - getContentPane().add(separator_1); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - } - - class MyItemListener1 implements ItemListener { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) - return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for (int x = 0, y = table.getRowCount(); x < y; x++) { - table.setValueAt(new Boolean(checked), x, 1); - } - } - } - - class MyItemListener2 implements ItemListener { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) - return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for (int x = 0, y = table.getRowCount(); x < y; x++) { - table.setValueAt(new Boolean(checked), x, 2); - } - } - } - - class MyItemListener3 implements ItemListener { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) - return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for (int x = 0, y = table.getRowCount(); x < y; x++) { - table.setValueAt(new Boolean(checked), x, 3); - } - } - } - - class MyItemListener4 implements ItemListener { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) - return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for (int x = 0, y = table.getRowCount(); x < y; x++) { - table.setValueAt(new Boolean(checked), x, 4); - } - } - } - - class MyItemListener5 implements ItemListener { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) - return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for (int x = 0, y = table.getRowCount(); x < y; x++) { - table.setValueAt(new Boolean(checked), x, 5); - } - } - } -} - -/* - * class CheckBoxHeader extends JCheckBox implements TableCellRenderer, - * MouseListener { protected CheckBoxHeader rendererComponent; protected int - * column; protected boolean mousePressed = false; - * - * public CheckBoxHeader(ItemListener itemListener ,String text) { - * rendererComponent = this; rendererComponent.addItemListener(itemListener); - * rendererComponent.setText(text); } - * - * public Component getTableCellRendererComponent( JTable table, Object value, - * boolean isSelected, boolean hasFocus, int row, int column) { if (table != - * null) { JTableHeader header = table.getTableHeader(); if (header != null) { - * rendererComponent.setForeground(header.getForeground()); - * rendererComponent.setBackground(header.getBackground()); - * rendererComponent.setFont(header.getFont()); - * rendererComponent.setBorder(header.getBorder()); - * header.addMouseListener(rendererComponent); } } setColumn(column); - * //rendererComponent.setText("Check All"); - * //setBorder(UIManager.getBorder("TableHeader.cellBorder")); - * - * return rendererComponent; } protected void setColumn(int column) { - * this.column = column; } public int getColumn() { return column; } protected - * void handleClickEvent(MouseEvent e) { if (mousePressed) { mousePressed=false; - * JTableHeader header = (JTableHeader)(e.getSource()); JTable tableView = - * header.getTable(); TableColumnModel columnModel = tableView.getColumnModel(); - * int viewColumn = columnModel.getColumnIndexAtX(e.getX()); int column = - * tableView.convertColumnIndexToModel(viewColumn); - * - * if (viewColumn == this.column && e.getClickCount() == 1 && column != -1) { - * doClick(); } } } public void mouseClicked(MouseEvent e) { - * handleClickEvent(e); ((JTableHeader)e.getSource()).repaint(); } public void - * mousePressed(MouseEvent e) { mousePressed = true; } public void - * mouseReleased(MouseEvent e) { } public void mouseEntered(MouseEvent e) { } - * public void mouseExited(MouseEvent e) { } } - */ diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java deleted file mode 100644 index 83e12b72..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java +++ /dev/null @@ -1,1055 +0,0 @@ -package gui.image; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JScrollPane; -import javax.swing.JSeparator; -import javax.swing.JTabbedPane; -import javax.swing.JTable; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.RowFilter; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableModel; -import javax.swing.table.TableRowSorter; - -import models.Image; -import models.Links; -import models.person; - -import org.apache.thrift.TException; - -import server.Server.Client; -import thrift.ThriftConnection; -import util.GuiOrganizer; -//import models.person; -import util.OpenLinks; - -@SuppressWarnings("serial") -public class SearchEditImage_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - JLabel labelName; - JLabel labelUpdate; - JLabel labelVerantwortlicher; - JLabel labelWeitereVerantwortliche; - JLabel labelVorlage; - JLabel labelLizenzSoftware; - JLabel labelInternet; - JLabel labelRam; - JLabel labelCPU; - JLabel labelID; - JLabel labelVersion; - JTextArea textAreadesc; - private JLabel labelOS; - String[] result; - JRadioButton rdbtnInternetJa; - JRadioButton rdbtnInternetNein; - JComboBox comboBox; - JTable tableAllImages; - JTable tablemyImages; - JTable tablePublicVorlagen; - boolean activeSearch = false; - private JTextField textFieldName; - JTabbedPane tabbedPane; - String[] titles = { "Name", "Lizenzpflichtig", "OS", "Veranstaltung", - "Verantwortlicher", "Letztes Update", "ID", "Version", "Template" };// Angezeigt - // werden - // aber - // nur - // Name (0), - // OS (2), - // Verantwortlicher (4), - // Letztes - // Update (5) - - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); - final DefaultTableModel modelAll = new DefaultTableModel(titles, 0) { - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0) { - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final DefaultTableModel modelPublicVorlagen = new DefaultTableModel(titles, - 0) { - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final TableRowSorter rowSorterAll = new TableRowSorter( - modelAll); - final TableRowSorter rowSorterMyImages = new TableRowSorter( - modelMyImages); - final TableRowSorter rowSorterPublicVorlagen = new TableRowSorter( - modelPublicVorlagen); - private JTextField textField; - - /** - * Create the dialog. - */ - public SearchEditImage_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - // Beendet die Anwendung nach klick auf X - con.closeThriftConnection(); - System.exit(0); - } - - @Override - public void windowOpened(WindowEvent arg0) { - initTableModel(modelMyImages); - initTableModel(modelAll); - initTableModel(modelPublicVorlagen); - - //auszublendende Angaben - //1=Lizenzpflichtig - //3=Veranstaltung - //6=ID - //7=Version - //8=Template - tablemyImages.getColumnModel().getColumn(1).setWidth(0); - tablemyImages.getColumnModel().getColumn(1).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(3).setWidth(0); - tablemyImages.getColumnModel().getColumn(3).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(3).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(8).setWidth(0); - tablemyImages.getColumnModel().getColumn(8).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(6).setWidth(0); - tablemyImages.getColumnModel().getColumn(6).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(7).setWidth(0); - tablemyImages.getColumnModel().getColumn(7).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0); - - tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(1) - .setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(1) - .setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(3).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(3) - .setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(3) - .setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(8) - .setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(8) - .setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(6) - .setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(6) - .setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(7) - .setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(7) - .setMaxWidth(0); - - tableAllImages.getColumnModel().getColumn(1).setWidth(0); - tableAllImages.getColumnModel().getColumn(1).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(3).setWidth(0); - tableAllImages.getColumnModel().getColumn(3).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(3).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(8).setWidth(0); - tableAllImages.getColumnModel().getColumn(8).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(6).setWidth(0); - tableAllImages.getColumnModel().getColumn(6).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(7).setWidth(0); - tableAllImages.getColumnModel().getColumn(7).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0); - textFieldName.requestFocusInWindow(); - } - }); - // Verhindert das Vergroessern Des Fensters - setResizable(false); - - try { - // Setzt das Look & Feel auf System - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - // Setzt den Fenstertitel - setTitle("bwLehrpool Suite - Image bearbeiten"); - // Zentriert das Fenster in die Bildmitte - setBounds(0, 0, 918, 722); - GuiOrganizer.centerGUI(this); - - final DefaultTableModel model = new DefaultTableModel(titles, 0); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 892, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Imageauswahl"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen"); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 531); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 49, 557, 98); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JLabel lblNewLabel_2 = new JLabel("Name:"); - lblNewLabel_2.setBounds(10, 30, 80, 20); - panel_1.add(lblNewLabel_2); - - JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:"); - lblInternetIstInnerhalb.setBounds(10, 58, 250, 20); - panel_1.add(lblInternetIstInnerhalb); - - textFieldName = new JTextField(); - // Key Listener der Tastatureingabe registriert - textFieldName.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - // Textfield eingabe auslesen - String stext = textFieldName.getText(); - - // Wenn Textfield nicht leer - if (stext.isEmpty() == false) { - activeSearch = true; - // Filtere nach der Eingabe - rowSorterAll.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - } else { - activeSearch = false; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - username, 4)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - "true", 8)); - rowSorterAll.setRowFilter(null); - } - } - }); - - textFieldName.setBounds(96, 30, 166, 20); - panel_1.add(textFieldName); - textFieldName.setColumns(10); - - comboBox = new JComboBox(); - try { - // Holt sich eine Liste aller verfuegbaren Betriebssysteme vom - // Server - List list = client.getAllOS(); - // Leeres Item hinzufuegen - comboBox.addItem(""); - for (int i = 0; i < list.size(); i++) { - // Hinzufuegen der verfuegbaren Betriebssysteme - comboBox.addItem(list.get(i)); - } - } catch (TException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - JOptionPane.showMessageDialog(null, - e2.getCause() + "\n" + e2.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - // Registriert Auswahlaenderungen der Box - comboBox.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - // Prueft das die Auswahl nicht leer ist - if (comboBox.getSelectedItem().toString().isEmpty() == false) { - // Filtert nach dem ausgewaehlten Betriebssystem - activeSearch = true; - rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox - .getSelectedItem().toString(), 2)); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - comboBox.getSelectedItem().toString(), 2)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - comboBox.getSelectedItem().toString(), 2)); - } else { - activeSearch = false; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - username, 4)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - "true", 8)); - rowSorterAll.setRowFilter(null); - } - } - - }); - comboBox.setBounds(96, 58, 166, 20); - panel_1.add(comboBox); - - JLabel label_3 = new JLabel("Beschreibung:"); - label_3.setBounds(291, 30, 80, 20); - panel_1.add(label_3); - - textField = new JTextField(); - textField.setColumns(10); - textField.setBounds(381, 30, 166, 20); - panel_1.add(textField); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - // oeffnet das Hauuetmenue - - SearchEditImage_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Image"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 45, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(116, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Imageauswahl"); - lblNewLabel_1.setBounds(129, 11, 85, 14); - contentPanel.add(lblNewLabel_1); - - tabbedPane = new JTabbedPane(JTabbedPane.TOP); - tabbedPane.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent arg0) { - if (tabbedPane.getSelectedIndex() == 0 && activeSearch == false) { - - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - username, 4)); - } else if (tabbedPane.getSelectedIndex() == 1 - && activeSearch == false) { - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - "true", 8)); - } else if (tabbedPane.getSelectedIndex() == 2 - && activeSearch == false) { - rowSorterAll.setRowFilter(null); - } - - } - }); - - tabbedPane.setBounds(10, 158, 557, 339); - contentPanel.add(tabbedPane); - - JScrollPane scrollPaneMyImage = new JScrollPane(); - tablemyImages = new JTable(); - tablemyImages.getSelectionModel().addListSelectionListener( - new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { - String imageid = modelMyImages.getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 6) - .toString(); - //System.out.println(imageid); - String version = modelMyImages.getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 7) - .toString(); - //System.out.println(version); - writeImageData(imageid, version); - } - }); - tablemyImages.setModel(modelMyImages); - tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit(); - tablemyImages.setRowSorter(rowSorterMyImages); - - scrollPaneMyImage.setViewportView(tablemyImages); - tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null); - - JScrollPane scrollPaneCoopImages = new JScrollPane(); - JTable tableCoopImages = new JTable(); - tableCoopImages.setModel(model); - tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit(); - - JScrollPane scrollPanePublicVorlagen = new JScrollPane(); - tablePublicVorlagen = new JTable(); - tablePublicVorlagen.getSelectionModel().addListSelectionListener( - new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { - String imageid = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 6) - .toString(); - //System.out.println(imageid); - String version = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 7) - .toString(); - //System.out.println(version); - writeImageData(imageid, version); - } - }); - tablePublicVorlagen.setModel(modelPublicVorlagen); - tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit(); - tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen); - scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen); - tabbedPane.addTab("Vorlagen", null, scrollPanePublicVorlagen, null); - - JScrollPane scrollPaneAllImages = new JScrollPane(); - tableAllImages = new JTable(); - tableAllImages.getSelectionModel().addListSelectionListener( - new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { - - String imageid = modelAll.getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 6) - .toString(); - //System.out.println(imageid); - String version = modelAll.getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 7) - .toString(); - //System.out.println(version); - writeImageData(imageid, version); - - } - }); - tableAllImages.setModel(modelAll); - tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit(); - tableAllImages.setRowSorter(rowSorterAll); - - scrollPaneAllImages.setViewportView(tableAllImages); - tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); - - scrollPaneCoopImages.setViewportView(tableCoopImages); - tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages, null); - tabbedPane.setEnabledAt(3, false); - - JButton btnDownload = new JButton("Download"); - btnDownload.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - // oeffnet den Downloader - - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - // check if user is in correct tab - if (tabbedPane.getSelectedIndex() == 0) { - // check if a row is selected - if (tablemyImages.getSelectedRow() != -1) { - String imageid = modelMyImages.getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 6) - .toString(); - - Image.image.setImageId(imageid); - String imageversion = modelMyImages.getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 7) - .toString(); - - Image.image.setVersion(imageversion); - - FTPEditDownloader_GUI ea = new FTPEditDownloader_GUI(); - ea.setVisible(true); - dispose(); - } - } else if (tabbedPane.getSelectedIndex() == 1) { - if (tablePublicVorlagen.getSelectedRow() != -1) { - if (modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 4) - .equals(username) == true - || modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), - 8).equals("true") == true) { - String imageid = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), - 6).toString(); - - Image.image.setImageId(imageid); - String imageversion = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), - 7).toString(); - - Image.image.setVersion(imageversion); - - FTPEditDownloader_GUI ea = new FTPEditDownloader_GUI(); - ea.setVisible(true); - dispose(); - } else { - JOptionPane - .showMessageDialog( - null, - "Sie haben keine Berechtigung fremde Images herunterzuladen.", - "Message", - JOptionPane.INFORMATION_MESSAGE); - } - } - } else if (tabbedPane.getSelectedIndex() == 2) { - if (tableAllImages.getSelectedRow() != -1) { - if (modelAll.getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 4).equals( - username) == true - || modelAll - .getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), - 8).equals("true") == true) { - String imageid = modelAll - .getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), - 6).toString(); - - Image.image.setImageId(imageid); - String imageversion = modelAll - .getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), - 7).toString(); - - Image.image.setVersion(imageversion); - - FTPEditDownloader_GUI ea = new FTPEditDownloader_GUI(); - ea.setVisible(true); - dispose(); - } else { - JOptionPane - .showMessageDialog( - null, - "Sie haben keine Berechtigung fremde Images herunterzuladen.", - "Message", - JOptionPane.INFORMATION_MESSAGE); - } - } - } else { - JOptionPane - .showMessageDialog( - null, - "Bitte w\u00e4hlen Sie ein Image f\u00fcr den Download aus", - "Message", JOptionPane.INFORMATION_MESSAGE); - } - } - }); - btnDownload.setBounds(449, 508, 118, 23); - contentPanel.add(btnDownload); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 902, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton okButton = new JButton("Zur\u00FCck"); - okButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - // oeffnet das Hauptmenue - - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - dispose(); - } - }); - okButton.setActionCommand("OK"); - buttonPane.add(okButton); - getRootPane().setDefaultButton(okButton); - } - { - JButton cancelButton = new JButton("Weiter"); - cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - String username = person.verantwortlicher.getName() - + " " + person.verantwortlicher.getVorname(); - // check if user is in correct tab - if (tabbedPane.getSelectedIndex() == 0) { - // check if a row is selected - if (tablemyImages.getSelectedRow() != -1) { - String imageid = modelMyImages - .getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), - 6).toString(); - - Image.image.setImageId(imageid); - String imageversion = modelMyImages - .getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), - 7).toString(); - - Image.image.setVersion(imageversion); - - EditImageAllgemein_GUI ea = new EditImageAllgemein_GUI(); - ea.setVisible(true); - dispose(); - } - } else if (tabbedPane.getSelectedIndex() == 1) { - if (tablePublicVorlagen.getSelectedRow() != -1 - && modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), - 4).equals(username) == true) { - String imageid = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), - 6).toString(); - - Image.image.setImageId(imageid); - String imageversion = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), - 7).toString(); - - Image.image.setVersion(imageversion); - - EditImageAllgemein_GUI ea = new EditImageAllgemein_GUI(); - ea.setVisible(true); - dispose(); - } - } else if (tabbedPane.getSelectedIndex() == 2) { - if (tableAllImages.getSelectedRow() != -1 - && modelAll - .getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), - 4).equals(username) == true) { - String imageid = modelAll - .getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), - 6).toString(); - - Image.image.setImageId(imageid); - String imageversion = modelAll - .getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), - 7).toString(); - - Image.image.setVersion(imageversion); - - EditImageAllgemein_GUI ea = new EditImageAllgemein_GUI(); - ea.setVisible(true); - dispose(); - } else { - JOptionPane - .showMessageDialog( - null, - "Bitte w\u00e4hlen Sie ein eigenes Image aus.", - "Image Auswahl", - JOptionPane.INFORMATION_MESSAGE); - } - }// end check if correct tab is selected - } - }); - cancelButton.setActionCommand("Cancel"); - buttonPane.add(cancelButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 79, 912, 1); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 912, 2); - getContentPane().add(separator_1); - - JPanel panel = new JPanel(); - panel.setLayout(null); - panel.setBorder(new TitledBorder(null, "Detailinformationen", - - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel.setBackground(SystemColor.menu); - panel.setBounds(586, 85, 316, 531); - getContentPane().add(panel); - - JLabel lblName = new JLabel("Name:"); - lblName.setBounds(10, 87, 130, 14); - panel.add(lblName); - - labelName = new JLabel(""); - labelName.setBounds(10, 102, 296, 14); - panel.add(labelName); - - JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); - lblVerantwortlicher.setBounds(10, 259, 130, 14); - panel.add(lblVerantwortlicher); - - labelOS = new JLabel(""); - labelOS.setBounds(10, 216, 296, 14); - panel.add(labelOS); - - JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:"); - lblWeitereVerantwortliche.setBounds(10, 202, 130, 14); - panel.add(lblWeitereVerantwortliche); - - labelVerantwortlicher = new JLabel(""); - labelVerantwortlicher.setBounds(10, 272, 296, 14); - panel.add(labelVerantwortlicher); - - JLabel label = new JLabel("Weitere Verantwortliche:"); - label.setBounds(10, 284, 130, 14); - panel.add(label); - - labelWeitereVerantwortliche = new JLabel(""); - labelWeitereVerantwortliche.setBounds(10, 297, 296, 14); - panel.add(labelWeitereVerantwortliche); - - labelUpdate = new JLabel(""); - labelUpdate.setBounds(10, 245, 296, 14); - panel.add(labelUpdate); - - JLabel lblLetztesUpdate = new JLabel("Letztes Update:"); - lblLetztesUpdate.setBounds(10, 231, 130, 14); - panel.add(lblLetztesUpdate); - - JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:"); - lblImageIstVorlage.setBounds(10, 336, 130, 14); - panel.add(lblImageIstVorlage); - - labelVorlage = new JLabel(""); - labelVorlage.setBounds(10, 350, 296, 14); - panel.add(labelVorlage); - - labelLizenzSoftware = new JLabel(""); - labelLizenzSoftware.setBounds(10, 383, 296, 14); - panel.add(labelLizenzSoftware); - - JLabel lblLizenzpflichtigeSoftware = new JLabel( - "Lizenzpflichtige Software:"); - lblLizenzpflichtigeSoftware.setBounds(10, 367, 130, 14); - panel.add(lblLizenzpflichtigeSoftware); - - JLabel lblInternet = new JLabel("Internetsperre vorhanden:"); - lblInternet.setBounds(10, 400, 130, 14); - panel.add(lblInternet); - - labelInternet = new JLabel(""); - labelInternet.setBounds(10, 417, 296, 14); - panel.add(labelInternet); - - JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:"); - lblEmpfehlungRam.setBounds(10, 432, 130, 14); - panel.add(lblEmpfehlungRam); - - labelRam = new JLabel(""); - labelRam.setBounds(10, 455, 296, 14); - panel.add(labelRam); - - JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:"); - lblEmpfehlungCpu.setBounds(10, 469, 130, 14); - panel.add(lblEmpfehlungCpu); - - labelCPU = new JLabel(""); - labelCPU.setBounds(10, 487, 296, 14); - panel.add(labelCPU); - - JLabel lblTechnischeDaten = new JLabel("Technische Daten:"); - lblTechnischeDaten.setBounds(10, 322, 296, 14); - panel.add(lblTechnischeDaten); - - JLabel lblId = new JLabel("ID:"); - lblId.setBounds(10, 23, 296, 14); - panel.add(lblId); - - labelID = new JLabel(""); - labelID.setBounds(10, 37, 296, 14); - panel.add(labelID); - - labelVersion = new JLabel(""); - labelVersion.setBounds(10, 73, 296, 14); - panel.add(labelVersion); - - JLabel lblVersion = new JLabel("Version:"); - lblVersion.setBounds(10, 57, 296, 14); - panel.add(lblVersion); - - JLabel lblBeschreibung = new JLabel("Beschreibung:"); - lblBeschreibung.setBounds(10, 119, 130, 14); - panel.add(lblBeschreibung); - - JScrollPane scrollPane = new JScrollPane(); - scrollPane.setBounds(10, 135, 296, 65); - panel.add(scrollPane); - - textAreadesc = new JTextArea(); - textAreadesc.setLineWrap(true); - textAreadesc.setEditable(false); - textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); - textAreadesc.setBackground(SystemColor.menu); - scrollPane.setViewportView(textAreadesc); - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - } - - // Initiale Beffuelung eines Table models - public DefaultTableModel initTableModel(DefaultTableModel model) { - List images; - try { - // Hole eine Liste der Images - images = client.getImageList(); - - Iterator i = images.iterator(); - SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); - int x = 0; - - while (i.hasNext()) { - // erzeuge Objekte fuer die Tabelle - Object[] obj = { images.get(x).getImageName(), - images.get(x).getLicenseRestriction(), - images.get(x).getOsName(), - images.get(x).getLectureName(), - images.get(x).getUserData(), - out.format(in.parse(images.get(x).updateTime)), - images.get(x).id, images.get(x).getVersion(), - images.get(x).getIsTemplate() }; - // Fuege diese Objekte der Tabelle hinzu - - model.addRow(obj); - x++; - i.next(); - - } - - return model; - } catch (TException | ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane.showMessageDialog(null, - e1.getCause() + "\n" + e1.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - return model; - } - - public void writeImageData(String id, String version) { - try { - SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); - Map res = client.getImageData(id, version); - labelName.setText(res.get("name")); - labelOS.setText(res.get("os")); - labelUpdate.setText(out.format(in.parse(res.get("lastupdate")))); - labelVerantwortlicher.setText(res.get("owner")); - labelWeitereVerantwortliche.setText("Noch nicht Verf\u00fcgbar"); - if (res.get("template").equals("true")) { - labelVorlage.setText("Ja"); - } else { - labelVorlage.setText("Nein"); - } - if (res.get("license").equals("1")) { - labelLizenzSoftware.setText("Ja"); - } else { - labelLizenzSoftware.setText("Nein"); - } - if (res.get("internet").equals("1")) { - labelInternet.setText("Ja"); - } else { - labelInternet.setText("Nein"); - } - labelRam.setText(res.get("ram")); - labelCPU.setText(res.get("cpu")); - labelID.setText(res.get("id")); - labelVersion.setText(res.get("version")); - textAreadesc.setText(res.get("desc")); - } catch (TException | ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java deleted file mode 100644 index f41135b1..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java +++ /dev/null @@ -1,963 +0,0 @@ -package gui.image; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JScrollPane; -import javax.swing.JSeparator; -import javax.swing.JTabbedPane; -import javax.swing.JTable; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.RowFilter; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.event.TableModelEvent; -import javax.swing.event.TableModelListener; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableModel; -import javax.swing.table.TableRowSorter; - -import models.Image; -import models.Links; -import models.person; - -import org.apache.thrift.TException; - -import server.Server.Client; -import thrift.ThriftConnection; -import util.GuiOrganizer; -import util.OpenLinks; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; - -@SuppressWarnings("serial") -public class SearchImage_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - JLabel labelName; - JLabel labelUpdate; - JLabel labelVerantwortlicher; - JLabel labelWeitereVerantwortliche; - JLabel labelVorlage; - JLabel labelLizenzSoftware; - JLabel labelInternet; - JLabel labelRam; - JLabel labelCPU; - JLabel labelID; - JLabel labelVersion; - JTextArea textAreadesc; - private JLabel labelOS; - String[] result; - JRadioButton rdbtnInternetJa; - JRadioButton rdbtnInternetNein; - JComboBox comboBox; - JTable tableAllImages; - JTable tablemyImages; - JTable tablePublicVorlagen; - private JTextField textFieldName; - JTabbedPane tabbedPane; - boolean activeSearch = false; - String[] titles = { "Name", "Lizenzpflichtig", "OS", "Veranstaltung", - "Verantwortlicher", "Letztes Update", "ID", "Version", "Template" }; // Angezeigt - // werden - // aber - // nur - // Name - // (0), - // OS - // (2), - // Verantwortlicher - // (4), - // Letztes - // Update - // (5) - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); - final DefaultTableModel modelAll = new DefaultTableModel(titles, 0) { - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0) { - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final DefaultTableModel modelPublicVorlagen = new DefaultTableModel(titles, - 0) { - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final TableRowSorter rowSorterAll = new TableRowSorter( - modelAll); - final TableRowSorter rowSorterMyImages = new TableRowSorter( - modelMyImages); - final TableRowSorter rowSorterPublicVorlagen = new TableRowSorter( - modelPublicVorlagen); - private JTextField textField; - - /** - * Create the dialog. - */ - public SearchImage_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - // Beendet die Anwendung nach klick auf X - con.closeThriftConnection(); - System.exit(0); - } - - @Override - public void windowOpened(WindowEvent arg0) { - initTableModel(modelAll); - initTableModel(modelMyImages); - initTableModel(modelPublicVorlagen); - - // auszublendende Angaben - // 1=Lizenzpflichtig - // 3=Veranstaltung - // 6=ID - // 7=Version - // 8=Template - tablemyImages.getColumnModel().getColumn(1).setWidth(0); - tablemyImages.getColumnModel().getColumn(1).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(3).setWidth(0); - tablemyImages.getColumnModel().getColumn(3).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(3).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(8).setWidth(0); - tablemyImages.getColumnModel().getColumn(8).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(6).setWidth(0); - tablemyImages.getColumnModel().getColumn(6).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(7).setWidth(0); - tablemyImages.getColumnModel().getColumn(7).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0); - - tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(1) - .setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(1) - .setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(3).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(3) - .setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(3) - .setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(8) - .setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(8) - .setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(6) - .setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(6) - .setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(7) - .setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(7) - .setMaxWidth(0); - - tableAllImages.getColumnModel().getColumn(1).setWidth(0); - tableAllImages.getColumnModel().getColumn(1).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(3).setWidth(0); - tableAllImages.getColumnModel().getColumn(3).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(3).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(8).setWidth(0); - tableAllImages.getColumnModel().getColumn(8).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(6).setWidth(0); - tableAllImages.getColumnModel().getColumn(6).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(7).setWidth(0); - tableAllImages.getColumnModel().getColumn(7).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0); - textFieldName.requestFocusInWindow(); - } - }); - // Verhindert das Vergroessern Des Fensters - setResizable(false); - - try { - // Setzt das Look & Feel auf System - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - // Setzt den Fenstertitel - setTitle("bwLehrpool Suite - Image suchen"); - // Zentriert das Fenster in die Bildmitte - setBounds(0, 0, 918, 722); - GuiOrganizer.centerGUI(this); - - final DefaultTableModel model = new DefaultTableModel(titles, 0); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 892, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Imagesuche"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen"); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 531); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 49, 557, 98); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JLabel lblNewLabel_2 = new JLabel("Anzeigename:"); - lblNewLabel_2.setBounds(10, 30, 80, 20); - panel_1.add(lblNewLabel_2); - - JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:"); - lblInternetIstInnerhalb.setBounds(10, 58, 80, 20); - panel_1.add(lblInternetIstInnerhalb); - - textFieldName = new JTextField(); - // Key Listener der Tastatureingabe registriert - textFieldName.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - // Textfield eingabe auslesen - String stext = textFieldName.getText(); - - // Wenn Textfield nicht leer - if (stext != "") { - activeSearch = true; - // Filtere nach der Eingabe - rowSorterAll.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - - } else { - activeSearch = false; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - username, 4)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - "true", 8)); - rowSorterAll.setRowFilter(null); - } - } - }); - - textFieldName.setBounds(96, 30, 166, 20); - panel_1.add(textFieldName); - textFieldName.setColumns(10); - - comboBox = new JComboBox(); - try { - // Holt sich eine Liste aller verfuegbaren Betriebssysteme vom - // Server - List list = client.getAllOS(); - // Leeres Item hinzufuegen - comboBox.addItem(""); - for (int i = 0; i < list.size(); i++) { - // Hinzufuegen der verfuegbaren Betriebssysteme - comboBox.addItem(list.get(i)); - } - } catch (TException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - JOptionPane.showMessageDialog(null, - e2.getCause() + "\n" + e2.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - // Registriert Auswahlaenderungen der Box - comboBox.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - // Prueft das die Auswahl nicht leer ist - if (comboBox.getSelectedItem().toString() != "") { - activeSearch = true; - rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox - .getSelectedItem().toString(), 2)); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - comboBox.getSelectedItem().toString(), 2)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - comboBox.getSelectedItem().toString(), 2)); - } else { - activeSearch = false; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - username, 4)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - "true", 8)); - rowSorterAll.setRowFilter(null); - } - } - - }); - comboBox.setBounds(96, 58, 166, 20); - panel_1.add(comboBox); - - JLabel label_3 = new JLabel("Beschreibung:"); - label_3.setBounds(291, 30, 80, 20); - panel_1.add(label_3); - - textField = new JTextField(); - textField.setColumns(10); - textField.setBounds(381, 30, 166, 20); - panel_1.add(textField); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - // oeffnet das Hauuetmenue - - SearchImage_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Image"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 45, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(116, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Imageauswahl"); - lblNewLabel_1.setBounds(129, 11, 85, 14); - contentPanel.add(lblNewLabel_1); - - tabbedPane = new JTabbedPane(JTabbedPane.TOP); - tabbedPane.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent arg0) { - if (tabbedPane.getSelectedIndex() == 0 && activeSearch == false) { - - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - username, 4)); - } else if (tabbedPane.getSelectedIndex() == 1 - && activeSearch == false) { - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - "true", 8)); - } else if (tabbedPane.getSelectedIndex() == 2 - && activeSearch == false) { - rowSorterAll.setRowFilter(null); - } - - } - }); - - tabbedPane.setBounds(10, 158, 557, 339); - contentPanel.add(tabbedPane); - - JScrollPane scrollPaneAllImages = new JScrollPane(); - tableAllImages = new JTable(); - tableAllImages.getSelectionModel().addListSelectionListener( - new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { - - String imageid = modelAll.getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 6) - .toString(); - //System.out.println(imageid); - String version = modelAll.getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 7) - .toString(); - //System.out.println(version); - writeImageData(imageid, version); - - } - }); - tableAllImages.setModel(modelAll); - tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit(); - - JScrollPane scrollPaneMyImage = new JScrollPane(); - tablemyImages = new JTable(); - tablemyImages.getSelectionModel().addListSelectionListener( - new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { - String imageid = modelMyImages.getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 6) - .toString(); - //System.out.println(imageid); - String version = modelMyImages.getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 7) - .toString(); - //System.out.println(version); - writeImageData(imageid, version); - } - }); - tablemyImages.setModel(modelMyImages); - tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit(); - tablemyImages.setRowSorter(rowSorterMyImages); - - scrollPaneMyImage.setViewportView(tablemyImages); - tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null); - - JScrollPane scrollPanePublicVorlagen = new JScrollPane(); - tablePublicVorlagen = new JTable(); - tablePublicVorlagen.getSelectionModel().addListSelectionListener( - new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { - String imageid = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 6) - .toString(); - //System.out.println(imageid); - String version = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 7) - .toString(); - //System.out.println(version); - writeImageData(imageid, version); - } - }); - tablePublicVorlagen.setModel(modelPublicVorlagen); - tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit(); - tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen); - scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen); - tabbedPane.addTab("Vorlagen", null, scrollPanePublicVorlagen, null); - tableAllImages.setRowSorter(rowSorterAll); - - scrollPaneAllImages.setViewportView(tableAllImages); - tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); - - JScrollPane scrollPaneCoopImages = new JScrollPane(); - JTable tableCoopImages = new JTable(); - tableCoopImages.setModel(model); - tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit(); - - scrollPaneCoopImages.setViewportView(tableCoopImages); - tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages, null); - tabbedPane.setEnabledAt(3, false); - - JButton btnDownload = new JButton("Download"); - btnDownload.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - // oeffnet den Downloader - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - // - // meine Images - // - if (tabbedPane.getSelectedIndex() == 0) { - if (tablemyImages.getSelectedRow() != -1) { - String imageid = modelMyImages.getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 6) - .toString(); - - Image.image.setImageId(imageid); - String imageversion = modelMyImages.getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 7) - .toString(); - - Image.image.setVersion(imageversion); - SearchImage_GUI.this.setVisible(false); - FTPSearchDownloader_GUI down = new FTPSearchDownloader_GUI(); - down.setVisible(true); - - } - } else if (tabbedPane.getSelectedIndex() == 1) { - // - // Vorlagen Images - // - - if (tablePublicVorlagen.getSelectedRow() != -1 - // && modelPublicVorlagen - // .getValueAt( - // tablePublicVorlagen - // .convertRowIndexToModel(tablePublicVorlagen - // .getSelectedRow()), - // 4).equals(username) == true - ) { - String imageid = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 6) - .toString(); - - Image.image.setImageId(imageid); - String imageversion = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 7) - .toString(); - - Image.image.setVersion(imageversion); - - SearchImage_GUI.this.setVisible(false); - FTPSearchDownloader_GUI down = new FTPSearchDownloader_GUI(); - down.setVisible(true); - } - } else if (tabbedPane.getSelectedIndex() == 2) { - // - // Alle Images - // - /** - * if (tableAllImages.getSelectedRow() != -1 && modelAll - * .getValueAt( tableAllImages - * .convertRowIndexToModel(tableAllImages - * .getSelectedRow()), 4).equals(username) == true) { - **/ - if (tableAllImages.getSelectedRow() != -1) { - // nur eigene Images downloadbar - if (modelAll.getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 4).equals( - username) == true - || modelAll - .getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), - 8).equals("true") == true) { - String imageid = modelAll - .getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), - 6).toString(); - - Image.image.setImageId(imageid); - String imageversion = modelAll - .getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), - 7).toString(); - - Image.image.setVersion(imageversion); - - SearchImage_GUI.this.setVisible(false); - FTPSearchDownloader_GUI down = new FTPSearchDownloader_GUI(); - down.setVisible(true); - } else { - JOptionPane - .showMessageDialog( - null, - "Sie haben keine Berechtigung fremde Images herunterzuladen.", - "Message", - JOptionPane.INFORMATION_MESSAGE); - } - - } - - } else { - // - // nichts markiert - // - JOptionPane - .showMessageDialog( - null, - "Bitte w\u00e4hlen Sie ein Image f\u00fcr den Download aus", - "Message", JOptionPane.INFORMATION_MESSAGE); - } - } - }); - btnDownload.setBounds(449, 508, 118, 23); - contentPanel.add(btnDownload); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 902, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton okButton = new JButton("Zur\u00FCck"); - okButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - // oeffnet das Hauptmenue - - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - dispose(); - } - }); - okButton.setActionCommand("OK"); - buttonPane.add(okButton); - getRootPane().setDefaultButton(okButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 79, 912, 1); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 912, 2); - getContentPane().add(separator_1); - - JPanel panel = new JPanel(); - panel.setLayout(null); - panel.setBorder(new TitledBorder(null, "Detailinformationen", - - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel.setBackground(SystemColor.menu); - panel.setBounds(586, 85, 316, 531); - getContentPane().add(panel); - - JLabel lblName = new JLabel("Name:"); - lblName.setBounds(10, 87, 130, 14); - panel.add(lblName); - - labelName = new JLabel(""); - labelName.setBounds(10, 102, 296, 14); - panel.add(labelName); - - JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); - lblVerantwortlicher.setBounds(10, 259, 130, 14); - panel.add(lblVerantwortlicher); - - labelOS = new JLabel(""); - labelOS.setBounds(10, 216, 296, 14); - panel.add(labelOS); - - JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:"); - lblWeitereVerantwortliche.setBounds(10, 202, 130, 14); - panel.add(lblWeitereVerantwortliche); - - labelVerantwortlicher = new JLabel(""); - labelVerantwortlicher.setBounds(10, 272, 296, 14); - panel.add(labelVerantwortlicher); - - JLabel label = new JLabel("Weitere Ansprechpartner:"); - label.setBounds(10, 284, 130, 14); - panel.add(label); - - labelWeitereVerantwortliche = new JLabel(""); - labelWeitereVerantwortliche.setBounds(10, 297, 296, 14); - panel.add(labelWeitereVerantwortliche); - - labelUpdate = new JLabel(""); - labelUpdate.setBounds(10, 245, 296, 14); - panel.add(labelUpdate); - - JLabel lblLetztesUpdate = new JLabel("Letztes Update:"); - lblLetztesUpdate.setBounds(10, 231, 130, 14); - panel.add(lblLetztesUpdate); - - JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:"); - lblImageIstVorlage.setBounds(10, 336, 130, 14); - panel.add(lblImageIstVorlage); - - labelVorlage = new JLabel(""); - labelVorlage.setBounds(10, 350, 296, 14); - panel.add(labelVorlage); - - labelLizenzSoftware = new JLabel(""); - labelLizenzSoftware.setBounds(10, 383, 296, 14); - panel.add(labelLizenzSoftware); - - JLabel lblLizenzpflichtigeSoftware = new JLabel( - "Lizenzpflichtige Software:"); - lblLizenzpflichtigeSoftware.setBounds(10, 367, 130, 14); - panel.add(lblLizenzpflichtigeSoftware); - - JLabel lblInternet = new JLabel("Internetsperre vorhanden:"); - lblInternet.setBounds(10, 400, 130, 14); - panel.add(lblInternet); - - labelInternet = new JLabel(""); - labelInternet.setBounds(10, 417, 296, 14); - panel.add(labelInternet); - - JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:"); - lblEmpfehlungRam.setBounds(10, 432, 130, 14); - panel.add(lblEmpfehlungRam); - - labelRam = new JLabel(""); - labelRam.setBounds(10, 455, 296, 14); - panel.add(labelRam); - - JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:"); - lblEmpfehlungCpu.setBounds(10, 469, 130, 14); - panel.add(lblEmpfehlungCpu); - - labelCPU = new JLabel(""); - labelCPU.setBounds(10, 487, 296, 14); - panel.add(labelCPU); - - JLabel lblTechnischeDaten = new JLabel("Technische Daten:"); - lblTechnischeDaten.setBounds(10, 322, 296, 14); - panel.add(lblTechnischeDaten); - - JLabel lblId = new JLabel("ID:"); - lblId.setBounds(10, 23, 296, 14); - panel.add(lblId); - - labelID = new JLabel(""); - labelID.setBounds(10, 37, 296, 14); - panel.add(labelID); - - labelVersion = new JLabel(""); - labelVersion.setBounds(10, 73, 296, 14); - panel.add(labelVersion); - - JLabel lblVersion = new JLabel("Version:"); - lblVersion.setBounds(10, 57, 296, 14); - panel.add(lblVersion); - - JLabel lblBeschreibung = new JLabel("Beschreibung:"); - lblBeschreibung.setBounds(10, 119, 130, 14); - panel.add(lblBeschreibung); - - JScrollPane scrollPane = new JScrollPane(); - scrollPane.setBounds(10, 135, 296, 65); - panel.add(scrollPane); - - textAreadesc = new JTextArea(); - textAreadesc.setEditable(false); - textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); - textAreadesc.setLineWrap(true); - textAreadesc.setBackground(SystemColor.menu); - scrollPane.setViewportView(textAreadesc); - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - } - - // Initiale Beffuelung eines Table models - public DefaultTableModel initTableModel(DefaultTableModel model) { - List images; - try { - // Hole eine Liste der Images - images = client.getImageList(); - - Iterator i = images.iterator(); - SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); - int x = 0; - - while (i.hasNext()) { - // erzeuge Objekte fuer die Tabelle - Object[] obj = { images.get(x).getImageName(), - images.get(x).getLicenseRestriction(), - images.get(x).getOsName(), - images.get(x).getLectureName(), - images.get(x).getUserData(), - out.format(in.parse(images.get(x).updateTime)), - images.get(x).id, images.get(x).getVersion(), - images.get(x).getIsTemplate() }; - // Fuege diese Objekte der Tabelle hinzu - model.addRow(obj); - x++; - i.next(); - - } - - return model; - } catch (TException | ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane.showMessageDialog(null, - e1.getCause() + "\n" + e1.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - return model; - } - - public void writeImageData(String id, String version) { - try { - SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); - Map res = client.getImageData(id, version); - labelName.setText(res.get("name")); - labelOS.setText(res.get("os")); - labelUpdate.setText(out.format(in.parse(res.get("lastupdate")))); - labelVerantwortlicher.setText(res.get("owner") + " (" + res.get("mail") + ")"); - labelWeitereVerantwortliche.setText("Keine"); - if (res.get("template").equals("true")) { - labelVorlage.setText("Ja"); - } else { - labelVorlage.setText("Nein"); - } - if (res.get("license").equals("1")) { - labelLizenzSoftware.setText("Ja"); - } else { - labelLizenzSoftware.setText("Nein"); - } - if (res.get("internet").equals("1")) { - labelInternet.setText("Ja"); - } else { - labelInternet.setText("Nein"); - } - labelRam.setText(res.get("ram")); - labelCPU.setText(res.get("cpu")); - labelID.setText(res.get("id")); - labelVersion.setText(res.get("version")); - textAreadesc.setText(res.get("desc")); - } catch (TException | ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/intro/About_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/intro/About_GUI.java deleted file mode 100644 index a97a217b..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/intro/About_GUI.java +++ /dev/null @@ -1,97 +0,0 @@ -package gui.intro; - -import java.awt.Image; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JTextPane; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; - -import models.Version; - -import util.GuiOrganizer; - -@SuppressWarnings("serial") -public class About_GUI extends JFrame { - - private JPanel contentPane; - private JTextPane txtpnVersionVBuilddate; - - /** - * Create the frame. - */ - public About_GUI() { - // Fenster darf nicht vergroessert werden - setResizable(false); - - try { - // Setzt das Look and Feel auf System - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog(null, - e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", - JOptionPane.ERROR_MESSAGE); - } - // Titel des Fensters setzen - setTitle("Dozentenmodul - About"); - // Aktion die beim Schliessen durchgefuehrt werden soll - setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - // Groesse des Fensters definieren - setBounds(0, 0, 355, 309); - GuiOrganizer.centerGUI(this); - // Erzeugen eines Panels - contentPane = new JPanel(); - // Hintergrund Farbe des Panels setzen - contentPane.setBackground(SystemColor.menu); - // Rahmen des Fensters setzen - contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); - setContentPane(contentPane); - // Layout setzen - contentPane.setLayout(null); - // Label fuer das Logo erzeugen - JLabel imgLabel = new JLabel(); - // Groesse und Position des Logos festelegen - imgLabel.setBounds(30, 18, 294, 80); - // Pfadangabe des Logos - - ImageIcon icon = new ImageIcon(getClass().getResource( - "/img/Logo_bwLehrpool.png"), "Logo"); - // Skalierung des Logos - Image scaled = icon.getImage().getScaledInstance(270, 64, 0); - imgLabel.setIcon(new ImageIcon(scaled)); - // Hinzufuegen des Logos in das Fenster - contentPane.add(imgLabel); - - // Erzeugen, Hinzufuegen und definierung der Aktion des Buttons - JButton BtnClose = new JButton("Close"); - BtnClose.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - dispose(); - - }// end actionPerformed - }); - - BtnClose.setBounds(62, 226, 237, 23); - contentPane.add(BtnClose); - - txtpnVersionVBuilddate = new JTextPane(); - txtpnVersionVBuilddate - .setText("Version: "+Version.getVersion()+"\r\nBuild-Date: "+Version.getBuildDate()+"\r\n\r\nContact: michael.wilson@hs-offenburg.de\r\nWebsite: http://bwlehrpool.hs-offenburg.de/"); - txtpnVersionVBuilddate.setEditable(false); - txtpnVersionVBuilddate.setBackground(SystemColor.menu); - txtpnVersionVBuilddate.setBounds(62, 95, 224, 90); - contentPane.add(txtpnVersionVBuilddate); - }// end LoginGUI() -}// end class diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java deleted file mode 100644 index b11dc746..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java +++ /dev/null @@ -1,241 +0,0 @@ -package gui.intro; - - -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JSeparator; -import javax.swing.JTextArea; -import javax.swing.JTextPane; -import javax.swing.SwingConstants; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import models.Links; - -import org.ini4j.InvalidFileFormatException; -import org.ini4j.Wini; - -import util.GuiOrganizer; -import util.OpenLinks; - - - -@SuppressWarnings("serial") -public class BillOfRights_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - JButton fwdButton; - JCheckBox chckbxAkzeptieren; - - /** - * Create the dialog. - */ - public BillOfRights_GUI() { - setResizable(false); - - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - //Beendet das Programm beim Klick auf das X - System.exit(0); - } - }); - try { - //Setzt das Look & Feel auf das System - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - //Setzt den Fenstertitel - setTitle("bwLehrpool Suite"); - - //Zentiert das Fenster in der Bildschirmmitte - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 567, 60); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Hinweis"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie.setText("Bitte lesen und best\u00E4tigen Sie folgende rechtliche Hinweise"); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 22); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 95, 567, 485); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JTextArea txtrLoremIpsumDolor = new JTextArea(); - txtrLoremIpsumDolor.setWrapStyleWord(true); - txtrLoremIpsumDolor.setLineWrap(true); - txtrLoremIpsumDolor.setEditable(false); - JScrollPane scr=new JScrollPane(txtrLoremIpsumDolor); - scr.setBounds(0, 0, 567, 477); - txtrLoremIpsumDolor.setBounds(0, 0, 567, 477); - txtrLoremIpsumDolor.setText("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \r\n\r\nDuis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. \r\n\r\nUt wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. \r\n\r\nNam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. \r\n\r\nDuis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis. \r\n\r\nAt vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat. \r\n\r\nConsetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus. \r\n\r\nLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \r\n\r\nDuis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. \r\n\r\nUt wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. \r\n\r\nNam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo"); - - contentPanel.add(scr); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 630, 587, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - fwdButton = new JButton("Weiter"); - fwdButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - try { - Wini ini=new Wini(new File("C:\\Users\\"+System.getProperty("user.name")+"\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - ini.put("main", "BillOfRights",true); - ini.store(); - } catch (InvalidFileFormatException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane.showMessageDialog(null, - e1.getCause()+"\n"+e1.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } catch (IOException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane.showMessageDialog(null, - e1.getCause()+"\n"+e1.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } - VmWareLink_GUI ac=new VmWareLink_GUI(); - ac.setVisible(true); - dispose(); - } - }); - fwdButton.setEnabled(false); - - buttonPane.add(fwdButton); - } - } - { - JSeparator separator = new JSeparator(); - separator.setBounds(0, 617, 587, 2); - getContentPane().add(separator); - } - { - JSeparator separator = new JSeparator(); - separator.setBounds(0, 82, 587, 2); - getContentPane().add(separator); - } - - chckbxAkzeptieren = new JCheckBox("Ja, ich akzeptiere die Vereinbarung. Benachrichtigung nicht mehr anzeigen."); - chckbxAkzeptieren.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent arg0) { - //Beim Akzeptieren der Bestaetigung wird der Weiter-Button verfuegbar gemacht - if(chckbxAkzeptieren.isSelected()==true) - { - - fwdButton.setEnabled(true); - - } - else - { - - } - } - }); - chckbxAkzeptieren.setBackground(SystemColor.menu); - chckbxAkzeptieren.setBounds(10, 587, 567, 23); - getContentPane().add(chckbxAkzeptieren); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - mnNewMenu_1.setHorizontalAlignment(SwingConstants.CENTER); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/intro/Login_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/intro/Login_GUI.java deleted file mode 100644 index b27c7179..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/intro/Login_GUI.java +++ /dev/null @@ -1,434 +0,0 @@ -package gui.intro; - -import java.awt.Color; -import java.awt.EventQueue; -import java.awt.Image; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.io.File; -import java.io.IOException; - -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JPasswordField; -import javax.swing.JTextField; -import javax.swing.SwingConstants; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; - -import models.SessionData; -import models.person; - -import org.apache.thrift.TException; -import org.ini4j.InvalidFileFormatException; -import org.ini4j.Wini; - -import org.openslx.imagemaster.thrift.iface.ImageServer.Client; -import thrift.MasterThriftConnection; -import thrift.ThriftConnection; -import org.openslx.imagemaster.thrift.iface.UserInfo; -import util.GuiOrganizer; -import config.config_file; -import javax.swing.JCheckBox; - -@SuppressWarnings("serial") -public class Login_GUI extends JFrame { - - private JPanel contentPane; - private JTextField lblusername; - private JPasswordField lblpass; - JLabel lblConnectionInfo = new JLabel(""); - boolean isClientReturnedCorrectly = false; - boolean login; - String masterServerIP = MasterThriftConnection.MASTERSERVERIP; - MasterThriftConnection thrift; - Client client; - String token; - JCheckBox chckbxBenutzernameSpeichern; - - /** - * Launch the application. - */ - public static void main(String[] args) { - EventQueue.invokeLater(new Runnable() { - public void run() { - try { - // Pruefe und Erzeuge gegebenfalls Config - config_file cf = new config_file(); - boolean conf = cf.createConfig(); - if (conf == true) { - // Aufruf und Anzeige des Login Fensters - Login_GUI frame = new Login_GUI(); - frame.setVisible(true); - } else { - JOptionPane.showMessageDialog(null, - "Fehler beim erzeugen der Konfigurationsfile", - "Message", JOptionPane.ERROR_MESSAGE); - } - - } catch (Exception e) { - e.printStackTrace(); - JOptionPane.showMessageDialog(null, e.getStackTrace(), - "Message", JOptionPane.ERROR_MESSAGE); - } - } - }); - } - - /** - * Create the frame. - */ - public Login_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent e) { - System.exit(0); - } - }); - - // Fenster darf nicht vergroessert werden - setResizable(false); - - try { - // Setzt das Look and Feel auf System - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - // Titel des Fensters setzen - setTitle("bwLehrpool Suite"); - // Aktion die beim Schliessen durchgefuehrt werden soll - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - - //Größe setzen und mittig ausrichten - setBounds(0, 0, 603, 400); - GuiOrganizer.centerGUI(this); - - - - // Erzeugen eines Panels - contentPane = new JPanel(); - // Hintergrund Farbe des Panels setzen - contentPane.setBackground(SystemColor.menu); - // Rahmen des Fensters setzen - contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); - setContentPane(contentPane); - // Layout setzen - contentPane.setLayout(null); - // Label fuer das Logo erzeugen - JLabel imgLabel = new JLabel(); - // Groesse und Position des Logos festelegen - imgLabel.setBounds(150, 11, 350, 142); - // Pfadangabe des Logos - - ImageIcon icon = new ImageIcon(getClass().getResource( - "/img/Logo_bwLehrpool.png"), "Logo"); - // Skalierung des Logos - Image scaled = icon.getImage().getScaledInstance(270, 64, 0); - imgLabel.setIcon(new ImageIcon(scaled)); - // Hinzufuegen des Logos in das Fenster - contentPane.add(imgLabel); - - chckbxBenutzernameSpeichern = new JCheckBox("Benutzername speichern"); - chckbxBenutzernameSpeichern.setBounds(292, 222, 237, 23); - contentPane.add(chckbxBenutzernameSpeichern); - - // Erzeugen und Hinzufuegen des Labels - JLabel LabelUser = new JLabel("bwIDM-Benutzername:"); - LabelUser.setBounds(111, 164, 134, 20); - contentPane.add(LabelUser); - - // Erzeugen und Hinzufuegen des Passwortfeldes - lblpass = new JPasswordField(); - lblpass.setToolTipText("Bitte geben Sie Ihr bwIDM-Passwort ein."); - lblpass.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - performLogin(); - } - }); - lblpass.setBounds(292, 195, 237, 20); - contentPane.add(lblpass); - - // Erzeugen und Hinzufuegen des Textfeldes - lblusername = new JTextField(); - lblusername - .setToolTipText("Bitte geben Sie Ihren bwIDM-Benutzernamen ein."); - try { - Wini ini = new Wini( - new File( - "C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - if(ini.get("main", "Benutzername").isEmpty()){ - - }else{ - lblusername.setText(ini.get("main", "Benutzername").toString()); - - } - - if(ini.get("main", "Benutzername speichern", Boolean.class)==true){ - chckbxBenutzernameSpeichern.setSelected(true); - - } - } catch (InvalidFileFormatException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (IOException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - lblusername.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - performLogin(); - } - }); - lblusername.setBounds(292, 164, 237, 20); - contentPane.add(lblusername); - lblusername.setColumns(10); - - // Erzeugen und Hinzufuegen des Labels - JLabel LabelPass = new JLabel("bwIDM-Passwort:"); - LabelPass.setBounds(111, 195, 134, 20); - contentPane.add(LabelPass); - - lblConnectionInfo.setHorizontalAlignment(SwingConstants.LEFT); - lblConnectionInfo.setBounds(111, 290, 418, 20); - lblConnectionInfo.setEnabled(true); - lblConnectionInfo.setText("Info: Bereit f\u00FCr Login"); - - contentPane.add(lblConnectionInfo); - - // Erzeugen, Hinzufuegen und definierung der Aktion des Buttons - JButton BtnLogin = new JButton("Login"); - BtnLogin.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - - performLogin(); - }// end actionPerformed - }); - - BtnLogin.setBounds(292, 252, 237, 23); - contentPane.add(BtnLogin); - - - - - - - //GuiOrganizer.centerGUI(this); - }// end LoginGUI() - - // Versuche den Benutzer einzuloggen - public void performLogin() { - - login = false; - thrift = new MasterThriftConnection(); - client = thrift.getMasterThriftConnection(); - token = null; - org.openslx.imagemaster.thrift.iface.SessionData result = null; - - try { - - login = true; - String passText = new String(lblpass.getPassword()); - // check if client has received a connection with information or a - // null package - if (checkClientPackage() == true) { - - // package has information - //User-Info - - System.out.println("Authentifiziere - warte auf Masterserver"); - lblConnectionInfo.setForeground(Color.black); - - lblConnectionInfo.setText("Authentifiziere - warte auf Antwort von Server..."); - - result = client.authenticate(lblusername.getText(), passText); - - //User-Info - System.out.println("Authentifizierung erfolgreich"); - lblConnectionInfo.setForeground(Color.green); - lblConnectionInfo.setText("Authentifizierung erfolgreich"); - - //set Information - SessionData.session.setAuthToken(result.authToken); - SessionData.session.setSessionID(result.sessionId); - SessionData.session.setServerAdress(result.serverAddress); - - - //User-Info - lblConnectionInfo.setForeground(Color.black); - lblConnectionInfo.setText("Hole Verbindungsdaten von Server..."); - System.out.println("warte auf Masterserver"); - // set connection to bwLehrpoolSuiteServer - ThriftConnection bwthrift = new ThriftConnection(); - server.Server.Client bwClient = bwthrift.getThriftConnection(); - models.Client.clientcon.setClient(bwClient); - - //User-Info - System.out.println("Client macht weiter"); - System.out.println("Session-ID: " + result.sessionId - + "\nToken: " + result.authToken); - lblConnectionInfo.setForeground(Color.green); - lblConnectionInfo.setText("Daten erhalten."); - - if (login == true) { - //Daten speichern - if (SessionData.session.getAuthToken() == null) { - System.out.println("Token ist null"); - JOptionPane.showMessageDialog(null, - "Error: Token ist null", "Token defekt", - JOptionPane.ERROR_MESSAGE); - } - System.out.println("Arbeite ab jetzt mit Infos aus SessionData."); - UserInfo user = client.getUserFromToken(SessionData.session - .getAuthToken()); - - String hochschule = user.eMail.substring(user.eMail - .indexOf("@") + 1); - - person.verantwortlicher.setUsername(lblusername.getText() - .substring(0, lblusername.getText().indexOf("@"))); - person.verantwortlicher.setName(user.lastName); - person.verantwortlicher.setVorname(user.firstName); - person.verantwortlicher.setEMail(user.eMail); - person.verantwortlicher.setHochschule(hochschule); - - - //Sp�ter �ber result.getRole zum Beispiel die Rolle holen - person.verantwortlicher.setRole("Dozent"); - //person.verantwortlicher.setRole("Admin"); - //person.verantwortlicher.setRole("Student"); - //person.verantwortlicher.setRole("GetToTheChopper!"); - - - try { - // Lege config File an und entscheide welches Fenster - // als naechstes geoeffnet wird - Wini ini = new Wini( - new File( - "C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - if(lblusername.getText().equals(ini.get("main","Benutzername",String.class))==true){ - if(chckbxBenutzernameSpeichern.isSelected()){ - ini.put("main", "Benutzername", lblusername.getText()); - ini.put("main", "Benutzername speichern", true); - ini.store(); - } - else{ - ini.put("main", "Benutzername", ""); - ini.put("main", "Benutzername speichern", false); - ini.store(); - } - }else{ - - if(chckbxBenutzernameSpeichern.isSelected()){ - ini.put("main", "Benutzername", lblusername.getText()); - ini.put("main", "Benutzername speichern", true); - ini.put("main", "BillOfRights",false); - ini.put("main", "vmware",false); - ini.store(); - } - else{ - ini.put("main", "Benutzername", ""); - ini.put("main", "Benutzername speichern", false); - ini.put("main", "BillOfRights",false); - ini.put("main", "vmware",false); - ini.store(); - } - } - - // Pruefe ob Bills Of Rights schon akzeptiert wurden, - // wenn - // nicht zeige diese an - if (ini.get("main", "BillOfRights", boolean.class) == false) { - // Erstellen einer Instanz der Aktionsauswahl - BillOfRights_GUI re = new BillOfRights_GUI(); - re.setVisible(true); - // Schliessen des Fensters nach erfolgreichen Login - setVisible(false); - } else { - // Pruefe ob die Links zu vmware angezeigt werden - // sollen - if (ini.get("main", "vmware", boolean.class) == false) { - VmWareLink_GUI vm = new VmWareLink_GUI(); - vm.setVisible(true); - setVisible(false); - } else { - - // oeffne das Hauptmenue - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - setVisible(false); - } - } - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - - } - - } else { - JOptionPane.showMessageDialog(null, "Login denied!", - "Message", JOptionPane.INFORMATION_MESSAGE); - } - - } else { - // package from server is null - login = false; - lblConnectionInfo.setForeground(Color.red); - lblConnectionInfo - .setText("Fehler: Client nicht mit Server verbunden."); - - } - - } catch (org.openslx.imagemaster.thrift.iface.AuthenticationException e) { - lblConnectionInfo.setForeground(Color.red); - lblConnectionInfo - .setText("Fehler: Falscher Benutzername oder Passwort."); - System.out - .println("Authentifizierung fehlgeschlagen: " + e.message); - JOptionPane - .showMessageDialog( - null, - "Benutzeranmeldung fehlgeschlagen: Bitte Benutzername und Passwort \u00fcberpr\u00fcfen.", - "Anmeldung fehlgeschlagen", - JOptionPane.ERROR_MESSAGE); - e.printStackTrace(); - return; - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - - } - }// end performLogin - - public boolean checkClientPackage() { - // check if client is null or has been returned with information - System.out.println("Prüfe Eingangsdaten"); - if (client != null) { - // client contains information - isClientReturnedCorrectly = true; - System.out.println("Verbindungsdaten erhalten"); - } else { - // client has returned with error - isClientReturnedCorrectly = false; - System.out - .println("Fehler: Keine korrekten Verbindungsdaten erhalten."); - } - - return isClientReturnedCorrectly; - }// end checkServerConnection() -}// end class diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java deleted file mode 100644 index a14525f0..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java +++ /dev/null @@ -1,606 +0,0 @@ -package gui.intro; - -import gui.image.CreateImageAllgemein_GUI; -import gui.image.DeleteImage_GUI; -import gui.image.SearchEditImage_GUI; -import gui.image.SearchImage_GUI; -import gui.lecture.CreateLectureAllgemein_GUI; -import gui.lecture.DeleteLecture_GUI; -import gui.lecture.EditLectureSearch_GUI; -import gui.lecture.SearchLecture_GUI; - -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.ScrollPane; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.ButtonGroup; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JSeparator; -import javax.swing.JTextArea; -import javax.swing.JTextPane; -import javax.swing.SwingConstants; -import javax.swing.ToolTipManager; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; - -import models.ImageRights; -import models.Links; -import models.SessionData; -import models.person; -import util.GuiOrganizer; -import util.OpenLinks; - -@SuppressWarnings("serial") -public class MainMenue_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - String descNewImage, descEditImage, descDeleteImage, descSearchImage, - descNewLecture, descEditLecture, descDeleteLecture, - descSearchLecture = ""; - JRadioButton rdbtnImageNew; - JRadioButton rdbtnImageEdit; - JRadioButton rdbtnImageSearchDownload; - JRadioButton rdbtnLectureNew; - JRadioButton rdbtnImageDelete; - JRadioButton rdbtnLectureEdit; - JRadioButton rdbtnLectureDelete; - JRadioButton rdbtnLectureSearch; - private final ButtonGroup buttonGroup = new ButtonGroup(); - private JMenuItem mntmAbout; - - // for testing - ImageRights imageRights = new ImageRights(); - - /** - * Create the dialog. - */ - public MainMenue_GUI() { - - // Leerzeile auf Konsole bei Rueckkehr ins Hauptmenue fuer leichteres - // Lesen - System.out.println("\n"); - - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - System.exit(0); - } - }); - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - setTitle("bwLehrpool Suite - Connected Server: " - + SessionData.session.getServerAdress()); - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 567, 69); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Hauptmen\u00FC"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("Bitte w\u00E4hlen Sie ihre gew\u00FCnschte Aktion."); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 22); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 104, 567, 502); - contentPanel.setBackground(SystemColor.menu); - - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panelImage = new JPanel(); - panelImage.setBackground(SystemColor.menu); - panelImage.setBorder(new TitledBorder(null, "Image", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panelImage.setBounds(10, 221, 270, 133); - contentPanel.add(panelImage); - panelImage.setLayout(null); - - rdbtnImageNew = new JRadioButton("Neu"); - rdbtnImageNew - .setToolTipText("Hier k\u00F6nnen Sie eine standard Laborvorlage downloaden"); - rdbtnImageNew.setBounds(20, 22, 159, 23); - panelImage.add(rdbtnImageNew); - buttonGroup.add(rdbtnImageNew); - rdbtnImageNew.setBackground(SystemColor.menu); - - rdbtnImageEdit = new JRadioButton("Bearbeiten"); - rdbtnImageEdit - .setToolTipText("Hier k\u00F6nnen Sie ein bestehendes Labor zum ver\u00E4ndern downloaden"); - rdbtnImageEdit.setBounds(20, 48, 185, 23); - panelImage.add(rdbtnImageEdit); - buttonGroup.add(rdbtnImageEdit); - rdbtnImageEdit.setHorizontalAlignment(SwingConstants.LEFT); - rdbtnImageEdit.setBackground(SystemColor.menu); - - rdbtnImageDelete = new JRadioButton("L\u00F6schen"); - rdbtnImageDelete.setEnabled(true); - buttonGroup.add(rdbtnImageDelete); - rdbtnImageDelete - .setToolTipText("Hier k\u00F6nnen Sie ein bestehendes Labor zum ver\u00E4ndern downloaden"); - rdbtnImageDelete.setHorizontalAlignment(SwingConstants.LEFT); - rdbtnImageDelete.setBackground(SystemColor.menu); - rdbtnImageDelete.setBounds(20, 74, 185, 23); - panelImage.add(rdbtnImageDelete); - - rdbtnImageSearchDownload = new JRadioButton("Suche und Download"); - buttonGroup.add(rdbtnImageSearchDownload); - rdbtnImageSearchDownload - .setToolTipText("Hier k\u00F6nnen Sie ein bestehendes Labor zum ver\u00E4ndern downloaden"); - rdbtnImageSearchDownload.setHorizontalAlignment(SwingConstants.LEFT); - rdbtnImageSearchDownload.setBackground(SystemColor.menu); - rdbtnImageSearchDownload.setBounds(20, 100, 185, 23); - panelImage.add(rdbtnImageSearchDownload); - - JPanel panelDesc = new JPanel(); - panelDesc.setLayout(null); - panelDesc.setBorder(new TitledBorder(UIManager - .getBorder("TitledBorder.border"), "Erkl\u00e4rung", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panelDesc.setBackground(SystemColor.menu); - panelDesc.setBounds(10, 364, 270, 133); - contentPanel.add(panelDesc); - - ScrollPane scrollPaneDesc = new ScrollPane(); - scrollPaneDesc.setBounds(10, 15, 250, 110); - final JTextArea txtDesc = new JTextArea(); - txtDesc.setEditable(false); - txtDesc.setBounds(280, 211, 10, 10); - txtDesc.setLineWrap(true); - txtDesc.setWrapStyleWord(true); - txtDesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); - txtDesc.setBackground(SystemColor.menu); - scrollPaneDesc.add(txtDesc); - // Pro AUswahl - txtDesc.setText("Legen Sie ein neues Image an und laden Sie anschlie\u00dfend die passende .vmdk-Datei hoch. Ein Image (wenn auch von einem anderen Dozenten) ist die Voraussetzung f\u00fcr eine Veranstaltung."); - panelDesc.add(scrollPaneDesc); - - JPanel panelVeranstaltung = new JPanel(); - panelVeranstaltung.setLayout(null); - panelVeranstaltung.setBorder(new TitledBorder(UIManager - .getBorder("TitledBorder.border"), "Veranstaltung (VMChooser)", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panelVeranstaltung.setBackground(SystemColor.menu); - panelVeranstaltung.setBounds(290, 221, 270, 133); - contentPanel.add(panelVeranstaltung); - - rdbtnLectureNew = new JRadioButton("Neu"); - buttonGroup.add(rdbtnLectureNew); - rdbtnLectureNew - .setToolTipText("Hier k\u00F6nnen Sie Ihre Labordaten eingeben"); - rdbtnLectureNew.setBounds(20, 24, 185, 23); - panelVeranstaltung.add(rdbtnLectureNew); - rdbtnLectureNew.setBackground(SystemColor.menu); - - rdbtnLectureEdit = new JRadioButton("Bearbeiten"); - rdbtnLectureEdit - .setToolTipText("Hier k\u00F6nnen Sie einen Link auf ein bestehendes Labor erzeugen"); - rdbtnLectureEdit.setBounds(20, 50, 230, 23); - panelVeranstaltung.add(rdbtnLectureEdit); - buttonGroup.add(rdbtnLectureEdit); - rdbtnLectureEdit.setBackground(SystemColor.menu); - - rdbtnLectureDelete = new JRadioButton("L\u00F6schen"); - rdbtnLectureDelete - .setToolTipText("Hier k\u00F6nnen Sie ein Labor l\u00F6schen"); - rdbtnLectureDelete.setBounds(20, 76, 175, 23); - panelVeranstaltung.add(rdbtnLectureDelete); - buttonGroup.add(rdbtnLectureDelete); - rdbtnLectureDelete.setBackground(SystemColor.menu); - - rdbtnLectureSearch = new JRadioButton("Suche"); - buttonGroup.add(rdbtnLectureSearch); - rdbtnLectureSearch - .setToolTipText("Hier k\u00F6nnen Sie ein Labor l\u00F6schen"); - rdbtnLectureSearch.setBackground(SystemColor.menu); - rdbtnLectureSearch.setBounds(20, 102, 175, 23); - panelVeranstaltung.add(rdbtnLectureSearch); - - JPanel panelNews = new JPanel(); - panelNews.setLayout(null); - panelNews.setBorder(new TitledBorder(UIManager - .getBorder("TitledBorder.border"), "News", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panelNews.setBackground(SystemColor.menu); - panelNews.setBounds(290, 364, 270, 133); - contentPanel.add(panelNews); - - ScrollPane scrollPaneNews = new ScrollPane(); - scrollPaneNews.setBounds(10, 15, 250, 110); - JTextArea txtNews = new JTextArea(); - txtNews.setEditable(false); - txtNews.setFont(new Font("Tahoma", Font.PLAIN, 11)); - txtNews.setBackground(SystemColor.menu); - txtNews.setWrapStyleWord(true); - txtNews.setLineWrap(true); - txtNews.setText("Hier werden mal die Neuigkeiten stehen. Diese kommen direkt vom Satelliten und sind HS-spezifisch."); - scrollPaneNews.add(txtNews); - panelNews.add(scrollPaneNews); - - /* - * Ber\u00fccksichtigen der Rechte für GUI - */ - // set the rights for this user - setRoleRights(); - processRights(); - setCorrectRadioButton(); - - /* - * Funktion Texte f\u00fcr das Klicken der RadioButtons - */ - rdbtnImageNew.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - descNewImage = "Legen Sie ein neues Image an und laden Sie anschlie\u00dfend die passende .vmdk-Datei hoch. Ein Image (wenn auch von einem anderen Dozenten) ist die Voraussetzung f\u00fcr eine Veranstaltung."; - txtDesc.setText(descNewImage); - } - }); - rdbtnImageEdit.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - descEditImage = "Bearbeiten Sie die hinterlegten Informationen zu einem Image oder laden Sie eine neue .vmdk-Datei hoch."; - txtDesc.setText(descEditImage); - } - }); - rdbtnImageDelete.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - descDeleteImage = "Suchen Sie alte und nicht mehr ben\u00f6tigte Images und l\u00f6schen Sie diese."; - txtDesc.setText(descDeleteImage); - } - }); - rdbtnImageSearchDownload.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - descSearchImage = "Suchen Sie nach bestimmten Images oder verschaffen Sie sich einen \u00fcberblick \u00fcber alle verf\u00fcgbaren Images. Sie k\u00f6nnen gew\u00fcnschte Images umgehend herunterladen."; - txtDesc.setText(descSearchImage); - } - }); - rdbtnLectureNew.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - descNewLecture = "Legen Sie eine neue Veranstaltung an und verkn\u00fcpfen Sie diese mit einem bereits vorhandenem Image. Ihre neue Veranstaltung kann auch auf dem Image eines anderen Dozenten beruhen."; - txtDesc.setText(descNewLecture); - } - }); - rdbtnLectureEdit.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - descEditLecture = "Bearbeiten Sie die hinterlegten Informationen zu einer Veranstaltung."; - txtDesc.setText(descEditLecture); - } - }); - rdbtnLectureDelete.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - descDeleteLecture = "Suchen und l\u00f6schen Sie eine Veranstaltung. Das hiermit verbundene Image bleibt erhalten."; - txtDesc.setText(descDeleteLecture); - } - }); - rdbtnLectureSearch.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - descSearchLecture = "Suchen Sie nach bestimmten Veranstaltungen oder verschaffen Sie sich einen \u00fcberblick \u00fcber alle verf\u00fcgbaren Veranstaltungen. Eventuell gibt es bereits etwas passendes f\u00fcr Ihre Vorlesung."; - txtDesc.setText(descSearchLecture); - } - }); - /* - * Ende der Radiobuttons - */ - - JLabel lblGrafik = new JLabel(""); - // ToolTipp fuer Grafik - lblGrafik - .setToolTipText("" - + "Ein virtuelles Labor besteht immer aus den beiden Komponenten
" - + "Image und Veranstaltung. Ein Image ist dabei die Grundlage f\u00FCr
" - + "mehrere Veranstaltungen. Somit kann eine neue Veranstaltung
" - + "erstellt werden, ohne ein neues Image hochladen zu m\u00FCssen.


" - + "Image: Das Image enth\u00E4lt die ben\u00F6tigte Software, die im
" - + "virtuellen Labor ben\u00F6tigt wird. Es wird von genau einem Dozenten
" - + "angelegt und besitzt einen allgemeinen Namen, z.B. \"Programmieren\".
" - + "Bei einem Image handelt es sich um eine Datei vom Typ VMDK.


" - + "Veranstaltung: Es k\u00F6nnen nun, basierend auf einem Image,
" - + " beliebig viele Veranstaltungen von unterschiedlichen Dozenten erstellt
" - + "werden. Diese k\u00F6nnten z.B. konkret \"Web-Entwicklung\" oder \"K\u00FCnstliche
" - + "Intelligenz\" lauten und referenzieren dabei auf das allgemeine Image
" - + "\"Programmieren\"."); - lblGrafik.setIcon(new ImageIcon(MainMenue_GUI.class - .getResource("/img/e4_n_imgs2_bwl_vmc_v2.png"))); - - // ToolTipp lange anzeigen - 60sec - ToolTipManager.sharedInstance().setDismissDelay(60000); - ToolTipManager.sharedInstance().registerComponent(lblGrafik); - lblGrafik.setBounds(10, -12, 547, 189); - contentPanel.add(lblGrafik); - - JTextPane txtpnUmDetaillierteInformationen = new JTextPane(); - txtpnUmDetaillierteInformationen - .setText("Um detaillierte Informationen zu erhalten, fahren Sie bitte mit der Maus \u00FCber die Grafik."); - txtpnUmDetaillierteInformationen.setEditable(false); - txtpnUmDetaillierteInformationen.setBackground(SystemColor.menu); - txtpnUmDetaillierteInformationen.setBounds(10, 188, 509, 22); - contentPanel.add(txtpnUmDetaillierteInformationen); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 630, 587, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton continueButton = new JButton("Weiter"); - - continueButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - // Images - if (rdbtnImageNew.isSelected() == true) { - CreateImageAllgemein_GUI sr = new CreateImageAllgemein_GUI(); - sr.setVisible(true); - dispose(); - } else if (rdbtnImageEdit.isSelected() == true) { - SearchEditImage_GUI si = new SearchEditImage_GUI(); - si.setVisible(true); - dispose(); - } else if (rdbtnImageDelete.isSelected() == true) { - DeleteImage_GUI di = new DeleteImage_GUI(); - di.setVisible(true); - dispose(); - } else if (rdbtnImageSearchDownload.isSelected() == true) { - // SearchMethodLecture_GUI sm = new - // SearchMethodLecture_GUI(); - SearchImage_GUI si = new SearchImage_GUI(); - si.setVisible(true); - dispose(); - // Lectures - } else if (rdbtnLectureNew.isSelected() == true) { - CreateLectureAllgemein_GUI av = new CreateLectureAllgemein_GUI(); - av.setVisible(true); - dispose(); - } else if (rdbtnLectureEdit.isSelected() == true) { - EditLectureSearch_GUI el = new EditLectureSearch_GUI(); - el.setVisible(true); - dispose(); - } else if (rdbtnLectureDelete.isSelected() == true) { - DeleteLecture_GUI dl = new DeleteLecture_GUI(); - dl.setVisible(true); - dispose(); - } else if (rdbtnLectureSearch.isSelected() == true) { - SearchLecture_GUI sl = new SearchLecture_GUI(); - sl.setVisible(true); - dispose(); - } else - JOptionPane.showMessageDialog(null, - "Keine Auswahl getroffen.", - "Auswahl fehlt", JOptionPane.ERROR_MESSAGE); - } - }); - continueButton.setActionCommand("OK"); - buttonPane.add(continueButton); - getRootPane().setDefaultButton(continueButton); - } - } - { - JSeparator separator = new JSeparator(); - separator.setBounds(0, 617, 587, 2); - getContentPane().add(separator); - } - { - JSeparator separator = new JSeparator(); - separator.setBounds(0, 91, 587, 2); - getContentPane().add(separator); - } - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - OpenLinks open = new OpenLinks(); - URI windows; - try { - windows = new URI(Links.getFAQ()); - open.openWebpage(windows); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - OpenLinks open = new OpenLinks(); - URI windows; - try { - windows = new URI(Links.getOTRS()); - open.openWebpage(windows); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmOtrs); - - mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - }// end main - - private void processRights() { - - /* - * Legt anhand der Rolle fest, welche Operationen der user machen darf. - * Rolle kommt vom Masterserver - */ - - // Image - if (person.verantwortlicher.getRole().equals("Student")) { - rdbtnImageNew.setEnabled(false); - rdbtnImageEdit.setEnabled(false); - rdbtnImageDelete.setEnabled(false); - rdbtnImageSearchDownload.setEnabled(true); - } else if (person.verantwortlicher.getRole().equals("Dozent") - || person.verantwortlicher.getRole().equals("Admin")) { - rdbtnImageNew.setEnabled(true); - rdbtnImageEdit.setEnabled(true); - rdbtnImageDelete.setEnabled(true); - rdbtnImageSearchDownload.setEnabled(true); - } else { - rdbtnImageNew.setEnabled(false); - rdbtnImageEdit.setEnabled(false); - rdbtnImageDelete.setEnabled(false); - rdbtnImageSearchDownload.setEnabled(false); - } - - // Veranstaltung - if (person.verantwortlicher.getRole().equals("Student")) { - rdbtnLectureNew.setEnabled(false); - rdbtnLectureEdit.setEnabled(false); - rdbtnLectureDelete.setEnabled(false); - rdbtnLectureSearch.setEnabled(true); - } else if (person.verantwortlicher.getRole().equals("Dozent") - || person.verantwortlicher.getRole().equals("Admin")) { - rdbtnLectureNew.setEnabled(true); - rdbtnLectureEdit.setEnabled(true); - rdbtnLectureDelete.setEnabled(true); - rdbtnLectureSearch.setEnabled(true); - } else { - rdbtnLectureNew.setEnabled(false); - rdbtnLectureEdit.setEnabled(false); - rdbtnLectureDelete.setEnabled(false); - rdbtnLectureSearch.setEnabled(false); - } - - }// end processRights() - - public void setRoleRights() { - // Set rights for user, depending on the role that is returned by the - // masterserver - - System.out.println("Ihre Rolle ist nun: " - + person.verantwortlicher.getRole()); - // role==Student - if (person.verantwortlicher.getRole().equals("Student")) { - ImageRights.rights.setRead(1); - ImageRights.rights.setWrite(0); - ImageRights.rights.setChangePermission(0); - ImageRights.rights.setAdmin(0); - ImageRights.rights.setLinkAllowed(0); - System.out.println("Rechte (r,w,cp,a,la): " - + ImageRights.rights.getRead() + "," - + ImageRights.rights.getWrite() + "," - + ImageRights.rights.getChangePermission() + "," - + ImageRights.rights.getAdmin() + "," - + ImageRights.rights.getLinkAllowed()); - - } else if (person.verantwortlicher.getRole().equals("Dozent")) { // role==Dozent - ImageRights.rights.setRead(1); - ImageRights.rights.setWrite(1); - ImageRights.rights.setChangePermission(0); - ImageRights.rights.setAdmin(0); - ImageRights.rights.setLinkAllowed(1); - System.out.println("Rechte (r,w,cp,a,la): " - + ImageRights.rights.getRead() + "," - + ImageRights.rights.getWrite() + "," - + ImageRights.rights.getChangePermission() + "," - + ImageRights.rights.getAdmin() + "," - + ImageRights.rights.getLinkAllowed()); - } else if (person.verantwortlicher.getRole().equals("Admin")) { // role==Admin - ImageRights.rights.setRead(1); - ImageRights.rights.setWrite(1); - ImageRights.rights.setChangePermission(1); - ImageRights.rights.setAdmin(1); - ImageRights.rights.setLinkAllowed(1); - System.out.println("Rechte (r,w,cp,a,la): " - + ImageRights.rights.getRead() + "," - + ImageRights.rights.getWrite() + "," - + ImageRights.rights.getChangePermission() + "," - + ImageRights.rights.getAdmin() + "," - + ImageRights.rights.getLinkAllowed()); - } else { // role==Nothing - ImageRights.rights.setRead(0); - ImageRights.rights.setWrite(0); - ImageRights.rights.setChangePermission(0); - ImageRights.rights.setAdmin(0); - ImageRights.rights.setLinkAllowed(0); - System.out.println("Rechte (r,w,cp,a,la): " - + ImageRights.rights.getRead() + "," - + ImageRights.rights.getWrite() + "," - + ImageRights.rights.getChangePermission() + "," - + ImageRights.rights.getAdmin() + "," - + ImageRights.rights.getLinkAllowed()); - }// end if else - }// end setRoleRights - - public void setCorrectRadioButton() { - // get the first enabled RadioButton depending on role an rights. Start - // at top - - if (rdbtnImageNew.isEnabled() == true) { - rdbtnImageNew.setSelected(true); - } else if (rdbtnImageEdit.isEnabled() == true) { - rdbtnImageEdit.setSelected(true); - } else if (rdbtnImageDelete.isEnabled() == true) { - rdbtnImageDelete.setSelected(true); - } else if (rdbtnImageSearchDownload.isEnabled() == true) { - rdbtnImageSearchDownload.setSelected(true); - } else if (rdbtnLectureNew.isEnabled() == true) { - rdbtnLectureNew.setSelected(true); - } else if (rdbtnLectureEdit.isEnabled() == true) { - rdbtnLectureEdit.setSelected(true); - } else if (rdbtnLectureDelete.isEnabled() == true) { - rdbtnLectureDelete.setSelected(true); - } else if (rdbtnLectureSearch.isEnabled() == true) { - rdbtnLectureSearch.setSelected(true); - } - - }// end setCorrectRadioButton() -}// end class diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java deleted file mode 100644 index d5350fbd..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java +++ /dev/null @@ -1,274 +0,0 @@ -package gui.intro; - - -import java.awt.Desktop; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JSeparator; -import javax.swing.JTextPane; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import models.Links; - -import org.ini4j.InvalidFileFormatException; -import org.ini4j.Wini; - -import util.GuiOrganizer; -import util.OpenLinks; - - -@SuppressWarnings("serial") -public class VmWareLink_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - JCheckBox chckbxNewCheckBox; - private JButton btnWindows; - - - /** - * Create the dialog. - */ - public VmWareLink_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent e) { - System.exit(0); - } - }); - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - setTitle("bwLehrpool Suite"); - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBounds(0, 0, 577, 80); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Hinweis VMWare Player"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 42); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 104, 567, 502); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JTextPane txtpnUmIhreVmdk = new JTextPane(); - txtpnUmIhreVmdk.setBackground(SystemColor.menu); - txtpnUmIhreVmdk.setEditable(false); - txtpnUmIhreVmdk.setText("F\u00FCr die Arbeit mit der bwLehrpool Suite wird zwingend ein VMWare Player ben\u00F6tigt. Diesen k\u00F6nnen Sie sich unter folgendem Link kostenfrei downloaden."); - txtpnUmIhreVmdk.setBounds(10, 16, 499, 66); - contentPanel.add(txtpnUmIhreVmdk); - - JLabel lblNewLabel_1 = new JLabel("Windows: "); - lblNewLabel_1.setBounds(10, 93, 499, 14); - contentPanel.add(lblNewLabel_1); - - chckbxNewCheckBox = new JCheckBox("Diese Benachrichtigung nicht mehr anzeigen."); - chckbxNewCheckBox.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent arg0) { - if(chckbxNewCheckBox.isSelected()==true) - { - try { - Wini ini=new Wini(new File("C:\\Users\\"+System.getProperty("user.name")+"\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - ini.put("main", "vmware",true); - ini.store(); - } catch (InvalidFileFormatException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane.showMessageDialog(null, - e1.getCause()+"\n"+e1.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } catch (IOException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane.showMessageDialog(null, - e1.getCause()+"\n"+e1.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } - } - } - }); - chckbxNewCheckBox.setBounds(6, 472, 555, 23); - contentPanel.add(chckbxNewCheckBox); - - JLabel lbllinuxvmwarePlayer = new JLabel("Linux: "); - lbllinuxvmwarePlayer.setBounds(10, 178, 499, 14); - contentPanel.add(lbllinuxvmwarePlayer); - - btnWindows = new JButton("VMware Player herunterladen"); - btnWindows.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - try { - - OpenLinks open = new OpenLinks(); - - URI windows= new URI(Links.getUriWindows()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - btnWindows.setBounds(10, 119, 186, 23); - contentPanel.add(btnWindows); - - JButton btnLinux = new JButton("VMware Player herunterladen"); - btnLinux.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - try { - OpenLinks open = new OpenLinks(); - - URI linux= new URI(Links.getUriLinux()); - - open.openWebpage(linux); - - } catch (URISyntaxException f) { - // TODO Auto-generated catch block - f.printStackTrace(); - } - } - }); - btnLinux.setBounds(10, 203, 186, 23); - contentPanel.add(btnLinux); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 630, 587, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton cancelButton = new JButton("Weiter"); - cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - MainMenue_GUI ea=new MainMenue_GUI(); - ea.setVisible(true); - dispose(); - } - }); - cancelButton.setActionCommand("Cancel"); - buttonPane.add(cancelButton); - } - } - { - JSeparator separator = new JSeparator(); - separator.setBounds(0, 617, 587, 2); - getContentPane().add(separator); - } - { - JSeparator separator = new JSeparator(); - separator.setBounds(0, 91, 587, 2); - getContentPane().add(separator); - } - { - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - { - JMenu mnHilfe = new JMenu("Hilfe"); - menuBar.add(mnHilfe); - { - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - - mnHilfe.add(mntmFaq); - } - { - JMenuItem mntmOTRS = new JMenuItem("OTRS"); - mntmOTRS.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - - mnHilfe.add(mntmOTRS); - } - } - } - - - - }//end constructor - - - -}// end class diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java deleted file mode 100644 index 76bf3933..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java +++ /dev/null @@ -1,579 +0,0 @@ -package gui.lecture; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.ScrollPane; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; - -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JSeparator; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; - -import models.Image; -import models.Lecture; -import models.Links; -import models.person; -import util.GuiOrganizer; -import util.OpenLinks; - -import com.toedter.calendar.JDateChooser; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; - -@SuppressWarnings("serial") -public class CreateLectureAllgemein_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - private JTextField Vorname; - private JTextField Nachname; - private JTextField Hochschule; - private JTextField EMail; - private JTextField txtFldVeranstaltungsname; - JTextArea description; - JRadioButton radioButtonyes; - JRadioButton radioButtonno; - JDateChooser dateChooserend; - JDateChooser dateChooserstart; - Date startDate = new Date(); - Date endDate; - private boolean descriptionLengthOK = false; // description may not be - // longer than - // MAX_DESCRIPTION_LENGTH - private final int MAX_DESCRIPTION_LENGTH = 254; - - int maxLifeTime = 180; // Anzahl Tage, die eine Veranstaltung in der Zukunft - // aktiv sein darf - boolean isDateOrderCorrect, isDateMaxLifeTimeCorrect, - isAllInformationReady = false; - - /** - * Create the dialog. - */ - public CreateLectureAllgemein_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - System.exit(0); - } - - @Override - public void windowOpened(WindowEvent arg0) { - txtFldVeranstaltungsname.requestFocusInWindow(); - } - }); - setResizable(false); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - setTitle("bwLehrpool Suite - Veranstaltung erzeugen"); - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Eingabe Ihrer Daten"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an"); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 21); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 493); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 331, 557, 162); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JLabel label = new JLabel("Vorname: *"); - label.setBackground(SystemColor.menu); - label.setBounds(10, 33, 125, 20); - panel_1.add(label); - - Vorname = new JTextField(); - Vorname.setEditable(false); - Vorname.setEnabled(false); - Vorname.setText(person.verantwortlicher.getVorname()); - Vorname.setBackground(Color.WHITE); - Vorname.setColumns(10); - Vorname.setBounds(145, 33, 350, 20); - panel_1.add(Vorname); - - JLabel label_7 = new JLabel("Nachname: *"); - label_7.setBackground(SystemColor.menu); - label_7.setBounds(10, 64, 125, 20); - panel_1.add(label_7); - - Nachname = new JTextField(); - Nachname.setEnabled(false); - Nachname.setEditable(false); - Nachname.setText(person.verantwortlicher.getName()); - Nachname.setBackground(Color.WHITE); - Nachname.setColumns(10); - Nachname.setBounds(145, 64, 350, 20); - panel_1.add(Nachname); - - JLabel label_8 = new JLabel("Hochschule: *"); - label_8.setBackground(SystemColor.menu); - label_8.setBounds(10, 95, 125, 20); - panel_1.add(label_8); - - Hochschule = new JTextField(); - Hochschule.setEnabled(false); - Hochschule.setEditable(false); - Hochschule.setText(person.verantwortlicher.getHochschule()); - Hochschule.setBackground(Color.WHITE); - Hochschule.setColumns(10); - Hochschule.setBounds(145, 95, 350, 20); - panel_1.add(Hochschule); - - JLabel label_9 = new JLabel("E-Mail: *"); - label_9.setBackground(SystemColor.menu); - label_9.setBounds(10, 126, 125, 20); - panel_1.add(label_9); - - EMail = new JTextField(); - EMail.setEnabled(false); - EMail.setEditable(false); - EMail.setText(person.verantwortlicher.getEMail()); - EMail.setBackground(Color.WHITE); - EMail.setColumns(10); - EMail.setBounds(145, 126, 350, 20); - panel_1.add(EMail); - - JPanel panel = new JPanel(); - panel.setBounds(10, 402, 577, 33); - contentPanel.add(panel); - panel.setLayout(null); - panel.setBorder(new EmptyBorder(5, 5, 5, 5)); - panel.setBackground(SystemColor.menu); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - - CreateLectureAllgemein_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Veranstaltung"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 70, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(161, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Neu"); - lblNewLabel_1.setBounds(174, 11, 46, 14); - contentPanel.add(lblNewLabel_1); - - JPanel panel_2 = new JPanel(); - panel_2.setLayout(null); - panel_2.setBorder(new TitledBorder(null, "Veranstaltungsdaten", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_2.setBackground(SystemColor.menu); - panel_2.setBounds(10, 36, 557, 284); - contentPanel.add(panel_2); - - JLabel lblAnzeigename = new JLabel("Anzeigename: *"); - lblAnzeigename.setBounds(10, 25, 180, 14); - panel_2.add(lblAnzeigename); - - txtFldVeranstaltungsname = new JTextField(); - txtFldVeranstaltungsname.setColumns(10); - txtFldVeranstaltungsname.setBounds(200, 22, 347, 20); - txtFldVeranstaltungsname.setText(Lecture.lecture.getName()); - panel_2.add(txtFldVeranstaltungsname); - - JTextArea textArea = new JTextArea(); - textArea.setEditable(false); - textArea.setWrapStyleWord(true); - textArea.setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an. Dieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\""); - textArea.setLineWrap(true); - textArea.setFont(new Font("Tahoma", Font.PLAIN, 12)); - textArea.setBackground(SystemColor.menu); - textArea.setBounds(10, 49, 537, 49); - panel_2.add(textArea); - - JLabel lblDesc = new JLabel("Beschreibung: *"); - lblDesc.setBounds(10, 111, 180, 14); - panel_2.add(lblDesc); - - ScrollPane scrollPane = new ScrollPane(); - scrollPane.setBounds(200, 104, 347, 78); - panel_2.add(scrollPane); - description = new JTextArea(); - description.setFont(new Font("Tahoma", Font.PLAIN, 11)); - description.setLineWrap(true); - description.setText(Lecture.lecture.getDesc()); - scrollPane.add(description); - description.setBounds(0, 0, 4, 22); - scrollPane.add(description); - dateChooserstart = new JDateChooser(); - dateChooserstart - .addPropertyChangeListener(new PropertyChangeListener() { - public void propertyChange(PropertyChangeEvent arg0) { - endDate = addDays(dateChooserstart.getDate(), - maxLifeTime); // Datum darf weiter als 6 - // Monate in der Zukunft - // liegen - } - }); - if (Lecture.lecture.getStartdate() == null) { - // is not defined yet - dateChooserstart.setDate(startDate); - } else { - // already defined from last visit on this page - dateChooserstart.setDate(Lecture.lecture.getStartdate()); - } - dateChooserstart.setDateFormatString("yyyy-MM-dd HH:mm:ss"); - dateChooserstart.setBounds(226, 188, 143, 20); - panel_2.add(dateChooserstart); - - dateChooserend = new JDateChooser(); - endDate = addDays(dateChooserstart.getDate(), maxLifeTime); // Datum - // darf - // weiter - // als 6 - // Monate in der Zukunft - // liegen - dateChooserend.setDate(endDate); - if (Lecture.lecture.getEnddate() == null) { - // is not defined yet - dateChooserend.setDate(endDate); - } else { - // already defined from last visit on this page - dateChooserend.setDate(Lecture.lecture.getEnddate()); - } - dateChooserend.setDateFormatString("yyyy-MM-dd HH:mm:ss"); - dateChooserend.setBounds(404, 188, 143, 20); - panel_2.add(dateChooserend); - - JLabel lblBis = new JLabel("bis:"); - lblBis.setBounds(378, 188, 21, 20); - panel_2.add(lblBis); - - JLabel label_6 = new JLabel("von:"); - label_6.setBounds(200, 188, 30, 20); - panel_2.add(label_6); - - JLabel label_10 = new JLabel("G\u00FCltigkeitsdatum: *"); - label_10.setBounds(10, 194, 127, 14); - panel_2.add(label_10); - - JLabel label_11 = new JLabel("Aktiv:"); - label_11.setBounds(10, 229, 127, 14); - panel_2.add(label_11); - - radioButtonyes = new JRadioButton("Ja"); - radioButtonyes.setSelected(true); - radioButtonyes.setBounds(200, 225, 73, 23); - panel_2.add(radioButtonyes); - - radioButtonno = new JRadioButton("Nein"); - radioButtonyes.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - radioButtonyes.setSelected(true); - radioButtonno.setSelected(false); - } - }); - radioButtonno.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - radioButtonno.setSelected(true); - radioButtonyes.setSelected(false); - } - }); - radioButtonno.setBounds(296, 225, 73, 23); - panel_2.add(radioButtonno); - - JLabel lblimVmchooserSichtbar = new JLabel("(im VMChooser sichtbar)"); - lblimVmchooserSichtbar.setBounds(10, 245, 127, 14); - panel_2.add(lblimVmchooserSichtbar); - - JLabel lblmaxMonate = new JLabel("(max. 6 Monate)"); - lblmaxMonate.setBounds(10, 208, 127, 14); - panel_2.add(lblmaxMonate); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton backButton = new JButton("Zur\u00FCck"); - backButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (radioButtonyes.isSelected() == true) { - Lecture.lecture.setActive(true); - } else { - Lecture.lecture.setActive(false); - } - - Lecture.lecture.setName(txtFldVeranstaltungsname - .getText()); - Lecture.lecture.setDesc(description.getText()); - Lecture.lecture.setEnddate(dateChooserend.getDate()); - Lecture.lecture.setStartdate(dateChooserstart.getDate()); - Image.image.setImagename(txtFldVeranstaltungsname - .getText()); - - MainMenue_GUI sr = new MainMenue_GUI(); - sr.setVisible(true); - dispose(); - } - }); - backButton.setActionCommand("Cancel"); - buttonPane.add(backButton); - getRootPane().setDefaultButton(backButton); - } - { - JButton continueButton = new JButton("Weiter"); - continueButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - // liegt das End-Datum vor dem Start-Datum? - if (dateChooserend.getDate().before( - dateChooserstart.getDate())) { - // datum ist falsch rum - isDateOrderCorrect = false; - JOptionPane - .showMessageDialog( - null, - "Das End-Datum liegt vor dem Start-Datum. Bitte \u00e4ndern.", - "Datum fehlerhaft", - JOptionPane.INFORMATION_MESSAGE); - } else { - // bereit - isDateOrderCorrect = true; - } - // liegt das eingegebene Datum nach dem erlaubten - // End-Datum? - if (dateChooserend.getDate().after(endDate)) { - // Datum zu weit weg - isDateMaxLifeTimeCorrect = false; - JOptionPane.showMessageDialog(null, - "Das End-Datum liegt zu weit in der Zukunft. Erlaubt ist maximal:\n" - + endDate, "Datum fehlerhaft", - JOptionPane.INFORMATION_MESSAGE); - - dateChooserend.setDate(endDate); // setze Datum auf - // maximum - } else { - // bereit - isDateMaxLifeTimeCorrect = true; - } - // Pruefen ob alles eingegeben wurde - if (txtFldVeranstaltungsname.getText().isEmpty() == true - || description.getText().isEmpty() == true) { - // mind 1 Textfeld ist leer - isAllInformationReady = false; - JOptionPane - .showMessageDialog( - null, - "Bitte geben Sie einen Veranstaltungsnamen und eine Beschreibung ein.", - "Datum fehlerhaft", - JOptionPane.INFORMATION_MESSAGE); - } else { - // Textfelder bereit - isAllInformationReady = true; - } - - // welcher Radiobutton ist geklickt? - if (radioButtonyes.isSelected() == true) { - Lecture.lecture.setActive(true); - } else { - Lecture.lecture.setActive(false); - } - // Pruefe ob alle Eingaben korrekt sind, dann mache - // weiter - if (isAllInformationReady == true - && isDateMaxLifeTimeCorrect == true - && isDateOrderCorrect == true - && descriptionLenghtOK() == true) { - // everything is ok, proceed - Lecture.lecture.setName(txtFldVeranstaltungsname - .getText()); - Lecture.lecture.setDesc(description.getText()); - Lecture.lecture.setEnddate(dateChooserend.getDate()); - Lecture.lecture.setStartdate(dateChooserstart - .getDate()); - - Image.image.setImagename(txtFldVeranstaltungsname - .getText()); - - PermissionCreateLecture_GUI ev = new PermissionCreateLecture_GUI(); - ev.setVisible(true); - dispose(); - } - - } - }); - continueButton.setActionCommand("OK"); - buttonPane.add(continueButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); - getContentPane().add(separator_1); - - JLabel lblPflichtfelder = new JLabel("* Pflichtfelder"); - lblPflichtfelder.setBounds(32, 602, 136, 14); - getContentPane().add(lblPflichtfelder); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu = new JMenu("Suchen"); - menuBar.add(mnNewMenu); - - JMenuItem mntmVlSuche = new JMenuItem("VL Suche"); - mnNewMenu.add(mntmVlSuche); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - OpenLinks open = new OpenLinks(); - URI windows; - try { - windows = new URI(Links.getFAQ()); - open.openWebpage(windows); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - open.openWebpage(windows); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mnmtAbout = new JMenuItem("About"); - mnmtAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mnmtAbout); - - } - - public Date addDays(Date date, int days) { - Calendar cal = Calendar.getInstance(); - cal.setTime(date); - cal.add(Calendar.DATE, days); // minus number would decrement the days - return cal.getTime(); - }// end addDays() - - public boolean descriptionLenghtOK() { - descriptionLengthOK = false; - - // max length is 254 chars - if (description.getText().length() >= MAX_DESCRIPTION_LENGTH) { - descriptionLengthOK = false; - JOptionPane.showMessageDialog(null, - "Die Beschreibung darf max 254 Zeichen enthalten. Aktuell enthält sie " - + description.getText().length() + ".", - "Beschreibung zu umfangreich", - JOptionPane.INFORMATION_MESSAGE); - } else { - descriptionLengthOK = true; - - } - - return descriptionLengthOK; - }// enddescriptionLenghtOK() - -}// end class diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java deleted file mode 100644 index f4d1bdd8..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java +++ /dev/null @@ -1,1013 +0,0 @@ -package gui.lecture; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JScrollPane; -import javax.swing.JSeparator; -import javax.swing.JTabbedPane; -import javax.swing.JTable; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.RowFilter; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableModel; -import javax.swing.table.TableRowSorter; - -import models.Lecture; -import models.Links; -import models.person; - -import org.apache.thrift.TException; - -import server.Server.Client; -import thrift.ThriftConnection; -import util.GuiOrganizer; -import util.OpenLinks; -import javax.swing.event.ChangeListener; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - -@SuppressWarnings("serial") -public class CreateLectureLink_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - JRadioButton rdbtnInternetJa; - JRadioButton rdbtnInternetNein; - JComboBox comboBox; - JTabbedPane tabbedPane; - JLabel labelName; - JLabel labelUpdate; - JLabel labelVerantwortlicher; - JLabel labelWeitereVerantwortliche; - JLabel labelVorlage; - JLabel labelLizenzSoftware; - JLabel labelInternet; - JLabel labelRam; - JLabel labelCPU; - JLabel labelID; - JLabel labelVersion; - JTextArea textAreadesc; - private JLabel labelOS; - JTable tableAllImages = new JTable(); - JTable tablemyImages = new JTable(); - JTable tableCoopImages = new JTable(); - JTable tablePublicVorlagen = new JTable(); - boolean activeSearch=false; - private JTextField textFieldName; - String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung", - "Verantwortlicher", "Letztes Update", "ID", "Version","Template" }; - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); - final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){ - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0){ - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final DefaultTableModel modelPublicVorlagen = new DefaultTableModel(titles, 0){ - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final TableRowSorter rowSorterAll = new TableRowSorter( - modelAll); - final TableRowSorter rowSorterMyImages = new TableRowSorter( - modelMyImages); - final TableRowSorter rowSorterPublicVorlagen = new TableRowSorter( - modelPublicVorlagen); - private JTextField textField; - - /** - * Create the dialog. - */ - public CreateLectureLink_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - con.closeThriftConnection(); - System.exit(0); - } - - @Override - public void windowOpened(WindowEvent arg0) { - try { - initTableModel(modelMyImages); - initTableModel(modelAll); - initTableModel(modelPublicVorlagen); - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - // auszublendende Angaben - // 1=Lizenzpflichtig - // 3=Veranstaltung - // 6=ID - // 7=Version - // 8=Template - tablemyImages.getColumnModel().getColumn(1).setWidth(0); - tablemyImages.getColumnModel().getColumn(1).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(3).setWidth(0); - tablemyImages.getColumnModel().getColumn(3).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(3).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(8).setWidth(0); - tablemyImages.getColumnModel().getColumn(8).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(6).setWidth(0); - tablemyImages.getColumnModel().getColumn(6).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(7).setWidth(0); - tablemyImages.getColumnModel().getColumn(7).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0); - - tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(1).setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(1).setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(3).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(3).setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(3).setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(8).setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(8).setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(6).setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(6).setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(7).setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(7).setMaxWidth(0); - - tableAllImages.getColumnModel().getColumn(1).setWidth(0); - tableAllImages.getColumnModel().getColumn(1).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(3).setWidth(0); - tableAllImages.getColumnModel().getColumn(3).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(3).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(8).setWidth(0); - tableAllImages.getColumnModel().getColumn(8).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(6).setWidth(0); - tableAllImages.getColumnModel().getColumn(6).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(7).setWidth(0); - tableAllImages.getColumnModel().getColumn(7).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0); - textFieldName.requestFocusInWindow(); - } - }); - setResizable(false); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - setTitle("bwLehrpool Suite - Veranstaltung erzeugen"); - setBounds(0, 0, 918, 722); - GuiOrganizer.centerGUI(this); - - - final DefaultTableModel model = new DefaultTableModel(titles, 0); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 892, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Image verlinken"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("W\u00E4hlen Sie bitte ein Image aus, auf dem Ihre Versanstaltung basiert."); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 531); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 49, 557, 92); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JLabel lblNewLabel_2 = new JLabel("Anzeigename:"); - lblNewLabel_2.setBounds(10, 30, 80, 20); - panel_1.add(lblNewLabel_2); - - JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:"); - lblInternetIstInnerhalb.setBounds(10, 58, 80, 20); - panel_1.add(lblInternetIstInnerhalb); - - textFieldName = new JTextField(); - textFieldName.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - String stext = textFieldName.getText(); - // Wenn Textfield nicht leer - if (stext != "") { - activeSearch=true; - // Filtere nach der Eingabe - rowSorterAll.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - - }else{ - activeSearch=false; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - username, 4)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - "true", 8)); - rowSorterAll.setRowFilter(null); - } - - } - - }); - - textFieldName.setBounds(96, 30, 166, 20); - panel_1.add(textFieldName); - textFieldName.setColumns(10); - - - comboBox = new JComboBox(); - try { - List list = client.getAllOS(); - comboBox.addItem(""); - for (int i = 0; i < list.size(); i++) { - comboBox.addItem(list.get(i)); - } - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - JOptionPane.showMessageDialog(null, - e.getCause()+"\n"+e.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } - comboBox.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - // Prueft das die Auswahl nicht leer ist - if (comboBox.getSelectedItem().toString() != "") { - activeSearch=true; - rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox - .getSelectedItem().toString(), 2)); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - comboBox.getSelectedItem().toString(), 2)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - comboBox.getSelectedItem().toString(), 2)); - }else{ - activeSearch=false; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - username, 4)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - "true", 8)); - rowSorterAll.setRowFilter(null); - } - } - }); - comboBox.setBounds(96, 58, 166, 20); - panel_1.add(comboBox); - - JLabel label_3 = new JLabel("Beschreibung:"); - label_3.setBounds(291, 30, 80, 20); - panel_1.add(label_3); - - textField = new JTextField(); - textField.setColumns(10); - textField.setBounds(381, 30, 166, 20); - panel_1.add(textField); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - - CreateLectureLink_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Veranstaltung"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 76, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(151, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Imageauswahl"); - lblNewLabel_1.setBounds(164, 11, 85, 14); - contentPanel.add(lblNewLabel_1); - - tabbedPane = new JTabbedPane(JTabbedPane.TOP); - tabbedPane.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent arg0) { - if (tabbedPane.getSelectedIndex() == 0 && activeSearch==false) { - - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - username, 4)); - }else if(tabbedPane.getSelectedIndex()==1 && activeSearch==false){ - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter("true", 8)); - } else if(tabbedPane.getSelectedIndex()==2 && activeSearch==false){ - rowSorterAll.setRowFilter(null); - } - - } - - }); - - tabbedPane.setBounds(10, 152, 557, 345); - contentPanel.add(tabbedPane); - - JScrollPane scrollPaneMyImage = new JScrollPane(); - tablemyImages.getSelectionModel().addListSelectionListener( new ListSelectionListener() - { - public void valueChanged(ListSelectionEvent e) - { - String imageid = modelMyImages - .getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 6) - .toString(); - //System.out.println(imageid); - String version = modelMyImages - .getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 7) - .toString(); - //System.out.println(version); - try { - writeImageData(imageid, version); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } - }); - tablemyImages.setModel(modelMyImages); - tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit(); - tablemyImages.setRowSorter(rowSorterMyImages); - - scrollPaneMyImage.setViewportView(tablemyImages); - tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null); - - JScrollPane scrollPaneCoopImages = new JScrollPane(); - - tableCoopImages.setModel(model); - tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit(); - - - JScrollPane scrollPanePublicVorlagen = new JScrollPane(); - tablePublicVorlagen.getSelectionModel().addListSelectionListener( new ListSelectionListener() - { - public void valueChanged(ListSelectionEvent e) - { - String imageid = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 6) - .toString(); - //System.out.println(imageid); - String version = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 7) - .toString(); - //System.out.println(version); - try { - writeImageData(imageid, version); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } - }); - tablePublicVorlagen.setModel(modelPublicVorlagen); - tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit(); - tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen); - scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen); - tabbedPane.addTab("Vorlagen", null, - scrollPanePublicVorlagen, null); - - JScrollPane scrollPaneAllImages = new JScrollPane(); - tableAllImages = new JTable(); - tableAllImages.getSelectionModel().addListSelectionListener( new ListSelectionListener() - { - public void valueChanged(ListSelectionEvent e) - { - - String imageid = modelAll - .getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 6) - .toString(); - //System.out.println(imageid); - String version = modelAll - .getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 7) - .toString(); - //System.out.println(version); - try { - writeImageData(imageid, version); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - } - }); - tableAllImages.setModel(modelAll); - tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit(); - tableAllImages.setRowSorter(rowSorterAll); - - scrollPaneAllImages.setViewportView(tableAllImages); - tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); - - - - scrollPaneCoopImages.setViewportView(tableCoopImages); - tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages, - null); - tabbedPane.setEnabledAt(3, false); - - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 902, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton cancelButton = new JButton("Zur\u00FCck"); - cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - PermissionCreateLecture_GUI eVAG = new PermissionCreateLecture_GUI(); - eVAG.setVisible(true); - dispose(); - } - }); - cancelButton.setActionCommand("CANCEL"); - buttonPane.add(cancelButton); - getRootPane().setDefaultButton(cancelButton); - } - { - JButton doLinkButton = new JButton( - "Veranstaltung erzeugen und abschlie\u00DFen"); - doLinkButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - // check if a row is selected - if (tablemyImages.getSelectedRow() != -1){ - - // a row is selected, do operations - String imagename = tablemyImages.getValueAt( - tablemyImages.getSelectedRow(), 0) - .toString(); - try { - DateFormat formatter = new SimpleDateFormat( - "yyyy-MM-dd HH:mm:ss"); - client.writeLecturedata( - Lecture.lecture.getName(), - Lecture.lecture.getShortDesc(), - Lecture.lecture.getDesc(), - formatter.format( - Lecture.lecture.getStartdate()) - .toString(), - formatter.format( - Lecture.lecture.getEnddate()) - .toString(), - Lecture.lecture.isActive(), - imagename, - person.verantwortlicher.getUsername(), - person.verantwortlicher.getVorname(), - person.verantwortlicher.getName(), - person.verantwortlicher.getHochschule(), - person.verantwortlicher.getEMail(), - person.verantwortlicher.getTel(), - person.verantwortlicher.getFakultaet()); - client.writeLectureRights(Lecture.lecture.getName(), person.verantwortlicher.getUsername(), person.verantwortlicher.getName(), person.verantwortlicher.getVorname(), person.verantwortlicher.getEMail(), person.verantwortlicher.getHochschule(), person.verantwortlicher.getRole()); - JOptionPane - .showMessageDialog( - null, - "Ihre Veranstaltung wurde erfolgreich angelegt. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", - "Veranstaltung angelegt", - JOptionPane.INFORMATION_MESSAGE); - // zurueck zum Menue - MainMenue_GUI m = new MainMenue_GUI(); - m.setVisible(true); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane - .showMessageDialog( - null, - "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.", - "Error", - JOptionPane.ERROR_MESSAGE); - JOptionPane.showMessageDialog(null, - e1.getCause()+"\n"+e1.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } - - dispose(); - - }else if (tablePublicVorlagen.getSelectedRow() != -1){ - - // a row is selected, do operations - String imagename = tablePublicVorlagen.getValueAt( - tablePublicVorlagen.getSelectedRow(), 0) - .toString(); - try { - DateFormat formatter = new SimpleDateFormat( - "yyyy-MM-dd hh:mm:ss"); - client.writeLecturedata( - Lecture.lecture.getName(), - Lecture.lecture.getShortDesc(), - Lecture.lecture.getDesc(), - formatter.format( - Lecture.lecture.getStartdate()) - .toString(), - formatter.format( - Lecture.lecture.getEnddate()) - .toString(), - Lecture.lecture.isActive(), - imagename, - person.verantwortlicher.getUsername(), - person.verantwortlicher.getVorname(), - person.verantwortlicher.getName(), - person.verantwortlicher.getHochschule(), - person.verantwortlicher.getEMail(), - person.verantwortlicher.getTel(), - person.verantwortlicher.getFakultaet()); - client.writeLectureRights(Lecture.lecture.getName(), person.verantwortlicher.getUsername(), person.verantwortlicher.getName(), person.verantwortlicher.getVorname(), person.verantwortlicher.getEMail(), person.verantwortlicher.getHochschule(), person.verantwortlicher.getRole()); - JOptionPane - .showMessageDialog( - null, - "Ihre Veranstaltung wurde erfolgreich angelegt. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", - "Veranstaltung angelegt", - JOptionPane.INFORMATION_MESSAGE); - // zurueck zum Menue - MainMenue_GUI m = new MainMenue_GUI(); - m.setVisible(true); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane - .showMessageDialog( - null, - "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.", - "Error", - JOptionPane.ERROR_MESSAGE); - JOptionPane.showMessageDialog(null, - e1.getCause()+"\n"+e1.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } - - dispose(); - - }else if (tableAllImages.getSelectedRow() != -1 &&tableAllImages.getValueAt(tableAllImages.getSelectedRow(), 4).toString().equals(username)){ - - // a row is selected, do operations - String imagename = tableAllImages.getValueAt( - tableAllImages.getSelectedRow(), 0) - .toString(); - try { - DateFormat formatter = new SimpleDateFormat( - "yyyy-MM-dd hh:mm:ss"); - client.writeLecturedata( - Lecture.lecture.getName(), - Lecture.lecture.getShortDesc(), - Lecture.lecture.getDesc(), - formatter.format( - Lecture.lecture.getStartdate()) - .toString(), - formatter.format( - Lecture.lecture.getEnddate()) - .toString(), - Lecture.lecture.isActive(), - imagename, - person.verantwortlicher.getUsername(), - person.verantwortlicher.getVorname(), - person.verantwortlicher.getName(), - person.verantwortlicher.getHochschule(), - person.verantwortlicher.getEMail(), - person.verantwortlicher.getTel(), - person.verantwortlicher.getFakultaet()); - client.writeLectureRights(Lecture.lecture.getName(), person.verantwortlicher.getUsername(), person.verantwortlicher.getName(), person.verantwortlicher.getVorname(), person.verantwortlicher.getEMail(), person.verantwortlicher.getHochschule(), person.verantwortlicher.getRole()); - JOptionPane - .showMessageDialog( - null, - "Ihre Veranstaltung wurde erfolgreich angelegt. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", - "Veranstaltung angelegt", - JOptionPane.INFORMATION_MESSAGE); - // zurueck zum Menue - MainMenue_GUI m = new MainMenue_GUI(); - m.setVisible(true); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane - .showMessageDialog( - null, - "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.", - "Error", - JOptionPane.ERROR_MESSAGE); - JOptionPane.showMessageDialog(null, - e1.getCause()+"\n"+e1.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } - - dispose(); - - } - else { - // nothing selected - JOptionPane.showMessageDialog(null, - "Bitte w\u00e4hlen Sie ein Image aus.", - "Image Auswahl", - JOptionPane.INFORMATION_MESSAGE); - } - - } - }); - doLinkButton.setActionCommand("OK"); - buttonPane.add(doLinkButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 79, 912, 1); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 912, 2); - getContentPane().add(separator_1); - - JPanel panel = new JPanel(); - panel.setLayout(null); - panel.setBorder(new TitledBorder(null, "Detailinformationen", - - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel.setBackground(SystemColor.menu); - panel.setBounds(586, 85, 316, 531); - getContentPane().add(panel); - - JLabel lblName = new JLabel("Name:"); - lblName.setBounds(10, 87, 130, 14); - panel.add(lblName); - - labelName = new JLabel(""); - labelName.setBounds(10, 102, 296, 14); - panel.add(labelName); - - JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); - lblVerantwortlicher.setBounds(10, 259, 130, 14); - panel.add(lblVerantwortlicher); - - labelOS = new JLabel(""); - labelOS.setBounds(10, 216, 296, 14); - panel.add(labelOS); - - JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:"); - lblWeitereVerantwortliche.setBounds(10, 202, 130, 14); - panel.add(lblWeitereVerantwortliche); - - labelVerantwortlicher = new JLabel(""); - labelVerantwortlicher.setBounds(10, 272, 296, 14); - panel.add(labelVerantwortlicher); - - JLabel label = new JLabel("Weitere Verantwortliche:"); - label.setBounds(10, 284, 130, 14); - panel.add(label); - - labelWeitereVerantwortliche = new JLabel(""); - labelWeitereVerantwortliche.setBounds(10, 297, 296, 14); - panel.add(labelWeitereVerantwortliche); - - labelUpdate = new JLabel(""); - labelUpdate.setBounds(10, 245, 296, 14); - panel.add(labelUpdate); - - JLabel lblLetztesUpdate = new JLabel("Letztes Update:"); - lblLetztesUpdate.setBounds(10, 231, 130, 14); - panel.add(lblLetztesUpdate); - - JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:"); - lblImageIstVorlage.setBounds(10, 336, 130, 14); - panel.add(lblImageIstVorlage); - - labelVorlage = new JLabel(""); - labelVorlage.setBounds(10, 350, 296, 14); - panel.add(labelVorlage); - - labelLizenzSoftware = new JLabel(""); - labelLizenzSoftware.setBounds(10, 383, 296, 14); - panel.add(labelLizenzSoftware); - - JLabel lblLizenzpflichtigeSoftware = new JLabel("Lizenzpflichtige Software:"); - lblLizenzpflichtigeSoftware.setBounds(10, 367, 130, 14); - panel.add(lblLizenzpflichtigeSoftware); - - JLabel lblInternet = new JLabel("Internetsperre vorhanden:"); - lblInternet.setBounds(10, 400, 130, 14); - panel.add(lblInternet); - - labelInternet = new JLabel(""); - labelInternet.setBounds(10, 417, 296, 14); - panel.add(labelInternet); - - JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:"); - lblEmpfehlungRam.setBounds(10, 432, 130, 14); - panel.add(lblEmpfehlungRam); - - labelRam = new JLabel(""); - labelRam.setBounds(10, 455, 296, 14); - panel.add(labelRam); - - JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:"); - lblEmpfehlungCpu.setBounds(10, 469, 130, 14); - panel.add(lblEmpfehlungCpu); - - labelCPU = new JLabel(""); - labelCPU.setBounds(10, 487, 296, 14); - panel.add(labelCPU); - - JLabel lblTechnischeDaten = new JLabel("Technische Daten:"); - lblTechnischeDaten.setBounds(10, 322, 296, 14); - panel.add(lblTechnischeDaten); - - JLabel lblId = new JLabel("ID:"); - lblId.setBounds(10, 23, 296, 14); - panel.add(lblId); - - labelID = new JLabel(""); - labelID.setBounds(10, 37, 296, 14); - panel.add(labelID); - - labelVersion = new JLabel(""); - labelVersion.setBounds(10, 73, 296, 14); - panel.add(labelVersion); - - JLabel lblVersion = new JLabel("Version:"); - lblVersion.setBounds(10, 57, 296, 14); - panel.add(lblVersion); - - JLabel lblBeschreibung = new JLabel("Beschreibung:"); - lblBeschreibung.setBounds(10, 119, 130, 14); - panel.add(lblBeschreibung); - - JScrollPane scrollPane = new JScrollPane(); - scrollPane.setBounds(10, 135, 296, 65); - panel.add(scrollPane); - - textAreadesc = new JTextArea(); - textAreadesc.setLineWrap(true); - textAreadesc.setBackground(SystemColor.menu); - scrollPane.setViewportView(textAreadesc); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - } - - // Initiale Beffuelung eines Table models - public DefaultTableModel initTableModel(DefaultTableModel model) throws TException, ParseException { - List images; - - // Hole eine Liste der Images - images = client.getImageList(); - - Iterator i = images.iterator(); - SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); - int x = 0; - - while (i.hasNext()) { - // erzeuge Objekte fuer die Tabelle - Object[] obj = { images.get(x).getImageName(), - images.get(x).getLicenseRestriction(), - images.get(x).getOsName(), - images.get(x).getLectureName(), - images.get(x).getUserData(), - out.format(in.parse(images.get(x).updateTime)), images.get(x).id, - images.get(x).getVersion(), - images.get(x).getIsTemplate()}; - // Fuege diese Objekte der Tabelle hinzu - - model.addRow(obj); - x++; - i.next(); - - } - - return model; - - - } - public void writeImageData(String id, String version) throws TException, ParseException{ - - SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); - Map res=client.getImageData(id,version); - labelName.setText(res.get("name")); - labelOS.setText(res.get("os")); - labelUpdate.setText(out.format(in.parse(res.get("lastupdate")))); - labelVerantwortlicher.setText(res.get("owner")); - labelWeitereVerantwortliche.setText("Noch nicht Verf�gbar"); - if(res.get("template").equals("true")){ - labelVorlage.setText("Ja"); - }else{ - labelVorlage.setText("Nein"); - } - if(res.get("license").equals("1")){ - labelLizenzSoftware.setText("Ja"); - } - else - { - labelLizenzSoftware.setText("Nein"); - } - if(res.get("internet").equals("1")){ - labelInternet.setText("Ja"); - } - else - { - labelInternet.setText("Nein"); - } - labelRam.setText(res.get("ram")); - labelCPU.setText(res.get("cpu")); - labelID.setText(res.get("id")); - labelVersion.setText(res.get("version")); - textAreadesc.setText(res.get("desc")); - - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java deleted file mode 100644 index ffadde1c..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java +++ /dev/null @@ -1,720 +0,0 @@ -package gui.lecture; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JScrollPane; -import javax.swing.JSeparator; -import javax.swing.JTabbedPane; -import javax.swing.JTable; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.RowFilter; -import javax.swing.ScrollPaneConstants; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableModel; -import javax.swing.table.TableRowSorter; - -import models.Links; -import models.person; - -import org.apache.thrift.TException; - -import server.Server.Client; -import thrift.ThriftConnection; -import util.GuiOrganizer; -import util.OpenLinks; - -@SuppressWarnings("serial") -public class DeleteLecture_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - JRadioButton rdbtnInternetJa; - JRadioButton rdbtnInternetNein; - JLabel labelAktiv; - JLabel labelstartdate; - JLabel labelenddate; - JLabel labelimageversion; - JTextArea labelName; - JTextArea labelimage; - JTextArea labeldesc; - JLabel labelVerantwortlicher; - JTable tableAllLectures; - JTable tablemyLectures; - private JTextField textFieldName; - JTabbedPane tabbedPane; - boolean activeSearch=false; - String[] titles = { "Veranstaltungsname", "Beschreibung", - "G\u00fcltigkeitsdatum", "Aktiv", "Letzte Benutzung", - "Verantwortlicher", "Image", "Schlagwort", "ID" }; - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); - final DefaultTableModel modelAll = new DefaultTableModel(titles, 0); - final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0); - final TableRowSorter rowSorterAll = new TableRowSorter( - modelAll); - final TableRowSorter rowSorterMyLectures = new TableRowSorter( - modelMyLectures); - private JButton button; - private JTextField textField; - - - /** - * Create the dialog. - */ - public DeleteLecture_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - // Beendet die Anwendung nach klick auf X - con.closeThriftConnection(); - System.exit(0); - } - @Override - public void windowOpened(WindowEvent arg0) { - textFieldName.requestFocusInWindow(); - try { - initTableModel(modelMyLectures); - initTableModel(modelAll); - - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - // auszublendende Angaben - // 1=Beschreibung - // 2=G\u00fcltigkeitsdatum - // 3=Aktiv - // 6=Image - // 7=Schlagwort - // 8=ID - tablemyLectures.getColumnModel().getColumn(1).setWidth(0); - tablemyLectures.getColumnModel().getColumn(1).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(1).setMaxWidth(0); - tablemyLectures.getColumnModel().getColumn(2).setWidth(0); - tablemyLectures.getColumnModel().getColumn(2).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(2).setMaxWidth(0); - tablemyLectures.getColumnModel().getColumn(3).setWidth(0); - tablemyLectures.getColumnModel().getColumn(3).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(3).setMaxWidth(0); - tablemyLectures.getColumnModel().getColumn(6).setWidth(0); - tablemyLectures.getColumnModel().getColumn(6).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(6).setMaxWidth(0); - tablemyLectures.getColumnModel().getColumn(7).setWidth(0); - tablemyLectures.getColumnModel().getColumn(7).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(7).setMaxWidth(0); - tablemyLectures.getColumnModel().getColumn(8).setWidth(0); - tablemyLectures.getColumnModel().getColumn(8).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(8).setMaxWidth(0); - - tableAllLectures.getColumnModel().getColumn(1).setWidth(0); - tableAllLectures.getColumnModel().getColumn(1).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(1).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(2).setWidth(0); - tableAllLectures.getColumnModel().getColumn(2).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(2).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(3).setWidth(0); - tableAllLectures.getColumnModel().getColumn(3).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(3).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(6).setWidth(0); - tableAllLectures.getColumnModel().getColumn(6).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(6).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(7).setWidth(0); - tableAllLectures.getColumnModel().getColumn(7).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(7).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(8).setWidth(0); - tableAllLectures.getColumnModel().getColumn(8).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(8).setMaxWidth(0); - } - }); - // Verhindert das Vergroessern Des Fensters - setResizable(false); - - try { - // Setzt das Look & Feel auf System - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - // Setzt den Fenstertitel - setTitle("bwLehrpool Suite - Veranstaltung l\u00F6schen"); - // Zentriert das Fenster in die Bildmitte - setBounds(0, 0, 842, 722); - GuiOrganizer.centerGUI(this); - - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 816, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel( - "Zu l\u00F6schende Veranstaltung w\u00E4hlen"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("W\u00E4hlen Sie bitte aus der unten stehenden Liste die zu l\u00F6schende Veranstaltung aus."); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 570, 518); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 49, 557, 64); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JLabel lblNewLabel_2 = new JLabel("Name:"); - lblNewLabel_2.setBounds(10, 30, 80, 20); - panel_1.add(lblNewLabel_2); - - textFieldName = new JTextField(); - // Key Listener der Tastatureingabe registriert - textFieldName.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - // Textfield eingabe auslesen - String stext = textFieldName.getText(); - // Wenn Textfield nicht leer - if (stext != "") { - activeSearch=true; - // Filtere nach der Eingabe - rowSorterAll.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - - }else{ - activeSearch=false; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( - username, 5)); - rowSorterAll.setRowFilter(null); - } - } - }); - - textFieldName.setBounds(96, 30, 166, 20); - panel_1.add(textFieldName); - textFieldName.setColumns(10); - - JLabel label = new JLabel("Beschreibung:"); - label.setBounds(291, 30, 80, 20); - panel_1.add(label); - - textField = new JTextField(); - textField.setColumns(10); - textField.setBounds(381, 30, 166, 20); - panel_1.add(textField); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - // oeffnet das Hauptmenue - - DeleteLecture_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Veranstaltung"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 75, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(152, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Veranstaltung l\u00F6schen"); - lblNewLabel_1.setBounds(166, 11, 128, 14); - contentPanel.add(lblNewLabel_1); - - tabbedPane = new JTabbedPane(JTabbedPane.TOP); - tabbedPane.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent arg0) { - if (tabbedPane.getSelectedIndex() == 0) { - - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( - username, 5)); - } else if (tabbedPane.getSelectedIndex() == 1) { - rowSorterAll.setRowFilter(null); - } - - } - }); - - tabbedPane.setBounds(10, 123, 557, 397); - contentPanel.add(tabbedPane); - - - JScrollPane scrollPaneAllImages = new JScrollPane(); - tableAllLectures = new JTable(); - tableAllLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener() - { - public void valueChanged(ListSelectionEvent e) - { - String imageid = modelAll - .getValueAt( - tableAllLectures - .convertRowIndexToModel(tableAllLectures - .getSelectedRow()), 8) - .toString(); - //System.out.println(imageid); - - try { - writeLectureData(imageid); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } - }); - tableAllLectures.setModel(modelAll); - tableAllLectures.getColumnModel().getColumn(1).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(2).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(3).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(4).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(5).sizeWidthToFit(); - tableAllLectures.setRowSorter(rowSorterAll); - JScrollPane scrollPaneMyImage = new JScrollPane(); - tablemyLectures = new JTable(); - tablemyLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener() - { - public void valueChanged(ListSelectionEvent e) - { - String imageid = modelMyLectures - .getValueAt( - tablemyLectures - .convertRowIndexToModel(tablemyLectures - .getSelectedRow()), 8) - .toString(); - //System.out.println(imageid); - - try { - writeLectureData(imageid); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } - }); - tablemyLectures.setModel(modelMyLectures); - - tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(2).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(3).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(4).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(5).sizeWidthToFit(); - tablemyLectures.setRowSorter(rowSorterMyLectures); - - scrollPaneMyImage.setViewportView(tablemyLectures); - tabbedPane.addTab("Meine Veranstaltungen", null, scrollPaneMyImage, - null); - - - scrollPaneAllImages.setViewportView(tableAllLectures); - tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 826, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton btnBack = new JButton("Zur\u00FCck"); - btnBack.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - // oeffnet das Hauptmenue - - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - dispose(); - } - }); - btnBack.setActionCommand("OK"); - buttonPane.add(btnBack); - getRootPane().setDefaultButton(btnBack); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 79, 836, 1); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 628, 836, 1); - getContentPane().add(separator_1); - - JPanel panel = new JPanel(); - panel.setLayout(null); - panel.setBorder(new TitledBorder(null, "Detailinformationen", - - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel.setBackground(SystemColor.menu); - panel.setBounds(591, 85, 235, 518); - getContentPane().add(panel); - - JLabel lblNewLabel_3 = new JLabel("Name:"); - lblNewLabel_3.setBounds(10, 27, 104, 14); - panel.add(lblNewLabel_3); - - JLabel lblAktiv = new JLabel("Aktiv:"); - lblAktiv.setBounds(10, 98, 104, 14); - panel.add(lblAktiv); - - labelAktiv = new JLabel(""); - labelAktiv.setBounds(10, 114, 218, 14); - panel.add(labelAktiv); - - labelstartdate = new JLabel(""); - labelstartdate.setBounds(10, 147, 218, 14); - panel.add(labelstartdate); - - JLabel lblStartdatum = new JLabel("Startdatum:"); - lblStartdatum.setBounds(10, 129, 104, 14); - panel.add(lblStartdatum); - - labelenddate = new JLabel(""); - labelenddate.setBounds(10, 175, 218, 14); - panel.add(labelenddate); - - JLabel lblEnddatum = new JLabel("Enddatum:"); - lblEnddatum.setBounds(10, 161, 104, 14); - panel.add(lblEnddatum); - - JLabel lblBeschreibung = new JLabel("Beschreibung:"); - lblBeschreibung.setBounds(10, 189, 104, 14); - panel.add(lblBeschreibung); - - JLabel lblImage = new JLabel("Image:"); - lblImage.setBounds(10, 293, 104, 14); - panel.add(lblImage); - - labelVerantwortlicher = new JLabel(""); - labelVerantwortlicher.setBounds(10, 426, 218, 14); - panel.add(labelVerantwortlicher); - - JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); - lblVerantwortlicher.setBounds(10, 411, 104, 14); - panel.add(lblVerantwortlicher); - - JLabel lblImageversion = new JLabel("Imageversion:"); - lblImageversion.setBounds(10, 381, 104, 14); - panel.add(lblImageversion); - - labelimageversion = new JLabel(""); - labelimageversion.setBounds(10, 399, 218, 14); - panel.add(labelimageversion); - - - labeldesc = new JTextArea(); - labeldesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); - labeldesc.setEditable(false); - labeldesc.setLineWrap(true); - labeldesc.setBackground(SystemColor.menu); - labeldesc.setBounds(124, 127, 104, 110); - JScrollPane scrollPane = new JScrollPane(labeldesc); - scrollPane.setBounds(10, 209, 218, 81); - panel.add(scrollPane); - //panel.add(labeldesc); - - labelimage = new JTextArea(); - labelimage.setLineWrap(true); - labelimage.setFont(new Font("Tahoma", Font.PLAIN, 11)); - labelimage.setEditable(false); - labelimage.setBackground(SystemColor.menu); - labelimage.setBounds(124, 248, 101, 81); - JScrollPane scrollPaneImage = new JScrollPane(labelimage); - scrollPaneImage.setBounds(10, 309, 215, 69); - panel.add(scrollPaneImage); - - labelName = new JTextArea(); - labelName.setEditable(false); - labelName.setFont(new Font("Tahoma", Font.PLAIN, 11)); - labelName.setBackground(SystemColor.menu); - labelName.setBounds(124, 22, 101, 55); - JScrollPane scrollPaneName = new JScrollPane(labelName); - scrollPaneName.setBounds(10, 40, 218, 55); - panel.add(scrollPaneName); - - button = new JButton("L\u00F6schen"); - button.setBounds(469, 606, 118, 23); - getContentPane().add(button); - button.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - String lectureID=""; - int eingabe; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - //check if a row is selected - if (tablemyLectures.getSelectedRowCount() !=0){ - //a row is selected - //ask for confirmation - eingabe = JOptionPane.showConfirmDialog(null, - "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?", - JOptionPane.YES_NO_OPTION); - - if (eingabe == JOptionPane.YES_OPTION) { - //user has confirmed deletion, now get the ID of the selected lecture - lectureID = modelMyLectures.getValueAt(tablemyLectures.convertColumnIndexToModel(tablemyLectures.getSelectedRow()), 8).toString(); - System.out.println("L\u00f6sche Lecture "+lectureID); - try { - if(client.deleteLecture(lectureID, person.verantwortlicher.getHochschule(),person.verantwortlicher.getUsername())){ - System.out.println("L\u00f6schen erfolgreich"); - //delete successful - - DeleteLecture_GUI dl = new DeleteLecture_GUI(); - dl.setVisible(true); - dispose(); - } else { - //delete not successful - JOptionPane - .showMessageDialog( - null, - "L\u00f6schen aus Datenbank fehlgeschlagen.", - "Fehler", - JOptionPane.INFORMATION_MESSAGE); - } - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - }//end delete - }//end ask for confirmation - - }//end check if a row is selected - else if (tableAllLectures.getSelectedRowCount() !=0 && tableAllLectures.getValueAt(tableAllLectures.getSelectedRow(), 5).toString().equals(username)){ - //a row is selected - //ask for confirmation - eingabe = JOptionPane.showConfirmDialog(null, - "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?", - JOptionPane.YES_NO_OPTION); - - if (eingabe == JOptionPane.YES_OPTION) { - //user has confirmed deletion, now get the ID of the selected lecture - lectureID = tableAllLectures.getValueAt(tableAllLectures.convertColumnIndexToModel(tableAllLectures.getSelectedRow()), 8).toString(); - System.out.println("L\u00f6sche Lecture "+lectureID); - try { - if(client.deleteLecture(lectureID, person.verantwortlicher.getHochschule(),person.verantwortlicher.getUsername())){ - System.out.println("L\u00f6schen erfolgreich"); - //delete successful - - DeleteLecture_GUI dl = new DeleteLecture_GUI(); - dl.setVisible(true); - dispose(); - } else { - //delete not successful - JOptionPane - .showMessageDialog( - null, - "L\u00f6schen aus Datenbank fehlgeschlagen.", - "Fehler", - JOptionPane.INFORMATION_MESSAGE); - } - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - }//end delete - }//end ask for confirmation - - } else { //end check if a row is selected - JOptionPane - .showMessageDialog( - null, - "Bitte w\u00e4hlen Sie ein eigenes Image aus.", - "Message", - JOptionPane.INFORMATION_MESSAGE); - } - - } - }); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - } - - // Initiale Beffuelung eines Table models - public DefaultTableModel initTableModel(DefaultTableModel model) throws ParseException { - List lectures; - try { - // Hole eine Liste der Images - lectures = client.getLectureList(); - Iterator i = lectures.iterator(); - SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); - int x = 0; - - while (i.hasNext()) { - // erzeuge Objekte fuer die Tabelle - Object[] obj = { - lectures.get(x).lecturename, - lectures.get(x).desc, - out.format(in.parse(lectures.get(x).starttime)) + " " - + out.format(in.parse(lectures.get(x).endtime)), - lectures.get(x).isActive, out.format(in.parse(lectures.get(x).lastused)), - lectures.get(x).username, - lectures.get(x).imagename," " ,lectures.get(x).id }; - // Fuege diese Objekte der Tabelle hinzu - model.addRow(obj); - x++; - i.next(); - - } - - return model; - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - return model; - } - public void writeLectureData(String id) throws TException, ParseException{ - - SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); - Map res=client.getLectureData(id); - labelName.setText(res.get("name")); - labelAktiv.setText(res.get("isActive")); - labeldesc.setText(res.get("desc")); - labelVerantwortlicher.setText(res.get("owner")); - labelstartdate.setText(out.format(in.parse(res.get("startTime")))); - labelenddate.setText(out.format(in.parse(res.get("endTime")))); - labelimage.setText(res.get("imagepath").substring(res.get("imagepath").indexOf("/")+1)); - labelimageversion.setText(res.get("imageversion")); - - -} -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java deleted file mode 100644 index 457b67db..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java +++ /dev/null @@ -1,594 +0,0 @@ -package gui.lecture; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.ScrollPane; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Calendar; -import java.util.Date; - -import javax.swing.ButtonGroup; -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JSeparator; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; - -import models.Image; -import models.Lecture; -import models.Links; -import models.person; -import util.GuiOrganizer; -import util.OpenLinks; - -import com.toedter.calendar.JDateChooser; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; - -@SuppressWarnings("serial") -public class EditLectureAllgemein_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - private JTextField Vorname; - private JTextField Nachname; - private JTextField Hochschule; - private JTextField EMail; - private JTextField textFieldLaborname; - JTextArea description; - JRadioButton radioButtonyes; - JDateChooser dateChooserend; - JDateChooser dateChooserstart; - JRadioButton radioButtonno; - Date startDate = new Date(); - Date endDate; - private final ButtonGroup buttonGroup = new ButtonGroup(); - private boolean descriptionLengthOK = false; // description may not be - // longer than - // MAX_DESCRIPTION_LENGTH - private final int MAX_DESCRIPTION_LENGTH = 254; - - int maxLifeTime = 180; // Anzahl Tage, die eine Veranstaltung in der Zukunft - // aktiv sein darf - boolean isDateOrderCorrect, isDateMaxLifeTimeCorrect, - isAllInformationReady = false; - - /** - * Create the dialog. - */ - public EditLectureAllgemein_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - System.exit(0); - } - }); - setResizable(false); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - setTitle("bwLehrpool Suite - Veranstaltung bearbeiten"); - ; - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Eingabe Ihrer Daten"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an"); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 21); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 493); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 331, 557, 162); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JLabel label = new JLabel("Vorname: *"); - label.setBackground(SystemColor.menu); - label.setBounds(10, 33, 125, 20); - panel_1.add(label); - - Vorname = new JTextField(); - Vorname.setEditable(false); - Vorname.setEnabled(false); - Vorname.setText(person.verantwortlicher.getVorname()); - Vorname.setBackground(Color.WHITE); - Vorname.setColumns(10); - Vorname.setBounds(145, 33, 350, 20); - panel_1.add(Vorname); - - JLabel label_7 = new JLabel("Nachname: *"); - label_7.setBackground(SystemColor.menu); - label_7.setBounds(10, 64, 125, 20); - panel_1.add(label_7); - - Nachname = new JTextField(); - Nachname.setEnabled(false); - Nachname.setEditable(false); - Nachname.setText(person.verantwortlicher.getName()); - Nachname.setBackground(Color.WHITE); - Nachname.setColumns(10); - Nachname.setBounds(145, 64, 350, 20); - panel_1.add(Nachname); - - JLabel label_8 = new JLabel("Hochschule: *"); - label_8.setBackground(SystemColor.menu); - label_8.setBounds(10, 95, 125, 20); - panel_1.add(label_8); - - Hochschule = new JTextField(); - Hochschule.setEnabled(false); - Hochschule.setEditable(false); - Hochschule.setText(person.verantwortlicher.getHochschule()); - Hochschule.setBackground(Color.WHITE); - Hochschule.setColumns(10); - Hochschule.setBounds(145, 95, 350, 20); - panel_1.add(Hochschule); - - JLabel label_9 = new JLabel("E-Mail: *"); - label_9.setBackground(SystemColor.menu); - label_9.setBounds(10, 126, 125, 20); - panel_1.add(label_9); - - EMail = new JTextField(); - EMail.setEnabled(false); - EMail.setEditable(false); - EMail.setText(person.verantwortlicher.getEMail()); - EMail.setBackground(Color.WHITE); - EMail.setColumns(10); - EMail.setBounds(145, 126, 350, 20); - panel_1.add(EMail); - - JPanel panel = new JPanel(); - panel.setBounds(10, 402, 577, 33); - contentPanel.add(panel); - panel.setLayout(null); - panel.setBorder(new EmptyBorder(5, 5, 5, 5)); - panel.setBackground(SystemColor.menu); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - - EditLectureAllgemein_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Veranstaltung"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 84, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(175, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Bearbeiten"); - lblNewLabel_1.setBounds(188, 11, 72, 14); - contentPanel.add(lblNewLabel_1); - - JPanel panel_2 = new JPanel(); - panel_2.setLayout(null); - panel_2.setBorder(new TitledBorder(null, "Veranstaltungsdaten", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_2.setBackground(SystemColor.menu); - panel_2.setBounds(10, 36, 557, 284); - contentPanel.add(panel_2); - - JLabel label_3 = new JLabel("Laborname (Anzeigename): *"); - label_3.setBounds(10, 25, 180, 14); - panel_2.add(label_3); - - textFieldLaborname = new JTextField(); - textFieldLaborname.setText(Lecture.lecture.getName()); - textFieldLaborname.setColumns(10); - textFieldLaborname.setBounds(200, 22, 347, 20); - panel_2.add(textFieldLaborname); - - JTextArea textArea = new JTextArea(); - textArea.setEditable(false); - textArea.setWrapStyleWord(true); - textArea.setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an. Dieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\""); - textArea.setLineWrap(true); - textArea.setFont(new Font("Tahoma", Font.PLAIN, 12)); - textArea.setBackground(SystemColor.menu); - textArea.setBounds(10, 49, 537, 49); - panel_2.add(textArea); - - JLabel label_4 = new JLabel("Beschreibung: *"); - label_4.setBounds(10, 111, 180, 14); - panel_2.add(label_4); - - ScrollPane scrollPane = new ScrollPane(); - scrollPane.setBounds(200, 104, 347, 78); - panel_2.add(scrollPane); - description = new JTextArea(); - description.setFont(new Font("Tahoma", Font.PLAIN, 11)); - description.setText(Lecture.lecture.getDesc()); - description.setLineWrap(true); - scrollPane.add(description); - description.setBounds(0, 0, 4, 22); - scrollPane.add(description); - - dateChooserend = new JDateChooser(); - dateChooserend.setDateFormatString("dd-MM-yyyy HH:mm:ss"); - dateChooserend.setDate(Lecture.lecture.getEnddate()); - dateChooserend.setBounds(404, 188, 143, 20); - panel_2.add(dateChooserend); - - JLabel label_5 = new JLabel("bis"); - label_5.setBounds(378, 188, 21, 20); - panel_2.add(label_5); - - dateChooserstart = new JDateChooser(); - dateChooserstart - .addPropertyChangeListener(new PropertyChangeListener() { - public void propertyChange(PropertyChangeEvent arg0) { - endDate = addDays(dateChooserstart.getDate(), - maxLifeTime); // Datum darf weiter als 6 - // Monate in der Zukunft - // liegen - } - }); - - // initialize - if (Lecture.lecture.getStartdate() == null) { - // is not defined yet - dateChooserstart.setDate(startDate); - } else { - // already defined from last visit on this page - dateChooserstart.setDate(Lecture.lecture.getStartdate()); - } - - if (Lecture.lecture.getEnddate() == null) { - // is not defined yet - dateChooserend.setDate(endDate); - } else { - // already defined from last visit on this page - dateChooserend.setDate(Lecture.lecture.getEnddate()); - } - - dateChooserstart.setDateFormatString("yyyy-MM-dd HH:mm:ss"); - dateChooserstart.setDate(Lecture.lecture.getStartdate()); - dateChooserstart.setBounds(226, 188, 143, 20); - panel_2.add(dateChooserstart); - - JLabel label_6 = new JLabel("von:"); - label_6.setBounds(200, 188, 30, 20); - panel_2.add(label_6); - - JLabel label_10 = new JLabel("G\u00FCltigkeitsdatum: *"); - label_10.setBounds(10, 188, 250, 14); - panel_2.add(label_10); - - JLabel label_11 = new JLabel("Aktiv:"); - label_11.setBounds(10, 229, 250, 14); - panel_2.add(label_11); - - radioButtonyes = new JRadioButton("Ja"); - buttonGroup.add(radioButtonyes); - radioButtonyes.setBounds(240, 225, 109, 23); - panel_2.add(radioButtonyes); - radioButtonno = new JRadioButton("Nein"); - buttonGroup.add(radioButtonno); - radioButtonno.setBounds(385, 225, 109, 23); - panel_2.add(radioButtonno); - - radioButtonyes.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - radioButtonyes.setSelected(true); - radioButtonno.setSelected(false); - } - }); - radioButtonno.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - radioButtonno.setSelected(true); - radioButtonyes.setSelected(false); - } - }); - - JLabel label_12 = new JLabel("(Im VMChooser sichtbar)"); - label_12.setBounds(10, 254, 250, 14); - panel_2.add(label_12); - - JLabel lblmaxMonate = new JLabel("(max. 6 Monate)"); - lblmaxMonate.setBounds(10, 208, 127, 14); - panel_2.add(lblmaxMonate); - - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton okButton = new JButton("Zur\u00FCck"); - okButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - if (radioButtonyes.isSelected() == true) { - Lecture.lecture.setActive(true); - } else { - Lecture.lecture.setActive(false); - } - - Lecture.lecture.setName(textFieldLaborname.getText()); - Lecture.lecture.setDesc(description.getText()); - Lecture.lecture.setEnddate(dateChooserend.getDate()); - Lecture.lecture.setStartdate(dateChooserstart.getDate()); - Image.image.setImagename(textFieldLaborname.getText()); - - MainMenue_GUI sr = new MainMenue_GUI(); - sr.setVisible(true); - dispose(); - } - }); - okButton.setActionCommand("OK"); - buttonPane.add(okButton); - getRootPane().setDefaultButton(okButton); - } - { - JButton cancelButton = new JButton("Weiter"); - cancelButton.addActionListener(new ActionListener() { - /* - * public void actionPerformed(ActionEvent e) { - * if(radioButtonyes.isSelected()==true) { - * Lecture.lecture.setActive(true); } else { - * Lecture.lecture.setActive(false); } - * - * Lecture.lecture.setName(textFieldLaborname.getText()); - * Lecture.lecture.setNewName(textFieldLaborname.getText()); - * Lecture.lecture.setDesc(description.getText()); - * Lecture.lecture.setEnddate(dateChooserend.getDate()); - * Lecture.lecture.setStartdate(dateChooserstart.getDate()); - * Image.image.setImagename(textFieldLaborname.getText()); - * - * - * PermissionEditLecture_GUI ev=new - * PermissionEditLecture_GUI(); ev.setVisible(true); - * dispose(); } - */ - public void actionPerformed(ActionEvent e) { - // liegt das End-Datum vor dem Start-Datum? - if (dateChooserend.getDate().before( - dateChooserstart.getDate())) { - // datum ist falsch rum - isDateOrderCorrect = false; - JOptionPane - .showMessageDialog( - null, - "Das End-Datum liegt vor dem Start-Datum. Bitte \u00e4ndern.", - "Datum fehlerhaft", - JOptionPane.INFORMATION_MESSAGE); - } else { - // bereit - isDateOrderCorrect = true; - } - // liegt das eingegebene Datum nach dem erlaubten - // End-Datum? - if (dateChooserend.getDate().after(endDate)) { - // Datum zu weit weg - isDateMaxLifeTimeCorrect = false; - JOptionPane.showMessageDialog(null, - "Das End-Datum liegt zu weit in der Zukunft. Erlaubt ist maximal:\n" - + endDate, "Datum fehlerhaft", - JOptionPane.INFORMATION_MESSAGE); - - dateChooserend.setDate(endDate); // setze Datum auf - // maximum - } else { - // bereit - isDateMaxLifeTimeCorrect = true; - } - // Pruefen ob alles eingegeben wurde - if (textFieldLaborname.getText().isEmpty() == true - || description.getText().isEmpty() == true) { - // mind 1 Textfeld ist leer - isAllInformationReady = false; - JOptionPane - .showMessageDialog( - null, - "Bitte geben Sie einen Veranstaltungsnamen und eine Beschreibung ein.", - "Datum fehlerhaft", - JOptionPane.INFORMATION_MESSAGE); - } else { - // Textfelder bereit - isAllInformationReady = true; - } - - // welcher Radiobutton ist geklickt? - if (radioButtonyes.isSelected() == true) { - Lecture.lecture.setActive(true); - } else { - Lecture.lecture.setActive(false); - } - // Pruefe ob alle Eingaben korrekt sind, dann mache - // weiter - if (isAllInformationReady == true - && isDateMaxLifeTimeCorrect == true - && isDateOrderCorrect == true - && descriptionLenghtOK() == true) { - // everything is ok, proceed - Lecture.lecture.setName(textFieldLaborname - .getText()); - Lecture.lecture.setDesc(description.getText()); - Lecture.lecture.setEnddate(dateChooserend.getDate()); - Lecture.lecture.setStartdate(dateChooserstart - .getDate()); - - Image.image.setImagename(textFieldLaborname - .getText()); - - PermissionCreateLecture_GUI ev = new PermissionCreateLecture_GUI(); - ev.setVisible(true); - dispose(); - } - - } - - }); - cancelButton.setActionCommand("Cancel"); - buttonPane.add(cancelButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); - getContentPane().add(separator_1); - - JLabel lblPflichtfelder = new JLabel("* Pflichtfelder"); - lblPflichtfelder.setBounds(32, 602, 136, 14); - getContentPane().add(lblPflichtfelder); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu = new JMenu("Suchen"); - menuBar.add(mnNewMenu); - - JMenuItem mntmVlSuche = new JMenuItem("VL Suche"); - mnNewMenu.add(mntmVlSuche); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - OpenLinks open = new OpenLinks(); - URI windows; - try { - windows = new URI(Links.getFAQ()); - open.openWebpage(windows); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - OpenLinks open = new OpenLinks(); - URI windows; - try { - windows = new URI(Links.getOTRS()); - open.openWebpage(windows); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - } - - public Date addDays(Date date, int days) { - Calendar cal = Calendar.getInstance(); - cal.setTime(date); - cal.add(Calendar.DATE, days); // minus number would decrement the days - return cal.getTime(); - }// end addDays() - - public boolean descriptionLenghtOK() { - descriptionLengthOK = false; - - // max length is 254 chars - if (description.getText().length() >= MAX_DESCRIPTION_LENGTH) { - descriptionLengthOK = false; - JOptionPane.showMessageDialog(null, - "Die Beschreibung darf max 254 Zeichen enthalten. Aktuell enthält sie " - + description.getText().length() + ".", - "Beschreibung zu umfangreich", - JOptionPane.INFORMATION_MESSAGE); - } else { - descriptionLengthOK = true; - - } - - return descriptionLengthOK; - }// enddescriptionLenghtOK() - -}// end class \ No newline at end of file diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java deleted file mode 100644 index 773a01b7..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java +++ /dev/null @@ -1,1020 +0,0 @@ -package gui.lecture; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JScrollPane; -import javax.swing.JSeparator; -import javax.swing.JTabbedPane; -import javax.swing.JTable; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.RowFilter; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableModel; -import javax.swing.table.TableRowSorter; - -import models.Lecture; -import models.Links; -import models.person; - -import org.apache.thrift.TException; - -import server.Server.Client; -import thrift.ThriftConnection; -import util.GuiOrganizer; -import util.OpenLinks; -import javax.swing.event.ChangeListener; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - -@SuppressWarnings("serial") -public class EditLectureLink_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - JRadioButton rdbtnInternetJa; - JRadioButton rdbtnInternetNein; - JComboBox comboBox; - JLabel labelName; - JLabel labelUpdate; - JLabel labelVerantwortlicher; - JLabel labelWeitereVerantwortliche; - JLabel labelVorlage; - JLabel labelLizenzSoftware; - JLabel labelInternet; - JLabel labelRam; - JLabel labelID; - JLabel labelVersion; - JTextArea textAreadesc; - JLabel labelCPU; - private JLabel labelOS; - JTable tableAllImages = new JTable(); - JTable tablemyImages = new JTable(); - JTable tableCoopImages = new JTable(); - JTable tablePublicVorlagen = new JTable(); - private JTextField textFieldName; - JTabbedPane tabbedPane; - boolean activeSearch=false; - String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung", - "Verantwortlicher", "Letztes Update", "ID", "Version","Template" }; - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); - final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){ - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0){ - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final DefaultTableModel modelPublicVorlagen = new DefaultTableModel(titles, 0){ - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final TableRowSorter rowSorterAll = new TableRowSorter( - modelAll); - final TableRowSorter rowSorterMyImages = new TableRowSorter( - modelMyImages); - final TableRowSorter rowSorterPublicVorlagen = new TableRowSorter( - modelPublicVorlagen); - private JTextField textField; - /** - * Create the dialog. - */ - public EditLectureLink_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - con.closeThriftConnection(); - System.exit(0); - } - @Override - public void windowOpened(WindowEvent arg0) { - try { - initTableModel(modelAll); - initTableModel(modelMyImages); - initTableModel(modelPublicVorlagen); - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - // auszublendende Angaben - // 1=Lizenzpflichtig - // 3=Veranstaltung - // 6=ID - // 7=Version - // 8=Template - tablemyImages.getColumnModel().getColumn(1).setWidth(0); - tablemyImages.getColumnModel().getColumn(1).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(3).setWidth(0); - tablemyImages.getColumnModel().getColumn(3).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(3).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(8).setWidth(0); - tablemyImages.getColumnModel().getColumn(8).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(6).setWidth(0); - tablemyImages.getColumnModel().getColumn(6).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0); - tablemyImages.getColumnModel().getColumn(7).setWidth(0); - tablemyImages.getColumnModel().getColumn(7).setMinWidth(0); - tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0); - - tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(1).setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(1).setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(3).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(3).setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(3).setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(8).setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(8).setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(6).setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(6).setMaxWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(7).setMinWidth(0); - tablePublicVorlagen.getColumnModel().getColumn(7).setMaxWidth(0); - - tableAllImages.getColumnModel().getColumn(1).setWidth(0); - tableAllImages.getColumnModel().getColumn(1).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(3).setWidth(0); - tableAllImages.getColumnModel().getColumn(3).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(3).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(8).setWidth(0); - tableAllImages.getColumnModel().getColumn(8).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(6).setWidth(0); - tableAllImages.getColumnModel().getColumn(6).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0); - tableAllImages.getColumnModel().getColumn(7).setWidth(0); - tableAllImages.getColumnModel().getColumn(7).setMinWidth(0); - tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0); - textFieldName.requestFocusInWindow(); - } - }); - setResizable(false); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - setTitle("bwLehrpool Suite - Veranstaltung bearbeiten"); - - setBounds(0, 0, 918, 722); - GuiOrganizer.centerGUI(this); - - - final DefaultTableModel model = new DefaultTableModel(titles, 0); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Image verlinken"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("W\u00E4hlen Sie bitte ein Image aus, auf dem Ihre Versanstaltung basiert."); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 531); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 49, 557, 91); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JLabel lblNewLabel_2 = new JLabel("Name:"); - lblNewLabel_2.setBounds(10, 30, 80, 20); - panel_1.add(lblNewLabel_2); - - JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:"); - lblInternetIstInnerhalb.setBounds(10, 58, 80, 20); - panel_1.add(lblInternetIstInnerhalb); - - textFieldName = new JTextField(); - textFieldName.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - String stext = textFieldName.getText(); - // Wenn Textfield nicht leer - if (stext != "") { - activeSearch=true; - // Filtere nach der Eingabe - rowSorterAll.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - - }else{ - activeSearch=false; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - username, 4)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - "true", 8)); - rowSorterAll.setRowFilter(null); - } - - } - - }); - - textFieldName.setBounds(96, 30, 166, 20); - panel_1.add(textFieldName); - textFieldName.setColumns(10); - - comboBox = new JComboBox(); - try { - List list = client.getAllOS(); - comboBox.addItem(""); - for (int i = 0; i < list.size(); i++) { - comboBox.addItem(list.get(i)); - } - } catch (TException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - comboBox.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent arg0) { - // Prueft das die Auswahl nicht leer ist - if (comboBox.getSelectedItem().toString() != "") { - activeSearch=true; - rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox - .getSelectedItem().toString(), 2)); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - comboBox.getSelectedItem().toString(), 2)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - comboBox.getSelectedItem().toString(), 2)); - }else{ - activeSearch=false; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - username, 4)); - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( - "true", 8)); - rowSorterAll.setRowFilter(null); - } - } - }); - comboBox.setBounds(96, 58, 166, 20); - panel_1.add(comboBox); - - JLabel label_3 = new JLabel("Beschreibung:"); - label_3.setBounds(291, 30, 80, 20); - panel_1.add(label_3); - - textField = new JTextField(); - textField.setColumns(10); - textField.setBounds(381, 30, 166, 20); - panel_1.add(textField); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - - EditLectureLink_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Veranstaltung"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 76, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(151, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Veranstaltung verlinken"); - lblNewLabel_1.setBounds(164, 11, 113, 14); - contentPanel.add(lblNewLabel_1); - - tabbedPane = new JTabbedPane(JTabbedPane.TOP); - tabbedPane.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent arg0) { - if (tabbedPane.getSelectedIndex() == 0 && activeSearch==false) { - - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyImages.setRowFilter(RowFilter.regexFilter( - username, 4)); - }else if(tabbedPane.getSelectedIndex()==1 && activeSearch==false){ - rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter("true", 8)); - } else if(tabbedPane.getSelectedIndex()==2 && activeSearch==false){ - rowSorterAll.setRowFilter(null); - } - - } - }); - - tabbedPane.setBounds(10, 158, 557, 339); - contentPanel.add(tabbedPane); - - JScrollPane scrollPaneAllImages = new JScrollPane(); - tableAllImages.getSelectionModel().addListSelectionListener( new ListSelectionListener() - { - public void valueChanged(ListSelectionEvent e) - { - - String imageid = modelAll - .getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 6) - .toString(); - //System.out.println(imageid); - String version = modelAll - .getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 7) - .toString(); - //System.out.println(version); - writeImageData(imageid, version); - - } - }); - tableAllImages.setModel(modelAll); - tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit(); - tableAllImages.setRowSorter(rowSorterAll); - JScrollPane scrollPaneMyImage = new JScrollPane(); - tablemyImages.getSelectionModel().addListSelectionListener( new ListSelectionListener() - { - public void valueChanged(ListSelectionEvent e) - { - String imageid = modelMyImages - .getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 6) - .toString(); - //System.out.println(imageid); - String version = modelMyImages - .getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 7) - .toString(); - //System.out.println(version); - writeImageData(imageid, version); - } - }); - tablemyImages.setModel(modelMyImages); - tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit(); - tablemyImages.setRowSorter(rowSorterMyImages); - scrollPaneMyImage.setViewportView(tablemyImages); - tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null); - - JScrollPane scrollPanePublicVorlagen = new JScrollPane(); - scrollPanePublicVorlagen.setEnabled(false); - tablePublicVorlagen.getSelectionModel().addListSelectionListener( new ListSelectionListener() - { - public void valueChanged(ListSelectionEvent e) - { - String imageid = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 6) - .toString(); - //System.out.println(imageid); - String version = modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 7) - .toString(); - //System.out.println(version); - writeImageData(imageid, version); - } - }); - tablePublicVorlagen.setModel(modelPublicVorlagen); - tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit(); - tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit(); - tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen); - scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen); - tabbedPane.addTab("Vorlagen", null, - scrollPanePublicVorlagen, null); - - - scrollPaneAllImages.setViewportView(tableAllImages); - tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); - - JScrollPane scrollPaneCoopImages = new JScrollPane(); - - tableCoopImages.setModel(model); - tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit(); - - scrollPaneCoopImages.setViewportView(tableCoopImages); - tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages, - null); - tabbedPane.setEnabledAt(3, false); - - JButton btnLinkLschen = new JButton("Link l\u00F6schen"); - btnLinkLschen.setEnabled(false); - btnLinkLschen.setBounds(478, 508, 89, 23); - contentPanel.add(btnLinkLschen); - - - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 902, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton okButton = new JButton("Zur\u00FCck"); - okButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - PermissionEditLecture_GUI el = new PermissionEditLecture_GUI(); - el.setVisible(true); - dispose(); - } - }); - okButton.setActionCommand("OK"); - buttonPane.add(okButton); - getRootPane().setDefaultButton(okButton); - } - { - JButton cancelButton = new JButton( - "Veranstaltung \u00e4ndern und abschlie\u00DFen"); - cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - // check if a row is selected - if (tablemyImages.getSelectedRow() != -1){ - - // a row is selected, do operations - String imagename = tablemyImages.getValueAt( - tablemyImages.getSelectedRow(), 0) - .toString(); - try { - DateFormat formatter = new SimpleDateFormat( - "yyyy-MM-dd hh:mm:ss"); - client.updateLecturedata( - Lecture.lecture.getName(), - Lecture.lecture.getNewName(), - Lecture.lecture.getShortDesc(), - Lecture.lecture.getDesc(), - formatter.format( - Lecture.lecture.getStartdate()) - .toString(), - formatter.format( - Lecture.lecture.getEnddate()) - .toString(), - Lecture.lecture.isActive(), - modelMyImages - .getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 6).toString(), - modelMyImages - .getValueAt( - tablemyImages - .convertRowIndexToModel(tablemyImages - .getSelectedRow()), 7) - .toString(), - person.verantwortlicher.getUsername(), - person.verantwortlicher.getVorname(), - person.verantwortlicher.getName(), - person.verantwortlicher.getHochschule(), - person.verantwortlicher.getEMail(), - person.verantwortlicher.getTel(), - person.verantwortlicher.getFakultaet(), - Lecture.lecture.getid()); - JOptionPane - .showMessageDialog( - null, - "Ihre Veranstaltung wurde erfolgreich ge�ndert. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", - "Veranstaltung angelegt", - JOptionPane.INFORMATION_MESSAGE); - // zurueck zum Menue - MainMenue_GUI m = new MainMenue_GUI(); - m.setVisible(true); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane - .showMessageDialog( - null, - "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.", - "Error", - JOptionPane.ERROR_MESSAGE); - JOptionPane.showMessageDialog(null, - e1.getCause()+"\n"+e1.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } - - dispose(); - - }else if (tablePublicVorlagen.getSelectedRow() != -1 &&tablePublicVorlagen.getValueAt(tablePublicVorlagen.getSelectedRow(), 4).toString().equals(username)){ - - // a row is selected, do operations - String imagename = tablePublicVorlagen.getValueAt( - tablePublicVorlagen.getSelectedRow(), 0) - .toString(); - try { - DateFormat formatter = new SimpleDateFormat( - "yyyy-MM-dd hh:mm:ss"); - client.updateLecturedata( - Lecture.lecture.getName(), - Lecture.lecture.getNewName(), - Lecture.lecture.getShortDesc(), - Lecture.lecture.getDesc(), - formatter.format( - Lecture.lecture.getStartdate()) - .toString(), - formatter.format( - Lecture.lecture.getEnddate()) - .toString(), - Lecture.lecture.isActive(), - modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 6).toString(), - modelPublicVorlagen - .getValueAt( - tablePublicVorlagen - .convertRowIndexToModel(tablePublicVorlagen - .getSelectedRow()), 7).toString(), - person.verantwortlicher.getUsername(), - person.verantwortlicher.getVorname(), - person.verantwortlicher.getName(), - person.verantwortlicher.getHochschule(), - person.verantwortlicher.getEMail(), - person.verantwortlicher.getTel(), - person.verantwortlicher.getFakultaet(), - Lecture.lecture.getid()); - JOptionPane - .showMessageDialog( - null, - "Ihre Veranstaltung wurde erfolgreich ge�ndert. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", - "Veranstaltung angelegt", - JOptionPane.INFORMATION_MESSAGE); - // zurueck zum Menue - MainMenue_GUI m = new MainMenue_GUI(); - m.setVisible(true); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane - .showMessageDialog( - null, - "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.", - "Error", - JOptionPane.ERROR_MESSAGE); - JOptionPane.showMessageDialog(null, - e1.getCause()+"\n"+e1.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } - - dispose(); - - }else if (tableAllImages.getSelectedRow() != -1 &&tableAllImages.getValueAt(tableAllImages.getSelectedRow(), 4).toString().equals(username)){ - - // a row is selected, do operations - String imagename = tableAllImages.getValueAt( - tableAllImages.getSelectedRow(), 0) - .toString(); - try { - DateFormat formatter = new SimpleDateFormat( - "yyyy-MM-dd hh:mm:ss"); - client.updateLecturedata( - Lecture.lecture.getName(), - Lecture.lecture.getNewName(), - Lecture.lecture.getShortDesc(), - Lecture.lecture.getDesc(), - formatter.format( - Lecture.lecture.getStartdate()) - .toString(), - formatter.format( - Lecture.lecture.getEnddate()) - .toString(), - Lecture.lecture.isActive(), - modelAll - .getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 6) - .toString(), - modelAll - .getValueAt( - tableAllImages - .convertRowIndexToModel(tableAllImages - .getSelectedRow()), 7) - .toString(), - person.verantwortlicher.getUsername(), - person.verantwortlicher.getVorname(), - person.verantwortlicher.getName(), - person.verantwortlicher.getHochschule(), - person.verantwortlicher.getEMail(), - person.verantwortlicher.getTel(), - person.verantwortlicher.getFakultaet(), - Lecture.lecture.getid()); - JOptionPane - .showMessageDialog( - null, - "Ihre Veranstaltung wurde erfolgreich ge�ndert. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", - "Veranstaltung angelegt", - JOptionPane.INFORMATION_MESSAGE); - // zurueck zum Menue - MainMenue_GUI m = new MainMenue_GUI(); - m.setVisible(true); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - JOptionPane - .showMessageDialog( - null, - "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.", - "Error", - JOptionPane.ERROR_MESSAGE); - JOptionPane.showMessageDialog(null, - e1.getCause()+"\n"+e1.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } - - dispose(); - - } - else { - // nothing selected - JOptionPane.showMessageDialog(null, - "Bitte w\u00e4hlen Sie ein Image aus.", - "Image Auswahl", - JOptionPane.INFORMATION_MESSAGE); - } - - } - }); - cancelButton.setActionCommand("Cancel"); - buttonPane.add(cancelButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 79, 912, 1); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 912, 2); - getContentPane().add(separator_1); - - JPanel panel = new JPanel(); - panel.setLayout(null); - panel.setBorder(new TitledBorder(null, "Detailinformationen", - - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel.setBackground(SystemColor.menu); - panel.setBounds(586, 85, 316, 531); - getContentPane().add(panel); - - JLabel lblName = new JLabel("Name:"); - lblName.setBounds(10, 87, 130, 14); - panel.add(lblName); - - labelName = new JLabel(""); - labelName.setBounds(10, 102, 296, 14); - panel.add(labelName); - - JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); - lblVerantwortlicher.setBounds(10, 259, 130, 14); - panel.add(lblVerantwortlicher); - - labelOS = new JLabel(""); - labelOS.setBounds(10, 216, 296, 14); - panel.add(labelOS); - - JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:"); - lblWeitereVerantwortliche.setBounds(10, 202, 130, 14); - panel.add(lblWeitereVerantwortliche); - - labelVerantwortlicher = new JLabel(""); - labelVerantwortlicher.setBounds(10, 272, 296, 14); - panel.add(labelVerantwortlicher); - - JLabel label = new JLabel("Weitere Verantwortliche:"); - label.setBounds(10, 284, 130, 14); - panel.add(label); - - labelWeitereVerantwortliche = new JLabel(""); - labelWeitereVerantwortliche.setBounds(10, 297, 296, 14); - panel.add(labelWeitereVerantwortliche); - - labelUpdate = new JLabel(""); - labelUpdate.setBounds(10, 245, 296, 14); - panel.add(labelUpdate); - - JLabel lblLetztesUpdate = new JLabel("Letztes Update:"); - lblLetztesUpdate.setBounds(10, 231, 130, 14); - panel.add(lblLetztesUpdate); - - JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:"); - lblImageIstVorlage.setBounds(10, 336, 130, 14); - panel.add(lblImageIstVorlage); - - labelVorlage = new JLabel(""); - labelVorlage.setBounds(10, 350, 296, 14); - panel.add(labelVorlage); - - labelLizenzSoftware = new JLabel(""); - labelLizenzSoftware.setBounds(10, 383, 296, 14); - panel.add(labelLizenzSoftware); - - JLabel lblLizenzpflichtigeSoftware = new JLabel("Lizenzpflichtige Software:"); - lblLizenzpflichtigeSoftware.setBounds(10, 367, 130, 14); - panel.add(lblLizenzpflichtigeSoftware); - - JLabel lblInternet = new JLabel("Internetsperre vorhanden:"); - lblInternet.setBounds(10, 400, 130, 14); - panel.add(lblInternet); - - labelInternet = new JLabel(""); - labelInternet.setBounds(10, 417, 296, 14); - panel.add(labelInternet); - - JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:"); - lblEmpfehlungRam.setBounds(10, 432, 130, 14); - panel.add(lblEmpfehlungRam); - - labelRam = new JLabel(""); - labelRam.setBounds(10, 455, 296, 14); - panel.add(labelRam); - - JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:"); - lblEmpfehlungCpu.setBounds(10, 469, 130, 14); - panel.add(lblEmpfehlungCpu); - - labelCPU = new JLabel(""); - labelCPU.setBounds(10, 487, 296, 14); - panel.add(labelCPU); - - JLabel lblTechnischeDaten = new JLabel("Technische Daten:"); - lblTechnischeDaten.setBounds(10, 322, 296, 14); - panel.add(lblTechnischeDaten); - - JLabel lblId = new JLabel("ID:"); - lblId.setBounds(10, 23, 296, 14); - panel.add(lblId); - - labelID = new JLabel(""); - labelID.setBounds(10, 37, 296, 14); - panel.add(labelID); - - labelVersion = new JLabel(""); - labelVersion.setBounds(10, 73, 296, 14); - panel.add(labelVersion); - - JLabel lblVersion = new JLabel("Version:"); - lblVersion.setBounds(10, 57, 296, 14); - panel.add(lblVersion); - - JLabel lblBeschreibung = new JLabel("Beschreibung:"); - lblBeschreibung.setBounds(10, 119, 130, 14); - panel.add(lblBeschreibung); - - JScrollPane scrollPane = new JScrollPane(); - scrollPane.setBounds(10, 135, 296, 65); - panel.add(scrollPane); - - textAreadesc = new JTextArea(); - textAreadesc.setLineWrap(true); - textAreadesc.setBackground(SystemColor.menu); - scrollPane.setViewportView(textAreadesc); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - } - - // Initiale Beffuelung eines Table models - public DefaultTableModel initTableModel(DefaultTableModel model) throws TException, ParseException { - List images; - - // Hole eine Liste der Images - images = client.getImageList(); - - Iterator i = images.iterator(); - SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); - int x = 0; - - while (i.hasNext()) { - // erzeuge Objekte fuer die Tabelle - Object[] obj = { images.get(x).getImageName(), - images.get(x).getLicenseRestriction(), - images.get(x).getOsName(), - images.get(x).getLectureName(), - images.get(x).getUserData(), - out.format(in.parse(images.get(x).updateTime)), images.get(x).id, - images.get(x).getVersion(), - images.get(x).getIsTemplate() }; - // Fuege diese Objekte der Tabelle hinzu - model.addRow(obj); - x++; - i.next(); - - } - - return model; - - - } - public void writeImageData(String id, String version){ - try { - SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); - Map res=client.getImageData(id,version); - labelName.setText(res.get("name")); - labelOS.setText(res.get("os")); - labelUpdate.setText(out.format(in.parse(res.get("lastupdate")))); - labelVerantwortlicher.setText(res.get("owner")); - labelWeitereVerantwortliche.setText("Noch nicht Verf�gbar"); - if(res.get("template").equals("true")){ - labelVorlage.setText("Ja"); - }else{ - labelVorlage.setText("Nein"); - } - if(res.get("license").equals("1")){ - labelLizenzSoftware.setText("Ja"); - } - else - { - labelLizenzSoftware.setText("Nein"); - } - if(res.get("internet").equals("1")){ - labelInternet.setText("Ja"); - } - else - { - labelInternet.setText("Nein"); - } - labelRam.setText(res.get("ram")); - labelCPU.setText(res.get("cpu")); - labelID.setText(res.get("id")); - labelVersion.setText(res.get("version")); - textAreadesc.setText(res.get("desc")); - } catch (TException | ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java deleted file mode 100644 index 6f0786ef..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java +++ /dev/null @@ -1,824 +0,0 @@ -package gui.lecture; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JScrollPane; -import javax.swing.JSeparator; -import javax.swing.JTabbedPane; -import javax.swing.JTable; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.RowFilter; -import javax.swing.ScrollPaneConstants; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableModel; -import javax.swing.table.TableRowSorter; - -import models.Lecture; -import models.Links; -import models.person; - -import org.apache.thrift.TException; - -import server.Server.Client; -import thrift.ThriftConnection; -import util.GuiOrganizer; -import util.OpenLinks; - -@SuppressWarnings("serial") -public class EditLectureSearch_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - JRadioButton rdbtnInternetJa; - JRadioButton rdbtnInternetNein; - JLabel labelAktiv; - JLabel labelstartdate; - JLabel labelenddate; - JLabel labelimageversion; - JTextArea labelName; - JTextArea labelimage; - JTextArea labeldesc; - JLabel labelVerantwortlicher; - JTable tableAllLectures; - JTable tablemyLectures; - private JTextField textFieldName; - JTabbedPane tabbedPane; - boolean activeSearch = false; - String[] titles = { "Veranstaltungsname", "Beschreibung", - "G\u00fcltigkeitsdatum", "Aktiv", "Letzte Benutzung", - "Verantwortlicher", "Image", "Schlagwort", "ID" }; - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); - final DefaultTableModel modelAll = new DefaultTableModel(titles, 0) { - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0) { - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final TableRowSorter rowSorterAll = new TableRowSorter( - modelAll); - final TableRowSorter rowSorterMyLectures = new TableRowSorter( - modelMyLectures); - private JTextField textField; - - /** - * Create the dialog. - */ - public EditLectureSearch_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - // Beendet die Anwendung nach klick auf X - con.closeThriftConnection(); - System.exit(0); - } - - @Override - public void windowOpened(WindowEvent arg0) { - textFieldName.requestFocusInWindow(); - try { - initTableModel(modelMyLectures); - initTableModel(modelAll); - - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - // auszublendende Angaben - // 1=Beschreibung - // 2=G\u00fcltigkeitsdatum - // 3=Aktiv - // 6=Image - // 7=Schlagwort - // 8=ID - tablemyLectures.getColumnModel().getColumn(1).setWidth(0); - tablemyLectures.getColumnModel().getColumn(1).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(1).setMaxWidth(0); - tablemyLectures.getColumnModel().getColumn(2).setWidth(0); - tablemyLectures.getColumnModel().getColumn(2).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(2).setMaxWidth(0); - tablemyLectures.getColumnModel().getColumn(3).setWidth(0); - tablemyLectures.getColumnModel().getColumn(3).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(3).setMaxWidth(0); - tablemyLectures.getColumnModel().getColumn(6).setWidth(0); - tablemyLectures.getColumnModel().getColumn(6).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(6).setMaxWidth(0); - tablemyLectures.getColumnModel().getColumn(7).setWidth(0); - tablemyLectures.getColumnModel().getColumn(7).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(7).setMaxWidth(0); - tablemyLectures.getColumnModel().getColumn(8).setWidth(0); - tablemyLectures.getColumnModel().getColumn(8).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(8).setMaxWidth(0); - - tableAllLectures.getColumnModel().getColumn(1).setWidth(0); - tableAllLectures.getColumnModel().getColumn(1).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(1).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(2).setWidth(0); - tableAllLectures.getColumnModel().getColumn(2).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(2).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(3).setWidth(0); - tableAllLectures.getColumnModel().getColumn(3).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(3).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(6).setWidth(0); - tableAllLectures.getColumnModel().getColumn(6).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(6).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(7).setWidth(0); - tableAllLectures.getColumnModel().getColumn(7).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(7).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(8).setWidth(0); - tableAllLectures.getColumnModel().getColumn(8).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(8).setMaxWidth(0); - } - }); - // Verhindert das Vergroessern Des Fensters - setResizable(false); - - try { - // Setzt das Look & Feel auf System - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - // Setzt den Fenstertitel - setTitle("bwLehrpool Suite - Veranstaltung bearbeiten"); - // Zentriert das Fenster in die Bildmitte - setBounds(0, 0, 842, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 816, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Suche nach Veranstaltung"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten VL-Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen"); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 531); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 49, 557, 66); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JLabel lblNewLabel_2 = new JLabel("Name:"); - lblNewLabel_2.setBounds(10, 30, 80, 20); - panel_1.add(lblNewLabel_2); - - textFieldName = new JTextField(); - // Key Listener der Tastatureingabe registriert - textFieldName.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - // Textfield eingabe auslesen - String stext = textFieldName.getText(); - // Wenn Textfield nicht leer - if (stext != "") { - activeSearch = true; - // Filtere nach der Eingabe - rowSorterAll.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - - } else { - activeSearch = false; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( - username, 5)); - rowSorterAll.setRowFilter(null); - } - } - }); - - textFieldName.setBounds(96, 30, 166, 20); - panel_1.add(textFieldName); - textFieldName.setColumns(10); - - JLabel label = new JLabel("Beschreibung:"); - label.setBounds(291, 30, 80, 20); - panel_1.add(label); - - textField = new JTextField(); - textField.setColumns(10); - textField.setBounds(381, 30, 166, 20); - panel_1.add(textField); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - // oeffnet das Hauptmenue - - EditLectureSearch_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Veranstaltung"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 75, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(152, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Veranstaltungsauswahl"); - lblNewLabel_1.setBounds(166, 11, 128, 14); - contentPanel.add(lblNewLabel_1); - - tabbedPane = new JTabbedPane(JTabbedPane.TOP); - tabbedPane.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent arg0) { - if (tabbedPane.getSelectedIndex() == 0) { - - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( - username, 5)); - } else if (tabbedPane.getSelectedIndex() == 1) { - rowSorterAll.setRowFilter(null); - } - - } - }); - - tabbedPane.setBounds(10, 123, 557, 397); - contentPanel.add(tabbedPane); - - JScrollPane scrollPaneAllImages = new JScrollPane(); - tableAllLectures = new JTable(); - tableAllLectures.getSelectionModel().addListSelectionListener( - new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { - String imageid = modelAll - .getValueAt( - tableAllLectures - .convertRowIndexToModel(tableAllLectures - .getSelectedRow()), 8) - .toString(); - //System.out.println(imageid); - - try { - writeLectureData(imageid); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } - }); - tableAllLectures.setModel(modelAll); - tableAllLectures.getColumnModel().getColumn(1).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(2).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(3).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(4).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(5).sizeWidthToFit(); - - JScrollPane scrollPaneMyImage = new JScrollPane(); - tablemyLectures = new JTable(); - tablemyLectures.getSelectionModel().addListSelectionListener( - new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { - String imageid = modelMyLectures.getValueAt( - tablemyLectures - .convertRowIndexToModel(tablemyLectures - .getSelectedRow()), 8) - .toString(); - //System.out.println(imageid); - - try { - writeLectureData(imageid); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } - }); - tablemyLectures.setModel(modelMyLectures); - - tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(2).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(3).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(4).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(5).sizeWidthToFit(); - tablemyLectures.setRowSorter(rowSorterMyLectures); - - scrollPaneMyImage.setViewportView(tablemyLectures); - tabbedPane.addTab("Meine Veranstaltungen", null, scrollPaneMyImage, - null); - tableAllLectures.setRowSorter(rowSorterAll); - - scrollPaneAllImages.setViewportView(tableAllLectures); - tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 826, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton btnBack = new JButton("Zur\u00FCck"); - btnBack.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - // oeffnet das Hauptmenue - - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - dispose(); - } - }); - btnBack.setActionCommand("OK"); - buttonPane.add(btnBack); - getRootPane().setDefaultButton(btnBack); - } - { - JButton btnContinue = new JButton("Weiter"); - btnContinue.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - String username = person.verantwortlicher.getName() - + " " + person.verantwortlicher.getVorname(); - // check if a row is selected - if (tablemyLectures.getSelectedRow() != -1) { - - // a row is selected, do operations - - Lecture.lecture.setid(modelMyLectures - .getValueAt( - tablemyLectures - .convertRowIndexToModel(tablemyLectures - .getSelectedRow()), - 8).toString()); - Lecture.lecture.setName(modelMyLectures - .getValueAt( - tablemyLectures - .convertRowIndexToModel(tablemyLectures - .getSelectedRow()), - 0).toString()); - Lecture.lecture.setDesc(modelMyLectures - .getValueAt( - tablemyLectures - .convertRowIndexToModel(tablemyLectures - .getSelectedRow()), - 1).toString()); - String date = modelMyLectures - .getValueAt( - tablemyLectures - .convertRowIndexToModel(tablemyLectures - .getSelectedRow()), - 2).toString(); - - Lecture.lecture.setLinkedImagename(modelMyLectures - .getValueAt( - tablemyLectures - .convertRowIndexToModel(tablemyLectures - .getSelectedRow()), - 6).toString()); - - int zweitesLeerzeichen = date.indexOf(" ", - date.indexOf(" ") + 1); - - String startdate = date.substring(0, - zweitesLeerzeichen); - String enddate = date.substring(zweitesLeerzeichen); - SimpleDateFormat out = new SimpleDateFormat( - "yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat in = new SimpleDateFormat( - "dd.MM.yyyy HH:mm:ss"); - try { - enddate = out.format(in.parse(enddate)); - startdate = out.format(in.parse(startdate)); - } catch (ParseException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - - DateFormat df = new SimpleDateFormat( - "yyyy-MM-dd HH:mm:ss"); - - try { - // Format has to be "yyyy-MM-dd HH:mm:ss" - Lecture.lecture.setEnddate(df.parse(enddate)); - Lecture.lecture.setStartdate(df - .parse(startdate)); - } catch (ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - if (modelMyLectures - .getValueAt( - tablemyLectures - .convertRowIndexToModel(tablemyLectures - .getSelectedRow()), - 3).toString().equals("1")) { - Lecture.lecture.setActive(true); - } else { - Lecture.lecture.setActive(false); - } - - // EditImageAllgemein_GUI ea=new - // EditImageAllgemein_GUI(); - EditLectureAllgemein_GUI el = new EditLectureAllgemein_GUI(); - el.setVisible(true); - dispose(); - } else if (tableAllLectures.getSelectedRow() != -1 - && tableAllLectures - .getValueAt( - tableAllLectures - .getSelectedRow(), 5) - .toString().equals(username)) { - - // a row is selected, do operations - - Lecture.lecture.setid(modelAll - .getValueAt( - tableAllLectures - .convertRowIndexToModel(tableAllLectures - .getSelectedRow()), - 8).toString()); - Lecture.lecture.setName(modelAll - .getValueAt( - tableAllLectures - .convertRowIndexToModel(tableAllLectures - .getSelectedRow()), - 0).toString()); - Lecture.lecture.setDesc(modelAll - .getValueAt( - tableAllLectures - .convertRowIndexToModel(tableAllLectures - .getSelectedRow()), - 1).toString()); - String date = modelAll - .getValueAt( - tableAllLectures - .convertRowIndexToModel(tableAllLectures - .getSelectedRow()), - 2).toString(); - - Lecture.lecture.setLinkedImagename(modelAll - .getValueAt( - tableAllLectures - .convertRowIndexToModel(tableAllLectures - .getSelectedRow()), - 6).toString()); - - int zweitesLeerzeichen = date.indexOf(" ", - date.indexOf(" ") + 1); - - String startdate = date.substring(0, - zweitesLeerzeichen); - String enddate = date.substring(zweitesLeerzeichen); - SimpleDateFormat out = new SimpleDateFormat( - "yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat in = new SimpleDateFormat( - "dd.MM.yyyy HH:mm:ss"); - try { - enddate = out.format(in.parse(enddate)); - startdate = out.format(in.parse(startdate)); - } catch (ParseException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - DateFormat df = new SimpleDateFormat( - "yyyy-MM-dd HH:mm:ss"); - - try { - // Format has to be "yyyy-MM-dd HH:mm:ss" - Lecture.lecture.setEnddate(df.parse(enddate)); - Lecture.lecture.setStartdate(df - .parse(startdate)); - } catch (ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - if (modelAll - .getValueAt( - tableAllLectures - .convertRowIndexToModel(tableAllLectures - .getSelectedRow()), - 3).toString().equals("1")) { - Lecture.lecture.setActive(true); - } else { - Lecture.lecture.setActive(false); - } - - EditLectureAllgemein_GUI el = new EditLectureAllgemein_GUI(); - el.setVisible(true); - dispose(); - } else { - JOptionPane - .showMessageDialog( - null, - "Bitte w\u00e4hlen Sie ein eigenes Image aus.", - "Message", - JOptionPane.INFORMATION_MESSAGE); - } // End Else - } // Action - - }); - btnContinue.setActionCommand("Cancel"); - buttonPane.add(btnContinue); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 79, 836, 1); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 628, 836, 1); - getContentPane().add(separator_1); - - JPanel panel = new JPanel(); - panel.setLayout(null); - panel.setBorder(new TitledBorder(null, "Detailinformationen", - - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel.setBackground(SystemColor.menu); - panel.setBounds(591, 85, 235, 518); - getContentPane().add(panel); - - JLabel lblNewLabel_3 = new JLabel("Name:"); - lblNewLabel_3.setBounds(10, 27, 104, 14); - panel.add(lblNewLabel_3); - - JLabel lblAktiv = new JLabel("Aktiv:"); - lblAktiv.setBounds(10, 98, 104, 14); - panel.add(lblAktiv); - - labelAktiv = new JLabel(""); - labelAktiv.setBounds(10, 114, 218, 14); - panel.add(labelAktiv); - - labelstartdate = new JLabel(""); - labelstartdate.setBounds(10, 147, 218, 14); - panel.add(labelstartdate); - - JLabel lblStartdatum = new JLabel("Startdatum:"); - lblStartdatum.setBounds(10, 129, 104, 14); - panel.add(lblStartdatum); - - labelenddate = new JLabel(""); - labelenddate.setBounds(10, 175, 218, 14); - panel.add(labelenddate); - - JLabel lblEnddatum = new JLabel("Enddatum:"); - lblEnddatum.setBounds(10, 161, 104, 14); - panel.add(lblEnddatum); - - JLabel lblBeschreibung = new JLabel("Beschreibung:"); - lblBeschreibung.setBounds(10, 189, 104, 14); - panel.add(lblBeschreibung); - - JLabel lblImage = new JLabel("Image:"); - lblImage.setBounds(10, 293, 104, 14); - panel.add(lblImage); - - labelVerantwortlicher = new JLabel(""); - labelVerantwortlicher.setBounds(10, 426, 218, 14); - panel.add(labelVerantwortlicher); - - JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); - lblVerantwortlicher.setBounds(10, 411, 104, 14); - panel.add(lblVerantwortlicher); - - JLabel lblImageversion = new JLabel("Imageversion:"); - lblImageversion.setBounds(10, 381, 104, 14); - panel.add(lblImageversion); - - labelimageversion = new JLabel(""); - labelimageversion.setBounds(10, 399, 218, 14); - panel.add(labelimageversion); - - labeldesc = new JTextArea(); - labeldesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); - labeldesc.setEditable(false); - labeldesc.setLineWrap(true); - labeldesc.setBackground(SystemColor.menu); - labeldesc.setBounds(124, 127, 104, 110); - JScrollPane scrollPane = new JScrollPane(labeldesc); - scrollPane.setBounds(10, 209, 218, 81); - panel.add(scrollPane); - // panel.add(labeldesc); - - labelimage = new JTextArea(); - labelimage.setLineWrap(true); - labelimage.setFont(new Font("Tahoma", Font.PLAIN, 11)); - labelimage.setEditable(false); - labelimage.setBackground(SystemColor.menu); - labelimage.setBounds(124, 248, 101, 81); - JScrollPane scrollPaneImage = new JScrollPane(labelimage); - scrollPaneImage.setBounds(10, 309, 215, 69); - panel.add(scrollPaneImage); - - labelName = new JTextArea(); - labelName.setEditable(false); - labelName.setFont(new Font("Tahoma", Font.PLAIN, 11)); - labelName.setBackground(SystemColor.menu); - labelName.setBounds(124, 22, 101, 55); - JScrollPane scrollPaneName = new JScrollPane(labelName); - scrollPaneName.setBounds(10, 40, 218, 55); - panel.add(scrollPaneName); - // panel.add(labelName); - // panel.add(labelimage); - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - } - - // Initiale Beffuelung eines Table models - public DefaultTableModel initTableModel(DefaultTableModel model) - throws ParseException { - List lectures; - try { - // Hole eine Liste der Images - lectures = client.getLectureList(); - Iterator i = lectures.iterator(); - SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); - int x = 0; - - while (i.hasNext()) { - // erzeuge Objekte fuer die Tabelle - - Object[] obj = { - lectures.get(x).lecturename, - lectures.get(x).desc, - out.format(in.parse(lectures.get(x).starttime)) + " " - + out.format(in.parse(lectures.get(x).endtime)), - lectures.get(x).isActive, - out.format(in.parse(lectures.get(x).lastused)), - lectures.get(x).username, lectures.get(x).imagename, - " ", lectures.get(x).id }; - // Fuege diese Objekte der Tabelle hinzu - model.addRow(obj); - - x++; - i.next(); - - } - - return model; - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - return model; - } - - public void writeLectureData(String id) throws TException, ParseException { - - SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); - Map res = client.getLectureData(id); - labelName.setText(res.get("name")); - labelAktiv.setText(res.get("isActive")); - labeldesc.setText(res.get("desc")); - labelVerantwortlicher.setText(res.get("owner")); - labelstartdate.setText(out.format(in.parse(res.get("startTime")))); - labelenddate.setText(out.format(in.parse(res.get("endTime")))); - labelimage.setText(res.get("imagepath").substring( - res.get("imagepath").indexOf("/") + 1)); - labelimageversion.setText(res.get("imageversion")); - - } - -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java deleted file mode 100644 index cfd2337c..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java +++ /dev/null @@ -1,546 +0,0 @@ -package gui.lecture; - - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Checkbox; -import java.awt.Color; -import java.awt.Component; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.AbstractButton; -import javax.swing.ButtonGroup; -import javax.swing.DefaultComboBoxModel; -import javax.swing.Icon; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JSeparator; -import javax.swing.JTextPane; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; -import javax.swing.table.DefaultTableCellRenderer; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.JTableHeader; -import javax.swing.table.TableCellEditor; -import javax.swing.table.TableCellRenderer; -import javax.swing.table.TableColumn; -import javax.swing.table.TableColumnModel; - -import models.Image; -import models.Links; -import util.GuiOrganizer; -import util.OpenLinks; -import javax.swing.JTable; -import javax.swing.JScrollPane; -import javax.swing.ScrollPaneConstants; -import javax.swing.JTextField; - -import org.eclipse.jface.viewers.CheckboxCellEditor; - -import java.awt.Choice; -import javax.swing.JRadioButton; - -@SuppressWarnings("serial") -public class PermissionCreateLecture_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - private JTable table; - private Class[] classes; - Object[] titles = { "Name","Read", "Write","Admin"}; - - final DefaultTableModel model = new DefaultTableModel(titles, 0){ - - - - public boolean isCellEditable(int rowIndex, int mColIndex) { - if(mColIndex>=1){ - return true; - } - return false; - } - public Class getColumnClass(int c) { - switch(c){ - case 0: - return String.class; - default: - return Boolean.class; - } - } - - - - }; - private JTextField textField; - private JTable table_1; - private final ButtonGroup buttonGroup = new ButtonGroup(); - - public PermissionCreateLecture_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - System.exit(0); - } - }); - setResizable(false); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - setTitle("bwLehrpool Suite - Berechtigungen"); - - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Veranstaltungen - Berechtigungen (Nur zur Veranschaulichung)"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie.setText("Definieren Sie hier bitte die gew\u00FCnschten Berechtigungen f\u00FCr ihr Lecture"); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 531); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Suite-Berechtigungen", TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 207, 311, 313); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JScrollPane scrollPane = new JScrollPane(); - scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - scrollPane.setBounds(10, 21, 291, 249); - panel_1.add(scrollPane); - - table = new JTable(); - table.setModel(model); - table.setSelectionForeground(Color.WHITE); - Object[] rowdata={"Max Mustermann", new Boolean(false),new Boolean(false),new Boolean(false),new Boolean(false)}; - model.addRow(rowdata); - - TableCellRenderer rend=table.getTableHeader().getDefaultRenderer(); - - - TableColumn tc1 = table.getColumnModel().getColumn(1); - tc1.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc1.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc1.setHeaderRenderer(new CheckBoxHeader(new MyItemListener1(),(String) titles[1])); - - TableColumn tc2 = table.getColumnModel().getColumn(2); - tc2.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc2.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc2.setHeaderRenderer(new CheckBoxHeader(new MyItemListener2(),(String) titles[2])); - - TableColumn tc3 = table.getColumnModel().getColumn(3); - tc3.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc3.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc3.setHeaderRenderer(new CheckBoxHeader(new MyItemListener3(),(String) titles[3])); - /* - TableColumn tc4 = table.getColumnModel().getColumn(4); - tc4.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc4.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc4.setHeaderRenderer(new CheckBoxHeader(new MyItemListener4(),(String) titles[4])); - */ - scrollPane.setViewportView(table); - - JButton btnHinzufgen_1 = new JButton("Hinzuf\u00FCgen"); - btnHinzufgen_1.setEnabled(false); - btnHinzufgen_1.setBounds(10, 279, 89, 23); - panel_1.add(btnHinzufgen_1); - - JButton btnLschen_1 = new JButton("L\u00F6schen"); - btnLschen_1.setEnabled(false); - btnLschen_1.setBounds(109, 279, 89, 23); - panel_1.add(btnLschen_1); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - - PermissionCreateLecture_GUI.this.setVisible(false); - MainMenue_GUI main=new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Veranstaltung"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 90, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(181, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Berechtigungen"); - lblNewLabel_1.setBounds(194, 11, 95, 14); - contentPanel.add(lblNewLabel_1); - - JLabel lblName = new JLabel("Name:"); - lblName.setBounds(10, 36, 46, 20); - contentPanel.add(lblName); - - textField = new JTextField(); - textField.setBounds(69, 36, 171, 20); - contentPanel.add(textField); - textField.setColumns(10); - - JLabel lblHochschule = new JLabel("Hochschule:"); - lblHochschule.setBounds(275, 36, 80, 20); - contentPanel.add(lblHochschule); - - JComboBox comboBox = new JComboBox(); - comboBox.setModel(new DefaultComboBoxModel(new String[] {"Hochschule Offenburg", "Hochschule Reutlingen", "Universit\u00E4t Freiburg"})); - comboBox.setBounds(365, 36, 202, 20); - contentPanel.add(comboBox); - - JPanel panel = new JPanel(); - panel.setBounds(10, 67, 557, 129); - contentPanel.add(panel); - panel.setLayout(null); - panel.setBorder(new TitledBorder(null, "Beschreibung", TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel.setBackground(SystemColor.menu); - - JLabel label = new JLabel("Read"); - label.setBounds(20, 18, 90, 20); - panel.add(label); - - JLabel label_3 = new JLabel("Write"); - label_3.setBounds(20, 38, 90, 20); - panel.add(label_3); - - JLabel label_5 = new JLabel("Admin"); - label_5.setBounds(20, 78, 90, 20); - panel.add(label_5); - - JLabel label_7 = new JLabel("Image darf gelesen und gestartet werden und ist in Suchfenster sichtbar."); - label_7.setBounds(120, 18, 380, 20); - panel.add(label_7); - - JLabel lblimageDarfAngepasst = new JLabel("Image darf angepasst und überschrieben, jedoch nicht gelöscht werden. Berechtigungen für andere Benutzer festlegen"); - lblimageDarfAngepasst.setBounds(120, 38, 380, 45); - panel.add(lblimageDarfAngepasst); - - JLabel lblvolleRechteRead = new JLabel("Volle Rechte: read, write, löschen und Berechtigungen für andere Benutzer festlegen."); - lblvolleRechteRead.setBounds(120, 78, 380, 40); - panel.add(lblvolleRechteRead); - - JPanel panel_2 = new JPanel(); - panel_2.setBounds(331, 207, 236, 313); - contentPanel.add(panel_2); - panel_2.setLayout(null); - panel_2.setBorder(new TitledBorder(null, "Sichtbarkeit im VMChooser", TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_2.setBackground(SystemColor.menu); - - JScrollPane scrollPane_1 = new JScrollPane(); - scrollPane_1.setEnabled(false); - scrollPane_1.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - scrollPane_1.setBounds(23, 83, 203, 185); - panel_2.add(scrollPane_1); - - table_1 = new JTable(); - scrollPane_1.setViewportView(table_1); - - JRadioButton rdbtnAlle = new JRadioButton("Sichtbar f\u00FCr alle"); - rdbtnAlle.setEnabled(false); - rdbtnAlle.setSelected(true); - buttonGroup.add(rdbtnAlle); - rdbtnAlle.setBounds(6, 27, 109, 23); - panel_2.add(rdbtnAlle); - - JRadioButton rdbtnIndividuell = new JRadioButton("Individuell"); - rdbtnIndividuell.setEnabled(false); - buttonGroup.add(rdbtnIndividuell); - rdbtnIndividuell.setBounds(6, 53, 109, 23); - panel_2.add(rdbtnIndividuell); - - JButton btnHinzufgen = new JButton("Hinzuf\u00FCgen"); - btnHinzufgen.setEnabled(false); - btnHinzufgen.setBounds(23, 279, 89, 23); - panel_2.add(btnHinzufgen); - - JButton btnLschen = new JButton("L\u00F6schen"); - btnLschen.setEnabled(false); - btnLschen.setBounds(122, 279, 89, 23); - panel_2.add(btnLschen); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton cancelButton = new JButton("Zur\u00FCck"); - cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - - CreateLectureAllgemein_GUI sr=new CreateLectureAllgemein_GUI(); - sr.setVisible(true); - dispose(); - } - }); - cancelButton.setActionCommand("OK"); - buttonPane.add(cancelButton); - //getRootPane().setDefaultButton(cancelButton); - } - { - JButton continueButton = new JButton("Weiter"); - continueButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - CreateLectureLink_GUI ea=new CreateLectureLink_GUI(); - ea.setVisible(true); - dispose(); - - } - }); - continueButton.setActionCommand("Cancel"); - buttonPane.add(continueButton); - getRootPane().setDefaultButton(continueButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); - getContentPane().add(separator_1); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu = new JMenu("Suchen"); - menuBar.add(mnNewMenu); - - JMenuItem mntmVlSuche = new JMenuItem("VL Suche"); - mnNewMenu.add(mntmVlSuche); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - } - class MyItemListener1 implements ItemListener - { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for(int x = 0, y = table.getRowCount(); x < y; x++) - { - table.setValueAt(new Boolean(checked),x,1); - } - } - } - class MyItemListener2 implements ItemListener - { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for(int x = 0, y = table.getRowCount(); x < y; x++) - { - table.setValueAt(new Boolean(checked),x,2); - } - } - } - class MyItemListener3 implements ItemListener - { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for(int x = 0, y = table.getRowCount(); x < y; x++) - { - table.setValueAt(new Boolean(checked),x,3); - } - } - } - class MyItemListener4 implements ItemListener - { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for(int x = 0, y = table.getRowCount(); x < y; x++) - { - table.setValueAt(new Boolean(checked),x,4); - } - } - } -} -class CheckBoxHeader extends JCheckBox -implements TableCellRenderer, MouseListener { -protected CheckBoxHeader rendererComponent; -protected int column; -protected boolean mousePressed = false; - -public CheckBoxHeader(ItemListener itemListener ,String text) { -rendererComponent = this; -rendererComponent.addItemListener(itemListener); -rendererComponent.setText(text); -} - -public Component getTableCellRendererComponent( - JTable table, Object value, - boolean isSelected, boolean hasFocus, int row, int column) { -if (table != null) { - JTableHeader header = table.getTableHeader(); - if (header != null) { - rendererComponent.setForeground(header.getForeground()); - rendererComponent.setBackground(header.getBackground()); - rendererComponent.setFont(header.getFont()); - rendererComponent.setBorder(header.getBorder()); - header.addMouseListener(rendererComponent); - } -} -setColumn(column); -//rendererComponent.setText("Check All"); -//setBorder(UIManager.getBorder("TableHeader.cellBorder")); - -return rendererComponent; -} -protected void setColumn(int column) { -this.column = column; -} -public int getColumn() { -return column; -} -protected void handleClickEvent(MouseEvent e) { -if (mousePressed) { - mousePressed=false; - JTableHeader header = (JTableHeader)(e.getSource()); - JTable tableView = header.getTable(); - TableColumnModel columnModel = tableView.getColumnModel(); - int viewColumn = columnModel.getColumnIndexAtX(e.getX()); - int column = tableView.convertColumnIndexToModel(viewColumn); - - if (viewColumn == this.column && e.getClickCount() == 1 && column != -1) { - doClick(); - } -} -} -public void mouseClicked(MouseEvent e) { -handleClickEvent(e); -((JTableHeader)e.getSource()).repaint(); -} -public void mousePressed(MouseEvent e) { -mousePressed = true; -} -public void mouseReleased(MouseEvent e) { -} -public void mouseEntered(MouseEvent e) { -} -public void mouseExited(MouseEvent e) { -} -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java deleted file mode 100644 index da8864c7..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java +++ /dev/null @@ -1,494 +0,0 @@ -package gui.lecture; - - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Checkbox; -import java.awt.Color; -import java.awt.Component; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.AbstractButton; -import javax.swing.ButtonGroup; -import javax.swing.DefaultComboBoxModel; -import javax.swing.Icon; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JSeparator; -import javax.swing.JTextPane; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; -import javax.swing.table.DefaultTableCellRenderer; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.JTableHeader; -import javax.swing.table.TableCellEditor; -import javax.swing.table.TableCellRenderer; -import javax.swing.table.TableColumn; -import javax.swing.table.TableColumnModel; - -import models.Image; -import models.Links; -import util.GuiOrganizer; -import util.OpenLinks; -import javax.swing.JTable; -import javax.swing.JScrollPane; -import javax.swing.ScrollPaneConstants; -import javax.swing.JTextField; - -import org.eclipse.jface.viewers.CheckboxCellEditor; - -import java.awt.Choice; - -@SuppressWarnings("serial") -public class PermissionEditLecture_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - private JTable table; - private Class[] classes; - Object[] titles = { "Name","Read", "Write","Admin"}; - - final DefaultTableModel model = new DefaultTableModel(titles, 0){ - - - - public boolean isCellEditable(int rowIndex, int mColIndex) { - if(mColIndex>=1){ - return true; - } - return false; - } - public Class getColumnClass(int c) { - switch(c){ - case 0: - return String.class; - default: - return Boolean.class; - } - } - - - - }; - private JTextField textField; - - public PermissionEditLecture_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - System.exit(0); - } - }); - setResizable(false); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - setTitle("bwLehrpool Suite - Berechtigungen"); - - setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Lecture Berechtigungen (Nur zur Veranschaulichung)"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie.setText("Definieren Sie hier bitte die gew\u00FCnschten Berechtigungen f\u00FCr ihr Lecture"); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 531); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel = new JPanel(); - panel.setLayout(null); - panel.setBorder(new TitledBorder(null, "Beschreibung", TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 67, 557, 129); - contentPanel.add(panel); - - JLabel label = new JLabel("Read"); - label.setBounds(20, 18, 90, 20); - panel.add(label); - - JLabel label_3 = new JLabel("Image darf gelesen und gestartet werden und ist in Suchfenster sichtbar."); - label_3.setBounds(120, 18, 380, 20); - panel.add(label_3); - - JLabel label_4 = new JLabel("Write"); - label_4.setBounds(20, 38, 90, 20); - panel.add(label_4); - - JLabel label_5 = new JLabel("Image darf angepasst und überschrieben, jedoch nicht gelöscht werden. Berechtigungen für andere Benutzer festlegen"); - label_5.setBounds(120, 38, 380, 45); - panel.add(label_5); - - JLabel label_6 = new JLabel("Admin"); - label_6.setBounds(20, 78, 90, 20); - panel.add(label_6); - - JLabel label_7 = new JLabel("Volle Rechte: read, write, löschen und Berechtigungen für andere Benutzer festlegen."); - label_7.setBounds(120, 78, 380, 40); - panel.add(label_7); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Berechtigungen", TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 207, 557, 313); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JScrollPane scrollPane = new JScrollPane(); - scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - scrollPane.setBounds(10, 21, 537, 281); - panel_1.add(scrollPane); - - table = new JTable(); - table.setModel(model); - table.setSelectionForeground(Color.WHITE); - Object[] rowdata={"Max Mustermann", new Boolean(false),new Boolean(false),new Boolean(false),new Boolean(false)}; - model.addRow(rowdata); - - TableCellRenderer rend=table.getTableHeader().getDefaultRenderer(); - - - TableColumn tc1 = table.getColumnModel().getColumn(1); - tc1.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc1.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc1.setHeaderRenderer(new CheckBoxHeader(new MyItemListener1(),(String) titles[1])); - - TableColumn tc2 = table.getColumnModel().getColumn(2); - tc2.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc2.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc2.setHeaderRenderer(new CheckBoxHeader(new MyItemListener2(),(String) titles[2])); - - TableColumn tc3 = table.getColumnModel().getColumn(3); - tc3.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc3.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc3.setHeaderRenderer(new CheckBoxHeader(new MyItemListener3(),(String) titles[3])); - /* - TableColumn tc4 = table.getColumnModel().getColumn(4); - tc4.setCellEditor(table.getDefaultEditor(Boolean.class)); - tc4.setCellRenderer(table.getDefaultRenderer(Boolean.class)); - tc4.setHeaderRenderer(new CheckBoxHeader(new MyItemListener4(),(String) titles[4])); - */ - scrollPane.setViewportView(table); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - - PermissionEditLecture_GUI.this.setVisible(false); - MainMenue_GUI main=new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Veranstaltung"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 90, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(181, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Berechtigungen"); - lblNewLabel_1.setBounds(194, 11, 99, 14); - contentPanel.add(lblNewLabel_1); - - JLabel lblName = new JLabel("Name:"); - lblName.setBounds(10, 36, 46, 20); - contentPanel.add(lblName); - - textField = new JTextField(); - textField.setBounds(69, 36, 171, 20); - contentPanel.add(textField); - textField.setColumns(10); - - JLabel lblHochschule = new JLabel("Hochschule:"); - lblHochschule.setBounds(275, 36, 80, 20); - contentPanel.add(lblHochschule); - - JComboBox comboBox = new JComboBox(); - comboBox.setModel(new DefaultComboBoxModel(new String[] {"Hochschule Offenburg", "Hochschule Reutlingen", "Universit\u00E4t Freiburg"})); - comboBox.setBounds(365, 36, 202, 20); - contentPanel.add(comboBox); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton cancelButton = new JButton("Zur\u00FCck"); - cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - - EditLectureAllgemein_GUI sr=new EditLectureAllgemein_GUI(); - sr.setVisible(true); - dispose(); - } - }); - cancelButton.setActionCommand("OK"); - buttonPane.add(cancelButton); - //getRootPane().setDefaultButton(cancelButton); - } - { - JButton continueButton = new JButton("Weiter"); - continueButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - EditLectureLink_GUI ea=new EditLectureLink_GUI(); - ea.setVisible(true); - dispose(); - - } - }); - continueButton.setActionCommand("Cancel"); - buttonPane.add(continueButton); - getRootPane().setDefaultButton(continueButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); - getContentPane().add(separator_1); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu = new JMenu("Suchen"); - menuBar.add(mnNewMenu); - - JMenuItem mntmVlSuche = new JMenuItem("VL Suche"); - mnNewMenu.add(mntmVlSuche); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - } - class MyItemListener1 implements ItemListener - { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for(int x = 0, y = table.getRowCount(); x < y; x++) - { - table.setValueAt(new Boolean(checked),x,1); - } - } - } - class MyItemListener2 implements ItemListener - { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for(int x = 0, y = table.getRowCount(); x < y; x++) - { - table.setValueAt(new Boolean(checked),x,2); - } - } - } - class MyItemListener3 implements ItemListener - { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for(int x = 0, y = table.getRowCount(); x < y; x++) - { - table.setValueAt(new Boolean(checked),x,3); - } - } - } - class MyItemListener4 implements ItemListener - { - public void itemStateChanged(ItemEvent e) { - Object source = e.getSource(); - if (source instanceof AbstractButton == false) return; - boolean checked = e.getStateChange() == ItemEvent.SELECTED; - for(int x = 0, y = table.getRowCount(); x < y; x++) - { - table.setValueAt(new Boolean(checked),x,4); - } - } - } -} -/*class CheckBoxHeader extends JCheckBox -implements TableCellRenderer, MouseListener { -protected CheckBoxHeader rendererComponent; -protected int column; -protected boolean mousePressed = false; - -public CheckBoxHeader(ItemListener itemListener ,String text) { -rendererComponent = this; -rendererComponent.addItemListener(itemListener); -rendererComponent.setText(text); -} - -public Component getTableCellRendererComponent( - JTable table, Object value, - boolean isSelected, boolean hasFocus, int row, int column) { -if (table != null) { - JTableHeader header = table.getTableHeader(); - if (header != null) { - rendererComponent.setForeground(header.getForeground()); - rendererComponent.setBackground(header.getBackground()); - rendererComponent.setFont(header.getFont()); - rendererComponent.setBorder(header.getBorder()); - header.addMouseListener(rendererComponent); - } -} -setColumn(column); -//rendererComponent.setText("Check All"); -//setBorder(UIManager.getBorder("TableHeader.cellBorder")); - -return rendererComponent; -} -protected void setColumn(int column) { -this.column = column; -} -public int getColumn() { -return column; -} -protected void handleClickEvent(MouseEvent e) { -if (mousePressed) { - mousePressed=false; - JTableHeader header = (JTableHeader)(e.getSource()); - JTable tableView = header.getTable(); - TableColumnModel columnModel = tableView.getColumnModel(); - int viewColumn = columnModel.getColumnIndexAtX(e.getX()); - int column = tableView.convertColumnIndexToModel(viewColumn); - - if (viewColumn == this.column && e.getClickCount() == 1 && column != -1) { - doClick(); - } -} -} -public void mouseClicked(MouseEvent e) { -handleClickEvent(e); -((JTableHeader)e.getSource()).repaint(); -} -public void mousePressed(MouseEvent e) { -mousePressed = true; -} -public void mouseReleased(MouseEvent e) { -} -public void mouseEntered(MouseEvent e) { -} -public void mouseExited(MouseEvent e) { -} -} */ diff --git a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java b/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java deleted file mode 100644 index 7a6c2118..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java +++ /dev/null @@ -1,627 +0,0 @@ -package gui.lecture; - -import gui.intro.About_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.Point; -import java.awt.SystemColor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JScrollPane; -import javax.swing.JSeparator; -import javax.swing.JTabbedPane; -import javax.swing.JTable; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.RowFilter; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableModel; -import javax.swing.table.TableRowSorter; - -import models.Links; -import models.person; - -import org.apache.thrift.TException; - -import server.Server.Client; -import thrift.ThriftConnection; -import util.GuiOrganizer; -import util.OpenLinks; -import javax.swing.JTextArea; -import javax.swing.ScrollPaneConstants; - -@SuppressWarnings("serial") -public class SearchLecture_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - JRadioButton rdbtnInternetJa; - JRadioButton rdbtnInternetNein; - JLabel labelAktiv; - JLabel labelstartdate; - JLabel labelenddate; - JLabel labelimageversion; - JTextArea labelName; - JTextArea labelimage; - JTextArea labeldesc; - JLabel labelVerantwortlicher; - JTable tableAllLectures; - JTable tablemyLectures; - private JTextField textFieldName; - JTabbedPane tabbedPane; - boolean activeSearch=false; - String[] titles = { "Veranstaltungsname", "Beschreibung", - "G\u00fcltigkeitsdatum", "Aktiv", "Letzte Benutzung", - "Verantwortlicher", "Image", "Schlagwort", "ID" }; - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); - final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){ - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0){ - public boolean isCellEditable(int rowIndex, int mColIndex) { - return false; - } - }; - final TableRowSorter rowSorterAll = new TableRowSorter( - modelAll); - final TableRowSorter rowSorterMyLectures = new TableRowSorter( - modelMyLectures); - private JTextField textField; - - - /** - * Create the dialog. - */ - public SearchLecture_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - // Beendet die Anwendung nach klick auf X - con.closeThriftConnection(); - System.exit(0); - } - @Override - public void windowOpened(WindowEvent arg0) { - try { - initTableModel(modelMyLectures); - initTableModel(modelAll); - - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - tablemyLectures.getColumnModel().getColumn(1).setWidth(0); - tablemyLectures.getColumnModel().getColumn(1).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(1).setMaxWidth(0); - tablemyLectures.getColumnModel().getColumn(2).setWidth(0); - tablemyLectures.getColumnModel().getColumn(2).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(2).setMaxWidth(0); - tablemyLectures.getColumnModel().getColumn(3).setWidth(0); - tablemyLectures.getColumnModel().getColumn(3).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(3).setMaxWidth(0); - tablemyLectures.getColumnModel().getColumn(6).setWidth(0); - tablemyLectures.getColumnModel().getColumn(6).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(6).setMaxWidth(0); - tablemyLectures.getColumnModel().getColumn(7).setWidth(0); - tablemyLectures.getColumnModel().getColumn(7).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(7).setMaxWidth(0); - tablemyLectures.getColumnModel().getColumn(8).setWidth(0); - tablemyLectures.getColumnModel().getColumn(8).setMinWidth(0); - tablemyLectures.getColumnModel().getColumn(8).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(1).setWidth(0); - tableAllLectures.getColumnModel().getColumn(1).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(1).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(2).setWidth(0); - tableAllLectures.getColumnModel().getColumn(2).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(2).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(3).setWidth(0); - tableAllLectures.getColumnModel().getColumn(3).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(3).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(6).setWidth(0); - tableAllLectures.getColumnModel().getColumn(6).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(6).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(7).setWidth(0); - tableAllLectures.getColumnModel().getColumn(7).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(7).setMaxWidth(0); - tableAllLectures.getColumnModel().getColumn(8).setWidth(0); - tableAllLectures.getColumnModel().getColumn(8).setMinWidth(0); - tableAllLectures.getColumnModel().getColumn(8).setMaxWidth(0); - } - }); - // Verhindert das Vergroessern Des Fensters - setResizable(false); - - try { - // Setzt das Look & Feel auf System - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - // Setzt den Fenstertitel - setTitle("bwLehrpool Suite - Veranstaltung suchen"); - // Zentriert das Fenster in die Bildmitte 2; - setBounds(0, 0, 842, 722); - GuiOrganizer.centerGUI(this); - - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 816, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Suche nach Veranstaltung"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie - .setText("Hier k\u00F6nnen Sie nach Ihrer gew\u00fcnschten Veranstaltung suchen und diese f\u00fcr weitere Schritte ausw\u00e4hlen."); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 531); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 49, 557, 63); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - JLabel lblNewLabel_2 = new JLabel("Name:"); - lblNewLabel_2.setBounds(10, 30, 80, 20); - panel_1.add(lblNewLabel_2); - - textFieldName = new JTextField(); - // Key Listener der Tastatureingabe registriert - textFieldName.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - // Textfield eingabe auslesen - String stext = textFieldName.getText(); - // Wenn Textfield nicht leer - if (stext != "") { - activeSearch=true; - // Filtere nach der Eingabe - rowSorterAll.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( - textFieldName.getText(), 0)); - - }else{ - activeSearch=false; - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( - username, 5)); - rowSorterAll.setRowFilter(null); - } - } - }); - - textFieldName.setBounds(96, 30, 166, 20); - panel_1.add(textFieldName); - textFieldName.setColumns(10); - - JLabel label = new JLabel("Beschreibung:"); - label.setBounds(291, 30, 80, 20); - panel_1.add(label); - - textField = new JTextField(); - textField.setColumns(10); - textField.setBounds(381, 30, 166, 20); - panel_1.add(textField); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00fc"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - // oeffnet das Hauptmenue - - SearchLecture_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("Veranstaltung"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 75, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(152, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Veranstaltungssuche"); - lblNewLabel_1.setBounds(166, 11, 128, 14); - contentPanel.add(lblNewLabel_1); - - tabbedPane = new JTabbedPane(JTabbedPane.TOP); - tabbedPane.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent arg0) { - if (tabbedPane.getSelectedIndex() == 0) { - - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( - username, 5)); - } else if (tabbedPane.getSelectedIndex() == 1) { - - } - - } - }); - - tabbedPane.setBounds(10, 123, 557, 397); - contentPanel.add(tabbedPane); - - - JScrollPane scrollPaneAllImages = new JScrollPane(); - tableAllLectures = new JTable(); - tableAllLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener() - { - public void valueChanged(ListSelectionEvent e) - { - String imageid = modelAll - .getValueAt( - tableAllLectures - .convertRowIndexToModel(tableAllLectures - .getSelectedRow()), 8) - .toString(); - //System.out.println(imageid); - - try { - writeLectureData(imageid); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } - }); - tableAllLectures.setModel(modelAll); - tableAllLectures.getColumnModel().getColumn(1).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(2).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(3).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(4).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(5).sizeWidthToFit(); - - JScrollPane scrollPaneMyImage = new JScrollPane(); - tablemyLectures = new JTable(); - tablemyLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener() - { - public void valueChanged(ListSelectionEvent e) - { - String imageid = modelMyLectures - .getValueAt( - tablemyLectures - .convertRowIndexToModel(tablemyLectures - .getSelectedRow()), 8) - .toString(); - //System.out.println(imageid); - - try { - writeLectureData(imageid); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } - }); - tablemyLectures.setModel(modelMyLectures); - - tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(2).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(3).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(4).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(5).sizeWidthToFit(); - tablemyLectures.setRowSorter(rowSorterMyLectures); - - scrollPaneMyImage.setViewportView(tablemyLectures); - tabbedPane.addTab("Meine Veranstaltungen", null, scrollPaneMyImage, - null); - tableAllLectures.setRowSorter(rowSorterAll); - - scrollPaneAllImages.setViewportView(tableAllLectures); - tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 826, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton btnBack = new JButton("Zur\u00FCck"); - btnBack.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - // oeffnet das Hauptmenue - - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - dispose(); - } - }); - btnBack.setActionCommand("OK"); - buttonPane.add(btnBack); - getRootPane().setDefaultButton(btnBack); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 79, 836, 1); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 628, 836, 1); - getContentPane().add(separator_1); - - JPanel panel = new JPanel(); - panel.setLayout(null); - panel.setBorder(new TitledBorder(null, "Detailinformationen", - TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel.setBackground(SystemColor.menu); - panel.setBounds(591, 85, 235, 518); - getContentPane().add(panel); - - JLabel lblNewLabel_3 = new JLabel("Name:"); - lblNewLabel_3.setBounds(10, 27, 104, 14); - panel.add(lblNewLabel_3); - - JLabel lblAktiv = new JLabel("Aktiv:"); - lblAktiv.setBounds(10, 98, 104, 14); - panel.add(lblAktiv); - - labelAktiv = new JLabel(""); - labelAktiv.setBounds(10, 114, 218, 14); - panel.add(labelAktiv); - - labelstartdate = new JLabel(""); - labelstartdate.setBounds(10, 147, 218, 14); - panel.add(labelstartdate); - - JLabel lblStartdatum = new JLabel("Startdatum:"); - lblStartdatum.setBounds(10, 129, 104, 14); - panel.add(lblStartdatum); - - labelenddate = new JLabel(""); - labelenddate.setBounds(10, 175, 218, 14); - panel.add(labelenddate); - - JLabel lblEnddatum = new JLabel("Enddatum:"); - lblEnddatum.setBounds(10, 161, 104, 14); - panel.add(lblEnddatum); - - JLabel lblBeschreibung = new JLabel("Beschreibung:"); - lblBeschreibung.setBounds(10, 189, 104, 14); - panel.add(lblBeschreibung); - - JLabel lblImage = new JLabel("Image:"); - lblImage.setBounds(10, 293, 104, 14); - panel.add(lblImage); - - labelVerantwortlicher = new JLabel(""); - labelVerantwortlicher.setBounds(10, 426, 218, 14); - panel.add(labelVerantwortlicher); - - JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); - lblVerantwortlicher.setBounds(10, 411, 104, 14); - panel.add(lblVerantwortlicher); - - JLabel lblImageversion = new JLabel("Imageversion:"); - lblImageversion.setBounds(10, 381, 104, 14); - panel.add(lblImageversion); - - labelimageversion = new JLabel(""); - labelimageversion.setBounds(10, 399, 218, 14); - panel.add(labelimageversion); - - - labeldesc = new JTextArea(); - labeldesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); - labeldesc.setEditable(false); - labeldesc.setLineWrap(true); - labeldesc.setBackground(SystemColor.menu); - labeldesc.setBounds(124, 127, 104, 110); - JScrollPane scrollPane = new JScrollPane(labeldesc); - scrollPane.setBounds(10, 209, 218, 81); - panel.add(scrollPane); - //panel.add(labeldesc); - - labelimage = new JTextArea(); - labelimage.setLineWrap(true); - labelimage.setFont(new Font("Tahoma", Font.PLAIN, 11)); - labelimage.setEditable(false); - labelimage.setBackground(SystemColor.menu); - labelimage.setBounds(124, 248, 101, 81); - JScrollPane scrollPaneImage = new JScrollPane(labelimage); - scrollPaneImage.setBounds(10, 309, 215, 69); - panel.add(scrollPaneImage); - - labelName = new JTextArea(); - labelName.setEditable(false); - labelName.setFont(new Font("Tahoma", Font.PLAIN, 11)); - labelName.setBackground(SystemColor.menu); - labelName.setBounds(124, 22, 101, 55); - JScrollPane scrollPaneName = new JScrollPane(labelName); - scrollPaneName.setBounds(10, 40, 218, 55); - panel.add(scrollPaneName); - //panel.add(labelName); - //panel.add(labelimage); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @SuppressWarnings("static-access") - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @SuppressWarnings("static-access") - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - } - - // Initiale Beffuelung eines Table models - public DefaultTableModel initTableModel(DefaultTableModel model) throws ParseException { - List lectures; - try { - // Hole eine Liste der Images - lectures = client.getLectureList(); - Iterator i = lectures.iterator(); - SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); - int x = 0; - - while (i.hasNext()) { - // erzeuge Objekte fuer die Tabelle - Object[] obj = { - lectures.get(x).lecturename, - lectures.get(x).desc, - out.format(in.parse(lectures.get(x).starttime)) + " " - + out.format(in.parse(lectures.get(x).endtime)), - lectures.get(x).isActive, out.format(in.parse(lectures.get(x).lastused)), - lectures.get(x).username, - lectures.get(x).imagename," " ,lectures.get(x).id }; - // Fuege diese Objekte der Tabelle hinzu - model.addRow(obj); - x++; - i.next(); - - } - - return model; - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - return model; - } - public void writeLectureData(String id) throws TException, ParseException{ - - SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); - Map res=client.getLectureData(id); - labelName.setText(res.get("name")); - labelAktiv.setText(res.get("isActive")); - labeldesc.setText(res.get("desc")); - labelVerantwortlicher.setText(res.get("owner")); - labelstartdate.setText(out.format(in.parse(res.get("startTime")))); - labelenddate.setText(out.format(in.parse(res.get("endTime")))); - labelimage.setText(res.get("imagepath").substring(res.get("imagepath").indexOf("/")+1)); - labelimageversion.setText(res.get("imageversion")); - - - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/models/Client.java b/dozentenmodul/Dozentenmodul/src/main/java/models/Client.java deleted file mode 100644 index 42eccdec..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/models/Client.java +++ /dev/null @@ -1,18 +0,0 @@ -package models; - -public class Client { - - private server.Server.Client client; - public static Client clientcon=new Client(); - - public server.Server.Client getClient() { - return client; - } - - public void setClient(server.Server.Client client) { - this.client = client; - } - - - -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/models/Image.java b/dozentenmodul/Dozentenmodul/src/main/java/models/Image.java deleted file mode 100644 index fc31e583..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/models/Image.java +++ /dev/null @@ -1,203 +0,0 @@ -package models; - -public class Image { - - - - private String ImageId; - - private String version; - - private String imagename; - - private String newName; - - private String imagepath; - - private String OS; - - private int shareMode; - - private boolean licensed; - - private boolean internet; - - private boolean vorlage; - - private int ram; - - private int cpu; - - private long filesize; - - private String desc; - - public static Image image =new Image(); - - - - - - - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public String getOS() { - return OS; - } - - public void setOS(String oS) { - OS = oS; - } - - public int getShareMode() { - - return shareMode; - - } - - public void setShareMode(int shareMode) { - - this.shareMode = shareMode; - - } - - public String getImagepath() { - - return imagepath; - - } - - public void setImagepath(String imagepath) { - - this.imagepath = imagepath; - - } - - public String getImagename() { - - return imagename; - - } - - public void setImagename(String imagename) { - - this.imagename = imagename; - - } - - public boolean isLicensed() { - - return licensed; - - } - - public void setLicensed(boolean licensed) { - - this.licensed = licensed; - - } - - public boolean isInternet() { - - return internet; - - } - - public void setInternet(boolean internet) { - - this.internet = internet; - - } - - public int getRam() { - - return ram; - - } - - public void setRam(int ram) { - - this.ram = ram; - - } - - public int getCpu() { - - return cpu; - - } - - public void setCpu(int cpu) { - - this.cpu = cpu; - - } - - public String getNewName() { - - return newName; - - } - - public void setNewName(String newName) { - - this.newName = newName; - - } - - public String getImageId() { - - return ImageId; - - } - - public void setImageId(String imageId) { - - ImageId = imageId; - - } - - public String getVersion() { - - return version; - - } - - public void setVersion(String version) { - - this.version = version; - - } - - public long getFilesize() { - - return filesize; - - } - - public void setFilesize(long filesize) { - - this.filesize = filesize; - - } - - public boolean isVorlage() { - return vorlage; - } - - public void setVorlage(boolean vorlage) { - this.vorlage = vorlage; - } - - - - -} - diff --git a/dozentenmodul/Dozentenmodul/src/main/java/models/ImageRights.java b/dozentenmodul/Dozentenmodul/src/main/java/models/ImageRights.java deleted file mode 100644 index 1b7e0e55..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/models/ImageRights.java +++ /dev/null @@ -1,45 +0,0 @@ -package models; - -public class ImageRights { - - private int read; - private int write; - private int changePermission; - private int admin; - private int linkAllowed; - - public static ImageRights rights =new ImageRights(); - public int getRead() { - return read; - } - public void setRead(int read) { - this.read = read; - } - public int getWrite() { - return write; - } - public void setWrite(int write) { - this.write = write; - } - public int getChangePermission() { - return changePermission; - } - public void setChangePermission(int changePermission) { - this.changePermission = changePermission; - } - public int getAdmin() { - return admin; - } - public void setAdmin(int admin) { - this.admin = admin; - } - public int getLinkAllowed() { - return linkAllowed; - } - public void setLinkAllowed(int linkAllowed) { - this.linkAllowed = linkAllowed; - } - - - -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/models/Lecture.java b/dozentenmodul/Dozentenmodul/src/main/java/models/Lecture.java deleted file mode 100644 index 8f67baba..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/models/Lecture.java +++ /dev/null @@ -1,141 +0,0 @@ -package models; - -import java.util.Date; - -public class Lecture { - - private String name; - - private String newName; - - private String shortDesc; - - private String desc; - - private Date startdate; - - private Date enddate; - - private boolean active; - - private String id; - - private String linkedImagename; - - public static Lecture lecture =new Lecture(); - - - - public String getNewName() { - - return newName; - - } - - public void setNewName(String newName) { - - this.newName = newName; - - } - - public String getLinkedImagename() { - - return linkedImagename; - - } - - public void setLinkedImagename(String linkedImagename) { - - this.linkedImagename = linkedImagename; - - } - - public String getid() { - - return id; - - } - - public void setid(String id) { - - this.id = id; - - } - - public String getName() { - - return name; - - } - - public void setName(String name) { - - this.name = name; - - } - - public String getShortDesc() { - - return shortDesc; - - } - - public void setShortDesc(String shortDesc) { - - this.shortDesc = shortDesc; - - } - - public String getDesc() { - - return desc; - - } - - public void setDesc(String desc) { - - this.desc = desc; - - } - - public Date getStartdate() { - - return startdate; - - } - - public void setStartdate(Date startdate) { - - this.startdate = startdate; - - } - - public Date getEnddate() { - - return enddate; - - } - - public void setEnddate(Date enddate) { - - this.enddate = enddate; - - } - - public boolean isActive() { - - return active; - - } - - public void setActive(boolean active) { - - this.active = active; - - } - - - - - -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/models/LectureRights.java b/dozentenmodul/Dozentenmodul/src/main/java/models/LectureRights.java deleted file mode 100644 index c136141f..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/models/LectureRights.java +++ /dev/null @@ -1,37 +0,0 @@ -package models; - -public class LectureRights { - private int recRead; - private int recWrite; - private int recChangePermission; - private int recAdmin; - - public static LectureRights rights =new LectureRights(); - - public int getRecRead() { - return recRead; - } - public void setRecRead(int recRead) { - this.recRead = recRead; - } - public int getRecWrite() { - return recWrite; - } - public void setRecWrite(int recWrite) { - this.recWrite = recWrite; - } - public int getRecChangePermission() { - return recChangePermission; - } - public void setRecChangePermission(int recChangePermission) { - this.recChangePermission = recChangePermission; - } - public int getRecAdmin() { - return recAdmin; - } - public void setRecAdmin(int recAdmin) { - this.recAdmin = recAdmin; - } - - -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/models/Links.java b/dozentenmodul/Dozentenmodul/src/main/java/models/Links.java deleted file mode 100644 index 80e3182e..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/models/Links.java +++ /dev/null @@ -1,31 +0,0 @@ -package models; - -public class Links { - - private static String FAQ = "http://bwlehrpool.hs-offenburg.de/"; - private static String OTRS = "http://bwlehrpool.hs-offenburg.de/"; - private static String uriWindows = "https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0"; - private static String uriLinux = "https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0"; - private static String AnleitungVMDK = "http://www.hs-offenburg.de/fileadmin/Einrichtungen/hrz/Projekte/bwLehrpool/3_bwLehrpool_-_Image_einbinden_und_starten.pdf"; - - public static String getFAQ() { - return FAQ; - } - - public static String getAnleitungVMDK(){ - return AnleitungVMDK; - } - - public static String getOTRS() { - return OTRS; - } - - public static String getUriWindows() { - return uriWindows; - } - - public static String getUriLinux() { - return uriLinux; - } - -}// end class diff --git a/dozentenmodul/Dozentenmodul/src/main/java/models/Search.java b/dozentenmodul/Dozentenmodul/src/main/java/models/Search.java deleted file mode 100644 index 59a28b21..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/models/Search.java +++ /dev/null @@ -1,46 +0,0 @@ -package models; - -public class Search { - - - private String Software; - private String Hochschule; - private String Creator; - private boolean ExistingImage; - private boolean Rohling; - public static Search search =new Search(); - - public String getSoftware() { - return Software; - } - public void setSoftware(String software) { - Software = software; - } - public String getHochschule() { - return Hochschule; - } - public void setHochschule(String hochschule) { - Hochschule = hochschule; - } - public String getCreator() { - return Creator; - } - public void setCreator(String creator) { - Creator = creator; - } - public boolean isExistingImage() { - return ExistingImage; - } - public void setExistingImage(boolean existingImage) { - ExistingImage = existingImage; - } - public boolean isRohling() { - return Rohling; - } - public void setRohling(boolean rohling) { - Rohling = rohling; - } - - - -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/models/SessionData.java b/dozentenmodul/Dozentenmodul/src/main/java/models/SessionData.java deleted file mode 100644 index d085bc29..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/models/SessionData.java +++ /dev/null @@ -1,32 +0,0 @@ -package models; - -public class SessionData { - - private String sessionID; - private String authToken; - private String serverAdress; - - public static SessionData session =new SessionData(); - - public String getSessionID() { - return sessionID; - } - public void setSessionID(String sessionID) { - this.sessionID = sessionID; - } - public String getAuthToken() { - return authToken; - } - public void setAuthToken(String authToken) { - this.authToken = authToken; - } - public String getServerAdress() { - return serverAdress; - } - public void setServerAdress(String serverAdress) { - this.serverAdress = serverAdress; - } - - - -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/models/Version.java b/dozentenmodul/Dozentenmodul/src/main/java/models/Version.java deleted file mode 100644 index b44819e4..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/models/Version.java +++ /dev/null @@ -1,24 +0,0 @@ -package models; - -public class Version { - - private static String Version = "1.06"; - private static String BuildDate = "04.09.2014"; - - - public static String getVersion() { - return Version; - } - public static void setVersion(String version) { - Version = version; - } - public static String getBuildDate() { - return BuildDate; - } - public static void setBuildDate(String buildDate) { - BuildDate = buildDate; - } - - - -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/models/person.java b/dozentenmodul/Dozentenmodul/src/main/java/models/person.java deleted file mode 100644 index 479c2ecd..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/models/person.java +++ /dev/null @@ -1,131 +0,0 @@ -package models; - -public class person{ - - private String username; - - private String Name; - - private String Vorname; - - private String Hochschule; - - private String EMail; - - private String Tel; - - private String Fakultaet; - - private boolean ischecked; - - private String role; - - public static person verantwortlicher=new person(); - - - - public String getRole() { - return role; - } - - public void setRole(String role) { - this.role = role; - } - - public String getUsername() { - - return username; - - } - - public void setUsername(String username) { - - this.username = username; - - } - - public String getName() { - - return Name; - - } - - public void setName(String name) { - - Name = name; - - } - - public String getVorname() { - - return Vorname; - - } - - public void setVorname(String vorname) { - - Vorname = vorname; - - } - - public String getHochschule() { - - return Hochschule; - - } - - public void setHochschule(String hochschule) { - - Hochschule = hochschule; - - } - - public String getEMail() { - - return EMail; - - } - - public void setEMail(String eMail) { - - EMail = eMail; - - } - - public String getTel() { - - return Tel; - - } - - public void setTel(String tel) { - - Tel = tel; - - } - - public String getFakultaet() { - - return Fakultaet; - - } - - public void setFakultaet(String fakultaet) { - - Fakultaet = fakultaet; - - } - - public boolean isIschecked() { - - return ischecked; - - } - - public void setIschecked(boolean ischecked) { - - this.ischecked = ischecked; - - } - -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/models/user.java b/dozentenmodul/Dozentenmodul/src/main/java/models/user.java deleted file mode 100644 index 9aa958a4..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/models/user.java +++ /dev/null @@ -1,23 +0,0 @@ -package models; - -public class user { - - private String userName; - private String Password; - - public String getUserName() { - return userName; - } - public void setUserName(String userName) { - this.userName = userName; - } - public String getPassword() { - return Password; - } - public void setPassword(String password) { - Password = password; - } - - - -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/org/eclipse/wb/swt/SWTResourceManager.java b/dozentenmodul/Dozentenmodul/src/main/java/org/eclipse/wb/swt/SWTResourceManager.java deleted file mode 100644 index 8b6d4cc3..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/org/eclipse/wb/swt/SWTResourceManager.java +++ /dev/null @@ -1,447 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Google, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Google, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.wb.swt; - -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Cursor; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Display; - -/** - * Utility class for managing OS resources associated with SWT controls such as colors, fonts, images, etc. - *

- * !!! IMPORTANT !!! Application code must explicitly invoke the dispose() method to release the - * operating system resources managed by cached objects when those objects and OS resources are no longer - * needed (e.g. on application shutdown) - *

- * This class may be freely distributed as part of any application or plugin. - *

- * @author scheglov_ke - * @author Dan Rubel - */ -public class SWTResourceManager { - //////////////////////////////////////////////////////////////////////////// - // - // Color - // - //////////////////////////////////////////////////////////////////////////// - private static Map m_colorMap = new HashMap(); - /** - * Returns the system {@link Color} matching the specific ID. - * - * @param systemColorID - * the ID value for the color - * @return the system {@link Color} matching the specific ID - */ - public static Color getColor(int systemColorID) { - Display display = Display.getCurrent(); - return display.getSystemColor(systemColorID); - } - /** - * Returns a {@link Color} given its red, green and blue component values. - * - * @param r - * the red component of the color - * @param g - * the green component of the color - * @param b - * the blue component of the color - * @return the {@link Color} matching the given red, green and blue component values - */ - public static Color getColor(int r, int g, int b) { - return getColor(new RGB(r, g, b)); - } - /** - * Returns a {@link Color} given its RGB value. - * - * @param rgb - * the {@link RGB} value of the color - * @return the {@link Color} matching the RGB value - */ - public static Color getColor(RGB rgb) { - Color color = m_colorMap.get(rgb); - if (color == null) { - Display display = Display.getCurrent(); - color = new Color(display, rgb); - m_colorMap.put(rgb, color); - } - return color; - } - /** - * Dispose of all the cached {@link Color}'s. - */ - public static void disposeColors() { - for (Color color : m_colorMap.values()) { - color.dispose(); - } - m_colorMap.clear(); - } - //////////////////////////////////////////////////////////////////////////// - // - // Image - // - //////////////////////////////////////////////////////////////////////////// - /** - * Maps image paths to images. - */ - private static Map m_imageMap = new HashMap(); - /** - * Returns an {@link Image} encoded by the specified {@link InputStream}. - * - * @param stream - * the {@link InputStream} encoding the image data - * @return the {@link Image} encoded by the specified input stream - */ - protected static Image getImage(InputStream stream) throws IOException { - try { - Display display = Display.getCurrent(); - ImageData data = new ImageData(stream); - if (data.transparentPixel > 0) { - return new Image(display, data, data.getTransparencyMask()); - } - return new Image(display, data); - } finally { - stream.close(); - } - } - /** - * Returns an {@link Image} stored in the file at the specified path. - * - * @param path - * the path to the image file - * @return the {@link Image} stored in the file at the specified path - */ - public static Image getImage(String path) { - Image image = m_imageMap.get(path); - if (image == null) { - try { - image = getImage(new FileInputStream(path)); - m_imageMap.put(path, image); - } catch (Exception e) { - image = getMissingImage(); - m_imageMap.put(path, image); - } - } - return image; - } - /** - * Returns an {@link Image} stored in the file at the specified path relative to the specified class. - * - * @param clazz - * the {@link Class} relative to which to find the image - * @param path - * the path to the image file, if starts with '/' - * @return the {@link Image} stored in the file at the specified path - */ - public static Image getImage(Class clazz, String path) { - String key = clazz.getName() + '|' + path; - Image image = m_imageMap.get(key); - if (image == null) { - try { - image = getImage(clazz.getResourceAsStream(path)); - m_imageMap.put(key, image); - } catch (Exception e) { - image = getMissingImage(); - m_imageMap.put(key, image); - } - } - return image; - } - private static final int MISSING_IMAGE_SIZE = 10; - /** - * @return the small {@link Image} that can be used as placeholder for missing image. - */ - private static Image getMissingImage() { - Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); - // - GC gc = new GC(image); - gc.setBackground(getColor(SWT.COLOR_RED)); - gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); - gc.dispose(); - // - return image; - } - /** - * Style constant for placing decorator image in top left corner of base image. - */ - public static final int TOP_LEFT = 1; - /** - * Style constant for placing decorator image in top right corner of base image. - */ - public static final int TOP_RIGHT = 2; - /** - * Style constant for placing decorator image in bottom left corner of base image. - */ - public static final int BOTTOM_LEFT = 3; - /** - * Style constant for placing decorator image in bottom right corner of base image. - */ - public static final int BOTTOM_RIGHT = 4; - /** - * Internal value. - */ - protected static final int LAST_CORNER_KEY = 5; - /** - * Maps images to decorated images. - */ - @SuppressWarnings("unchecked") - private static Map>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY]; - /** - * Returns an {@link Image} composed of a base image decorated by another image. - * - * @param baseImage - * the base {@link Image} that should be decorated - * @param decorator - * the {@link Image} to decorate the base image - * @return {@link Image} The resulting decorated image - */ - public static Image decorateImage(Image baseImage, Image decorator) { - return decorateImage(baseImage, decorator, BOTTOM_RIGHT); - } - /** - * Returns an {@link Image} composed of a base image decorated by another image. - * - * @param baseImage - * the base {@link Image} that should be decorated - * @param decorator - * the {@link Image} to decorate the base image - * @param corner - * the corner to place decorator image - * @return the resulting decorated {@link Image} - */ - public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) { - if (corner <= 0 || corner >= LAST_CORNER_KEY) { - throw new IllegalArgumentException("Wrong decorate corner"); - } - Map> cornerDecoratedImageMap = m_decoratedImageMap[corner]; - if (cornerDecoratedImageMap == null) { - cornerDecoratedImageMap = new HashMap>(); - m_decoratedImageMap[corner] = cornerDecoratedImageMap; - } - Map decoratedMap = cornerDecoratedImageMap.get(baseImage); - if (decoratedMap == null) { - decoratedMap = new HashMap(); - cornerDecoratedImageMap.put(baseImage, decoratedMap); - } - // - Image result = decoratedMap.get(decorator); - if (result == null) { - Rectangle bib = baseImage.getBounds(); - Rectangle dib = decorator.getBounds(); - // - result = new Image(Display.getCurrent(), bib.width, bib.height); - // - GC gc = new GC(result); - gc.drawImage(baseImage, 0, 0); - if (corner == TOP_LEFT) { - gc.drawImage(decorator, 0, 0); - } else if (corner == TOP_RIGHT) { - gc.drawImage(decorator, bib.width - dib.width, 0); - } else if (corner == BOTTOM_LEFT) { - gc.drawImage(decorator, 0, bib.height - dib.height); - } else if (corner == BOTTOM_RIGHT) { - gc.drawImage(decorator, bib.width - dib.width, bib.height - dib.height); - } - gc.dispose(); - // - decoratedMap.put(decorator, result); - } - return result; - } - /** - * Dispose all of the cached {@link Image}'s. - */ - public static void disposeImages() { - // dispose loaded images - { - for (Image image : m_imageMap.values()) { - image.dispose(); - } - m_imageMap.clear(); - } - // dispose decorated images - for (int i = 0; i < m_decoratedImageMap.length; i++) { - Map> cornerDecoratedImageMap = m_decoratedImageMap[i]; - if (cornerDecoratedImageMap != null) { - for (Map decoratedMap : cornerDecoratedImageMap.values()) { - for (Image image : decoratedMap.values()) { - image.dispose(); - } - decoratedMap.clear(); - } - cornerDecoratedImageMap.clear(); - } - } - } - //////////////////////////////////////////////////////////////////////////// - // - // Font - // - //////////////////////////////////////////////////////////////////////////// - /** - * Maps font names to fonts. - */ - private static Map m_fontMap = new HashMap(); - /** - * Maps fonts to their bold versions. - */ - private static Map m_fontToBoldFontMap = new HashMap(); - /** - * Returns a {@link Font} based on its name, height and style. - * - * @param name - * the name of the font - * @param height - * the height of the font - * @param style - * the style of the font - * @return {@link Font} The font matching the name, height and style - */ - public static Font getFont(String name, int height, int style) { - return getFont(name, height, style, false, false); - } - /** - * Returns a {@link Font} based on its name, height and style. Windows-specific strikeout and underline - * flags are also supported. - * - * @param name - * the name of the font - * @param size - * the size of the font - * @param style - * the style of the font - * @param strikeout - * the strikeout flag (warning: Windows only) - * @param underline - * the underline flag (warning: Windows only) - * @return {@link Font} The font matching the name, height, style, strikeout and underline - */ - public static Font getFont(String name, int size, int style, boolean strikeout, boolean underline) { - String fontName = name + '|' + size + '|' + style + '|' + strikeout + '|' + underline; - Font font = m_fontMap.get(fontName); - if (font == null) { - FontData fontData = new FontData(name, size, style); - if (strikeout || underline) { - try { - Class logFontClass = Class.forName("org.eclipse.swt.internal.win32.LOGFONT"); //$NON-NLS-1$ - Object logFont = FontData.class.getField("data").get(fontData); //$NON-NLS-1$ - if (logFont != null && logFontClass != null) { - if (strikeout) { - logFontClass.getField("lfStrikeOut").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$ - } - if (underline) { - logFontClass.getField("lfUnderline").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$ - } - } - } catch (Throwable e) { - System.err.println("Unable to set underline or strikeout" + " (probably on a non-Windows platform). " + e); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - font = new Font(Display.getCurrent(), fontData); - m_fontMap.put(fontName, font); - } - return font; - } - /** - * Returns a bold version of the given {@link Font}. - * - * @param baseFont - * the {@link Font} for which a bold version is desired - * @return the bold version of the given {@link Font} - */ - public static Font getBoldFont(Font baseFont) { - Font font = m_fontToBoldFontMap.get(baseFont); - if (font == null) { - FontData fontDatas[] = baseFont.getFontData(); - FontData data = fontDatas[0]; - font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD); - m_fontToBoldFontMap.put(baseFont, font); - } - return font; - } - /** - * Dispose all of the cached {@link Font}'s. - */ - public static void disposeFonts() { - // clear fonts - for (Font font : m_fontMap.values()) { - font.dispose(); - } - m_fontMap.clear(); - // clear bold fonts - for (Font font : m_fontToBoldFontMap.values()) { - font.dispose(); - } - m_fontToBoldFontMap.clear(); - } - //////////////////////////////////////////////////////////////////////////// - // - // Cursor - // - //////////////////////////////////////////////////////////////////////////// - /** - * Maps IDs to cursors. - */ - private static Map m_idToCursorMap = new HashMap(); - /** - * Returns the system cursor matching the specific ID. - * - * @param id - * int The ID value for the cursor - * @return Cursor The system cursor matching the specific ID - */ - public static Cursor getCursor(int id) { - Integer key = Integer.valueOf(id); - Cursor cursor = m_idToCursorMap.get(key); - if (cursor == null) { - cursor = new Cursor(Display.getDefault(), id); - m_idToCursorMap.put(key, cursor); - } - return cursor; - } - /** - * Dispose all of the cached cursors. - */ - public static void disposeCursors() { - for (Cursor cursor : m_idToCursorMap.values()) { - cursor.dispose(); - } - m_idToCursorMap.clear(); - } - //////////////////////////////////////////////////////////////////////////// - // - // General - // - //////////////////////////////////////////////////////////////////////////// - /** - * Dispose of cached objects and their underlying OS resources. This should only be called when the cached - * objects are no longer needed (e.g. on application shutdown). - */ - public static void dispose() { - disposeColors(); - disposeImages(); - disposeFonts(); - disposeCursors(); - } -} \ No newline at end of file diff --git a/dozentenmodul/Dozentenmodul/src/main/java/thrift/MasterThriftConnection.java b/dozentenmodul/Dozentenmodul/src/main/java/thrift/MasterThriftConnection.java deleted file mode 100644 index a84931c6..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/thrift/MasterThriftConnection.java +++ /dev/null @@ -1,43 +0,0 @@ -package thrift; - -import javax.swing.JOptionPane; - -import org.apache.thrift.protocol.TBinaryProtocol; -import org.apache.thrift.protocol.TProtocol; -import org.apache.thrift.transport.TSocket; -import org.apache.thrift.transport.TTransport; -import org.apache.thrift.transport.TTransportException; - -import org.openslx.imagemaster.thrift.iface.ImageServer.Client; - - - -public class MasterThriftConnection { - - public static final String MASTERSERVERIP="132.230.4.16"; - //public static final String MASTERSERVERIP="127.0.0.1"; - - final TTransport transport = new TSocket(MASTERSERVERIP, 9090); - - public Client getMasterThriftConnection() - { - - try { - transport.open(); - } catch (TTransportException e) { - System.out.println("Keine Verbindung m\u00f6glich!"); - return null; - } - - final TProtocol protocol = new TBinaryProtocol(transport); - final Client client = new Client(protocol); - System.out.println("Masterserver erreichbar."); - - return client; - } - - public void closeMasterThriftConnection() - { - transport.close(); - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/thrift/ThriftConnection.java b/dozentenmodul/Dozentenmodul/src/main/java/thrift/ThriftConnection.java deleted file mode 100644 index 3eec5d25..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/thrift/ThriftConnection.java +++ /dev/null @@ -1,53 +0,0 @@ -package thrift; - -import javax.swing.JOptionPane; - -import models.SessionData; - -import org.apache.thrift.protocol.TBinaryProtocol; -import org.apache.thrift.protocol.TProtocol; -import org.apache.thrift.transport.TSocket; -import org.apache.thrift.transport.TTransport; -import org.apache.thrift.transport.TTransportException; - -import server.Server; -import server.Server.Client; - -public class ThriftConnection { - - private String satAddress = ""+SessionData.session.getServerAdress(); - final TTransport transport = new TSocket(satAddress, 9090); - - public ThriftConnection() { - // TODO Auto-generated constructor stub - } - - public Client getThriftConnection() - { - - try { - transport.open(); - } catch (TTransportException e) { - System.out.println("Keine Verbindung m\u00f6glich! Satellit="+satAddress); - e.printStackTrace(); - JOptionPane.showMessageDialog(null, - e.getCause()+"\n"+e.getMessage(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - //System.out.println("Keine Verbindung moeglich! Satellit="); - return null; - } - - final TProtocol protocol = new TBinaryProtocol(transport); - - final Server.Client client = new Server.Client(protocol); - System.out.println("Verbindung zu "+satAddress+" wurde aufgebaut."); - - return client; - } - - public void closeThriftConnection() - { - System.out.println("Verbindung wird geplant getrennt..."); - transport.close(); - } -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/util/GuiOrganizer.java b/dozentenmodul/Dozentenmodul/src/main/java/util/GuiOrganizer.java deleted file mode 100644 index 5d6b2de8..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/util/GuiOrganizer.java +++ /dev/null @@ -1,19 +0,0 @@ -package util; - -import java.awt.Dimension; -import java.awt.Toolkit; -import java.awt.Window; - -public abstract class GuiOrganizer { - - /* receive GUI, set it to center of the screen */ - public static void centerGUI(Window gui) { - Dimension dm = Toolkit.getDefaultToolkit().getScreenSize(); - double width = dm.getWidth(); - double height = dm.getHeight(); - double xPosition = (width / 2 - gui.getWidth() / 2); - double yPosition = (height / 2 - gui.getHeight() / 2); - gui.setLocation((int) xPosition, (int) yPosition); - } - -} diff --git a/dozentenmodul/Dozentenmodul/src/main/java/util/OpenLinks.java b/dozentenmodul/Dozentenmodul/src/main/java/util/OpenLinks.java deleted file mode 100644 index 2dd7b936..00000000 --- a/dozentenmodul/Dozentenmodul/src/main/java/util/OpenLinks.java +++ /dev/null @@ -1,25 +0,0 @@ -package util; - -import java.awt.Desktop; -import java.net.URI; - -import javax.swing.JOptionPane; - -public class OpenLinks { - - public static void openWebpage(URI uri) { - Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() - : null; - if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) { - try { - desktop.browse(uri); - } catch (Exception e) { - e.printStackTrace(); - JOptionPane.showMessageDialog(null, - e.getCause() + "\n" + e.getStackTrace(), - "Debug-Message", JOptionPane.ERROR_MESSAGE); - } - } - }// end openWebpage - -} diff --git a/dozentenmodul/Dozentenmodul/src/main/resources/img/Image_zu_Veranstaltung_HDD.png b/dozentenmodul/Dozentenmodul/src/main/resources/img/Image_zu_Veranstaltung_HDD.png deleted file mode 100644 index 39b3bac6..00000000 Binary files a/dozentenmodul/Dozentenmodul/src/main/resources/img/Image_zu_Veranstaltung_HDD.png and /dev/null differ diff --git a/dozentenmodul/Dozentenmodul/src/main/resources/img/Logo_bwLehrpool.png b/dozentenmodul/Dozentenmodul/src/main/resources/img/Logo_bwLehrpool.png deleted file mode 100644 index b897d9f1..00000000 Binary files a/dozentenmodul/Dozentenmodul/src/main/resources/img/Logo_bwLehrpool.png and /dev/null differ diff --git a/dozentenmodul/Dozentenmodul/src/main/resources/img/e4_n_imgs2_bwl_vmc_v2.png b/dozentenmodul/Dozentenmodul/src/main/resources/img/e4_n_imgs2_bwl_vmc_v2.png deleted file mode 100644 index 95e8a293..00000000 Binary files a/dozentenmodul/Dozentenmodul/src/main/resources/img/e4_n_imgs2_bwl_vmc_v2.png and /dev/null differ diff --git a/dozentenmodul/Dozentenmodul/src/test/java/bwlehrpool/AppTest.java b/dozentenmodul/Dozentenmodul/src/test/java/bwlehrpool/AppTest.java deleted file mode 100644 index ffcdcc2e..00000000 --- a/dozentenmodul/Dozentenmodul/src/test/java/bwlehrpool/AppTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package bwlehrpool; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Unit test for simple App. - */ -public class AppTest - extends TestCase -{ - /** - * Create the test case - * - * @param testName name of the test case - */ - public AppTest( String testName ) - { - super( testName ); - } - - /** - * @return the suite of tests being tested - */ - public static Test suite() - { - return new TestSuite( AppTest.class ); - } - - /** - * Rigourous Test :-) - */ - public void testApp() - { - assertTrue( true ); - } -} diff --git a/dozentenmodul/forms-1.3.0-src.zip b/dozentenmodul/forms-1.3.0-src.zip new file mode 100644 index 00000000..b7673afc Binary files /dev/null and b/dozentenmodul/forms-1.3.0-src.zip differ diff --git a/dozentenmodul/forms-1.3.0.jar b/dozentenmodul/forms-1.3.0.jar new file mode 100644 index 00000000..3e705ffe Binary files /dev/null and b/dozentenmodul/forms-1.3.0.jar differ diff --git a/dozentenmodul/pom.xml b/dozentenmodul/pom.xml new file mode 100644 index 00000000..d78eb1d0 --- /dev/null +++ b/dozentenmodul/pom.xml @@ -0,0 +1,203 @@ + + 4.0.0 + + bwlehrpool + dozmod-client + 1.0-SNAPSHOT + jar + + DozMod-Client + http://maven.apache.org + + + UTF-8 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + maven-assembly-plugin + + + package + + single + + + + + + + gui.intro.Login_GUI + + + + jar-with-dependencies + + + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + true + + + gui.intro.Login_GUI + + + + + + + + + + + + mac + + + mac os x + + + + org.eclipse.swt.carbon + macosx + + + + windows + + + windows + + + + org.eclipse.swt.org.eclipse.swt.win32.win32.x86.4.3.swt + org.eclipse.swt.win32.win32.x86 + + + + linux_64 + + + linux + amd64 + + + + org.eclipse.swt.org.eclipse.swt.gtk.linux.x86_64.4.3.swt + org.eclipse.swt.gtk.linux.x86_64 + + + + + + + + org.eclipse.jface + text + 3.3.0-v20070606-0010 + + + org.apache.thrift + libthrift + 0.9.1 + compile + + + commons-io + commons-io + 2.4 + compile + + + commons-net + commons-net + 3.3 + compile + + + com.toedter + jcalendar + 1.4 + compile + + + net.sourceforge.jdatepicker + jdatepicker + 1.3.2 + compile + + + ${swt.groupId} + ${swt.artifactId} + 4.3 + + + + log4j + log4j + 1.2.17 + compile + + + org.ini4j + ini4j + 0.5.2 + compile + + + org.slf4j + slf4j-log4j12 + 1.5.8 + compile + + + org.openslx.bwlp + master-sync-shared + 1.0-SNAPSHOT + compile + + + bwlehrpool + dms + 1.0-SNAPSHOT + + + junit + junit + 3.8.1 + test + + + + diff --git a/dozentenmodul/src/main/java/auth/Authentification.java b/dozentenmodul/src/main/java/auth/Authentification.java new file mode 100644 index 00000000..d242c01e --- /dev/null +++ b/dozentenmodul/src/main/java/auth/Authentification.java @@ -0,0 +1,12 @@ +package auth; + +import org.openslx.imagemaster.thrift.iface.UserInfo; + +public class Authentification { + + public boolean auth(String username, String pass) + { + return false; + + } +} diff --git a/dozentenmodul/src/main/java/config/config_file.java b/dozentenmodul/src/main/java/config/config_file.java new file mode 100644 index 00000000..754e67a9 --- /dev/null +++ b/dozentenmodul/src/main/java/config/config_file.java @@ -0,0 +1,121 @@ +package config; + +import java.io.File; +import java.io.IOException; + +import org.ini4j.Wini; + +public class config_file { + + private String configPath = null; + + public boolean createConfig() throws IOException{ + + // Unterscheide zwischen Windows/Unix + String OSName = System.getProperty("os.name").toLowerCase(); + System.out.println("Machine's OS: " + OSName); + if (OSName.contains("windows")) + { + // Windows machine. Use the environment variable 'APPDATA' which + // should point to a path similar to: + // C:\Users\\AppData\Roaming + String appDataPath = System.getenv("APPDATA"); + if (!appDataPath.isEmpty()) + { + System.out.println("APPDATA: " + appDataPath); + configPath = appDataPath + "\\bwSuite\\config.ini"; + } + else + { + // APPDATA was empty, let's build it ourselves... + System.out.println("APPDATA ist leer."); + configPath = System.getProperty("user.home") + "\\AppData\\Roaming\\bwSuite\\config.ini" + + } + + } + else if (OSName.contains("linux")) + { + configPath=System.getProperty("user.home") + "/.config/bwSuite/config.ini"; + + } + + if (configPath == null) + { + System.out.println("Config file path could not be determined."); + } + //config_file="C:\\Users\\"+System.getProperty("user.name")+"\\AppData\\Roaming\\bwLehrpoolSuite"; + //File fuer den Ordner erzeugen + File configFile=new File(configPath); + Wini ini; + + //Pruefen ob Ordner schon existiert + if(!configFile.exists()) + { + System.out.println("Ordner \"bwLehrpoolSuite\" exisitiert nicht - lege ihn jetzt an."); + //Wenn nicht erzeuge Ordner + if (!configFile.getParentFile().mkdirs()) + { + System.out.print("Konnte Verzeichnisstruktur nicht erstellen: " + configFile.getParentFile()); + System.out.println(" - keine weitere Aktion"); + // jetzt nichts mehr + } + + //Erzeuge eine neue Datei + configFile.createNewFile(); + ini=new Wini(configFile); + + //Wenn in die Datei geschrieben werden kann + if(configFile.canWrite()==true) + { + System.out.println("Erzeuge \"config.ini.\""); + //Schreibe Config + ini.put("main", "BillOfRights", false); + ini.put("main", "vmware", false); + ini.put("main", "Benutzername speichern", false); + ini.put("main", "Benutzername", ""); + ini.put("main", "Letzter Downloadpfad", ""); + ini.put("main", "Letzter Uploadpfad", ""); + ini.store(); + + return true; + } else { + System.out.println("Konnte \"config.ini\" nicht anlegen - keine weitere Aktion."); + } + + } + else + { + System.out.println("Ordner \"bwLehrpoolSuite\" existiert bereits - keine weitere Aktion."); + //Wenn Ordner schon existiert, pruefe ob Datei existiert + if(!configFile.exists()) + { + System.out.println("\"config.ini\" existiert nicht - lege jetzt an."); + //Wenn nicht, erzeuge diese + configFile.createNewFile(); + ini=new Wini(configFile); + + if(configFile.canWrite()==true) + { + System.out.println("Schreibe jetzt \"config.ini\"."); + //Schreibe Konfig in File + ini.put("main", "BillOfRights",false); + ini.put("main", "vmware", false); + ini.put("main", "Benutzername speichern", false); + ini.put("main", "Benutzername", ""); + ini.put("main", "Letzter Downloadpfad", ""); + ini.put("main", "Letzter Uploadpfad", ""); + ini.store(); + + return true; + } else { + System.out.println("Kann \"config.ini\" nicht schreiben - keine weitere Aktion."); + } + } else { + System.out.println("\"config.ini\" existiert bereits - keine weitere Aktion."); + } + } + return true; + + } +} diff --git a/dozentenmodul/src/main/java/ftp/DownloadTask.java b/dozentenmodul/src/main/java/ftp/DownloadTask.java new file mode 100644 index 00000000..5592adba --- /dev/null +++ b/dozentenmodul/src/main/java/ftp/DownloadTask.java @@ -0,0 +1,117 @@ +package ftp; + +import gui.image.FTPEditDownloader_GUI; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; + +import javax.swing.JOptionPane; +import javax.swing.SwingWorker; + +/** + * Execute file download in a background thread and update the progress. + * + * @author www.codejava.net + * + */ +public class DownloadTask extends SwingWorker { + + private static final int BUFFER_SIZE = 4096; + + private String host; + private int port; + private String username; + private String password; + private String downloadPath; + private String saveDir; + private int percentCompleted; + + public DownloadTask(String host, int port, String username, + String password, String downloadPath, String saveDir) { + this.host = host; + this.port = port; + this.username = username; + this.password = password; + this.downloadPath = downloadPath; + this.saveDir = saveDir; + + } + + /** + * Executed in background thread + */ + @Override + protected Void doInBackground() throws Exception { + FTPUtility util = new FTPUtility(host, port, username, password); + try { + util.connect(); + + byte[] buffer = new byte[BUFFER_SIZE]; + int bytesRead = -1; + long totalBytesRead = 0; + percentCompleted = 0; + long start = System.nanoTime(); + final double NANOS_PER_SECOND = 1000000000.0; + final double BYTES_PER_MIB = 1024 * 1024; + long fileSize = util.getFileSize(downloadPath); + // gui.setFileSize(fileSize); + + String fileName = new File(downloadPath).getName(); + + File downloadFile = new File(saveDir + File.separator + fileName); + FileOutputStream outputStream = new FileOutputStream(downloadFile); + + util.downloadFile(downloadPath); + InputStream inputStream = util.getInputStream(); + + while ((bytesRead = inputStream.read(buffer)) != -1 + && isCancelled() == false) { + outputStream.write(buffer, 0, bytesRead); + totalBytesRead += bytesRead; + // System.out.println(totalBytesRead); + double speed = NANOS_PER_SECOND / BYTES_PER_MIB + * totalBytesRead / (System.nanoTime() - start + 1); + percentCompleted = (int) (totalBytesRead * 100 / fileSize); + setProgress(percentCompleted); + firePropertyChange("speed", 0, speed); + firePropertyChange("filesize", 0, fileSize); + firePropertyChange("bytesread", 0, totalBytesRead); + + } + + outputStream.close(); + + util.finish(); + } catch (FTPException ex) { + JOptionPane.showMessageDialog(null, + "Error downloading file: " + ex.getMessage(), "Error", + JOptionPane.ERROR_MESSAGE); + ex.printStackTrace(); + setProgress(0); + cancel(true); + } finally { + util.disconnect(); + } + + return null; + } + + /** + * Executed in Swing's event dispatching thread + */ + @Override + protected void done() { + if (!isCancelled() && percentCompleted==100) { + System.out.println("Datei erfolgreich heruntergeladen"); + JOptionPane.showMessageDialog(null, + "Datei erfolgreich heruntergeladen.", "Message", + JOptionPane.INFORMATION_MESSAGE); + } else if(!isCancelled() && percentCompleted != 100){ + System.out.println("Datein wurde unvollständig heruntergeladen"); + JOptionPane.showMessageDialog(null, + "Datei wurde unvollständig heruntergeladen. Bitte wiederholen.", "Message", + JOptionPane.INFORMATION_MESSAGE); + } + } +} \ No newline at end of file diff --git a/dozentenmodul/src/main/java/ftp/FTPException.java b/dozentenmodul/src/main/java/ftp/FTPException.java new file mode 100644 index 00000000..bc3193e0 --- /dev/null +++ b/dozentenmodul/src/main/java/ftp/FTPException.java @@ -0,0 +1,8 @@ +package ftp; + +@SuppressWarnings("serial") +public class FTPException extends Exception { + public FTPException(String message) { + super(message); + } +} \ No newline at end of file diff --git a/dozentenmodul/src/main/java/ftp/FTPUtility.java b/dozentenmodul/src/main/java/ftp/FTPUtility.java new file mode 100644 index 00000000..beae3f34 --- /dev/null +++ b/dozentenmodul/src/main/java/ftp/FTPUtility.java @@ -0,0 +1,199 @@ +package ftp; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.SocketException; +import java.security.NoSuchAlgorithmException; + +import javax.swing.JOptionPane; + +import models.Image; + +import org.apache.commons.net.ftp.FTP; +import org.apache.commons.net.ftp.FTPFile; +import org.apache.commons.net.ftp.FTPReply; +import org.apache.commons.net.ftp.FTPSClient; + +/** + * A utility class that provides functionality for downloading files from a FTP + * server. + * + * @author www.codejava.net + * + */ +public class FTPUtility { + + // FTP server information + private String host; + private int port; + private String username; + private String password; + + private FTPSClient ftpClient = new FTPSClient(); + private int replyCode; + + private InputStream inputStream; + private OutputStream outputStream; + + public FTPUtility(String host, int port, String user, String pass) { + this.host = host; + this.port = port; + this.username = user; + this.password = pass; + } + + /** + * Connect and login to the server. + * + * @throws FTPException + * @throws NoSuchAlgorithmException + */ + public void connect() throws FTPException, NoSuchAlgorithmException { + try { + ftpClient.connect(host, port); + replyCode = ftpClient.getReplyCode(); + if (!FTPReply.isPositiveCompletion(replyCode)) { + throw new FTPException("FTP serve refused connection."); + } + + boolean logged = ftpClient.login(username, password); + if (!logged) { + // failed to login + ftpClient.execPROT("P"); + ftpClient.disconnect(); + throw new FTPException("Could not login to the server."); + } + + ftpClient.enterLocalPassiveMode(); + + } catch (IOException ex) { + throw new FTPException("I/O error: " + ex.getMessage()); + } + } + + /** + * Gets size (in bytes) of the file on the server. + * + * @param filePath + * Path of the file on server + * @return file size in bytes + * @throws FTPException + */ + public long getFileSize(String filePath) throws FTPException { + try { + FTPFile file = ftpClient.mlistFile(filePath); + if (file == null) { + throw new FTPException("The file may not exist on the server!"); + } + return file.getSize(); + } catch (IOException ex) { + throw new FTPException("Could not determine size of the file: " + + ex.getMessage()); + } + } + + /** + * Start downloading a file from the server + * + * @param downloadPath + * Full path of the file on the server + * @throws FTPException + * if client-server communication error occurred + */ + public void downloadFile(String downloadPath) throws FTPException { + try { + + boolean success = ftpClient.setFileType(FTP.BINARY_FILE_TYPE); + if (!success) { + throw new FTPException("Could not set binary file type."); + } + + inputStream = ftpClient.retrieveFileStream(downloadPath); + + if (inputStream == null) { + throw new FTPException( + "Could not open input stream. The file may not exist on the server."); + } + } catch (IOException ex) { + throw new FTPException("Error downloading file: " + ex.getMessage()); + } + } + + /** + * Start uploading a file to the server + * + * @param uploadFile + * the file to be uploaded + * @param destDir + * destination directory on the server where the file is stored + * @throws FTPException + * if client-server communication error occurred + */ + public void uploadFile(File uploadFile, String destDir) throws FTPException { + try { + boolean success = ftpClient.changeWorkingDirectory(destDir); + if (!success) { + throw new FTPException("Could not change working directory to " + + destDir + ". The directory may not exist."); + } + + success = ftpClient.setFileType(FTP.BINARY_FILE_TYPE); + if (!success) { + throw new FTPException("Could not set binary file type."); + } + + outputStream = ftpClient.storeFileStream(Image.image.getNewName()); + + // ftpClient.rename(uploadFile.getName(), ); + } catch (IOException ex) { + throw new FTPException("Error uploading file: " + ex.getMessage()); + } + } + + /** + * Write an array of bytes to the output stream. + */ + public void writeFileBytes(byte[] bytes, int offset, int length) + throws IOException { + outputStream.write(bytes, offset, length); + } + + /** + * Complete the download operation. + */ + public void finish() throws IOException { + inputStream.close(); + ftpClient.completePendingCommand(); + } + + /** + * Log out and disconnect from the server + */ + public void disconnect() throws FTPException { + if (ftpClient.isConnected()) { + try { + if (!ftpClient.logout()) { + throw new FTPException("Could not log out from the server"); + } + ftpClient.disconnect(); + } catch (IOException ex) { + throw new FTPException("Error disconnect from the server: " + + ex.getMessage()); + } + } + } + + /** + * Return InputStream of the remote file on the server. + */ + public InputStream getInputStream() { + return inputStream; + } + + public OutputStream getOutputStream() { + return outputStream; + } + +} \ No newline at end of file diff --git a/dozentenmodul/src/main/java/ftp/UploadTask.java b/dozentenmodul/src/main/java/ftp/UploadTask.java new file mode 100644 index 00000000..e7ebe43b --- /dev/null +++ b/dozentenmodul/src/main/java/ftp/UploadTask.java @@ -0,0 +1,108 @@ +package ftp; + +import java.io.File; +import java.io.FileInputStream; + +import javax.swing.JOptionPane; +import javax.swing.SwingWorker; + +import models.Image; + +/** + * Executes the file upload in a background thread and updates progress to + * listeners that implement the java.beans.PropertyChangeListener interface. + * + * @author www.codejava.net + * + */ +public class UploadTask extends SwingWorker { + private static final int BUFFER_SIZE = 4096; + + private String host; + private int port; + private String username; + private String password; + private String destDir; + private File uploadFile; + private int percentCompleted; + + public UploadTask(String host, int port, String username, String password, + String destDir, File uploadFile) { + this.host = host; + this.port = port; + this.username = username; + this.password = password; + this.destDir = destDir; + this.uploadFile = uploadFile; + + } + + /** + * Executed in background thread + */ + @Override + protected Void doInBackground() throws Exception { + FTPUtility util = new FTPUtility(host, port, username, password); + try { + util.connect(); + util.uploadFile(uploadFile, destDir); + + FileInputStream inputStream = new FileInputStream(uploadFile); + byte[] buffer = new byte[BUFFER_SIZE]; + int bytesRead = -1; + int i = 0; + long totalBytesRead = 0; + percentCompleted = 0; + long fileSize = uploadFile.length(); + Image.image.setFilesize(fileSize); + long start = System.nanoTime(); + final double NANOS_PER_SECOND = 1000000000.0; + final double BYTES_PER_MIB = 1024 * 1024; + while ((bytesRead = inputStream.read(buffer)) != -1 + && isCancelled() == false) { + util.writeFileBytes(buffer, 0, bytesRead); + totalBytesRead += bytesRead; + percentCompleted = (int) (totalBytesRead * 100 / fileSize); + double speed = NANOS_PER_SECOND / BYTES_PER_MIB + * totalBytesRead / (System.nanoTime() - start + 1); + setProgress(percentCompleted); + firePropertyChange("speed", 0, speed); + firePropertyChange("filesize", 0, fileSize); + firePropertyChange("bytesread", 0, totalBytesRead); + } + + inputStream.close(); + + util.finish(); + } catch (FTPException ex) { + JOptionPane.showMessageDialog(null, + "Error uploading file: " + ex.getMessage(), "Error", + JOptionPane.ERROR_MESSAGE); + ex.printStackTrace(); + setProgress(0); + cancel(true); + } finally { + util.disconnect(); + } + + return null; + } + + /** + * Executed in Swing's event dispatching thread + */ + @Override + protected void done() { + if (!isCancelled() && percentCompleted==100) { + System.out.println("Datei erfolgreich hochgeladen"); + JOptionPane.showMessageDialog(null, + "Datei erfolgreich hochgeladen.", "Message", + JOptionPane.INFORMATION_MESSAGE); + } else if(!isCancelled() && percentCompleted != 100){ + System.out.println("Datein wurde unvollständig hochgeladen"); + JOptionPane.showMessageDialog(null, + "Datei wurde unvollständig hochgeladen. Bitte wiederholen.", "Message", + JOptionPane.INFORMATION_MESSAGE); + } + } +} \ No newline at end of file diff --git a/dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java b/dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java new file mode 100644 index 00000000..06835167 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java @@ -0,0 +1,464 @@ +package gui.image; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.net.URI; +import java.net.URISyntaxException; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; + +import models.Image; +import models.Links; +import models.person; +import util.GuiOrganizer; +import util.OpenLinks; +import javax.swing.JScrollPane; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; + + +@SuppressWarnings("serial") +public class CreateImageAllgemein_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + private JTextField Vorname; + private JTextField Nachname; + private JTextField Hochschule; + private JTextField EMail; + private JTextField imagename; + private JTextArea textAreadesc; + private boolean textfieldsHaveContent = false; // no textfield is empty + private boolean descriptionLengthOK = false; //description may not be longer than 254 chars + private boolean nameIsOK = false; // imagename only contains letters + private final int MAX_DESCRIPTION_LENGTH = 254; + private JTextArea txtrGebenSieBitte_1; + + /** + * Create the dialog. + */ + public CreateImageAllgemein_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + // Beendet das Fenster auf X + System.exit(0); + } + + @Override + public void windowOpened(WindowEvent arg0) { + imagename.requestFocusInWindow(); + } + }); + // Verhindert das Vergroessern des Fensters + setResizable(false); + + try { + // setzt das Look & Feel + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog(null, + e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + // Setzt den Titel + setTitle("bwLehrpool Suite - Image erzeugen"); + // Zentriert das Fenster + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Eingabe Ihrer Daten"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("Geben Sie hier bitte einen sprechenden Imagenamen sowie Ihre Kontaktdaten an"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 493); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 66, 557, 369); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel label = new JLabel("Vorname: *"); + label.setBackground(SystemColor.menu); + label.setBounds(10, 245, 125, 20); + panel_1.add(label); + + Vorname = new JTextField(); + Vorname.setEnabled(false); + Vorname.setEditable(false); + Vorname.setBackground(Color.WHITE); + Vorname.setText(person.verantwortlicher.getVorname()); + Vorname.setColumns(10); + Vorname.setBounds(145, 245, 350, 20); + panel_1.add(Vorname); + + JLabel label_7 = new JLabel("Nachname: *"); + label_7.setBackground(SystemColor.menu); + label_7.setBounds(10, 276, 125, 20); + panel_1.add(label_7); + + Nachname = new JTextField(); + Nachname.setEnabled(false); + Nachname.setEditable(false); + Nachname.setBackground(Color.WHITE); + Nachname.setText(person.verantwortlicher.getName()); + Nachname.setColumns(10); + Nachname.setBounds(145, 276, 350, 20); + panel_1.add(Nachname); + + JLabel label_8 = new JLabel("Hochschule: *"); + label_8.setBackground(SystemColor.menu); + label_8.setBounds(10, 307, 125, 20); + panel_1.add(label_8); + + Hochschule = new JTextField(); + Hochschule.setEnabled(false); + Hochschule.setEditable(false); + Hochschule.setBackground(Color.WHITE); + Hochschule.setText(person.verantwortlicher.getHochschule()); + Hochschule.setColumns(10); + Hochschule.setBounds(145, 307, 350, 20); + panel_1.add(Hochschule); + + JLabel label_9 = new JLabel("E-Mail: *"); + label_9.setBackground(SystemColor.menu); + label_9.setBounds(10, 338, 125, 20); + panel_1.add(label_9); + + EMail = new JTextField(); + EMail.setEnabled(false); + EMail.setEditable(false); + EMail.setBackground(Color.WHITE); + EMail.setText(person.verantwortlicher.getEMail()); + EMail.setColumns(10); + EMail.setBounds(145, 338, 350, 20); + panel_1.add(EMail); + + JLabel lblImagename = new JLabel("Imagename: *"); + lblImagename.setBackground(SystemColor.menu); + lblImagename.setBounds(10, 23, 125, 20); + panel_1.add(lblImagename); + + imagename = new JTextField(); + imagename.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + textAreadesc.requestFocusInWindow(); + } + }); + imagename.setBackground(Color.WHITE); + imagename.setText((String) null); + imagename.setColumns(10); + imagename.setBounds(145, 23, 350, 20); + imagename.setText(Image.image.getImagename()); // null am Anfang, aber + // speichert die + // Eingabe, wenn man + // zurueck kommt zur + // Seite + panel_1.add(imagename); + + JTextArea txtrGebenSieBitte = new JTextArea(); + txtrGebenSieBitte.setEditable(false); + txtrGebenSieBitte.setBackground(SystemColor.menu); + txtrGebenSieBitte.setLineWrap(true); + txtrGebenSieBitte.setFont(new Font("Tahoma", Font.PLAIN, 12)); + txtrGebenSieBitte + .setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an.\r\nDieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\""); + txtrGebenSieBitte.setBounds(145, 48, 350, 49); + panel_1.add(txtrGebenSieBitte); + + JLabel lblBeschreibung = new JLabel("Beschreibung: *"); + lblBeschreibung.setBackground(SystemColor.menu); + lblBeschreibung.setBounds(10, 110, 125, 20); + panel_1.add(lblBeschreibung); + + JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBounds(145, 110, 350, 60); + panel_1.add(scrollPane); + + textAreadesc = new JTextArea(); + textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); + textAreadesc.setLineWrap(true); + textAreadesc.setText((String) null); + textAreadesc.setText(Image.image.getDesc());// null am Anfang, aber + // speichert die Eingabe, + // wenn man zurueck kommt + // zur Seite + + scrollPane.setViewportView(textAreadesc); + + txtrGebenSieBitte_1 = new JTextArea(); + txtrGebenSieBitte_1 + .setText("Geben Sie bitte eine Beschreibung f\u00FCr das Image an.\r\nDiese soll jedoch recht spezifisch gehalten werden.\r\nBeispiel: \"Java-Enticklung mit eclipse und MySQL\""); + txtrGebenSieBitte_1.setLineWrap(true); + txtrGebenSieBitte_1.setFont(new Font("Tahoma", Font.PLAIN, 12)); + txtrGebenSieBitte_1.setEditable(false); + txtrGebenSieBitte_1.setBackground(SystemColor.menu); + txtrGebenSieBitte_1.setBounds(145, 177, 350, 49); + panel_1.add(txtrGebenSieBitte_1); + + JPanel panel = new JPanel(); + panel.setBounds(10, 402, 577, 33); + contentPanel.add(panel); + panel.setLayout(null); + panel.setBorder(new EmptyBorder(5, 5, 5, 5)); + panel.setBackground(SystemColor.menu); + + JLabel lblPflichtfelder = new JLabel("* Pflichtfelder"); + lblPflichtfelder.setBounds(10, 442, 136, 14); + contentPanel.add(lblPflichtfelder); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + // oeffnet das Hauptmenue + CreateImageAllgemein_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Image"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 45, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(133, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Neu"); + lblNewLabel_1.setBounds(146, 11, 46, 14); + contentPanel.add(lblNewLabel_1); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton backButton = new JButton("Zur\u00FCck"); + backButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Image.image.setImagename(imagename.getText()); + Image.image.setDesc(textAreadesc.getText()); + MainMenue_GUI sr = new MainMenue_GUI(); + sr.setVisible(true); + dispose(); + } + }); + backButton.setActionCommand("Cancel"); + buttonPane.add(backButton); + } + { + JButton continueButton = new JButton("Weiter"); + continueButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + // Prueft die Eingabe und leitet weiter zur naechsten + // Seite + if (checkContent() == true + && checkNameIsLettersOrNumbers() == true && descriptionLenghtOK() == true) { + // Schreibt die Daten in das Model + Image.image.setImagename(imagename.getText()); + Image.image.setDesc(textAreadesc.getText()); + // Info + System.out + .println("Alle Eingaben in Ordnung. Imagename= \"" + + Image.image.getImagename() + + "\", Imagebeschreibung=\"" + + Image.image.getDesc()+"\""); + CreateImageTechnisch_GUI ea = new CreateImageTechnisch_GUI(); + ea.setVisible(true); + dispose(); + } else { + + } + } + }); + continueButton.setActionCommand("OK"); + buttonPane.add(continueButton); + getRootPane().setDefaultButton(continueButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 78, 597, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + getContentPane().add(separator_1); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + OpenLinks open = new OpenLinks(); + URI windows; + try { + windows = new URI(Links.getFAQ()); + open.openWebpage(windows); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + OpenLinks open = new OpenLinks(); + URI windows; + try { + windows = new URI(Links.getOTRS()); + open.openWebpage(windows); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem menuItem = new JMenuItem("About"); + menuItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(menuItem); + + }// end main + + public boolean checkNameIsLettersOrNumbers() { + nameIsOK = false; + + // only allow letter from alphabet and numbers + if (imagename.getText().matches("[a-zA-Z0-9]+")) { + nameIsOK = true; + } else { + JOptionPane + .showMessageDialog( + null, + "Der Imagename darf keine Leer- oder Sonderzeichen enthalten.", + "Unerlaubte Zeichen", + JOptionPane.INFORMATION_MESSAGE); + }// if + + return nameIsOK; + }// end nameIsOK + + public boolean checkContent() { + textfieldsHaveContent = false; + + // check if any textfield is empty + if (imagename.getText().isEmpty() == false + && textAreadesc.getText().isEmpty() == false + && Vorname.getText().isEmpty() == false + && Nachname.getText().isEmpty() == false + && Hochschule.getText().isEmpty() == false + && EMail.getText().isEmpty() == false) { + // all textfields have content + textfieldsHaveContent = true; + } else { + JOptionPane + .showMessageDialog(null, + "Bitte geben Sie alle notwendigen Daten an!", + "Daten unvollst\u00e4ndig", + JOptionPane.INFORMATION_MESSAGE); + }// end if + + return textfieldsHaveContent; + }// end checkContent + + public boolean descriptionLenghtOK(){ + descriptionLengthOK=false; + + //max length is 254 chars + if (textAreadesc.getText().length() >= MAX_DESCRIPTION_LENGTH) { + descriptionLengthOK=false; + JOptionPane + .showMessageDialog(null, + "Die Beschreibung darf max 254 Zeichen enthalten. Aktuell enthält sie "+textAreadesc.getText().length()+".", + "Beschreibung zu umfangreich", + JOptionPane.INFORMATION_MESSAGE); + }else { + descriptionLengthOK=true; + + } + + return descriptionLengthOK; + }// enddescriptionLenghtOK() +}// end Class diff --git a/dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java b/dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java new file mode 100644 index 00000000..dea785d3 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java @@ -0,0 +1,258 @@ +package gui.image; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +import javax.swing.ButtonGroup; +import javax.swing.DefaultComboBoxModel; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.JTextPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; + +import models.Image; +import models.Links; +import util.GuiOrganizer; +import util.OpenLinks; + +@SuppressWarnings("serial") +public class CreateImageFreigabe_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + private final ButtonGroup buttonGrouplicense = new ButtonGroup(); + private final ButtonGroup buttonGroupInternet = new ButtonGroup(); + JComboBox comboBox; + + /** + * Create the dialog. + */ + public CreateImageFreigabe_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + System.exit(0); + } + }); + setResizable(false); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("bwLehrpool Suite - Image erzeugen"); + + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Image Freigabe"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("W\u00E4hlen Sie bitte hier die von Ihnen gew\u00FCnschte Freigabe f\u00FCr Ihr Image aus."); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 493); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Freigabe", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 51, 557, 124); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel lblNewLabel_2 = new JLabel("Freigabemodus:"); + lblNewLabel_2.setBounds(10, 55, 250, 20); + panel_1.add(lblNewLabel_2); + + comboBox = new JComboBox(); + comboBox.setModel(new DefaultComboBoxModel(new String[] { + "Lokal (Eigene Hochschule)", + "\u00D6ffentlich (Alle Hochschulen)" })); + comboBox.setSelectedIndex(0); + comboBox.setBounds(270, 55, 250, 20); + panel_1.add(comboBox); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + + CreateImageFreigabe_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Image"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 45, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(133, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Neu"); + lblNewLabel_1.setBounds(146, 11, 46, 14); + contentPanel.add(lblNewLabel_1); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton cancelButton = new JButton("Zur\u00FCck"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + Image.image.setShareMode(comboBox.getSelectedIndex()); + CreateImageTechnisch_GUI sr = new CreateImageTechnisch_GUI(); + sr.setVisible(true); + dispose(); + } + }); + cancelButton.setActionCommand("OK"); + buttonPane.add(cancelButton); + // getRootPane().setDefaultButton(cancelButton); + } + { + JButton continueButton = new JButton("Weiter"); + continueButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Image.image.setShareMode(comboBox.getSelectedIndex()); + PermissionCreateImage_GUI ea = new PermissionCreateImage_GUI(); + ea.setVisible(true); + dispose(); + + } + }); + continueButton.setActionCommand("Cancel"); + buttonPane.add(continueButton); + getRootPane().setDefaultButton(continueButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 78, 597, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + getContentPane().add(separator_1); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + JMenuItem menuItem = new JMenuItem("About"); + menuItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(menuItem); + + } +} diff --git a/dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java b/dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java new file mode 100644 index 00000000..a6b19c6c --- /dev/null +++ b/dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java @@ -0,0 +1,473 @@ +package gui.image; + + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; + +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JSeparator; +import javax.swing.JSpinner; +import javax.swing.JTextArea; +import javax.swing.JTextPane; +import javax.swing.SpinnerNumberModel; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; + +import models.Image; +import models.Links; +import server.Server.Client; +import thrift.ThriftConnection; +import util.GuiOrganizer; +import util.OpenLinks; +import javax.swing.JComboBox; + +import org.apache.thrift.TException; + +@SuppressWarnings("serial") +public class CreateImageTechnisch_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JSpinner spinnerCPU; + JSpinner spinnerRam; + //JRadioButton rdbtnlicenseJa; + //JRadioButton rdbtnlicenseNein; + //JRadioButton rdbtnInternetJa; + //JRadioButton rdbtnInternetNein; + //JRadioButton radioButtonVorlageJa; + //JRadioButton radioButtonVorlageNein; + private JCheckBox chckbxIsTemplate; + private JCheckBox chckbxIsLicensed; + private JCheckBox chckbxIsInternetBlocked; + JComboBox comboBox; + private final ButtonGroup buttonGrouplicense = new ButtonGroup(); + private final ButtonGroup buttonGroupInternet = new ButtonGroup(); + private final ButtonGroup buttonGroupVorlage = new ButtonGroup(); + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); + + + /** + * Create the dialog. + */ + public CreateImageTechnisch_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + System.exit(0); + } + }); + setResizable(false); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("bwLehrpool Suite - Image erzeugen"); + + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Eingabe technischer Daten"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie.setText("Geben Sie hier bitte einige technische Daten ein"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 531); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Informationen zum Image", TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 36, 557, 166); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + + JLabel lblInternetIstInnerhalb = new JLabel("Internet ist f\u00FCr dieses Image gesperrt:"); + lblInternetIstInnerhalb.setBounds(10, 106, 250, 20); + panel_1.add(lblInternetIstInnerhalb); + + JButton btnInternetSettings = new JButton("Einstellungen..."); + btnInternetSettings.setEnabled(false); + btnInternetSettings.setBounds(439, 105, 108, 23); + panel_1.add(btnInternetSettings); + + + JLabel lblNewLabel_2 = new JLabel("Image enth\u00E4lt lizenzpflichtige Software:"); + lblNewLabel_2.setBounds(10, 78, 250, 20); + panel_1.add(lblNewLabel_2); + + chckbxIsTemplate = new JCheckBox(""); + chckbxIsTemplate.setBounds(266, 50, 97, 23); + panel_1.add(chckbxIsTemplate); + + chckbxIsLicensed = new JCheckBox(""); + chckbxIsLicensed.setSelected(true); + chckbxIsLicensed.setBounds(266, 76, 97, 23); + panel_1.add(chckbxIsLicensed); + + chckbxIsInternetBlocked = new JCheckBox(""); + chckbxIsInternetBlocked.setBounds(266, 104, 97, 23); + panel_1.add(chckbxIsInternetBlocked); + + JLabel lblLizenzserverEintragen = new JLabel("Lizenzserver eintragen:"); + lblLizenzserverEintragen.setBounds(10, 133, 250, 20); + panel_1.add(lblLizenzserverEintragen); + + JButton btnLicenseServer = new JButton("Server-Adresse..."); + btnLicenseServer.setEnabled(false); + btnLicenseServer.setBounds(266, 132, 157, 23); + panel_1.add(btnLicenseServer); + + JLabel lblImageIstEine = new JLabel("Image ist eine Vorlage:"); + lblImageIstEine.setBounds(10, 52, 250, 20); + panel_1.add(lblImageIstEine); + + + JLabel lblBetriebssystem = new JLabel("Betriebssystem:"); + lblBetriebssystem.setBounds(10, 21, 250, 20); + panel_1.add(lblBetriebssystem); + + if (Image.image.isVorlage() == true) { + //radioButtonVorlageJa.setSelected(true); + chckbxIsTemplate.setSelected(true); + } else { + //radioButtonVorlageNein.setSelected(true); + chckbxIsTemplate.setSelected(false); + } + + if(Image.image.isInternet() == true ){ + chckbxIsInternetBlocked.setSelected(true); + } else { + chckbxIsInternetBlocked.setSelected(false); + } + + /* TODO deprecated, as checked is default in new image + if (Image.image.isLicensed() == true) { + //rdbtnlicenseJa.setSelected(true); + chckbxIsLicensed.setSelected(true); + chckbxIsLicensed.isSelected(); + } else { + //rdbtnlicenseNein.setSelected(true); + chckbxIsLicensed.setSelected(false); + } + */ + + comboBox = new JComboBox(); + try { + List os=client.getAllOS(); + + for(int i=0; i"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Image"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 45, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(133, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Neu"); + lblNewLabel_1.setBounds(146, 11, 46, 14); + contentPanel.add(lblNewLabel_1); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton cancelButton = new JButton("Zur\u00FCck"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + if(chckbxIsInternetBlocked.isSelected()==true) + { + Image.image.setInternet(true); + } + else + { + Image.image.setInternet(false); + } + + if(chckbxIsLicensed.isSelected()==true) + { + Image.image.setLicensed(true); + } + else + { + Image.image.setLicensed(false); + } + + if(chckbxIsTemplate.isSelected() == true){ + Image.image.setVorlage(true); + } else { + Image.image.setVorlage(false); + } + + Image.image.setCpu(Integer.valueOf(spinnerCPU.getValue().toString()).intValue()); + Image.image.setRam(Integer.valueOf(spinnerRam.getValue().toString()).intValue()); + Image.image.setOS(comboBox.getSelectedItem().toString()); + CreateImageAllgemein_GUI sr=new CreateImageAllgemein_GUI(); + sr.setVisible(true); + dispose(); + } + }); + cancelButton.setActionCommand("OK"); + buttonPane.add(cancelButton); + //getRootPane().setDefaultButton(cancelButton); + } + { + JButton continueButton = new JButton("Weiter"); + continueButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + if(chckbxIsInternetBlocked.isSelected()==true) + { + Image.image.setInternet(true); + } + else + { + Image.image.setInternet(false); + } + + if(chckbxIsLicensed.isSelected()==true) + { + Image.image.setLicensed(true); + } + else + { + Image.image.setLicensed(false); + } + if(chckbxIsTemplate.isSelected()==true) + { + Image.image.setVorlage(true); + } + else + { + Image.image.setVorlage(false); + } + Image.image.setCpu(Integer.valueOf(spinnerCPU.getValue().toString()).intValue()); + Image.image.setRam(Integer.valueOf(spinnerRam.getValue().toString()).intValue()); + Image.image.setOS(comboBox.getSelectedItem().toString()); + System.out.println("Betriebssystem: "+Image.image.getOS()+", istVorlage: "+Image.image.isVorlage()+", Lizenzpflichtig: "+Image.image.isLicensed()+", Internetsperre: "+Image.image.isInternet()+", CPU: "+Image.image.getCpu()+", RAM: "+Image.image.getRam()); + CreateImageFreigabe_GUI ea=new CreateImageFreigabe_GUI(); + ea.setVisible(true); + dispose(); + + } + }); + continueButton.setActionCommand("Cancel"); + buttonPane.add(continueButton); + getRootPane().setDefaultButton(continueButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 78, 597, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + getContentPane().add(separator_1); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem menuItem = new JMenuItem("About"); + menuItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(menuItem); + + } +} diff --git a/dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java b/dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java new file mode 100644 index 00000000..3b4cc3ba --- /dev/null +++ b/dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java @@ -0,0 +1,1180 @@ +package gui.image; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.HeadlessException; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JSeparator; +import javax.swing.JTabbedPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.ListSelectionModel; +import javax.swing.RowFilter; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableModel; +import javax.swing.table.TableRowSorter; + +import models.Links; +import models.person; + +import org.apache.thrift.TException; + +import server.Server.Client; +import thrift.ThriftConnection; +import util.GuiOrganizer; +import util.OpenLinks; +import javax.swing.JTextArea; + +@SuppressWarnings("serial") +public class DeleteImage_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + JLabel labelName; + JLabel labelUpdate; + JLabel labelVerantwortlicher; + JLabel labelWeitereVerantwortliche; + JLabel labelVorlage; + JLabel labelLizenzSoftware; + JLabel labelInternet; + JLabel labelRam; + JLabel labelCPU; + JLabel labelID; + JLabel labelVersion; + JTextArea textAreadesc; + private JLabel labelOS; + String[] result; + JRadioButton rdbtnInternetJa; + JRadioButton rdbtnInternetNein; + JComboBox comboBox; + JTable tableAllImages; + JTable tablemyImages; + JTable tablePublicVorlagen; + private JTextField textFieldName; + JTabbedPane tabbedPane; + boolean activeSearch = false; + String[] titles = { "Name", "Lizenzpflichtig", "OS", "Veranstaltung", + "Verantwortlicher", "Letztes Update", "ID", "Version", "Template" }; // Angezeigt + // werden + // aber + // nur + // Name + // (0), + // OS + // (2), + // Verantwortlicher + // (4), + // Letztes + // Update + // (5) + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); + final DefaultTableModel modelAll = new DefaultTableModel(titles, 0) { + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0) { + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final DefaultTableModel modelPublicVorlagen = new DefaultTableModel(titles, + 0) { + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final TableRowSorter rowSorterAll = new TableRowSorter( + modelAll); + final TableRowSorter rowSorterMyImages = new TableRowSorter( + modelMyImages); + final TableRowSorter rowSorterPublicVorlagen = new TableRowSorter( + modelPublicVorlagen); + private JLabel lblBeschreibung_1; + private JTextField textField; + + /** + * Create the dialog. + */ + public DeleteImage_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + // Beendet die Anwendung nach klick auf X + con.closeThriftConnection(); + System.exit(0); + } + + @Override + public void windowOpened(WindowEvent arg0) { + initTableModel(modelAll); + initTableModel(modelMyImages); + initTableModel(modelPublicVorlagen); + + // auszublendende Angaben + // 1=Lizenzpflichtig + // 3=Veranstaltung + // 6=ID + // 7=Version + // 8=Template + tablemyImages.getColumnModel().getColumn(1).setWidth(0); + tablemyImages.getColumnModel().getColumn(1).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(3).setWidth(0); + tablemyImages.getColumnModel().getColumn(3).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(3).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(8).setWidth(0); + tablemyImages.getColumnModel().getColumn(8).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(6).setWidth(0); + tablemyImages.getColumnModel().getColumn(6).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(7).setWidth(0); + tablemyImages.getColumnModel().getColumn(7).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0); + + tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(1) + .setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(1) + .setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(3).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(3) + .setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(3) + .setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8) + .setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8) + .setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6) + .setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6) + .setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7) + .setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7) + .setMaxWidth(0); + + tableAllImages.getColumnModel().getColumn(1).setWidth(0); + tableAllImages.getColumnModel().getColumn(1).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(3).setWidth(0); + tableAllImages.getColumnModel().getColumn(3).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(3).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(8).setWidth(0); + tableAllImages.getColumnModel().getColumn(8).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(6).setWidth(0); + tableAllImages.getColumnModel().getColumn(6).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(7).setWidth(0); + tableAllImages.getColumnModel().getColumn(7).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0); + // bis hier + textFieldName.requestFocusInWindow(); + } + }); + // Verhindert das Vergroessern Des Fensters + setResizable(false); + + try { + // Setzt das Look & Feel auf System + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + // Setzt den Fenstertitel + setTitle("bwLehrpool Suite - Image l\u00F6schen"); + // Zentriert das Fenster in die Bildmitte + setBounds(0, 0, 918, 722); + GuiOrganizer.centerGUI(this); + + final DefaultTableModel model = new DefaultTableModel(titles, 0); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 892, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel( + "Zu l\u00F6schendes Image w\u00E4hlen"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("W\u00E4hlen Sie bitte aus der unten stehenden Liste das zu l\u00F6schende Image aus."); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 531); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 49, 557, 98); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel lblNewLabel_2 = new JLabel("Name:"); + lblNewLabel_2.setBounds(10, 30, 80, 20); + panel_1.add(lblNewLabel_2); + + JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:"); + lblInternetIstInnerhalb.setBounds(10, 58, 80, 20); + panel_1.add(lblInternetIstInnerhalb); + + textFieldName = new JTextField(); + // Key Listener der Tastatureingabe registriert + textFieldName.addKeyListener(new KeyAdapter() { + @Override + public void keyReleased(KeyEvent e) { + // Textfield eingabe auslesen + String stext = textFieldName.getText(); + + // Wenn Textfield nicht leer + if (stext != "") { + activeSearch = true; + // Filtere nach der Eingabe + rowSorterAll.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + + } else { + activeSearch = false; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + "true", 8)); + rowSorterAll.setRowFilter(null); + } + } + }); + + textFieldName.setBounds(96, 30, 166, 20); + panel_1.add(textFieldName); + textFieldName.setColumns(10); + + comboBox = new JComboBox(); + try { + // Holt sich eine Liste aller verf\u00FCgbaren Betriebssysteme vom + // Server + List list = client.getAllOS(); + // Leeres Item hinzufuegen + comboBox.addItem(""); + for (int i = 0; i < list.size(); i++) { + // Hinzufuegen der verfuegbaren Betriebssysteme + comboBox.addItem(list.get(i)); + } + } catch (TException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + JOptionPane.showMessageDialog(null, + e2.getCause() + "\n" + e2.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + // Registriert Auswahlaenderungen der Box + comboBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + // Prueft das die Auswahl nicht leer ist + if (comboBox.getSelectedItem().toString() != "") { + activeSearch = true; + rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox + .getSelectedItem().toString(), 2)); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + comboBox.getSelectedItem().toString(), 2)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + comboBox.getSelectedItem().toString(), 2)); + } else { + activeSearch = false; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + "true", 8)); + rowSorterAll.setRowFilter(null); + } + } + + }); + comboBox.setBounds(96, 58, 166, 20); + panel_1.add(comboBox); + + lblBeschreibung_1 = new JLabel("Beschreibung:"); + lblBeschreibung_1.setBounds(291, 30, 80, 20); + panel_1.add(lblBeschreibung_1); + + textField = new JTextField(); + textField.setColumns(10); + textField.setBounds(381, 30, 166, 20); + panel_1.add(textField); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + + // oeffnet das Hauuetmenue + con.closeThriftConnection(); + + // oeffnet das Hauuetmenue + + DeleteImage_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Image"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 45, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(115, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Imageauswahl"); + lblNewLabel_1.setBounds(128, 11, 85, 14); + contentPanel.add(lblNewLabel_1); + + tabbedPane = new JTabbedPane(JTabbedPane.TOP); + tabbedPane.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent arg0) { + // System.out.println(tabbedPane.getSelectedIndex()); + if (tabbedPane.getSelectedIndex() == 0 && activeSearch == false) { + + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + } else if (tabbedPane.getSelectedIndex() == 1 + && activeSearch == false) { + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + "true", 8)); + } else if (tabbedPane.getSelectedIndex() == 2 + && activeSearch == false) { + rowSorterAll.setRowFilter(null); + } + + } + }); + + tabbedPane.setBounds(10, 158, 557, 339); + contentPanel.add(tabbedPane); + + JScrollPane scrollPaneMyImage = new JScrollPane(); + tablemyImages = new JTable(); + tablemyImages.getSelectionModel().addListSelectionListener( + new ListSelectionListener() { + public void valueChanged(ListSelectionEvent e) { + String imageid = modelMyImages.getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 6) + .toString(); + // System.out.println(imageid); + String version = modelMyImages.getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 7) + .toString(); + // System.out.println(version); + writeImageData(imageid, version); + } + }); + tablemyImages.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + tablemyImages.setModel(modelMyImages); + tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit(); + tablemyImages.setRowSorter(rowSorterMyImages); + + scrollPaneMyImage.setViewportView(tablemyImages); + tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null); + + JScrollPane scrollPaneCoopImages = new JScrollPane(); + JTable tableCoopImages = new JTable(); + tableCoopImages.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + tableCoopImages.setModel(model); + tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit(); + + JScrollPane scrollPanePublicVorlagen = new JScrollPane(); + tablePublicVorlagen = new JTable(); + tablePublicVorlagen.getSelectionModel().addListSelectionListener( + new ListSelectionListener() { + public void valueChanged(ListSelectionEvent e) { + String imageid = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 6) + .toString(); + // System.out.println(imageid); + String version = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 7) + .toString(); + // System.out.println(version); + writeImageData(imageid, version); + } + }); + tablePublicVorlagen.setModel(modelPublicVorlagen); + tablePublicVorlagen + .setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + + tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit(); + tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen); + scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen); + tabbedPane.addTab("Vorlagen", null, scrollPanePublicVorlagen, null); + + JScrollPane scrollPaneAllImages = new JScrollPane(); + tableAllImages = new JTable(); + tableAllImages.getSelectionModel().addListSelectionListener( + new ListSelectionListener() { + public void valueChanged(ListSelectionEvent e) { + + String imageid = modelAll.getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 6) + .toString(); + // System.out.println(imageid); + String version = modelAll.getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 7) + .toString(); + // System.out.println(version); + writeImageData(imageid, version); + + } + }); + tableAllImages.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + tableAllImages.setModel(modelAll); + tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit(); + tableAllImages.setRowSorter(rowSorterAll); + + scrollPaneAllImages.setViewportView(tableAllImages); + tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); + + scrollPaneCoopImages.setViewportView(tableCoopImages); + tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages, null); + tabbedPane.setEnabledAt(3, false); + + JButton btnDelete = new JButton("L\u00F6schen"); + btnDelete.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + + String imageid = ""; + String imageversion = ""; + int eingabe; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + if (tablemyImages.getSelectedRowCount() != 0) { + + // frage, soll das selektierte Daten geloescht werden? + eingabe = JOptionPane.showConfirmDialog(null, + "Wollen Sie diese Daten l\u00f6schen?", + "L\u00f6schen?", JOptionPane.YES_NO_OPTION); + + if (eingabe == JOptionPane.YES_OPTION) { + + imageid = modelMyImages.getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 6) + .toString(); + + imageversion = modelMyImages.getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 7) + .toString(); + + // TODO + // Image darf nur geloescht werden, wenn keine + // Veranstaltung mehr auf das Image verweist. + // Unbdingt abfragen! + + try { + if (!client.connectedToLecture(imageid, + imageversion)) { + // System.out.println(imageid); + // System.out.println(imageversion); + try { + client.deleteImageServer(imageid, + imageversion); + if (client.deleteImageData(imageid, + imageversion)) { + // if (client.deleteImageServer(imageid + // ,imageversion)) { + + DeleteImage_GUI di = new DeleteImage_GUI(); + di.setVisible(true); + dispose(); + + /* + * } else { + * + * JOptionPane.showConfirmDialog(null, + * "Loeschen vom Server hat leider nicht geklappt!!" + * , imageversion, + * JOptionPane.OK_CANCEL_OPTION); } + */ + + } else { + + JOptionPane + .showConfirmDialog( + null, + "L\u00f6schen von der DB hat leider nicht geklappt!!", + "Fehler", + JOptionPane.INFORMATION_MESSAGE); + } + } catch (HeadlessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog( + null, + e.getCause() + "\n" + + e.getStackTrace(), + "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog( + null, + e.getCause() + "\n" + + e.getStackTrace(), + "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + + } else { + + JOptionPane + .showMessageDialog( + null, + "Image kann nicht gel\u00f6scht werden, da mindestens eine Veranstaltung mit diesem Image verlinkt ist.", + "Verlinkung vorhanden", + JOptionPane.INFORMATION_MESSAGE); + } + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog(null, e.getCause() + + "\n" + e.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } + } + + } else if (tablePublicVorlagen.getSelectedRowCount() != 0 + && modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 4) + .equals(username)) { + + // frage, soll das selektierte Daten geloescht werden? + eingabe = JOptionPane.showConfirmDialog(null, + "Wollen Sie diese Daten l\u00f6schen?", + "L\u00f6schen?", JOptionPane.YES_NO_OPTION); + + if (eingabe == JOptionPane.YES_OPTION) { + + imageid = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 6) + .toString(); + + imageversion = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 7) + .toString(); + + // TODO + // Image darf nur geloescht werden, wenn keine + // Veranstaltung mehr auf das Image verweist. + // Unbdingt abfragen! + + try { + if (!client.connectedToLecture(imageid, + imageversion)) { + // System.out.println(imageid); + // System.out.println(imageversion); + try { + client.deleteImageServer(imageid, + imageversion); + if (client.deleteImageData(imageid, + imageversion)) { + // if (client.deleteImageServer(imageid + // ,imageversion)) { + + DeleteImage_GUI di = new DeleteImage_GUI(); + di.setVisible(true); + dispose(); + + /* + * } else { + * + * JOptionPane.showConfirmDialog(null, + * "Loeschen vom Server hat leider nicht geklappt!!" + * , imageversion, + * JOptionPane.OK_CANCEL_OPTION); } + */ + + } else { + + JOptionPane + .showConfirmDialog( + null, + "L\u00f6schen von der DB hat leider nicht geklappt!!", + "Fehler", + JOptionPane.INFORMATION_MESSAGE); + } + } catch (HeadlessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog( + null, + e.getCause() + "\n" + + e.getStackTrace(), + "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog( + null, + e.getCause() + "\n" + + e.getStackTrace(), + "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + + } else { + + JOptionPane + .showMessageDialog( + null, + "Image kann nicht gel\u00f6scht werden, da mindestens eine Veranstaltung mit diesem Image verlinkt ist.", + "Verlinkung vorhanden", + JOptionPane.INFORMATION_MESSAGE); + } + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog(null, e.getCause() + + "\n" + e.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } + } + + } else if (tableAllImages.getSelectedRowCount() != 0 + && modelAll.getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 4).equals( + username)) { + + // frage, soll das selektierte Daten geloescht werden? + eingabe = JOptionPane.showConfirmDialog(null, + "Wollen Sie diese Daten l\u00f6schen?", + "L\u00f6schen?", JOptionPane.YES_NO_OPTION); + + if (eingabe == JOptionPane.YES_OPTION) { + + imageid = modelAll.getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 6) + .toString(); + + imageversion = modelAll.getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 7) + .toString(); + + // TODO + // Image darf nur geloescht werden, wenn keine + // Veranstaltung mehr auf das Image verweist. + // Unbdingt abfragen! + + try { + if (!client.connectedToLecture(imageid, + imageversion)) { + // System.out.println(imageid); + // System.out.println(imageversion); + try { + client.deleteImageServer(imageid, + imageversion); + if (client.deleteImageData(imageid, + imageversion)) { + // if (client.deleteImageServer(imageid + // ,imageversion)) { + + DeleteImage_GUI di = new DeleteImage_GUI(); + di.setVisible(true); + dispose(); + + /* + * } else { + * + * JOptionPane.showConfirmDialog(null, + * "Loeschen vom Server hat leider nicht geklappt!!" + * , imageversion, + * JOptionPane.OK_CANCEL_OPTION); } + */ + + } else { + + JOptionPane + .showConfirmDialog( + null, + "L\u00f6schen von der DB hat leider nicht geklappt!!", + "Fehler", + JOptionPane.INFORMATION_MESSAGE); + } + } catch (HeadlessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog( + null, + e.getCause() + "\n" + + e.getStackTrace(), + "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog( + null, + e.getCause() + "\n" + + e.getStackTrace(), + "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + + } else { + + JOptionPane + .showMessageDialog( + null, + "Image kann nicht gel\u00f6scht werden, da mindestens eine Veranstaltung mit diesem Image verlinkt ist.", + "Verlinkung vorhanden", + JOptionPane.INFORMATION_MESSAGE); + } + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog(null, e.getCause() + + "\n" + e.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } + } + + } else { + + JOptionPane.showMessageDialog(null, + "Bitte w\u00e4hlen Sie ein eigenes Image aus", + "Message", JOptionPane.INFORMATION_MESSAGE); + } + + } + }); + btnDelete.setBounds(449, 508, 118, 23); + contentPanel.add(btnDelete); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 902, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton okButton = new JButton("Zur\u00FCck"); + okButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + // oeffnet das Hauptmen\u00FC + con.closeThriftConnection(); + + // oeffnet das Hauptmenue + + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + dispose(); + } + }); + okButton.setActionCommand("OK"); + buttonPane.add(okButton); + getRootPane().setDefaultButton(okButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 79, 912, 1); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 912, 2); + getContentPane().add(separator_1); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBorder(new TitledBorder(null, "Detailinformationen", + + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel.setBackground(SystemColor.menu); + panel.setBounds(586, 85, 316, 531); + getContentPane().add(panel); + + JLabel lblName = new JLabel("Name:"); + lblName.setBounds(10, 87, 130, 14); + panel.add(lblName); + + labelName = new JLabel(""); + labelName.setBounds(10, 102, 296, 14); + panel.add(labelName); + + JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); + lblVerantwortlicher.setBounds(10, 259, 130, 14); + panel.add(lblVerantwortlicher); + + labelOS = new JLabel(""); + labelOS.setBounds(10, 216, 296, 14); + panel.add(labelOS); + + JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:"); + lblWeitereVerantwortliche.setBounds(10, 202, 130, 14); + panel.add(lblWeitereVerantwortliche); + + labelVerantwortlicher = new JLabel(""); + labelVerantwortlicher.setBounds(10, 272, 296, 14); + panel.add(labelVerantwortlicher); + + JLabel label = new JLabel("Weitere Verantwortliche:"); + label.setBounds(10, 284, 130, 14); + panel.add(label); + + labelWeitereVerantwortliche = new JLabel(""); + labelWeitereVerantwortliche.setBounds(10, 297, 296, 14); + panel.add(labelWeitereVerantwortliche); + + labelUpdate = new JLabel(""); + labelUpdate.setBounds(10, 245, 296, 14); + panel.add(labelUpdate); + + JLabel lblLetztesUpdate = new JLabel("Letztes Update:"); + lblLetztesUpdate.setBounds(10, 231, 130, 14); + panel.add(lblLetztesUpdate); + + JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:"); + lblImageIstVorlage.setBounds(10, 336, 130, 14); + panel.add(lblImageIstVorlage); + + labelVorlage = new JLabel(""); + labelVorlage.setBounds(10, 350, 296, 14); + panel.add(labelVorlage); + + labelLizenzSoftware = new JLabel(""); + labelLizenzSoftware.setBounds(10, 383, 296, 14); + panel.add(labelLizenzSoftware); + + JLabel lblLizenzpflichtigeSoftware = new JLabel( + "Lizenzpflichtige Software:"); + lblLizenzpflichtigeSoftware.setBounds(10, 367, 130, 14); + panel.add(lblLizenzpflichtigeSoftware); + + JLabel lblInternet = new JLabel("Internetsperre vorhanden:"); + lblInternet.setBounds(10, 400, 130, 14); + panel.add(lblInternet); + + labelInternet = new JLabel(""); + labelInternet.setBounds(10, 417, 296, 14); + panel.add(labelInternet); + + JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:"); + lblEmpfehlungRam.setBounds(10, 432, 130, 14); + panel.add(lblEmpfehlungRam); + + labelRam = new JLabel(""); + labelRam.setBounds(10, 455, 296, 14); + panel.add(labelRam); + + JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:"); + lblEmpfehlungCpu.setBounds(10, 469, 130, 14); + panel.add(lblEmpfehlungCpu); + + labelCPU = new JLabel(""); + labelCPU.setBounds(10, 487, 296, 14); + panel.add(labelCPU); + + JLabel lblTechnischeDaten = new JLabel("Technische Daten:"); + lblTechnischeDaten.setBounds(10, 322, 296, 14); + panel.add(lblTechnischeDaten); + + JLabel lblId = new JLabel("ID:"); + lblId.setBounds(10, 23, 296, 14); + panel.add(lblId); + + labelID = new JLabel(""); + labelID.setBounds(10, 37, 296, 14); + panel.add(labelID); + + labelVersion = new JLabel(""); + labelVersion.setBounds(10, 73, 296, 14); + panel.add(labelVersion); + + JLabel lblVersion = new JLabel("Version:"); + lblVersion.setBounds(10, 57, 296, 14); + panel.add(lblVersion); + + JLabel lblBeschreibung = new JLabel("Beschreibung:"); + lblBeschreibung.setBounds(10, 119, 130, 14); + panel.add(lblBeschreibung); + + JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBounds(10, 135, 296, 65); + panel.add(scrollPane); + + textAreadesc = new JTextArea(); + textAreadesc.setEditable(false); + textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); + textAreadesc.setLineWrap(true); + textAreadesc.setBackground(SystemColor.menu); + scrollPane.setViewportView(textAreadesc); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem menuItem = new JMenuItem("About"); + menuItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(menuItem); + + } + + // Initiale Beffuelung eines Table models + public DefaultTableModel initTableModel(DefaultTableModel model) { + List images; + try { + // Hole eine Liste der Images + images = client.getImageList(); + + Iterator i = images.iterator(); + + int x = 0; + SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); + while (i.hasNext()) { + + // System.out.println(out.format(in.parse(images.get(x).updateTime))); + + // erzeuge Objekte fuer die Tabelle + Object[] obj = { images.get(x).getImageName(), + images.get(x).getLicenseRestriction(), + images.get(x).getOsName(), + images.get(x).getLectureName(), + images.get(x).getUserData(), + out.format(in.parse(images.get(x).updateTime)), + images.get(x).id, images.get(x).getVersion(), + images.get(x).getIsTemplate() }; + // Fuege diese Objekte der Tabelle hinzu + model.addRow(obj); + x++; + i.next(); + + } + + return model; + } catch (TException | ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + JOptionPane.showMessageDialog(null, + e1.getCause() + "\n" + e1.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + return model; + } + + public void writeImageData(String id, String version) { + try { + SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); + Map res = client.getImageData(id, version); + labelName.setText(res.get("name")); + labelOS.setText(res.get("os")); + labelUpdate.setText(out.format(in.parse(res.get("lastupdate")))); + labelVerantwortlicher.setText(res.get("owner")); + labelWeitereVerantwortliche.setText("Noch nicht Verf�gbar"); + if (res.get("template").equals("true")) { + labelVorlage.setText("Ja"); + } else { + labelVorlage.setText("Nein"); + } + if (res.get("license").equals("1")) { + labelLizenzSoftware.setText("Ja"); + } else { + labelLizenzSoftware.setText("Nein"); + } + if (res.get("internet").equals("1")) { + labelInternet.setText("Ja"); + } else { + labelInternet.setText("Nein"); + } + labelRam.setText(res.get("ram")); + labelCPU.setText(res.get("cpu")); + labelID.setText(res.get("id")); + labelVersion.setText(res.get("version")); + textAreadesc.setText(res.get("desc")); + } catch (TException | ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } +} diff --git a/dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java b/dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java new file mode 100644 index 00000000..4c6e5629 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java @@ -0,0 +1,531 @@ +package gui.image; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Map; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; + +import models.Image; +import models.Links; +import models.person; + +import org.apache.thrift.TException; + +import server.Server.Client; +import thrift.ThriftConnection; +import util.GuiOrganizer; +import util.OpenLinks; +import javax.swing.JScrollPane; + +@SuppressWarnings("serial") +public class EditImageAllgemein_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + private JTextField Vorname; + private JTextField Nachname; + private JTextField Hochschule; + private JTextField EMail; + private JTextField imagename; + private JTextArea textAreadesc; + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); + private JPanel panel_2; + private JLabel lblNewLabel; + private JTextPane txtpnBitteWhlenSie; + private JPanel buttonPane; + private JButton backButton; + private JButton okButton; + private boolean textfieldsHaveContent = false; //no textfield is empty + private boolean nameIsOK = false; //imagename only contains letters + private boolean descriptionLengthOK = false; //description may not be longer than MAX_DESCRIPTION_LENGTH + private final int MAX_DESCRIPTION_LENGTH = 254; + + /** + * Create the dialog. + */ + public EditImageAllgemein_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + // Beendet die Anwendung bei einem Klick auf das X + con.closeThriftConnection(); + System.exit(0); + } + }); + // Verhindert das vergroessern des Fensters + setResizable(false); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + // Setzt den Fenstertitel + setTitle("bwLehrpool Suite - Image bearbeiten"); + + // Zentriert das Fenster in der Bildmitte + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + initData(); + getContentPane().setLayout(null); + { + panel_2 = new JPanel(); + panel_2.setBackground(SystemColor.menu); + panel_2.setBounds(10, 11, 577, 57); + getContentPane().add(panel_2); + panel_2.setLayout(null); + { + lblNewLabel = new JLabel("Bearbeiten Ihrer Daten"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel_2.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel_2.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 493); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 66, 557, 369); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel label = new JLabel("Vorname: *"); + label.setBackground(SystemColor.menu); + label.setBounds(10, 245, 125, 20); + panel_1.add(label); + + Vorname = new JTextField(); + Vorname.setEditable(false); + Vorname.setEnabled(false); + Vorname.setBackground(Color.WHITE); + Vorname.setText(person.verantwortlicher.getVorname()); + Vorname.setColumns(10); + Vorname.setBounds(145, 245, 350, 20); + panel_1.add(Vorname); + + JLabel label_7 = new JLabel("Nachname: *"); + label_7.setBackground(SystemColor.menu); + label_7.setBounds(10, 276, 125, 20); + panel_1.add(label_7); + + Nachname = new JTextField(); + Nachname.setEnabled(false); + Nachname.setEditable(false); + Nachname.setBackground(Color.WHITE); + Nachname.setText(person.verantwortlicher.getName()); + Nachname.setColumns(10); + Nachname.setBounds(145, 276, 350, 20); + panel_1.add(Nachname); + + JLabel label_8 = new JLabel("Hochschule: *"); + label_8.setBackground(SystemColor.menu); + label_8.setBounds(10, 307, 125, 20); + panel_1.add(label_8); + + Hochschule = new JTextField(); + Hochschule.setEnabled(false); + Hochschule.setEditable(false); + Hochschule.setBackground(Color.WHITE); + Hochschule.setText(person.verantwortlicher.getHochschule()); + Hochschule.setColumns(10); + Hochschule.setBounds(145, 307, 350, 20); + panel_1.add(Hochschule); + + JLabel label_9 = new JLabel("E-Mail: *"); + label_9.setBackground(SystemColor.menu); + label_9.setBounds(10, 338, 125, 20); + panel_1.add(label_9); + + EMail = new JTextField(); + EMail.setEnabled(false); + EMail.setEditable(false); + EMail.setBackground(Color.WHITE); + EMail.setText(person.verantwortlicher.getEMail()); + EMail.setColumns(10); + EMail.setBounds(145, 338, 350, 20); + panel_1.add(EMail); + + JLabel lblImagename = new JLabel("Imagename: *"); + lblImagename.setBackground(SystemColor.menu); + lblImagename.setBounds(10, 23, 125, 20); + panel_1.add(lblImagename); + + imagename = new JTextField(); + imagename + .setToolTipText("Bitte geben Sie hier den Namen des Image ein, z.B. \"Programmieren\"."); + imagename.setBackground(Color.WHITE); + imagename.setText(Image.image.getImagename()); + imagename.setColumns(10); + imagename.setBounds(145, 23, 350, 20); + panel_1.add(imagename); + + JTextArea txtrGebenSieBitte = new JTextArea(); + txtrGebenSieBitte.setBackground(SystemColor.menu); + txtrGebenSieBitte.setLineWrap(true); + txtrGebenSieBitte.setFont(new Font("Tahoma", Font.PLAIN, 12)); + txtrGebenSieBitte + .setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an.\r\nDieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\""); + txtrGebenSieBitte.setBounds(145, 48, 350, 55); + panel_1.add(txtrGebenSieBitte); + + JLabel lblBeschreibung = new JLabel("Beschreibung: *"); + lblBeschreibung.setBackground(SystemColor.menu); + lblBeschreibung.setBounds(10, 110, 125, 20); + panel_1.add(lblBeschreibung); + + JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBounds(145, 110, 350, 60); + panel_1.add(scrollPane); + + textAreadesc = new JTextArea(); + textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); + textAreadesc.setLineWrap(true); + textAreadesc.setText((String) null); + textAreadesc.setText(Image.image.getDesc());// null am Anfang, aber + // speichert die Eingabe, + // wenn man zurueck kommt + // zur Seite + scrollPane.setViewportView(textAreadesc); + + JTextArea textArea = new JTextArea(); + textArea.setText("Geben Sie bitte eine Beschreibung für das Image an.\r\nDiese soll jedoch recht spezifisch gehalten werden.\r\nBeispiel: \"Java-Enticklung mit eclipse und MySQL\""); + textArea.setLineWrap(true); + textArea.setFont(new Font("Tahoma", Font.PLAIN, 12)); + textArea.setEditable(false); + textArea.setBackground(SystemColor.menu); + textArea.setBounds(145, 177, 350, 49); + panel_1.add(textArea); + + JPanel panel = new JPanel(); + panel.setBounds(10, 402, 577, 33); + contentPanel.add(panel); + panel.setLayout(null); + panel.setBorder(new EmptyBorder(5, 5, 5, 5)); + panel.setBackground(SystemColor.menu); + + JLabel lblPflichtfelder = new JLabel("* Pflichtfelder"); + lblPflichtfelder.setBounds(10, 442, 136, 14); + contentPanel.add(lblPflichtfelder); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + // Durch den Klick auf Button Hauptmenpue wird dieses Fenster + // unsichtbar und das Hauptmenue sichtbar + + EditImageAllgemein_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Image"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 45, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(133, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Bearbeiten"); + lblNewLabel_1.setBounds(146, 11, 71, 14); + contentPanel.add(lblNewLabel_1); + { + buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + backButton = new JButton("Zur\u00FCck"); + backButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + // Setzen der Eingabe im Model, dadurch bleiben die + // Daten bei einem erneuten Aufruf verfuegbar + // Image.image.setImagename(imagename.getText()); + + SearchEditImage_GUI se = new SearchEditImage_GUI(); + se.setVisible(true); + dispose(); + } + }); + backButton.setActionCommand("CANCEL"); + buttonPane.add(backButton); + + } + { + okButton = new JButton("Weiter"); + okButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + // Prueft die Eingabe und leitet weiter zur naechsten + // Seite + if (checkContent() == true && checkNameIsLettersOrNumbers() == true && descriptionLenghtOK()== true) { + + // setze Namen, egal ob alt oder nicht + Image.image.setImagename(imagename.getText()); + Image.image.setDesc(textAreadesc.getText()); + // Info + System.out + .println("Alle Eingaben in Ordnung. Imagename= \"" + + Image.image.getImagename() + + "\", Imagebeschreibung=\"" + + Image.image.getDesc()+"\""); + + + EditImageTechnisch_GUI ea = new EditImageTechnisch_GUI(); + ea.setVisible(true); + dispose(); + + } else { + + }// end else + } + }); + + okButton.setActionCommand("OK"); + buttonPane.add(okButton); + getRootPane().setDefaultButton(okButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 78, 597, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + getContentPane().add(separator_1); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem menuItem = new JMenuItem("About"); + menuItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(menuItem); + // setFocusTraversalPolicy(new FocusTraversalOnArray(new + // Component[]{getContentPane(), panel_2, lblNewLabel, + // txtpnBitteWhlenSie, contentPanel, panel_1, label, Vorname, label_7, + // Nachname, label_8, Hochschule, label_9, EMail, lblImagename, + // imagename, txtrGebenSieBitte, panel, lblPflichtfelder, lblHauptmen, + // label_1, lblVlimage, label_2, lblNewLabel_1, buttonPane, backButton, + // okButton, separator, separator_1, menuBar, mnNewMenu_1, mntmFaq, + // mntmOtrs})); + + } + + public void initData() { + try { + + Map map = client.getImageData( + Image.image.getImageId(), Image.image.getVersion()); + if (map.get("internet").equals("0")) { + Image.image.setInternet(false); + } else { + Image.image.setInternet(true); + } + if (map.get("license").equals("0")) { + Image.image.setLicensed(false); + } else { + Image.image.setLicensed(true); + } + System.out.println(map.get("template")); + if (map.get("template").equals("false")) { + Image.image.setVorlage(false); + } else { + Image.image.setVorlage(true); + } + Image.image.setImagename(map.get("name")); + Image.image.setRam(Integer.parseInt(map.get("ram"))); + Image.image.setCpu(Integer.parseInt(map.get("cpu"))); + Image.image.setImagepath(map.get("path")); + Image.image.setDesc(map.get("desc")); + Image.image.setFilesize(Long.parseLong(map.get("filesize"))); + int mode=0; + if(map.get("shareMode").equals("only_local")){ + mode=0; + } + else + { + mode=1; + } + Image.image.setShareMode(mode); + Image.image.setOS(map.get("os")); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog(null, + e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + }//end initData() + + public boolean checkNameIsLettersOrNumbers() { + nameIsOK = false; + + //only allow letter from alphabet and nothing else + if (imagename.getText().matches("[a-zA-Z0-9]+")) { + nameIsOK = true; + } else { + JOptionPane + .showMessageDialog( + null, + "Der Imagename darf keine Leer- oder Sonderzeichen enthalten.", + "Unerlaubte Zeichen", + JOptionPane.INFORMATION_MESSAGE); + }// if + + return nameIsOK; + }// end nameIsOK + + public boolean checkContent(){ + textfieldsHaveContent=false; + + //check if any textfield is empty + if(imagename.getText().isEmpty() == false + && textAreadesc.getText().isEmpty() == false + && Vorname.getText().isEmpty() == false + && Nachname.getText().isEmpty() == false + && Hochschule.getText().isEmpty() == false + && EMail.getText().isEmpty() == false) { + //all textfields have content + textfieldsHaveContent = true; + } else { + JOptionPane + .showMessageDialog( + null, + "Bitte geben Sie alle notwendigen Daten an!", + "Daten unvollst\u00e4ndig", + JOptionPane.INFORMATION_MESSAGE); + }//end if + + return textfieldsHaveContent; + }//end checkContent + + public boolean descriptionLenghtOK(){ + descriptionLengthOK=false; + + //max length is 254 chars + if (textAreadesc.getText().length() >= MAX_DESCRIPTION_LENGTH) { + descriptionLengthOK=false; + JOptionPane + .showMessageDialog(null, + "Die Beschreibung darf max 254 Zeichen enthalten. Aktuell enthält sie "+textAreadesc.getText().length()+".", + "Beschreibung zu umfangreich", + JOptionPane.INFORMATION_MESSAGE); + }else { + descriptionLengthOK=true; + + } + + return descriptionLengthOK; + }// enddescriptionLenghtOK() + +}//end class diff --git a/dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java b/dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java new file mode 100644 index 00000000..147900fe --- /dev/null +++ b/dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java @@ -0,0 +1,256 @@ +package gui.image; + + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +import javax.swing.ButtonGroup; +import javax.swing.DefaultComboBoxModel; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.JTextPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; + +import models.Image; +import models.Links; +import util.GuiOrganizer; +import util.OpenLinks; + +@SuppressWarnings("serial") +public class EditImageFreigabe_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + private final ButtonGroup buttonGrouplicense = new ButtonGroup(); + private final ButtonGroup buttonGroupInternet = new ButtonGroup(); + JComboBox comboBox; + + /** + * Create the dialog. + */ + public EditImageFreigabe_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + System.exit(0); + } + }); + setResizable(false); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("bwLehrpool Suite - Image erzeugen"); + + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Image Freigabe"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie.setText("W\u00E4hlen Sie bitte hier die von Ihnen gew\u00FCnschte Freigabe f\u00FCr Ihr Image aus."); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 493); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Freigabe", TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 51, 557, 124); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel lblNewLabel_2 = new JLabel("Freigabemodus:"); + lblNewLabel_2.setBounds(10, 55, 250, 20); + panel_1.add(lblNewLabel_2); + + comboBox = new JComboBox(); + comboBox.setModel(new DefaultComboBoxModel(new String[] {"Lokal (Eigene Hochschule)", "\u00D6ffentlich (Alle Hochschulen)"})); + comboBox.setSelectedIndex(Image.image.getShareMode()); + comboBox.setBounds(270, 55, 250, 20); + panel_1.add(comboBox); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + + EditImageFreigabe_GUI.this.setVisible(false); + MainMenue_GUI main=new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Image"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 45, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(133, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Neu"); + lblNewLabel_1.setBounds(146, 11, 46, 14); + contentPanel.add(lblNewLabel_1); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton cancelButton = new JButton("Zur\u00FCck"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + Image.image.setShareMode(comboBox.getSelectedIndex()); + EditImageTechnisch_GUI sr=new EditImageTechnisch_GUI(); + sr.setVisible(true); + dispose(); + } + }); + cancelButton.setActionCommand("OK"); + buttonPane.add(cancelButton); + //getRootPane().setDefaultButton(cancelButton); + } + { + JButton continueButton = new JButton("Weiter"); + continueButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Image.image.setShareMode(comboBox.getSelectedIndex()); + PermissionEditImage_GUI ea=new PermissionEditImage_GUI(); + ea.setVisible(true); + dispose(); + + } + }); + continueButton.setActionCommand("Cancel"); + buttonPane.add(continueButton); + getRootPane().setDefaultButton(continueButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 78, 597, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + getContentPane().add(separator_1); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAbout); + + } +} diff --git a/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java b/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java new file mode 100644 index 00000000..5da9259e --- /dev/null +++ b/dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java @@ -0,0 +1,518 @@ +package gui.image; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; + + +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JSeparator; +import javax.swing.JSpinner; +import javax.swing.JTextArea; +import javax.swing.JTextPane; +import javax.swing.SpinnerNumberModel; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; + +import server.Server.Client; +import thrift.ThriftConnection; +import util.GuiOrganizer; +import util.OpenLinks; +import models.Image; +import models.Links; +import javax.swing.JComboBox; + +import org.apache.thrift.TException; +import javax.swing.JCheckBox; + +@SuppressWarnings("serial") +public class EditImageTechnisch_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JSpinner spinnerCPU; + JSpinner spinnerRam; + //JRadioButton rdbtnlicenseJa; + //JRadioButton rdbtnlicenseNein; + //JRadioButton rdbtnInternetJa; + //JRadioButton rdbtnInternetNein; + //JRadioButton radioButtonVorlageJa; + //JRadioButton radioButtonVorlageNein; + private JCheckBox chckbxIsTemplate; + private JCheckBox chckbxIsLicensed; + private JCheckBox chckbxIsInternetBlocked; + private final ButtonGroup buttonGrouplicense = new ButtonGroup(); + private final ButtonGroup buttonGroupInternet = new ButtonGroup(); + private final ButtonGroup buttonGroupVorlage = new ButtonGroup(); + JComboBox comboBox; + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); + + /** + * Create the dialog. + */ + public EditImageTechnisch_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + // Beendet die Anwendung bei Klick auf das X + + System.exit(0); + } + + }); + // Verhindert das Vergroe�ern des Fensters + setResizable(false); + + try { + // setzt das Look & Feel + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + // Setzt den Titel des Fensters + setTitle("bwLehrpool Suite - Image bearbeiten"); + // Zentriert das Fenster + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Eingabe technischer Daten"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("Geben Sie hier bitte einige technische Daten ein."); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 532); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Informationen zum Image", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 25, 557, 167); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel lblNewLabel_2 = new JLabel( + "Image enth\u00E4lt lizenzpflichtige Software:"); + lblNewLabel_2.setBounds(10, 77, 250, 20); + panel_1.add(lblNewLabel_2); + + chckbxIsTemplate = new JCheckBox(""); + chckbxIsTemplate.setBounds(266, 50, 97, 23); + panel_1.add(chckbxIsTemplate); + + chckbxIsLicensed = new JCheckBox(""); + chckbxIsLicensed.setBounds(266, 76, 97, 23); + panel_1.add(chckbxIsLicensed); + + chckbxIsInternetBlocked = new JCheckBox(""); + chckbxIsInternetBlocked.setBounds(266, 104, 97, 23); + panel_1.add(chckbxIsInternetBlocked); + + //rdbtnlicenseJa = new JRadioButton("Ja"); + //rdbtnlicenseJa.setSelected(true); + //buttonGrouplicense.add(rdbtnlicenseJa); + //rdbtnlicenseJa.setBounds(266, 76, 109, 23); + //panel_1.add(rdbtnlicenseJa); + + //rdbtnlicenseNein = new JRadioButton("Nein"); + //buttonGrouplicense.add(rdbtnlicenseNein); + //rdbtnlicenseNein.setBounds(377, 76, 53, 23); + //panel_1.add(rdbtnlicenseNein); + + + JLabel lblInternetIstInnerhalb = new JLabel( + "Internet ist innerhalb des Image gesperrt:"); + lblInternetIstInnerhalb.setBounds(10, 105, 250, 20); + panel_1.add(lblInternetIstInnerhalb); + + /*rdbtnInternetJa = new JRadioButton("Ja"); + buttonGroupInternet.add(rdbtnInternetJa); + rdbtnInternetJa.setBounds(266, 104, 109, 23); + panel_1.add(rdbtnInternetJa); + + rdbtnInternetNein = new JRadioButton("Nein"); + rdbtnInternetNein.setSelected(true); + buttonGroupInternet.add(rdbtnInternetNein); + rdbtnInternetNein.setBounds(377, 104, 53, 23); + panel_1.add(rdbtnInternetNein); + */ + JLabel label = new JLabel("Lizenzserver eintragen:"); + label.setBounds(10, 134, 250, 20); + panel_1.add(label); + + JButton button = new JButton("Server-Adresse..."); + button.setEnabled(false); + button.setBounds(266, 133, 157, 23); + panel_1.add(button); + + JLabel label_4 = new JLabel("Image ist eine Vorlage:"); + label_4.setBounds(10, 51, 250, 20); + panel_1.add(label_4); + + //radioButtonVorlageJa = new JRadioButton("Ja"); + //buttonGroupVorlage.add(radioButtonVorlageJa); + //radioButtonVorlageJa.setBounds(266, 50, 41, 23); + //panel_1.add(radioButtonVorlageJa); + + //radioButtonVorlageNein = new JRadioButton("Nein"); + //radioButtonVorlageNein.setSelected(true); + //buttonGroupVorlage.add(radioButtonVorlageNein); + //radioButtonVorlageNein.setBounds(377, 50, 46, 23); + //panel_1.add(radioButtonVorlageNein); + + JLabel lblBetriebssystem = new JLabel("Betriebssystem:"); + lblBetriebssystem.setBounds(10, 26, 250, 20); + panel_1.add(lblBetriebssystem); + + comboBox = new JComboBox(); + try { + List os=client.getAllOS(); + for(int i=0;i"); + label_1.setBounds(69, 0, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Image"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 0, 45, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(133, 0, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Neu"); + lblNewLabel_1.setBounds(146, 0, 46, 14); + contentPanel.add(lblNewLabel_1); + + JPanel panel_2 = new JPanel(); + panel_2.setLayout(null); + panel_2.setBorder(new TitledBorder(null, + "Empfehlung bez\u00fcglich Ressourcen", TitledBorder.LEADING, + TitledBorder.TOP, null, null)); + panel_2.setBackground(SystemColor.menu); + panel_2.setBounds(10, 203, 557, 329); + contentPanel.add(panel_2); + + JTextArea txtrHinweisSolltenSie = new JTextArea(); + txtrHinweisSolltenSie.setBackground(SystemColor.menu); + txtrHinweisSolltenSie.setFont(new Font("Tahoma", Font.PLAIN, 13)); + txtrHinweisSolltenSie + .setText("Hinweis: Sollten Sie keine Software einsetzen, die viele Ressourcen ben\u00F6tigt,\r\nk\u00F6nnen Sie sich an den Beispielwerten orientieren."); + txtrHinweisSolltenSie.setBounds(10, 43, 537, 55); + panel_2.add(txtrHinweisSolltenSie); + + JLabel lblNewLabel_3 = new JLabel( + "Wie viel Arbeitsspeicher empfehlen Sie f\u00FCr das Image:"); + lblNewLabel_3.setBounds(10, 109, 280, 20); + panel_2.add(lblNewLabel_3); + + JLabel lblMindestens = new JLabel("mindestens"); + lblMindestens.setBounds(315, 109, 60, 20); + panel_2.add(lblMindestens); + + spinnerRam = new JSpinner(); + spinnerRam.setModel(new SpinnerNumberModel(1, 1, 8, 1)); + spinnerRam.setBounds(385, 106, 29, 20); + spinnerRam.setValue(Image.image.getRam()); + panel_2.add(spinnerRam); + + JLabel lblGbyte = new JLabel("GByte"); + lblGbyte.setBounds(424, 109, 46, 20); + panel_2.add(lblGbyte); + + JTextArea txtrBeispielWindows = new JTextArea(); + txtrBeispielWindows + .setText("Beispiel:\r\nWindows 7 32/64 Bit: 2 GByte\r\nLinux/Unix 32/64 Bit: 1 GByte"); + txtrBeispielWindows.setFont(new Font("Tahoma", Font.PLAIN, 11)); + txtrBeispielWindows.setBackground(SystemColor.menu); + txtrBeispielWindows.setBounds(20, 129, 280, 55); + panel_2.add(txtrBeispielWindows); + + JTextArea txtrBeispielWindows_1 = new JTextArea(); + txtrBeispielWindows_1 + .setText("Beispiel:\r\nWindows 7 32/64 Bit: 1 Kern\r\nLinux/Unix 32/64 Bit: 1 Kern"); + txtrBeispielWindows_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); + txtrBeispielWindows_1.setBackground(SystemColor.menu); + txtrBeispielWindows_1.setBounds(20, 244, 280, 55); + panel_2.add(txtrBeispielWindows_1); + + JLabel lblWieVieleCpus = new JLabel( + "Wie viele CPUs empfehlen Sie f\u00FCr das Image:"); + lblWieVieleCpus.setBounds(10, 219, 280, 20); + panel_2.add(lblWieVieleCpus); + + JLabel label_3 = new JLabel("mindestens"); + label_3.setBounds(315, 219, 60, 20); + panel_2.add(label_3); + + spinnerCPU = new JSpinner(); + spinnerCPU.setModel(new SpinnerNumberModel(1, 1, 4, 1)); + spinnerCPU.setBounds(385, 216, 29, 20); + spinnerCPU.setValue(Image.image.getCpu()); + panel_2.add(spinnerCPU); + + JLabel lblKerne = new JLabel("Kerne"); + lblKerne.setBounds(424, 219, 46, 20); + panel_2.add(lblKerne); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton okButton = new JButton("Zur\u00FCck"); + okButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + // Setzt die Imagewerte in das Model + Image.image.setCpu(Integer.valueOf( + spinnerCPU.getValue().toString()).intValue()); + Image.image.setRam(Integer.valueOf( + spinnerRam.getValue().toString()).intValue()); + if (chckbxIsInternetBlocked.isSelected() == true) { + Image.image.setInternet(true); + } else { + Image.image.setInternet(false); + } + + if (chckbxIsLicensed.isSelected() == true) { + Image.image.setLicensed(true); + } else { + Image.image.setLicensed(false); + } + + if (chckbxIsTemplate.isSelected() == true) { + Image.image.setVorlage(true); + } else { + Image.image.setVorlage(false); + } + + Image.image.setOS(comboBox.getSelectedItem().toString()); + // oeffnet das vorherige Fenster + EditImageAllgemein_GUI ei = new EditImageAllgemein_GUI(); + ei.setVisible(true); + dispose(); + } + }); + okButton.setActionCommand("OK"); + buttonPane.add(okButton); + getRootPane().setDefaultButton(okButton); + } + { + JButton cancelButton = new JButton("Weiter"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Image.image.setCpu(Integer.valueOf( + spinnerCPU.getValue().toString()).intValue()); + Image.image.setRam(Integer.valueOf( + spinnerRam.getValue().toString()).intValue()); + if (chckbxIsInternetBlocked.isSelected() == true) { + Image.image.setInternet(true); + } else { + Image.image.setInternet(false); + } + + if (chckbxIsLicensed.isSelected() == true) { + Image.image.setLicensed(true); + } else { + Image.image.setLicensed(false); + } + + if (chckbxIsTemplate.isSelected() == true) { + Image.image.setVorlage(true); + } else { + Image.image.setVorlage(false); + } + + Image.image.setOS(comboBox.getSelectedItem().toString()); + System.out.println("Betriebssystem: "+Image.image.getOS()+", istVorlage: "+Image.image.isVorlage()+", Lizenzpflichtig: "+Image.image.isLicensed()+", Internetsperre: "+Image.image.isInternet()+", CPU: "+Image.image.getCpu()+", RAM: "+Image.image.getRam()); + // oeffnet das naechste Fenster + EditImageFreigabe_GUI ea=new EditImageFreigabe_GUI(); + ea.setVisible(true); + dispose(); + + } + }); + cancelButton.setActionCommand("Cancel"); + buttonPane.add(cancelButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 78, 597, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + getContentPane().add(separator_1); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAbout); + + } +} diff --git a/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java new file mode 100644 index 00000000..a9461bb4 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java @@ -0,0 +1,659 @@ +package gui.image; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; + +import javax.swing.JButton; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.JSeparator; +import javax.swing.JTextPane; +import javax.swing.SwingConstants; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; + +import models.Image; +import models.Links; +import models.SessionData; +import models.person; + +import org.apache.thrift.TException; +import org.ini4j.InvalidFileFormatException; +import org.ini4j.Wini; + +import server.Server.Client; +import thrift.ThriftConnection; +import util.GuiOrganizer; +import util.OpenLinks; +import ftp.UploadTask; +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +@SuppressWarnings("serial") +public class FTPCreateUploader_GUI extends JFrame implements + PropertyChangeListener { + + @SuppressWarnings("unused") + private JPanel contentPane; + private final JPanel contentPanel = new JPanel(); + JLabel lblPath; + JProgressBar progressBar; + String host = SessionData.session.getServerAdress(); + int port = 21; + server.User user; + String filename = ""; + File uploadFile; + static String arg = ""; + UploadTask task; + JLabel UpSpeed; + JLabel labelfertig; + JLabel labelfilesize; + JLabel labelZeit; + JLabel labelverbleibend; + JFileChooser fc; + long filesize; + double speed; + long bytesread; + boolean taskrun = false; + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); + JButton finishButton = new JButton("Fertigstellen"); + JButton btnUploadStarten = new JButton("Upload auf Server starten"); + JButton btnZurck = new JButton("Zur\u00FCck"); + int progress = 0; // progress of upload + private boolean isCurrentlyLoading = false; // currently up or downloading + // file + + /** + * Create the frame. + */ + public FTPCreateUploader_GUI() { + + final Object[] options = { "Beenden", "Abbrechen" }; + + addWindowListener(new WindowAdapter() { + + @Override + public void windowClosing(WindowEvent arg0) { + + if (taskrun == true) { + // check if user wants to quit. + int choice = JOptionPane + .showOptionDialog( + null, + "Aktuell ist ein Upload aktiv. Wollen Sie diesen Abbrechen und das Programm beenden?", + "Upload aktiv", + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE, null, + options, options[1]); + // 0=beenden, 1=abbrechen + if (choice == 0) { + try { + client.DeleteFtpUser(user.userName); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + task.cancel(true); + con.closeThriftConnection(); + System.exit(0); + }// end if choice + } else { + // no upload running, close window + System.exit(0); + }// end if taskrun + }// end window closing + }); + setResizable(false); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog(null, + e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + + // filename=name; + setBackground(Color.WHITE); + setTitle("Dozentenmodul - Image erzeugen"); + // Aktion die beim Schliessen durchgefuehrt werden soll + setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); + + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(new BorderLayout()); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel, BorderLayout.CENTER); + contentPanel.setLayout(null); + { + JButton btnSpeicherortAuswhlen = new JButton("Image ausw\u00E4hlen"); + btnSpeicherortAuswhlen.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + fc = new JFileChooser(ini.get("main", + "Letzter Uploadpfad", String.class)); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + + fc.setFileSelectionMode(JFileChooser.FILES_ONLY); + + fc.showOpenDialog(getParent()); + File file = fc.getSelectedFile(); + // check if a file is selected and exists + if (file != null) { + // file selected + uploadFile = file; + filename = uploadFile.getName(); + lblPath.setText(file.getAbsolutePath()); + } else { + // no file selected + lblPath.setText(""); + }// end if + } + }); + + btnSpeicherortAuswhlen.setBounds(102, 124, 173, 23); + btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP); + contentPanel.add(btnSpeicherortAuswhlen); + } + lblPath = new JLabel(""); + try { + Wini ini = new Wini(new File("C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + lblPath.setText(ini.get("main", "Letzter Uploadpfad", String.class)); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + + lblPath.addPropertyChangeListener(new PropertyChangeListener() { + public void propertyChange(PropertyChangeEvent arg0) { + if (lblPath.getText() == null) { + // wenn leer, dann upload button nicht freigeben + btnUploadStarten.setEnabled(false); + btnUploadStarten.setText("Bitte warten"); + } else if (lblPath.getText().endsWith(".vmdk")) { + // wenn leer, dann upload button freigeben + btnUploadStarten.setEnabled(true); + btnUploadStarten.setText("Upload auf Server starten"); + } + } + }); + lblPath.setHorizontalAlignment(SwingConstants.LEFT); + lblPath.setBounds(102, 158, 485, 23); + contentPanel.add(lblPath); + + btnUploadStarten.setEnabled(false); + btnUploadStarten.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + buttonUploadActionPerformed(arg0); + + } + }); + + btnUploadStarten.setBounds(102, 200, 173, 23); + contentPanel.add(btnUploadStarten); + + progressBar = new JProgressBar(0, 100); + progressBar.setStringPainted(true); + + progressBar.setBounds(102, 234, 485, 30); + contentPanel.add(progressBar); + + JLabel lblUploadgeschwindigkeit = new JLabel("Uploadgeschwindigkeit:"); + lblUploadgeschwindigkeit.setBounds(102, 275, 141, 14); + contentPanel.add(lblUploadgeschwindigkeit); + + JLabel label_1 = new JLabel("Fertig:"); + label_1.setBounds(102, 325, 46, 14); + contentPanel.add(label_1); + + labelfertig = new JLabel("0"); + labelfertig.setHorizontalAlignment(SwingConstants.LEFT); + labelfertig.setBounds(183, 325, 108, 14); + contentPanel.add(labelfertig); + + UpSpeed = new JLabel("0"); + UpSpeed.setHorizontalAlignment(SwingConstants.LEFT); + UpSpeed.setBounds(374, 275, 117, 14); + contentPanel.add(UpSpeed); + + JLabel label_4 = new JLabel("von:"); + label_4.setBounds(318, 325, 46, 14); + contentPanel.add(label_4); + + labelfilesize = new JLabel("0"); + labelfilesize.setHorizontalAlignment(SwingConstants.LEFT); + labelfilesize.setBounds(374, 325, 117, 14); + contentPanel.add(labelfilesize); + + JLabel label_6 = new JLabel("Verbleibend:"); + label_6.setBounds(102, 350, 71, 14); + contentPanel.add(label_6); + + JLabel label_7 = new JLabel("Gesch\u00E4tzte Verbleibende Zeit:"); + label_7.setBounds(102, 300, 150, 14); + contentPanel.add(label_7); + + labelZeit = new JLabel("0"); + labelZeit.setHorizontalAlignment(SwingConstants.LEFT); + labelZeit.setBounds(374, 300, 117, 14); + contentPanel.add(labelZeit); + + labelverbleibend = new JLabel("0"); + labelverbleibend.setHorizontalAlignment(SwingConstants.LEFT); + labelverbleibend.setBounds(183, 350, 108, 14); + contentPanel.add(labelverbleibend); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + contentPanel.add(panel); + + JLabel lblUploadIhresImage = new JLabel("Upload Ihres Image"); + lblUploadIhresImage.setFont(new Font("Tahoma", Font.BOLD, 18)); + lblUploadIhresImage.setBounds(10, 11, 509, 22); + panel.add(lblUploadIhresImage); + + JTextPane txtpnFhreSieBitte = new JTextPane(); + txtpnFhreSieBitte + .setText("F\u00FChre Sie bitte die folgenden 3 Schritte aus um Ihr Image auf unseren Server zu laden."); + txtpnFhreSieBitte.setEditable(false); + txtpnFhreSieBitte.setBackground(SystemColor.menu); + txtpnFhreSieBitte.setBounds(10, 36, 509, 32); + panel.add(txtpnFhreSieBitte); + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 79, 597, 2); + contentPanel.add(separator); + + JLabel lblNewLabel_1 = new JLabel("Hauptmen\u00FC"); + lblNewLabel_1.setForeground(Color.BLUE); + lblNewLabel_1.setBounds(20, 88, 61, 20); + contentPanel.add(lblNewLabel_1); + + JLabel label_3 = new JLabel(">"); + label_3.setBounds(80, 91, 14, 14); + contentPanel.add(label_3); + + JLabel lblVlimage = new JLabel("Image"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(91, 88, 46, 20); + contentPanel.add(lblVlimage); + + JLabel label_5 = new JLabel(">"); + label_5.setBounds(139, 91, 14, 14); + contentPanel.add(label_5); + + JLabel lblNeubearbeiten = new JLabel("Neu"); + lblNeubearbeiten.setBounds(149, 91, 108, 14); + contentPanel.add(lblNeubearbeiten); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + contentPanel.add(separator_1); + + JLabel lblSchritt_1 = new JLabel("Schritt 1:"); + lblSchritt_1.setBounds(24, 128, 57, 14); + contentPanel.add(lblSchritt_1); + + JLabel lblSchritt_2 = new JLabel("Schritt 2:"); + lblSchritt_2.setBounds(24, 204, 57, 14); + contentPanel.add(lblSchritt_2); + + JLabel lblSchritt_3 = new JLabel("Schritt 3:"); + lblSchritt_3.setBounds(20, 423, 57, 14); + contentPanel.add(lblSchritt_3); + + JLabel lblKlickenSieAuf = new JLabel( + "Klicken Sie auf \"Fertigstellen\"."); + lblKlickenSieAuf.setBounds(98, 423, 241, 14); + contentPanel.add(lblKlickenSieAuf); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBackground(UIManager.getColor("Button.background")); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane, BorderLayout.SOUTH); + { + finishButton.setEnabled(false); + finishButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + writeData(); + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + + // check if path has content, then write to file + if (lblPath.getText().contains("\\") == true) { + System.out.println("Hole Infos aus Label: " + + lblPath.getText()); + ini.put("main", + "Letzter Uploadpfad", + lblPath.getText().substring( + 0, + lblPath.getText().lastIndexOf( + "\\"))); + ini.store(); + } else { + System.out.println("Mache nix"); + }// end if + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + dispose(); + MainMenue_GUI m = new MainMenue_GUI(); + m.setVisible(true); + if (taskrun == true) { + try { + client.DeleteFtpUser(user.userName); + + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + JOptionPane.showMessageDialog( + null, + e1.getCause() + "\n" + + e1.getStackTrace(), + "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + task.cancel(true); + } + + } + }); + + btnZurck.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + // check if loading file or not + if (isCurrentlyLoading() == true) { + int choice = JOptionPane + .showOptionDialog( + null, + "Nicht abgeschlossene Uploads werden beendet. Trotzdem zurück gehen?", + "Warnung", + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE, null, + options, options[1]); + // 0=beenden, 1=abbrechen + if (choice == 0) { + try { + client.DeleteFtpUser(user.userName); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + task.cancel(true); + // not loading files, go back one page + dispose(); + PermissionCreateImage_GUI m = new PermissionCreateImage_GUI(); + m.setVisible(true); + + }// end if choice + } else { + dispose(); + PermissionCreateImage_GUI m = new PermissionCreateImage_GUI(); + m.setVisible(true); + }// end else + }// end action + }); + btnZurck.setActionCommand("Cancel"); + buttonPane.add(btnZurck); + finishButton.setActionCommand("Cancel"); + buttonPane.add(finishButton); + } + } + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu menu = new JMenu("Hilfe"); + menuBar.add(menu); + + JMenuItem menuItem = new JMenuItem("FAQ"); + menuItem.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + OpenLinks open = new OpenLinks(); + URI windows; + try { + windows = new URI(Links.getFAQ()); + open.openWebpage(windows); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + + menu.add(menuItem); + + JMenuItem menuItem_1 = new JMenuItem("OTRS"); + menuItem_1.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + OpenLinks open = new OpenLinks(); + URI windows; + try { + windows = new URI(Links.getOTRS()); + open.openWebpage(windows); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + menu.add(menuItem_1); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + menu.add(mntmAbout); + setVisible(true); + + } + + private void buttonUploadActionPerformed(ActionEvent event) { + + progressBar.setValue(0); + btnUploadStarten.setEnabled(false); // verhindert einen weiteren klick + btnUploadStarten.setText("Bitte warten"); + + try { + System.out.println("Getting FTP User"); + user = client.getFtpUser(); + System.out.println("FTP name: " + user.userName); + System.out.println("FTP path: " + user.path); + System.out.println("FTP pass: " + user.password); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog(null, + e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + DateFormat formatter = new SimpleDateFormat("yyyMMddhhmmss"); + + System.out.println("Setting new Name: " + formatter.format(new Date()) + + "_" + person.verantwortlicher.getHochschule() + "_" + + person.verantwortlicher.getUsername() + "_" + + Image.image.getImagename() + ".vmdk"); + Image.image.setNewName(formatter.format(new Date()) + "_" + + person.verantwortlicher.getHochschule() + "_" + + person.verantwortlicher.getUsername() + "_" + + Image.image.getImagename() + ".vmdk"); + System.out.println("Uploading to host: " + host); + + task = new UploadTask(host, port, user.userName, user.password, + user.path + "temp/", uploadFile); + + task.addPropertyChangeListener(this); + task.execute(); + taskrun = true; + + } + + public void propertyChange(PropertyChangeEvent arg0) { + progress = 0; + if ("progress" == arg0.getPropertyName()) { + progress = (Integer) arg0.getNewValue(); + progressBar.setValue(progress); + + } + + // Fertigstellen erlauben wenn upload abgeschlossen + if (isCurrentlyLoading() == false) { + // isCurrentlyLoading(); + finishButton.setEnabled(true); + } else { + finishButton.setEnabled(false); + } + + if ("speed" == arg0.getPropertyName()) { + speed = (double) arg0.getNewValue(); + // if(speed<=1){ + + UpSpeed.setText(String.valueOf(speed).substring(0, + String.valueOf(speed).lastIndexOf(".") + 3) + + " MB/s"); + + } + if ("bytesread" == arg0.getPropertyName()) { + bytesread = (long) arg0.getNewValue(); + labelfertig.setText((bytesread / 1024 / 1024) + " MB"); + labelverbleibend + .setText(((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) + + " MB"); + + labelZeit + .setText(String + .valueOf( + ((((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + 1) + .substring( + 0, + String.valueOf( + (((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + .lastIndexOf(".")) + + " Minuten"); + + } + if ("filesize" == arg0.getPropertyName()) { + filesize = (long) arg0.getNewValue(); + labelfilesize.setText((filesize / 1024 / 1024) + " MB"); + + } + + } + + public boolean writeData() { + + try { + + client.writeVLdata(Image.image.getImagename(), + Image.image.getDesc(), + person.verantwortlicher.getUsername(), + person.verantwortlicher.getVorname(), + person.verantwortlicher.getName(), + person.verantwortlicher.getHochschule(), + person.verantwortlicher.getEMail(), + person.verantwortlicher.getTel(), + person.verantwortlicher.getFakultaet(), + Image.image.isLicensed(), Image.image.isInternet(), + Image.image.getRam(), Image.image.getCpu(), "temp/" + + Image.image.getNewName(), + Image.image.isVorlage(), Image.image.getFilesize(), + Image.image.getShareMode(), Image.image.getOS()); + + client.startFileCopy(Image.image.getNewName()); + + client.writeImageRights(Image.image.getImagename(), + person.verantwortlicher.getUsername(), + person.verantwortlicher.getName(), + person.verantwortlicher.getVorname(), + person.verantwortlicher.getEMail(), + person.verantwortlicher.getHochschule(), + person.verantwortlicher.getRole()); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog(null, + e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + return false; + } + return true; + + }// end writeData() + + public boolean isCurrentlyLoading() { + isCurrentlyLoading = false; + + if (labelverbleibend.getText().equals("0 MB") + || labelverbleibend.getText().equals("0")) { + isCurrentlyLoading = false; + } else { + isCurrentlyLoading = true; + } + + return isCurrentlyLoading; + }// end isCurrentlyLoading() + +}// end class \ No newline at end of file diff --git a/dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java new file mode 100644 index 00000000..013c2774 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java @@ -0,0 +1,590 @@ +package gui.image; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +import javax.swing.JButton; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.JSeparator; +import javax.swing.JTextPane; +import javax.swing.SwingConstants; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; + +import models.Image; +import models.Links; +import models.SessionData; + +import org.apache.thrift.TException; +import org.ini4j.InvalidFileFormatException; +import org.ini4j.Wini; + +import server.Server.Client; +import server.User; +import thrift.ThriftConnection; +import util.GuiOrganizer; +import util.OpenLinks; +import ftp.DownloadTask; +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +@SuppressWarnings("serial") +public class FTPEditDownloader_GUI extends JFrame implements + PropertyChangeListener { + + @SuppressWarnings("unused") + private JPanel contentPane; + private final JPanel contentPanel = new JPanel(); + JLabel lblPath; + JLabel downspeed; + User user; + JProgressBar progressBar; + String host = SessionData.session.getServerAdress(); + int port = 21; + String downloadFile = ""; + static String arg = ""; + DownloadTask task; + JLabel lblBytesread; + JLabel lblNewLabel_3; + JLabel labelVerbleibend; + JFileChooser fc; + long filesize; + double speed; + int progress = 0; // progress of download + long bytesread; + JLabel labelZeit; + boolean taskrun = false; + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); + JButton btnZurck = new JButton("Zur\u00FCck"); + JButton btnDownloadStarten = new JButton("Download starten"); + private JLabel lblAnleitung; + private boolean isCurrentlyLoading = false; // currently up or downloading + // file + + /** + * Create the frame. + */ + public FTPEditDownloader_GUI() { + + final Object[] options = { "Beenden", "Abbrechen" }; + + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + if (taskrun == true) { + // check if user wants to quit. + int choice = JOptionPane + .showOptionDialog( + null, + "Aktuell ist ein Download aktiv. Wollen Sie diesen Abbrechen und das Programm beenden?", + "Upload aktiv", + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE, null, + options, options[1]); + // 0=beenden, 1=abbrechen + if (choice == 0) { + try { + client.DeleteFtpUser(user.userName); + con.closeThriftConnection(); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + task.cancel(true); + System.exit(0); + }// end if coice + } else { + // no download running, close window + System.exit(0); + }// end if taskrun + }// end window closing + }); + setResizable(false); + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + setBackground(Color.WHITE); + setTitle("Dozentenmodul - Image herunterladen"); + // Aktion die beim Schliessen durchgefuehrt werden soll + setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); + + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(new BorderLayout()); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel, BorderLayout.CENTER); + contentPanel.setLayout(null); + { + JButton btnSpeicherortAuswhlen = new JButton( + "Speicherort ausw\u00E4hlen"); + btnSpeicherortAuswhlen.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + System.out.println("FileChooser Pfad: " + + ini.get("main", "Letzter Downloadpfad", + String.class)); + fc = new JFileChooser(ini.get("main", + "Letzter Downloadpfad", String.class)); + fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + + fc.showOpenDialog(getParent()); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + + File dir = fc.getSelectedFile(); + // check if directory is selected + if (dir != null) { + // is selected + lblPath.setText(dir.getAbsolutePath()); + } else { + // no directory selected + lblPath.setText(""); + }// end if + } + }); + + btnSpeicherortAuswhlen.setBounds(102, 124, 173, 23); + btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP); + contentPanel.add(btnSpeicherortAuswhlen); + } + + lblPath = new JLabel(""); + try { + Wini ini = new Wini(new File("C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + lblPath.setText(ini.get("main", "Letzter Downloadpfad", + String.class)); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + lblPath.addPropertyChangeListener(new PropertyChangeListener() { + public void propertyChange(PropertyChangeEvent arg0) { + if (lblPath.getText() == null) { + // wenn leer, dann upload button nicht freigeben + btnDownloadStarten.setEnabled(false); + btnDownloadStarten.setText("Bitte warten"); + } else { + // wenn leer, dann upload button freigeben + btnDownloadStarten.setEnabled(true); + btnDownloadStarten.setText("Download starten"); + } + } + }); + lblPath.setBounds(102, 158, 485, 23); + contentPanel.add(lblPath); + + btnDownloadStarten.setEnabled(false); + btnDownloadStarten.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + buttonDownloadActionPerformed(arg0); + } + }); + + btnDownloadStarten.setBounds(102, 200, 173, 23); + contentPanel.add(btnDownloadStarten); + + progressBar = new JProgressBar(0, 100); + progressBar.setStringPainted(true); + + progressBar.setBounds(102, 234, 485, 30); + contentPanel.add(progressBar); + + JLabel lblDownloadgeschwindigkeit = new JLabel( + "Downloadgeschwindigkeit:"); + lblDownloadgeschwindigkeit.setBounds(102, 275, 141, 14); + contentPanel.add(lblDownloadgeschwindigkeit); + + downspeed = new JLabel("0"); + downspeed.setBounds(374, 275, 117, 14); + contentPanel.add(downspeed); + + JLabel lblFertig = new JLabel("Fertig:"); + lblFertig.setBounds(102, 325, 46, 14); + contentPanel.add(lblFertig); + + lblBytesread = new JLabel("0"); + lblBytesread.setBounds(183, 325, 108, 14); + contentPanel.add(lblBytesread); + + JLabel lblVon = new JLabel("von:"); + lblVon.setBounds(318, 325, 46, 14); + contentPanel.add(lblVon); + + lblNewLabel_3 = new JLabel("0"); + lblNewLabel_3.setBounds(374, 325, 117, 14); + contentPanel.add(lblNewLabel_3); + + JLabel lblMbVerbleibend = new JLabel("Verbleibend:"); + lblMbVerbleibend.setBounds(102, 350, 71, 14); + contentPanel.add(lblMbVerbleibend); + + labelVerbleibend = new JLabel("0"); + labelVerbleibend.setBounds(183, 350, 108, 14); + contentPanel.add(labelVerbleibend); + + JLabel lblGeschtzteVerbleibendeZeit = new JLabel( + "Gesch\u00E4tzte Verbleibende Zeit:"); + lblGeschtzteVerbleibendeZeit.setBounds(102, 300, 150, 14); + contentPanel.add(lblGeschtzteVerbleibendeZeit); + + labelZeit = new JLabel("0"); + labelZeit.setBounds(374, 300, 117, 14); + contentPanel.add(labelZeit); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 24, 577, 57); + contentPanel.add(panel); + + JLabel lblImageDownloader = new JLabel("Image Downloader"); + lblImageDownloader.setFont(new Font("Tahoma", Font.BOLD, 18)); + lblImageDownloader.setBounds(10, 11, 509, 22); + panel.add(lblImageDownloader); + + JTextPane txtpnWhlenSieEinen = new JTextPane(); + txtpnWhlenSieEinen + .setText("W\u00E4hlen Sie einen Ort aus, um das von Ihnen gw\u00E4hlte Image erunter zu laden."); + txtpnWhlenSieEinen.setEditable(false); + txtpnWhlenSieEinen.setBackground(SystemColor.menu); + txtpnWhlenSieEinen.setBounds(10, 36, 509, 32); + panel.add(txtpnWhlenSieEinen); + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 88, 597, 2); + contentPanel.add(separator); + + JLabel label_1 = new JLabel("Hauptmen\u00FC"); + label_1.setForeground(Color.BLUE); + label_1.setBounds(20, 92, 61, 20); + contentPanel.add(label_1); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(80, 95, 14, 14); + contentPanel.add(label_2); + + JLabel label_3 = new JLabel("Image"); + label_3.setForeground(Color.BLUE); + label_3.setBounds(91, 92, 46, 20); + contentPanel.add(label_3); + + JLabel label_4 = new JLabel(">"); + label_4.setBounds(139, 95, 14, 14); + contentPanel.add(label_4); + + JLabel label_5 = new JLabel("Neu/Bearbeiten"); + label_5.setBounds(149, 95, 108, 14); + contentPanel.add(label_5); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(-10, 648, 597, 2); + contentPanel.add(separator_1); + + JLabel lblSchritt = new JLabel("Schritt 1:"); + lblSchritt.setBounds(24, 128, 57, 14); + contentPanel.add(lblSchritt); + + JLabel lblSchritt_1 = new JLabel("Schritt 2:"); + lblSchritt_1.setBounds(24, 204, 57, 14); + contentPanel.add(lblSchritt_1); + + JLabel lblSchritt_3 = new JLabel("Schritt 3:"); + lblSchritt_3.setBounds(20, 423, 57, 14); + contentPanel.add(lblSchritt_3); + + JLabel lblKlickenSieAuf = new JLabel( + "Klicken Sie auf \"Fertigstellen\"."); + lblKlickenSieAuf.setBounds(102, 423, 241, 14); + contentPanel.add(lblKlickenSieAuf); + + JMenuBar menuBar = new JMenuBar(); + menuBar.setBounds(0, 0, 597, 21); + contentPanel.add(menuBar); + + JMenu menu = new JMenu("Hilfe"); + menuBar.add(menu); + + JMenuItem menuItem = new JMenuItem("FAQ"); + menuItem.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + OpenLinks open = new OpenLinks(); + URI windows; + try { + windows = new URI(Links.getFAQ()); + open.openWebpage(windows); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + + menu.add(menuItem); + + JMenuItem menuItem_1 = new JMenuItem("OTRS"); + menuItem_1.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + OpenLinks open = new OpenLinks(); + URI windows; + try { + windows = new URI(Links.getOTRS()); + open.openWebpage(windows); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + + menu.add(menuItem_1); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + menu.add(mntmAbout); + + lblAnleitung = new JLabel( + "Anleitung zum erstellen einer virtuellen Maschine herunterladen"); + lblAnleitung.setForeground(Color.BLUE); + lblAnleitung.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + OpenLinks open = new OpenLinks(); + + URI anleitung; + try { + anleitung = new URI(Links.getAnleitungVMDK()); + open.openWebpage(anleitung); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + lblAnleitung.setBounds(102, 448, 311, 14); + contentPanel.add(lblAnleitung); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBackground(UIManager.getColor("Button.background")); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane, BorderLayout.SOUTH); + { + btnZurck.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + // check if loading file or not + if (isCurrentlyLoading() == true) { + int choice = JOptionPane + .showOptionDialog( + null, + "Nicht abgeschlossene Uploads werden beendet. Trotzdem zurück gehen?", + "Warnung", + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE, null, + options, options[1]); + // 0=beenden, 1=abbrechen + if (choice == 0) { + task.cancel(true); + try { + client.DeleteFtpUser(user.userName); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + ini.put("main", "Letzter Downloadpfad", + lblPath.getText()); + ini.store(); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + // go back one page + SearchEditImage_GUI se = new SearchEditImage_GUI(); + se.setVisible(true); + dispose(); + }// end choice + + } else { + + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + ini.put("main", "Letzter Downloadpfad", + lblPath.getText()); + ini.store(); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + // go back one page + SearchEditImage_GUI se = new SearchEditImage_GUI(); + se.setVisible(true); + dispose(); + + }// end else + + } + }); + btnZurck.setActionCommand("Cancel"); + buttonPane.add(btnZurck); + } + } + setVisible(true); + + } + + private void buttonDownloadActionPerformed(ActionEvent event) { + + progressBar.setValue(0); + btnDownloadStarten.setEnabled(false); // verhindert schnellen zweiten + // Klick + btnDownloadStarten.setText("Bitte warten"); + try { + user = client.getFtpUser(); + + downloadFile = user.path + + "/" + + client.getPathOfImage(Image.image.getImageId(), + Image.image.getVersion()); + + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog(null, + e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + + task = new DownloadTask(host, port, user.userName, user.password, + downloadFile, lblPath.getText()); + task.addPropertyChangeListener(this); + task.execute(); + taskrun = true; + + } + + public void propertyChange(PropertyChangeEvent arg0) { + + progress = 0; + if ("progress" == arg0.getPropertyName()) { + progress = (Integer) arg0.getNewValue(); + progressBar.setValue(progress); + } + + if ("speed" == arg0.getPropertyName()) { + speed = (double) arg0.getNewValue(); + + downspeed.setText(String.valueOf(speed).substring(0, + String.valueOf(speed).lastIndexOf(".") + 3) + + " MB/s"); + + } + if ("bytesread" == arg0.getPropertyName()) { + bytesread = (long) arg0.getNewValue(); + lblBytesread.setText((bytesread / 1024 / 1024) + " MB"); + labelVerbleibend + .setText(((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) + + " MB"); + + labelZeit + .setText(String + .valueOf( + ((((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + 1) + .substring( + 0, + String.valueOf( + (((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + .lastIndexOf(".")) + + " Minuten"); + + } + if ("filesize" == arg0.getPropertyName()) { + filesize = (long) arg0.getNewValue(); + lblNewLabel_3.setText((filesize / 1024 / 1024) + " MB"); + + } + + }// end PropertyChange() + + public boolean isCurrentlyLoading() { + isCurrentlyLoading = false; + + if (labelVerbleibend.getText().equals("0 MB") || labelVerbleibend.getText().equals("0")) { + isCurrentlyLoading = false; + } else { + isCurrentlyLoading = true; + } + System.out.println("isCurrentlyLoading="+isCurrentlyLoading); + return isCurrentlyLoading; + }// end isCurrentlyLoading() + +}// end class diff --git a/dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java new file mode 100644 index 00000000..5d679ea5 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java @@ -0,0 +1,664 @@ +package gui.image; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; + +import javax.swing.JButton; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.JSeparator; +import javax.swing.JTextPane; +import javax.swing.SwingConstants; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; + +import models.Image; +import models.Links; +import models.SessionData; +import models.person; + +import org.apache.thrift.TException; +import org.ini4j.InvalidFileFormatException; +import org.ini4j.Wini; + +import server.Server.Client; +import thrift.ThriftConnection; +import util.GuiOrganizer; +import util.OpenLinks; +import ftp.UploadTask; +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +@SuppressWarnings("serial") +public class FTPEditUploader_GUI extends JFrame implements + PropertyChangeListener { + + @SuppressWarnings("unused") + private JPanel contentPane; + private final JPanel contentPanel = new JPanel(); + JLabel lblPath; + JProgressBar progressBar; + String host = SessionData.session.getServerAdress(); + int port = 21; + server.User user; + String filename = ""; + File uploadFile; + static String arg = ""; + UploadTask task; + JLabel UpSpeed; + JLabel labelfertig; + JLabel labelfilesize; + JLabel labelZeit; + JLabel labelverbleibend; + JFileChooser fc; + long filesize; + double speed; + long bytesread; + boolean fileupload = false; + boolean taskrun = false; + int progress = 0; + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); + JButton btnUploadStarten = new JButton("Upload auf Server starten"); + JButton btnSpeicherortAuswhlen = new JButton("Image ausw\u00E4hlen"); + JButton finishButton = new JButton("Fertigstellen"); + JButton btnZurck = new JButton("Zur\u00FCck"); + private boolean isCurrentlyLoading = false; // currently up or downloading + // file + + /** + * Create the frame. + */ + public FTPEditUploader_GUI() { + + final Object[] options = { "Beenden", "Abbrechen" }; + + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + + if (taskrun == true) { + // check if user wants to quit. + int choice = JOptionPane + .showOptionDialog( + null, + "Aktuell ist ein Upload aktiv. Wollen Sie diesen Abbrechen und das Programm beenden?", + "Upload aktiv", + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE, null, + options, options[1]); + // 0=beenden, 1=abbrechen + if (choice == 0) { + try { + client.DeleteFtpUser(user.userName); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + task.cancel(true); + con.closeThriftConnection(); + System.exit(0); + }// end if choice + } else { + // no upload running, close window + System.exit(0); + }// end if taskrun + }// end window closing + }); + setResizable(false); + // Aktion die beim Schliessen durchgefuehrt werden soll + setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + // filename=name; + setBackground(Color.WHITE); + setTitle("Dozentenmodul - Image bearbeiten"); + + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(new BorderLayout()); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel, BorderLayout.CENTER); + contentPanel.setLayout(null); + { + + btnSpeicherortAuswhlen.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + fc = new JFileChooser(ini.get("main", + "Letzter Uploadpfad", String.class)); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + + fc.setFileSelectionMode(JFileChooser.FILES_ONLY); + + fc.showOpenDialog(getParent()); + File file = fc.getSelectedFile(); + // check if a file is selected and exists + if (file != null) { + // file selected + uploadFile = file; + filename = uploadFile.getName(); + lblPath.setText(file.getAbsolutePath()); + } else { + // no file selected + lblPath.setText(""); + }// end if + } + }); + + btnSpeicherortAuswhlen.setBounds(102, 124, 173, 23); + btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP); + contentPanel.add(btnSpeicherortAuswhlen); + } + + lblPath = new JLabel(""); + try { + Wini ini = new Wini(new File("C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + lblPath.setText(ini.get("main", "Letzter Uploadpfad", String.class)); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + lblPath.addPropertyChangeListener(new PropertyChangeListener() { + public void propertyChange(PropertyChangeEvent arg0) { + if (lblPath.getText().isEmpty()) { + // wenn leer, dann upload button nicht freigeben + btnUploadStarten.setEnabled(false); + btnUploadStarten.setText("Bitte warten"); + } else if (lblPath.getText().endsWith(".vmdk")) { + // wenn leer, dann upload button freigeben + btnUploadStarten.setEnabled(true); + btnUploadStarten.setText("Upload auf Server starten"); + } + } + }); + lblPath.setBounds(102, 158, 485, 23); + contentPanel.add(lblPath); + + btnUploadStarten.setEnabled(false); + btnUploadStarten.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + buttonUploadActionPerformed(arg0); + + } + }); + + btnUploadStarten.setBounds(102, 200, 173, 23); + contentPanel.add(btnUploadStarten); + + progressBar = new JProgressBar(0, 100); + progressBar.setStringPainted(true); + + progressBar.setBounds(102, 234, 485, 30); + contentPanel.add(progressBar); + + JLabel lblUploadgeschwindigkeit = new JLabel("Uploadgeschwindigkeit:"); + lblUploadgeschwindigkeit.setBounds(102, 275, 141, 14); + contentPanel.add(lblUploadgeschwindigkeit); + + JLabel label_1 = new JLabel("Fertig:"); + label_1.setBounds(102, 325, 46, 14); + contentPanel.add(label_1); + + labelfertig = new JLabel("0"); + labelfertig.setBounds(183, 325, 108, 14); + contentPanel.add(labelfertig); + + UpSpeed = new JLabel("0"); + UpSpeed.setBounds(374, 275, 117, 14); + contentPanel.add(UpSpeed); + + JLabel label_4 = new JLabel("von:"); + label_4.setBounds(318, 325, 46, 14); + contentPanel.add(label_4); + + labelfilesize = new JLabel("0"); + labelfilesize.setBounds(374, 325, 117, 14); + contentPanel.add(labelfilesize); + + JLabel label_6 = new JLabel("Verbleibend:"); + label_6.setBounds(102, 350, 71, 14); + contentPanel.add(label_6); + + JLabel label_7 = new JLabel("Gesch\u00E4tzte Verbleibende Zeit:"); + label_7.setBounds(102, 300, 150, 14); + contentPanel.add(label_7); + + labelZeit = new JLabel("0"); + labelZeit.setBounds(374, 300, 117, 14); + contentPanel.add(labelZeit); + + labelverbleibend = new JLabel("0"); + labelverbleibend.setBounds(183, 350, 108, 14); + contentPanel.add(labelverbleibend); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + contentPanel.add(panel); + + JLabel lblUploadIhresImage = new JLabel("Upload Ihres Image"); + lblUploadIhresImage.setFont(new Font("Tahoma", Font.BOLD, 18)); + lblUploadIhresImage.setBounds(10, 11, 509, 22); + panel.add(lblUploadIhresImage); + + JTextPane txtpnFhreSieBitte = new JTextPane(); + txtpnFhreSieBitte + .setText("F\u00FChre Sie bitte die folgenden 3 Schritte aus um Ihr Image auf unseren Server zu laden."); + txtpnFhreSieBitte.setEditable(false); + txtpnFhreSieBitte.setBackground(SystemColor.menu); + txtpnFhreSieBitte.setBounds(10, 36, 509, 32); + panel.add(txtpnFhreSieBitte); + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 79, 597, 2); + contentPanel.add(separator); + + JLabel lblNewLabel_1 = new JLabel("Hauptmen\u00FC"); + lblNewLabel_1.setForeground(Color.BLUE); + lblNewLabel_1.setBounds(20, 88, 61, 20); + contentPanel.add(lblNewLabel_1); + + JLabel label_3 = new JLabel(">"); + label_3.setBounds(80, 91, 14, 14); + contentPanel.add(label_3); + + JLabel lblVlimage = new JLabel("Image"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(91, 88, 46, 20); + contentPanel.add(lblVlimage); + + JLabel label_5 = new JLabel(">"); + label_5.setBounds(139, 91, 14, 14); + contentPanel.add(label_5); + + JLabel lblNeubearbeiten = new JLabel("Bearbeiten"); + lblNeubearbeiten.setBounds(149, 91, 108, 14); + contentPanel.add(lblNeubearbeiten); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + contentPanel.add(separator_1); + + JLabel lblSchritt_1 = new JLabel("Schritt 1:"); + lblSchritt_1.setBounds(24, 128, 57, 14); + contentPanel.add(lblSchritt_1); + + JLabel lblSchritt_2 = new JLabel("Schritt 2:"); + lblSchritt_2.setBounds(24, 204, 57, 14); + contentPanel.add(lblSchritt_2); + + JLabel label = new JLabel("Schritt 3:"); + label.setBounds(20, 423, 57, 14); + contentPanel.add(label); + + JLabel label_2 = new JLabel("Klicken Sie auf \"Fertigstellen\"."); + label_2.setBounds(98, 423, 241, 14); + contentPanel.add(label_2); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBackground(UIManager.getColor("Button.background")); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane, BorderLayout.SOUTH); + { + + // finishButton.setEnabled(false); + finishButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + updateData(); + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + + // check if path has content, then write to file + if (lblPath.getText().contains("\\") == true) { + System.out.println("Hole Infos aus Label: " + + lblPath.getText()); + ini.put("main", + "Letzter Uploadpfad", + lblPath.getText().substring( + 0, + lblPath.getText().lastIndexOf( + "\\"))); + ini.store(); + } else { + System.out.println("Mache nix"); + }// end if + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + dispose(); + MainMenue_GUI m = new MainMenue_GUI(); + m.setVisible(true); + + if (taskrun == true) { + try { + client.DeleteFtpUser(user.userName); + + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + JOptionPane.showMessageDialog( + null, + e1.getCause() + "\n" + + e1.getStackTrace(), + "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + task.cancel(true); + } + + } + }); + btnZurck.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + + // check if loading file or not + if (isCurrentlyLoading() == true) { + int choice = JOptionPane + .showOptionDialog( + null, + "Nicht abgeschlossene Uploads werden beendet. Trotzdem zurück gehen?", + "Warnung", + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE, null, + options, options[1]); + // 0=beenden, 1=abbrechen + if (choice == 0) { + try { + client.DeleteFtpUser(user.userName); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + task.cancel(true); + // not loading files, go back one page + dispose(); + PermissionEditImage_GUI ei = new PermissionEditImage_GUI(); + ei.setVisible(true); + + }// end if coice + } else { + dispose(); + PermissionEditImage_GUI ei = new PermissionEditImage_GUI(); + ei.setVisible(true); + }// end else + }// end action + }); + + btnZurck.setActionCommand("Cancel"); + buttonPane.add(btnZurck); + finishButton.setActionCommand("Cancel"); + buttonPane.add(finishButton); + } + } + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu menu = new JMenu("Hilfe"); + menuBar.add(menu); + + JMenuItem menuItem = new JMenuItem("FAQ"); + menuItem.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + + menu.add(menuItem); + + JMenuItem menuItem_1 = new JMenuItem("OTRS"); + menuItem_1.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + + menu.add(menuItem_1); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + menu.add(mntmAbout); + setVisible(true); + + } + + private void buttonUploadActionPerformed(ActionEvent event) { + fileupload = true; + progressBar.setValue(0); + btnUploadStarten.setEnabled(false); // verhindert einen weiteren klick + btnUploadStarten.setText("Bitte warten"); + + try { + user = client.getFtpUser(); + System.out.println("FTP name: " + user.userName); + System.out.println("FTP path: " + user.path); + System.out.println("FTP pass: " + user.password); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog(null, + e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + DateFormat formatter = new SimpleDateFormat("yyyMMddhhmmss"); + + System.out.println("Setting new Name: " + formatter.format(new Date()) + + "_" + person.verantwortlicher.getHochschule() + "_" + + person.verantwortlicher.getUsername() + "_" + + Image.image.getImagename() + ".vmdk"); + Image.image.setNewName(formatter.format(new Date()) + "_" + + person.verantwortlicher.getHochschule() + "_" + + person.verantwortlicher.getUsername() + "_" + + Image.image.getImagename() + ".vmdk"); + task = new UploadTask(host, port, user.userName, user.password, + user.path + "temp/", uploadFile); + + task.addPropertyChangeListener(this); + task.execute(); + taskrun = true; + + } + + public void propertyChange(PropertyChangeEvent arg0) { + // set progressbar + if ("progress" == arg0.getPropertyName()) { + progress = (Integer) arg0.getNewValue(); + progressBar.setValue(progress); + } + + // Fertigstellen erlauben wenn upload abgeschlossen + if (isCurrentlyLoading() == true) { + finishButton.setEnabled(false); + } else { + finishButton.setEnabled(true); + } + + if ("speed" == arg0.getPropertyName()) { + speed = (double) arg0.getNewValue(); + // if(speed<=1){ + + UpSpeed.setText(String.valueOf(speed).substring(0, + String.valueOf(speed).lastIndexOf(".") + 3) + + " MB/s"); + + } + if ("bytesread" == arg0.getPropertyName()) { + bytesread = (long) arg0.getNewValue(); + labelfertig.setText((bytesread / 1024 / 1024) + " MB"); + labelverbleibend + .setText(((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) + + " MB"); + + labelZeit + .setText(String + .valueOf( + ((((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + 1) + .substring( + 0, + String.valueOf( + (((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + .lastIndexOf(".")) + + " Minuten"); + + } + if ("filesize" == arg0.getPropertyName()) { + filesize = (long) arg0.getNewValue(); + labelfilesize.setText((filesize / 1024 / 1024) + " MB"); + + } + + } + + public boolean updateData() { + + try { + System.out.println("NewName=" + Image.image.getNewName()); + System.out.println("OldName=" + Image.image.getImagename()); + if (Image.image.getNewName() != null) { + client.updateImageData(Image.image.getImagename(), + Image.image.getImagename(), Image.image.getDesc(), + Image.image.getImagepath(), Image.image.isLicensed(), + Image.image.isInternet(), Image.image.getRam(), + Image.image.getCpu(), Image.image.getImageId(), + Image.image.getVersion(), Image.image.isVorlage(), + Image.image.getFilesize(), Image.image.getShareMode(), + Image.image.getOS()); + if (fileupload == true) { + client.startFileCopy(Image.image.getNewName()); + } + + } else { + + client.updateImageData(Image.image.getImagename(), + Image.image.getImagename(), Image.image.getDesc(), + "temp/" + Image.image.getNewName(), + Image.image.isLicensed(), Image.image.isInternet(), + Image.image.getRam(), Image.image.getCpu(), + Image.image.getImageId(), Image.image.getVersion(), + Image.image.isVorlage(), Image.image.getFilesize(), + Image.image.getShareMode(), Image.image.getOS()); + + if (fileupload == true) { + client.startFileCopy(Image.image.getNewName()); + } + } + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog(null, + e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + return false; + } + return true; + + } + + public boolean isCurrentlyLoading() { + isCurrentlyLoading = false; + + if (labelverbleibend.getText().equals("0 MB") + || labelverbleibend.getText().equals("0")) { + isCurrentlyLoading = false; + } else { + isCurrentlyLoading = true; + } + return isCurrentlyLoading; + }// end isCurrentlyLoading() + +}// end class \ No newline at end of file diff --git a/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java new file mode 100644 index 00000000..c3041e41 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java @@ -0,0 +1,635 @@ +package gui.image; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +import javax.swing.JButton; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.JSeparator; +import javax.swing.JTextPane; +import javax.swing.SwingConstants; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; + +import models.Image; +import models.Links; +import models.SessionData; + +import org.apache.thrift.TException; +import org.ini4j.InvalidFileFormatException; +import org.ini4j.Wini; + +import server.Server.Client; +import server.User; +import thrift.ThriftConnection; +import util.GuiOrganizer; +import util.OpenLinks; +import ftp.DownloadTask; +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +@SuppressWarnings("serial") +public class FTPSearchDownloader_GUI extends JFrame implements + PropertyChangeListener { + + @SuppressWarnings("unused") + private JPanel contentPane; + private final JPanel contentPanel = new JPanel(); + JLabel lblPath; + JLabel downspeed; + User user; + JProgressBar progressBar; + String host = SessionData.session.getServerAdress(); + int port = 21; + String downloadFile = ""; + static String arg = ""; + DownloadTask task; + JLabel lblBytesread; + JLabel lblNewLabel_3; + JLabel labelVerbleibend; + JFileChooser fc; + long filesize; + double speed; + int progress = 0; // progress of download + long bytesread; + JLabel labelZeit; + boolean taskrun = false; + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); + JButton btnZurck = new JButton("Zur\u00FCck"); + JButton btnDownloadStarten = new JButton("Download starten"); + JButton btnMainMenu = new JButton("Hauptmen\u00FC"); + private JLabel lblAnleitung; + private boolean isCurrentlyLoading = false; // currently up or downloading + // file + + /** + * Create the frame. + */ + public FTPSearchDownloader_GUI() { + + final Object[] options = { "Beenden", "Abbrechen" }; + + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + if (taskrun == true) { + // check if user wants to quit. + int choice = JOptionPane + .showOptionDialog( + null, + "Aktuell ist ein Download aktiv. Wollen Sie diesen Abbrechen und das Programm beenden?", + "Upload aktiv", + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE, null, + options, options[1]); + // 0=beenden, 1=abbrechen + if (choice == 0) { + + try { + client.DeleteFtpUser(user.userName); + con.closeThriftConnection(); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + task.cancel(true); + + System.exit(0); + }// end if choice + } else { + // no download running, close window + System.exit(0); + }// end if taskrun + }// end window closing + }); + setResizable(false); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + setBackground(Color.WHITE); + setTitle("Dozentenmodul - Image herunterladen"); + // Aktion die beim Schliessen durchgefuehrt werden soll + setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(new BorderLayout()); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel, BorderLayout.CENTER); + contentPanel.setLayout(null); + { + JButton btnSpeicherortAuswhlen = new JButton( + "Speicherort ausw\u00E4hlen"); + btnSpeicherortAuswhlen.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + System.out.println("FileChooser Pfad: " + + ini.get("main", "Letzter Downloadpfad", + String.class)); + fc = new JFileChooser(ini.get("main", + "Letzter Downloadpfad", String.class)); + fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + + fc.showOpenDialog(getParent()); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + + File dir = fc.getSelectedFile(); + // check if directory is selected + if (dir != null) { + // is selected + lblPath.setText(dir.getAbsolutePath()); + } else { + // no directory selected + lblPath.setText(""); + }// end if + } + }); + + btnSpeicherortAuswhlen.setBounds(102, 124, 173, 23); + btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP); + contentPanel.add(btnSpeicherortAuswhlen); + } + + lblPath = new JLabel(""); + try { + Wini ini = new Wini(new File("C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + lblPath.setText(ini.get("main", "Letzter Downloadpfad", + String.class)); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + lblPath.addPropertyChangeListener(new PropertyChangeListener() { + public void propertyChange(PropertyChangeEvent arg0) { + if (lblPath.getText() == null) { + // wenn leer, dann upload button nicht freigeben + btnDownloadStarten.setEnabled(false); + btnDownloadStarten.setText("Bitte warten"); + } else { + // wenn leer, dann upload button nicht freigeben + btnDownloadStarten.setEnabled(true); + btnDownloadStarten.setText("Download starten"); + } + } + }); + lblPath.setBounds(102, 158, 485, 23); + contentPanel.add(lblPath); + + btnDownloadStarten.setEnabled(false); + btnDownloadStarten.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + buttonDownloadActionPerformed(arg0); + } + }); + + btnDownloadStarten.setBounds(102, 200, 173, 23); + contentPanel.add(btnDownloadStarten); + + progressBar = new JProgressBar(0, 100); + progressBar.setStringPainted(true); + + progressBar.setBounds(102, 234, 485, 30); + contentPanel.add(progressBar); + + JLabel lblDownloadgeschwindigkeit = new JLabel( + "Downloadgeschwindigkeit:"); + lblDownloadgeschwindigkeit.setBounds(102, 275, 141, 14); + contentPanel.add(lblDownloadgeschwindigkeit); + + downspeed = new JLabel("0"); + downspeed.setBounds(374, 275, 117, 14); + contentPanel.add(downspeed); + + JLabel lblFertig = new JLabel("Fertig:"); + lblFertig.setBounds(102, 325, 46, 14); + contentPanel.add(lblFertig); + + lblBytesread = new JLabel("0"); + lblBytesread.setBounds(183, 325, 108, 14); + contentPanel.add(lblBytesread); + + JLabel lblVon = new JLabel("von:"); + lblVon.setBounds(318, 325, 46, 14); + contentPanel.add(lblVon); + + lblNewLabel_3 = new JLabel("0"); + lblNewLabel_3.setBounds(374, 325, 117, 14); + contentPanel.add(lblNewLabel_3); + + JLabel lblMbVerbleibend = new JLabel("Verbleibend:"); + lblMbVerbleibend.setBounds(102, 350, 71, 14); + contentPanel.add(lblMbVerbleibend); + + labelVerbleibend = new JLabel("0"); + labelVerbleibend.setBounds(183, 350, 108, 14); + contentPanel.add(labelVerbleibend); + + JLabel lblGeschtzteVerbleibendeZeit = new JLabel( + "Gesch\u00E4tzte Verbleibende Zeit:"); + lblGeschtzteVerbleibendeZeit.setBounds(102, 300, 150, 14); + contentPanel.add(lblGeschtzteVerbleibendeZeit); + + labelZeit = new JLabel("0"); + labelZeit.setBounds(374, 300, 117, 14); + contentPanel.add(labelZeit); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 24, 577, 57); + contentPanel.add(panel); + + JLabel lblImageDownloader = new JLabel("Image Downloader"); + lblImageDownloader.setFont(new Font("Tahoma", Font.BOLD, 18)); + lblImageDownloader.setBounds(10, 11, 509, 22); + panel.add(lblImageDownloader); + + JTextPane txtpnWhlenSieEinen = new JTextPane(); + txtpnWhlenSieEinen + .setText("W\u00E4hlen Sie einen Ort aus, um das von Ihnen gw\u00E4hlte Image erunter zu laden."); + txtpnWhlenSieEinen.setEditable(false); + txtpnWhlenSieEinen.setBackground(SystemColor.menu); + txtpnWhlenSieEinen.setBounds(10, 36, 509, 32); + panel.add(txtpnWhlenSieEinen); + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 88, 597, 2); + contentPanel.add(separator); + + JLabel label_1 = new JLabel("Hauptmen\u00FC"); + label_1.setForeground(Color.BLUE); + label_1.setBounds(20, 92, 61, 20); + contentPanel.add(label_1); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(80, 95, 14, 14); + contentPanel.add(label_2); + + JLabel label_3 = new JLabel("Image"); + label_3.setForeground(Color.BLUE); + label_3.setBounds(91, 92, 46, 20); + contentPanel.add(label_3); + + JLabel label_4 = new JLabel(">"); + label_4.setBounds(139, 95, 14, 14); + contentPanel.add(label_4); + + JLabel label_5 = new JLabel("Neu/Bearbeiten"); + label_5.setBounds(149, 95, 108, 14); + contentPanel.add(label_5); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(-10, 648, 597, 2); + contentPanel.add(separator_1); + + JLabel lblSchritt = new JLabel("Schritt 1:"); + lblSchritt.setBounds(24, 128, 57, 14); + contentPanel.add(lblSchritt); + + JLabel lblSchritt_1 = new JLabel("Schritt 2:"); + lblSchritt_1.setBounds(24, 204, 57, 14); + contentPanel.add(lblSchritt_1); + + JLabel lblSchritt_3 = new JLabel("Schritt 3:"); + lblSchritt_3.setBounds(20, 423, 57, 14); + contentPanel.add(lblSchritt_3); + + JLabel lblKlickenSieAuf = new JLabel( + "Klicken Sie auf \"Fertigstellen\"."); + lblKlickenSieAuf.setBounds(102, 423, 241, 14); + contentPanel.add(lblKlickenSieAuf); + + JMenuBar menuBar = new JMenuBar(); + menuBar.setBounds(0, 0, 597, 21); + contentPanel.add(menuBar); + + JMenu menu = new JMenu("Hilfe"); + menuBar.add(menu); + + JMenuItem menuItem = new JMenuItem("FAQ"); + menuItem.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + + menu.add(menuItem); + + JMenuItem menuItem_1 = new JMenuItem("OTRS"); + menuItem_1.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + + menu.add(menuItem_1); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + menu.add(mntmAbout); + + lblAnleitung = new JLabel( + "Anleitung zum erstellen einer virtuellen Maschine herunterladen"); + lblAnleitung.setForeground(Color.BLUE); + lblAnleitung.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + OpenLinks open = new OpenLinks(); + + URI anleitung; + try { + anleitung = new URI(Links.getAnleitungVMDK()); + open.openWebpage(anleitung); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + lblAnleitung.setBounds(102, 448, 311, 14); + contentPanel.add(lblAnleitung); + + { + JPanel buttonPane = new JPanel(); + buttonPane.setBackground(UIManager.getColor("Button.background")); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane, BorderLayout.SOUTH); + { + btnZurck.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + // check if loading file or not + if (isCurrentlyLoading() == true) { + int choice = JOptionPane + .showOptionDialog( + null, + "Nicht abgeschlossene Uploads werden beendet. Trotzdem zurück gehen?", + "Warnung", + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE, null, + options, options[1]); + // 0=beenden, 1=abbrechen + if (choice == 0) { + task.cancel(true); + try { + client.DeleteFtpUser(user.userName); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + ini.put("main", "Letzter Downloadpfad", + lblPath.getText()); + ini.store(); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + // go back one page + SearchImage_GUI si = new SearchImage_GUI(); + si.setVisible(true); + dispose(); + }// end choice + + } else { + + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + ini.put("main", "Letzter Downloadpfad", + lblPath.getText()); + ini.store(); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + // go back one page + SearchImage_GUI si = new SearchImage_GUI(); + si.setVisible(true); + dispose(); + }// end else + }//end action + }); + btnZurck.setActionCommand("Cancel"); + buttonPane.add(btnZurck); + } + + btnMainMenu.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + ini.put("main", "Letzter Downloadpfad", + lblPath.getText()); + ini.store(); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + MainMenue_GUI mm = new MainMenue_GUI(); + mm.setVisible(true); + dispose(); + } + }); + btnMainMenu.setActionCommand("Cancel"); + buttonPane.add(btnMainMenu); + } + setVisible(true); + + } + + private void buttonDownloadActionPerformed(ActionEvent event) { + + progressBar.setValue(0); + btnDownloadStarten.setEnabled(false); // verhindert schnellen zweiten + // Klick + btnDownloadStarten.setText("Bitte warten"); + try { + user = client.getFtpUser(); + + downloadFile = user.path + + "/" + + client.getPathOfImage(Image.image.getImageId(), + Image.image.getVersion()); + + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog(null, + e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + + task = new DownloadTask(host, port, user.userName, user.password, + downloadFile, lblPath.getText()); + task.addPropertyChangeListener(this); + task.execute(); + taskrun = true; + + } + + public void propertyChange(PropertyChangeEvent arg0) { + + progress = 0; + if ("progress" == arg0.getPropertyName()) { + progress = (Integer) arg0.getNewValue(); + progressBar.setValue(progress); + } + + // Button zum Fertigstellen freischalten, wenn 100% erreicht sind + if (isCurrentlyLoading() == true) { + // not uploading currently + btnMainMenu.setEnabled(false); + } else { + // currently uploading, don't let user interact + btnMainMenu.setEnabled(true); + } + + if ("speed" == arg0.getPropertyName()) { + speed = (double) arg0.getNewValue(); + // if(speed<=1){ + + downspeed.setText(String.valueOf(speed).substring(0, + String.valueOf(speed).lastIndexOf(".") + 3) + + " MB/s"); + + } + if ("bytesread" == arg0.getPropertyName()) { + bytesread = (long) arg0.getNewValue(); + lblBytesread.setText((bytesread / 1024 / 1024) + " MB"); + labelVerbleibend + .setText(((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) + + " MB"); + + labelZeit + .setText(String + .valueOf( + ((((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + 1) + .substring( + 0, + String.valueOf( + (((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + .lastIndexOf(".")) + + " Minuten"); + + } + if ("filesize" == arg0.getPropertyName()) { + filesize = (long) arg0.getNewValue(); + lblNewLabel_3.setText((filesize / 1024 / 1024) + " MB"); + + } + + } + + public boolean isCurrentlyLoading() { + isCurrentlyLoading = false; + + if (labelVerbleibend.getText().equals("0 MB") || labelVerbleibend.getText().equals("0")) { + isCurrentlyLoading = false; + } else { + isCurrentlyLoading = true; + } + return isCurrentlyLoading; + }// end isCurrentlyLoading() + +}// end class \ No newline at end of file diff --git a/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java b/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java new file mode 100644 index 00000000..d2b0dada --- /dev/null +++ b/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java @@ -0,0 +1,552 @@ +package gui.image; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Checkbox; +import java.awt.Color; +import java.awt.Component; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +import javax.swing.AbstractButton; +import javax.swing.ButtonGroup; +import javax.swing.DefaultComboBoxModel; +import javax.swing.Icon; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.JTextPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.JTableHeader; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import javax.swing.table.TableColumn; +import javax.swing.table.TableColumnModel; + +import models.Image; +import models.Links; +import util.GuiOrganizer; +import util.OpenLinks; +import javax.swing.JTable; +import javax.swing.JScrollPane; +import javax.swing.ScrollPaneConstants; +import javax.swing.JTextField; + +import org.eclipse.jface.viewers.CheckboxCellEditor; + +import java.awt.Choice; + +@SuppressWarnings("serial") +public class PermissionCreateImage_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + private JTable table; + private Class[] classes; + Object[] titles = { "Name", "Read", "Write", "Link allowed","Admin"}; + + final DefaultTableModel model = new DefaultTableModel(titles, 0) { + + public boolean isCellEditable(int rowIndex, int mColIndex) { + if (mColIndex >= 1) { + return true; + } + return false; + } + + public Class getColumnClass(int c) { + switch (c) { + case 0: + return String.class; + default: + return Boolean.class; + } + } + + }; + private JTextField textField; + private JLabel lblRead; + private JLabel lblWrite; + private JLabel lblAdmin; + private JLabel lblLinkallowed; + private JLabel lblReadDesc; + private JLabel lblWriteDesc; + private JLabel lblAdminDesc; + private JLabel lblLinkallowedDesc; + private JCheckBox chckbxFrAlleSichtbar; + private JLabel lblFuerAlleSichtbar; + + public PermissionCreateImage_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + System.exit(0); + } + }); + setResizable(false); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("bwLehrpool Suite - Image erzeugen"); + + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel( + "Image Berechtigungen (Nur zur Veranschaulichung)"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("Definieren Sie hier bitte die gew\u00FCnschten Berechtigungen f\u00FCr ihr Image"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 531); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Berechtigungen", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 228, 557, 292); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JScrollPane scrollPane = new JScrollPane(); + scrollPane + .setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + scrollPane.setBounds(10, 21, 537, 260); + panel_1.add(scrollPane); + + table = new JTable(); + table.setModel(model); + table.setSelectionForeground(Color.WHITE); + Object[] rowdata = { "Max Mustermann", new Boolean(false), + new Boolean(false), new Boolean(false), new Boolean(false), + new Boolean(false) }; + model.addRow(rowdata); + + TableCellRenderer rend = table.getTableHeader().getDefaultRenderer(); + + TableColumn tc1 = table.getColumnModel().getColumn(1); + tc1.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc1.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc1.setHeaderRenderer(new CheckBoxHeader(new MyItemListener1(), + (String) titles[1])); + + TableColumn tc2 = table.getColumnModel().getColumn(2); + tc2.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc2.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc2.setHeaderRenderer(new CheckBoxHeader(new MyItemListener2(), + (String) titles[2])); + + TableColumn tc3 = table.getColumnModel().getColumn(3); + tc3.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc3.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc3.setHeaderRenderer(new CheckBoxHeader(new MyItemListener3(), + (String) titles[3])); + + TableColumn tc4 = table.getColumnModel().getColumn(4); + tc4.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc4.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc4.setHeaderRenderer(new CheckBoxHeader(new MyItemListener4(), + (String) titles[4])); + + /* + TableColumn tc5 = table.getColumnModel().getColumn(5); + tc5.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc5.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc5.setHeaderRenderer(new CheckBoxHeader(new MyItemListener5(), + (String) titles[5])); + */ + scrollPane.setViewportView(table); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + + PermissionCreateImage_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Image"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 45, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(133, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Berechtigung"); + lblNewLabel_1.setBounds(146, 11, 80, 14); + contentPanel.add(lblNewLabel_1); + + JLabel lblName = new JLabel("Name:"); + lblName.setBounds(10, 36, 46, 20); + contentPanel.add(lblName); + + textField = new JTextField(); + textField.setBounds(69, 36, 171, 20); + contentPanel.add(textField); + textField.setColumns(10); + + JLabel lblHochschule = new JLabel("Hochschule:"); + lblHochschule.setBounds(275, 36, 80, 20); + contentPanel.add(lblHochschule); + + JComboBox comboBox = new JComboBox(); + comboBox.setModel(new DefaultComboBoxModel(new String[] { + "Hochschule Offenburg", "Hochschule Reutlingen", + "Universit\u00E4t Freiburg" })); + comboBox.setBounds(365, 36, 202, 20); + contentPanel.add(comboBox); + + JPanel panel_2 = new JPanel(); + panel_2.setBackground(SystemColor.menu); + panel_2.setBorder(new TitledBorder(null, "Beschreibung", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_2.setBounds(10, 67, 557, 150); + contentPanel.add(panel_2); + panel_2.setLayout(null); + + lblRead = new JLabel("Read"); + lblRead.setBounds(20, 18, 90, 20); + panel_2.add(lblRead); + + lblWrite = new JLabel("Write"); + lblWrite.setBounds(20, 38, 90, 20); + panel_2.add(lblWrite); + + lblAdmin = new JLabel("Admin"); + lblAdmin.setBounds(20, 78, 90, 20); + panel_2.add(lblAdmin); + + lblLinkallowed = new JLabel("Link allowed"); + lblLinkallowed.setBounds(20, 58, 90, 20); + panel_2.add(lblLinkallowed); + + lblReadDesc = new JLabel( + "Image lesen und starten, in Suchfenster und VMchooser sichtbar."); + lblReadDesc.setBounds(120, 18, 427, 20); + panel_2.add(lblReadDesc); + + lblWriteDesc = new JLabel( + "Image anpassen und überschrieben, jedoch nicht löschen."); + lblWriteDesc.setBounds(120, 38, 380, 20); + panel_2.add(lblWriteDesc); + + lblAdminDesc = new JLabel( + "Volle Rechte: read, write, löschen, Link_allowed und
Berechtigungen für andere Benutzer festlegen."); + lblAdminDesc.setBounds(120, 78, 380, 40); + panel_2.add(lblAdminDesc); + + lblLinkallowedDesc = new JLabel( + "Erzeugung einer Veranstaltung auf ein Image ist erlaubt."); + lblLinkallowedDesc.setBounds(120, 58, 380, 20); + panel_2.add(lblLinkallowedDesc); + + chckbxFrAlleSichtbar = new JCheckBox(""); + chckbxFrAlleSichtbar.setBounds(115, 119, 21, 23); + panel_2.add(chckbxFrAlleSichtbar); + + lblFuerAlleSichtbar = new JLabel("Für alle sichtbar"); + lblFuerAlleSichtbar.setBounds(20, 120, 90, 20); + panel_2.add(lblFuerAlleSichtbar); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton cancelButton = new JButton("Zur\u00FCck"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + CreateImageFreigabe_GUI sr = new CreateImageFreigabe_GUI(); + sr.setVisible(true); + dispose(); + } + }); + cancelButton.setActionCommand("OK"); + buttonPane.add(cancelButton); + // getRootPane().setDefaultButton(cancelButton); + } + { + JButton continueButton = new JButton("Weiter"); + continueButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + FTPCreateUploader_GUI ea = new FTPCreateUploader_GUI(); + ea.setVisible(true); + dispose(); + + } + }); + continueButton.setActionCommand("Cancel"); + buttonPane.add(continueButton); + getRootPane().setDefaultButton(continueButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 78, 597, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + getContentPane().add(separator_1); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAbout); + + } + + class MyItemListener1 implements ItemListener { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) + return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for (int x = 0, y = table.getRowCount(); x < y; x++) { + table.setValueAt(new Boolean(checked), x, 1); + } + } + } + + class MyItemListener2 implements ItemListener { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) + return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for (int x = 0, y = table.getRowCount(); x < y; x++) { + table.setValueAt(new Boolean(checked), x, 2); + } + } + } + + class MyItemListener3 implements ItemListener { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) + return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for (int x = 0, y = table.getRowCount(); x < y; x++) { + table.setValueAt(new Boolean(checked), x, 3); + } + } + } + + class MyItemListener4 implements ItemListener { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) + return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for (int x = 0, y = table.getRowCount(); x < y; x++) { + table.setValueAt(new Boolean(checked), x, 4); + } + } + } + + class MyItemListener5 implements ItemListener { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) + return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for (int x = 0, y = table.getRowCount(); x < y; x++) { + table.setValueAt(new Boolean(checked), x, 5); + } + } + } +} + +class CheckBoxHeader extends JCheckBox implements TableCellRenderer, + MouseListener { + protected CheckBoxHeader rendererComponent; + protected int column; + protected boolean mousePressed = false; + + public CheckBoxHeader(ItemListener itemListener, String text) { + rendererComponent = this; + rendererComponent.addItemListener(itemListener); + rendererComponent.setText(text); + } + + public Component getTableCellRendererComponent(JTable table, Object value, + boolean isSelected, boolean hasFocus, int row, int column) { + if (table != null) { + JTableHeader header = table.getTableHeader(); + if (header != null) { + rendererComponent.setForeground(header.getForeground()); + rendererComponent.setBackground(header.getBackground()); + rendererComponent.setFont(header.getFont()); + rendererComponent.setBorder(header.getBorder()); + header.addMouseListener(rendererComponent); + } + } + setColumn(column); + // rendererComponent.setText("Check All"); + // setBorder(UIManager.getBorder("TableHeader.cellBorder")); + + return rendererComponent; + } + + protected void setColumn(int column) { + this.column = column; + } + + public int getColumn() { + return column; + } + + protected void handleClickEvent(MouseEvent e) { + if (mousePressed) { + mousePressed = false; + JTableHeader header = (JTableHeader) (e.getSource()); + JTable tableView = header.getTable(); + TableColumnModel columnModel = tableView.getColumnModel(); + int viewColumn = columnModel.getColumnIndexAtX(e.getX()); + int column = tableView.convertColumnIndexToModel(viewColumn); + + if (viewColumn == this.column && e.getClickCount() == 1 + && column != -1) { + doClick(); + } + } + } + + public void mouseClicked(MouseEvent e) { + handleClickEvent(e); + ((JTableHeader) e.getSource()).repaint(); + } + + public void mousePressed(MouseEvent e) { + mousePressed = true; + } + + public void mouseReleased(MouseEvent e) { + } + + public void mouseEntered(MouseEvent e) { + } + + public void mouseExited(MouseEvent e) { + } +} diff --git a/dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java b/dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java new file mode 100644 index 00000000..4d780e8f --- /dev/null +++ b/dozentenmodul/src/main/java/gui/image/PermissionEditImage_GUI.java @@ -0,0 +1,504 @@ +package gui.image; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Checkbox; +import java.awt.Color; +import java.awt.Component; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +import javax.swing.AbstractButton; +import javax.swing.ButtonGroup; +import javax.swing.DefaultComboBoxModel; +import javax.swing.Icon; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.JTextPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.JTableHeader; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import javax.swing.table.TableColumn; +import javax.swing.table.TableColumnModel; + +import models.Image; +import models.Links; +import util.GuiOrganizer; +import util.OpenLinks; +import javax.swing.JTable; +import javax.swing.JScrollPane; +import javax.swing.ScrollPaneConstants; +import javax.swing.JTextField; + +import org.eclipse.jface.viewers.CheckboxCellEditor; + +import java.awt.Choice; + +@SuppressWarnings("serial") +public class PermissionEditImage_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + private JTable table; + private Class[] classes; + Object[] titles = { "Name", "Read", "Write", "Link allowed","Admin"}; + + final DefaultTableModel model = new DefaultTableModel(titles, 0) { + + public boolean isCellEditable(int rowIndex, int mColIndex) { + if (mColIndex >= 1) { + return true; + } + return false; + } + + public Class getColumnClass(int c) { + switch (c) { + case 0: + return String.class; + default: + return Boolean.class; + } + } + + }; + private JTextField textField; + private JLabel lblLinkAllowed; + private JLabel label_5; + private JLabel label_6; + private JLabel label_7; + + public PermissionEditImage_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + System.exit(0); + } + }); + setResizable(false); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("bwLehrpool Suite - Image erzeugen"); + + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel( + "Image Berechtigungen (Nur zur Veranschaulichung)"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("Definieren Sie hier bitte die gew\u00FCnschten Berechtigungen f\u00FCr Ihr Image"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 531); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Berechtigungen", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 228, 557, 292); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JScrollPane scrollPane = new JScrollPane(); + scrollPane + .setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + scrollPane.setBounds(10, 21, 537, 260); + panel_1.add(scrollPane); + + table = new JTable(); + table.setModel(model); + table.setSelectionForeground(Color.WHITE); + Object[] rowdata = { "Max Mustermann", new Boolean(false), + new Boolean(false), new Boolean(false), new Boolean(false) }; + model.addRow(rowdata); + + TableCellRenderer rend = table.getTableHeader().getDefaultRenderer(); + + TableColumn tc1 = table.getColumnModel().getColumn(1); + tc1.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc1.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc1.setHeaderRenderer(new CheckBoxHeader(new MyItemListener1(), + (String) titles[1])); + + TableColumn tc2 = table.getColumnModel().getColumn(2); + tc2.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc2.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc2.setHeaderRenderer(new CheckBoxHeader(new MyItemListener2(), + (String) titles[2])); + + TableColumn tc3 = table.getColumnModel().getColumn(3); + tc3.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc3.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc3.setHeaderRenderer(new CheckBoxHeader(new MyItemListener3(), + (String) titles[3])); + + TableColumn tc4 = table.getColumnModel().getColumn(4); + tc4.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc4.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc4.setHeaderRenderer(new CheckBoxHeader(new MyItemListener4(), + (String) titles[4])); + /* + TableColumn tc5 = table.getColumnModel().getColumn(5); + tc5.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc5.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc5.setHeaderRenderer(new CheckBoxHeader(new MyItemListener5(), + (String) titles[5])); + */ + scrollPane.setViewportView(table); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + + PermissionEditImage_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Image"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 45, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(133, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Berechtigung"); + lblNewLabel_1.setBounds(146, 11, 80, 14); + contentPanel.add(lblNewLabel_1); + + JLabel lblName = new JLabel("Name:"); + lblName.setBounds(10, 36, 46, 20); + contentPanel.add(lblName); + + textField = new JTextField(); + textField.setBounds(69, 36, 171, 20); + contentPanel.add(textField); + textField.setColumns(10); + + JLabel lblHochschule = new JLabel("Hochschule:"); + lblHochschule.setBounds(275, 36, 80, 20); + contentPanel.add(lblHochschule); + + JComboBox comboBox = new JComboBox(); + comboBox.setModel(new DefaultComboBoxModel(new String[] { + "Hochschule Offenburg", "Hochschule Reutlingen", + "Universit\u00E4t Freiburg" })); + comboBox.setBounds(365, 36, 202, 20); + contentPanel.add(comboBox); + + JPanel panel = new JPanel(); + panel.setBounds(10, 67, 557, 150); + contentPanel.add(panel); + panel.setLayout(null); + panel.setBorder(new TitledBorder(null, "Beschreibung", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel.setBackground(SystemColor.menu); + + JLabel label = new JLabel("Read"); + label.setBounds(20, 18, 90, 20); + panel.add(label); + + JLabel label_3 = new JLabel("Write"); + label_3.setBounds(20, 38, 90, 20); + panel.add(label_3); + + JLabel lblImageLesenUnd = new JLabel( + "Image lesen und starten, in Suchfenster und VMchooser sichtbar."); + lblImageLesenUnd.setBounds(120, 18, 380, 20); + panel.add(lblImageLesenUnd); + + JLabel lblImageAnpassenUnd = new JLabel( + "Image anpassen und \u00DCberschrieben, jedoch nicht l\u00F6schen."); + lblImageAnpassenUnd.setBounds(120, 38, 380, 20); + panel.add(lblImageAnpassenUnd); + + lblLinkAllowed = new JLabel("Link"); + lblLinkAllowed.setBounds(20, 58, 90, 20); + panel.add(lblLinkAllowed); + + label_5 = new JLabel("Admin"); + label_5.setBounds(20, 78, 90, 20); + panel.add(label_5); + + label_6 = new JLabel("Erzeugung einer Veranstaltung auf ein Image ist erlaubt."); + label_6.setBounds(120, 58, 380, 20); + panel.add(label_6); + + label_7 = new JLabel("Volle Rechte: read, write, l\u00F6schen, Link_allowed und
Berechtigungen f\u00FCr andere Benutzer festlegen."); + label_7.setBounds(120, 78, 380, 40); + panel.add(label_7); + + JLabel label_4 = new JLabel("F\u00FCr alle sichtbar"); + label_4.setBounds(20, 120, 90, 20); + panel.add(label_4); + + JCheckBox checkBox = new JCheckBox(""); + checkBox.setBounds(115, 120, 21, 23); + panel.add(checkBox); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton cancelButton = new JButton("Zur\u00FCck"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + EditImageFreigabe_GUI sr = new EditImageFreigabe_GUI(); + sr.setVisible(true); + dispose(); + } + }); + cancelButton.setActionCommand("OK"); + buttonPane.add(cancelButton); + // getRootPane().setDefaultButton(cancelButton); + } + { + JButton continueButton = new JButton("Weiter"); + continueButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + FTPEditUploader_GUI ea = new FTPEditUploader_GUI(); + ea.setVisible(true); + dispose(); + + } + }); + continueButton.setActionCommand("Cancel"); + buttonPane.add(continueButton); + getRootPane().setDefaultButton(continueButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 78, 597, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + getContentPane().add(separator_1); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAbout); + + } + + class MyItemListener1 implements ItemListener { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) + return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for (int x = 0, y = table.getRowCount(); x < y; x++) { + table.setValueAt(new Boolean(checked), x, 1); + } + } + } + + class MyItemListener2 implements ItemListener { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) + return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for (int x = 0, y = table.getRowCount(); x < y; x++) { + table.setValueAt(new Boolean(checked), x, 2); + } + } + } + + class MyItemListener3 implements ItemListener { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) + return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for (int x = 0, y = table.getRowCount(); x < y; x++) { + table.setValueAt(new Boolean(checked), x, 3); + } + } + } + + class MyItemListener4 implements ItemListener { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) + return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for (int x = 0, y = table.getRowCount(); x < y; x++) { + table.setValueAt(new Boolean(checked), x, 4); + } + } + } + + class MyItemListener5 implements ItemListener { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) + return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for (int x = 0, y = table.getRowCount(); x < y; x++) { + table.setValueAt(new Boolean(checked), x, 5); + } + } + } +} + +/* + * class CheckBoxHeader extends JCheckBox implements TableCellRenderer, + * MouseListener { protected CheckBoxHeader rendererComponent; protected int + * column; protected boolean mousePressed = false; + * + * public CheckBoxHeader(ItemListener itemListener ,String text) { + * rendererComponent = this; rendererComponent.addItemListener(itemListener); + * rendererComponent.setText(text); } + * + * public Component getTableCellRendererComponent( JTable table, Object value, + * boolean isSelected, boolean hasFocus, int row, int column) { if (table != + * null) { JTableHeader header = table.getTableHeader(); if (header != null) { + * rendererComponent.setForeground(header.getForeground()); + * rendererComponent.setBackground(header.getBackground()); + * rendererComponent.setFont(header.getFont()); + * rendererComponent.setBorder(header.getBorder()); + * header.addMouseListener(rendererComponent); } } setColumn(column); + * //rendererComponent.setText("Check All"); + * //setBorder(UIManager.getBorder("TableHeader.cellBorder")); + * + * return rendererComponent; } protected void setColumn(int column) { + * this.column = column; } public int getColumn() { return column; } protected + * void handleClickEvent(MouseEvent e) { if (mousePressed) { mousePressed=false; + * JTableHeader header = (JTableHeader)(e.getSource()); JTable tableView = + * header.getTable(); TableColumnModel columnModel = tableView.getColumnModel(); + * int viewColumn = columnModel.getColumnIndexAtX(e.getX()); int column = + * tableView.convertColumnIndexToModel(viewColumn); + * + * if (viewColumn == this.column && e.getClickCount() == 1 && column != -1) { + * doClick(); } } } public void mouseClicked(MouseEvent e) { + * handleClickEvent(e); ((JTableHeader)e.getSource()).repaint(); } public void + * mousePressed(MouseEvent e) { mousePressed = true; } public void + * mouseReleased(MouseEvent e) { } public void mouseEntered(MouseEvent e) { } + * public void mouseExited(MouseEvent e) { } } + */ diff --git a/dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java b/dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java new file mode 100644 index 00000000..83e12b72 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java @@ -0,0 +1,1055 @@ +package gui.image; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JSeparator; +import javax.swing.JTabbedPane; +import javax.swing.JTable; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.RowFilter; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableModel; +import javax.swing.table.TableRowSorter; + +import models.Image; +import models.Links; +import models.person; + +import org.apache.thrift.TException; + +import server.Server.Client; +import thrift.ThriftConnection; +import util.GuiOrganizer; +//import models.person; +import util.OpenLinks; + +@SuppressWarnings("serial") +public class SearchEditImage_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + JLabel labelName; + JLabel labelUpdate; + JLabel labelVerantwortlicher; + JLabel labelWeitereVerantwortliche; + JLabel labelVorlage; + JLabel labelLizenzSoftware; + JLabel labelInternet; + JLabel labelRam; + JLabel labelCPU; + JLabel labelID; + JLabel labelVersion; + JTextArea textAreadesc; + private JLabel labelOS; + String[] result; + JRadioButton rdbtnInternetJa; + JRadioButton rdbtnInternetNein; + JComboBox comboBox; + JTable tableAllImages; + JTable tablemyImages; + JTable tablePublicVorlagen; + boolean activeSearch = false; + private JTextField textFieldName; + JTabbedPane tabbedPane; + String[] titles = { "Name", "Lizenzpflichtig", "OS", "Veranstaltung", + "Verantwortlicher", "Letztes Update", "ID", "Version", "Template" };// Angezeigt + // werden + // aber + // nur + // Name (0), + // OS (2), + // Verantwortlicher (4), + // Letztes + // Update (5) + + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); + final DefaultTableModel modelAll = new DefaultTableModel(titles, 0) { + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0) { + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final DefaultTableModel modelPublicVorlagen = new DefaultTableModel(titles, + 0) { + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final TableRowSorter rowSorterAll = new TableRowSorter( + modelAll); + final TableRowSorter rowSorterMyImages = new TableRowSorter( + modelMyImages); + final TableRowSorter rowSorterPublicVorlagen = new TableRowSorter( + modelPublicVorlagen); + private JTextField textField; + + /** + * Create the dialog. + */ + public SearchEditImage_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + // Beendet die Anwendung nach klick auf X + con.closeThriftConnection(); + System.exit(0); + } + + @Override + public void windowOpened(WindowEvent arg0) { + initTableModel(modelMyImages); + initTableModel(modelAll); + initTableModel(modelPublicVorlagen); + + //auszublendende Angaben + //1=Lizenzpflichtig + //3=Veranstaltung + //6=ID + //7=Version + //8=Template + tablemyImages.getColumnModel().getColumn(1).setWidth(0); + tablemyImages.getColumnModel().getColumn(1).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(3).setWidth(0); + tablemyImages.getColumnModel().getColumn(3).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(3).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(8).setWidth(0); + tablemyImages.getColumnModel().getColumn(8).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(6).setWidth(0); + tablemyImages.getColumnModel().getColumn(6).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(7).setWidth(0); + tablemyImages.getColumnModel().getColumn(7).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0); + + tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(1) + .setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(1) + .setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(3).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(3) + .setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(3) + .setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8) + .setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8) + .setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6) + .setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6) + .setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7) + .setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7) + .setMaxWidth(0); + + tableAllImages.getColumnModel().getColumn(1).setWidth(0); + tableAllImages.getColumnModel().getColumn(1).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(3).setWidth(0); + tableAllImages.getColumnModel().getColumn(3).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(3).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(8).setWidth(0); + tableAllImages.getColumnModel().getColumn(8).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(6).setWidth(0); + tableAllImages.getColumnModel().getColumn(6).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(7).setWidth(0); + tableAllImages.getColumnModel().getColumn(7).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0); + textFieldName.requestFocusInWindow(); + } + }); + // Verhindert das Vergroessern Des Fensters + setResizable(false); + + try { + // Setzt das Look & Feel auf System + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + // Setzt den Fenstertitel + setTitle("bwLehrpool Suite - Image bearbeiten"); + // Zentriert das Fenster in die Bildmitte + setBounds(0, 0, 918, 722); + GuiOrganizer.centerGUI(this); + + final DefaultTableModel model = new DefaultTableModel(titles, 0); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 892, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Imageauswahl"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 531); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 49, 557, 98); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel lblNewLabel_2 = new JLabel("Name:"); + lblNewLabel_2.setBounds(10, 30, 80, 20); + panel_1.add(lblNewLabel_2); + + JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:"); + lblInternetIstInnerhalb.setBounds(10, 58, 250, 20); + panel_1.add(lblInternetIstInnerhalb); + + textFieldName = new JTextField(); + // Key Listener der Tastatureingabe registriert + textFieldName.addKeyListener(new KeyAdapter() { + @Override + public void keyReleased(KeyEvent e) { + // Textfield eingabe auslesen + String stext = textFieldName.getText(); + + // Wenn Textfield nicht leer + if (stext.isEmpty() == false) { + activeSearch = true; + // Filtere nach der Eingabe + rowSorterAll.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + } else { + activeSearch = false; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + "true", 8)); + rowSorterAll.setRowFilter(null); + } + } + }); + + textFieldName.setBounds(96, 30, 166, 20); + panel_1.add(textFieldName); + textFieldName.setColumns(10); + + comboBox = new JComboBox(); + try { + // Holt sich eine Liste aller verfuegbaren Betriebssysteme vom + // Server + List list = client.getAllOS(); + // Leeres Item hinzufuegen + comboBox.addItem(""); + for (int i = 0; i < list.size(); i++) { + // Hinzufuegen der verfuegbaren Betriebssysteme + comboBox.addItem(list.get(i)); + } + } catch (TException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + JOptionPane.showMessageDialog(null, + e2.getCause() + "\n" + e2.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + // Registriert Auswahlaenderungen der Box + comboBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + // Prueft das die Auswahl nicht leer ist + if (comboBox.getSelectedItem().toString().isEmpty() == false) { + // Filtert nach dem ausgewaehlten Betriebssystem + activeSearch = true; + rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox + .getSelectedItem().toString(), 2)); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + comboBox.getSelectedItem().toString(), 2)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + comboBox.getSelectedItem().toString(), 2)); + } else { + activeSearch = false; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + "true", 8)); + rowSorterAll.setRowFilter(null); + } + } + + }); + comboBox.setBounds(96, 58, 166, 20); + panel_1.add(comboBox); + + JLabel label_3 = new JLabel("Beschreibung:"); + label_3.setBounds(291, 30, 80, 20); + panel_1.add(label_3); + + textField = new JTextField(); + textField.setColumns(10); + textField.setBounds(381, 30, 166, 20); + panel_1.add(textField); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + // oeffnet das Hauuetmenue + + SearchEditImage_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Image"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 45, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(116, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Imageauswahl"); + lblNewLabel_1.setBounds(129, 11, 85, 14); + contentPanel.add(lblNewLabel_1); + + tabbedPane = new JTabbedPane(JTabbedPane.TOP); + tabbedPane.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent arg0) { + if (tabbedPane.getSelectedIndex() == 0 && activeSearch == false) { + + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + } else if (tabbedPane.getSelectedIndex() == 1 + && activeSearch == false) { + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + "true", 8)); + } else if (tabbedPane.getSelectedIndex() == 2 + && activeSearch == false) { + rowSorterAll.setRowFilter(null); + } + + } + }); + + tabbedPane.setBounds(10, 158, 557, 339); + contentPanel.add(tabbedPane); + + JScrollPane scrollPaneMyImage = new JScrollPane(); + tablemyImages = new JTable(); + tablemyImages.getSelectionModel().addListSelectionListener( + new ListSelectionListener() { + public void valueChanged(ListSelectionEvent e) { + String imageid = modelMyImages.getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 6) + .toString(); + //System.out.println(imageid); + String version = modelMyImages.getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 7) + .toString(); + //System.out.println(version); + writeImageData(imageid, version); + } + }); + tablemyImages.setModel(modelMyImages); + tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit(); + tablemyImages.setRowSorter(rowSorterMyImages); + + scrollPaneMyImage.setViewportView(tablemyImages); + tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null); + + JScrollPane scrollPaneCoopImages = new JScrollPane(); + JTable tableCoopImages = new JTable(); + tableCoopImages.setModel(model); + tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit(); + + JScrollPane scrollPanePublicVorlagen = new JScrollPane(); + tablePublicVorlagen = new JTable(); + tablePublicVorlagen.getSelectionModel().addListSelectionListener( + new ListSelectionListener() { + public void valueChanged(ListSelectionEvent e) { + String imageid = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 6) + .toString(); + //System.out.println(imageid); + String version = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 7) + .toString(); + //System.out.println(version); + writeImageData(imageid, version); + } + }); + tablePublicVorlagen.setModel(modelPublicVorlagen); + tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit(); + tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen); + scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen); + tabbedPane.addTab("Vorlagen", null, scrollPanePublicVorlagen, null); + + JScrollPane scrollPaneAllImages = new JScrollPane(); + tableAllImages = new JTable(); + tableAllImages.getSelectionModel().addListSelectionListener( + new ListSelectionListener() { + public void valueChanged(ListSelectionEvent e) { + + String imageid = modelAll.getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 6) + .toString(); + //System.out.println(imageid); + String version = modelAll.getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 7) + .toString(); + //System.out.println(version); + writeImageData(imageid, version); + + } + }); + tableAllImages.setModel(modelAll); + tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit(); + tableAllImages.setRowSorter(rowSorterAll); + + scrollPaneAllImages.setViewportView(tableAllImages); + tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); + + scrollPaneCoopImages.setViewportView(tableCoopImages); + tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages, null); + tabbedPane.setEnabledAt(3, false); + + JButton btnDownload = new JButton("Download"); + btnDownload.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + // oeffnet den Downloader + + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + // check if user is in correct tab + if (tabbedPane.getSelectedIndex() == 0) { + // check if a row is selected + if (tablemyImages.getSelectedRow() != -1) { + String imageid = modelMyImages.getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 6) + .toString(); + + Image.image.setImageId(imageid); + String imageversion = modelMyImages.getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 7) + .toString(); + + Image.image.setVersion(imageversion); + + FTPEditDownloader_GUI ea = new FTPEditDownloader_GUI(); + ea.setVisible(true); + dispose(); + } + } else if (tabbedPane.getSelectedIndex() == 1) { + if (tablePublicVorlagen.getSelectedRow() != -1) { + if (modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 4) + .equals(username) == true + || modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), + 8).equals("true") == true) { + String imageid = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), + 6).toString(); + + Image.image.setImageId(imageid); + String imageversion = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), + 7).toString(); + + Image.image.setVersion(imageversion); + + FTPEditDownloader_GUI ea = new FTPEditDownloader_GUI(); + ea.setVisible(true); + dispose(); + } else { + JOptionPane + .showMessageDialog( + null, + "Sie haben keine Berechtigung fremde Images herunterzuladen.", + "Message", + JOptionPane.INFORMATION_MESSAGE); + } + } + } else if (tabbedPane.getSelectedIndex() == 2) { + if (tableAllImages.getSelectedRow() != -1) { + if (modelAll.getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 4).equals( + username) == true + || modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), + 8).equals("true") == true) { + String imageid = modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), + 6).toString(); + + Image.image.setImageId(imageid); + String imageversion = modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), + 7).toString(); + + Image.image.setVersion(imageversion); + + FTPEditDownloader_GUI ea = new FTPEditDownloader_GUI(); + ea.setVisible(true); + dispose(); + } else { + JOptionPane + .showMessageDialog( + null, + "Sie haben keine Berechtigung fremde Images herunterzuladen.", + "Message", + JOptionPane.INFORMATION_MESSAGE); + } + } + } else { + JOptionPane + .showMessageDialog( + null, + "Bitte w\u00e4hlen Sie ein Image f\u00fcr den Download aus", + "Message", JOptionPane.INFORMATION_MESSAGE); + } + } + }); + btnDownload.setBounds(449, 508, 118, 23); + contentPanel.add(btnDownload); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 902, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton okButton = new JButton("Zur\u00FCck"); + okButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + // oeffnet das Hauptmenue + + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + dispose(); + } + }); + okButton.setActionCommand("OK"); + buttonPane.add(okButton); + getRootPane().setDefaultButton(okButton); + } + { + JButton cancelButton = new JButton("Weiter"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + String username = person.verantwortlicher.getName() + + " " + person.verantwortlicher.getVorname(); + // check if user is in correct tab + if (tabbedPane.getSelectedIndex() == 0) { + // check if a row is selected + if (tablemyImages.getSelectedRow() != -1) { + String imageid = modelMyImages + .getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), + 6).toString(); + + Image.image.setImageId(imageid); + String imageversion = modelMyImages + .getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), + 7).toString(); + + Image.image.setVersion(imageversion); + + EditImageAllgemein_GUI ea = new EditImageAllgemein_GUI(); + ea.setVisible(true); + dispose(); + } + } else if (tabbedPane.getSelectedIndex() == 1) { + if (tablePublicVorlagen.getSelectedRow() != -1 + && modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), + 4).equals(username) == true) { + String imageid = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), + 6).toString(); + + Image.image.setImageId(imageid); + String imageversion = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), + 7).toString(); + + Image.image.setVersion(imageversion); + + EditImageAllgemein_GUI ea = new EditImageAllgemein_GUI(); + ea.setVisible(true); + dispose(); + } + } else if (tabbedPane.getSelectedIndex() == 2) { + if (tableAllImages.getSelectedRow() != -1 + && modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), + 4).equals(username) == true) { + String imageid = modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), + 6).toString(); + + Image.image.setImageId(imageid); + String imageversion = modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), + 7).toString(); + + Image.image.setVersion(imageversion); + + EditImageAllgemein_GUI ea = new EditImageAllgemein_GUI(); + ea.setVisible(true); + dispose(); + } else { + JOptionPane + .showMessageDialog( + null, + "Bitte w\u00e4hlen Sie ein eigenes Image aus.", + "Image Auswahl", + JOptionPane.INFORMATION_MESSAGE); + } + }// end check if correct tab is selected + } + }); + cancelButton.setActionCommand("Cancel"); + buttonPane.add(cancelButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 79, 912, 1); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 912, 2); + getContentPane().add(separator_1); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBorder(new TitledBorder(null, "Detailinformationen", + + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel.setBackground(SystemColor.menu); + panel.setBounds(586, 85, 316, 531); + getContentPane().add(panel); + + JLabel lblName = new JLabel("Name:"); + lblName.setBounds(10, 87, 130, 14); + panel.add(lblName); + + labelName = new JLabel(""); + labelName.setBounds(10, 102, 296, 14); + panel.add(labelName); + + JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); + lblVerantwortlicher.setBounds(10, 259, 130, 14); + panel.add(lblVerantwortlicher); + + labelOS = new JLabel(""); + labelOS.setBounds(10, 216, 296, 14); + panel.add(labelOS); + + JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:"); + lblWeitereVerantwortliche.setBounds(10, 202, 130, 14); + panel.add(lblWeitereVerantwortliche); + + labelVerantwortlicher = new JLabel(""); + labelVerantwortlicher.setBounds(10, 272, 296, 14); + panel.add(labelVerantwortlicher); + + JLabel label = new JLabel("Weitere Verantwortliche:"); + label.setBounds(10, 284, 130, 14); + panel.add(label); + + labelWeitereVerantwortliche = new JLabel(""); + labelWeitereVerantwortliche.setBounds(10, 297, 296, 14); + panel.add(labelWeitereVerantwortliche); + + labelUpdate = new JLabel(""); + labelUpdate.setBounds(10, 245, 296, 14); + panel.add(labelUpdate); + + JLabel lblLetztesUpdate = new JLabel("Letztes Update:"); + lblLetztesUpdate.setBounds(10, 231, 130, 14); + panel.add(lblLetztesUpdate); + + JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:"); + lblImageIstVorlage.setBounds(10, 336, 130, 14); + panel.add(lblImageIstVorlage); + + labelVorlage = new JLabel(""); + labelVorlage.setBounds(10, 350, 296, 14); + panel.add(labelVorlage); + + labelLizenzSoftware = new JLabel(""); + labelLizenzSoftware.setBounds(10, 383, 296, 14); + panel.add(labelLizenzSoftware); + + JLabel lblLizenzpflichtigeSoftware = new JLabel( + "Lizenzpflichtige Software:"); + lblLizenzpflichtigeSoftware.setBounds(10, 367, 130, 14); + panel.add(lblLizenzpflichtigeSoftware); + + JLabel lblInternet = new JLabel("Internetsperre vorhanden:"); + lblInternet.setBounds(10, 400, 130, 14); + panel.add(lblInternet); + + labelInternet = new JLabel(""); + labelInternet.setBounds(10, 417, 296, 14); + panel.add(labelInternet); + + JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:"); + lblEmpfehlungRam.setBounds(10, 432, 130, 14); + panel.add(lblEmpfehlungRam); + + labelRam = new JLabel(""); + labelRam.setBounds(10, 455, 296, 14); + panel.add(labelRam); + + JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:"); + lblEmpfehlungCpu.setBounds(10, 469, 130, 14); + panel.add(lblEmpfehlungCpu); + + labelCPU = new JLabel(""); + labelCPU.setBounds(10, 487, 296, 14); + panel.add(labelCPU); + + JLabel lblTechnischeDaten = new JLabel("Technische Daten:"); + lblTechnischeDaten.setBounds(10, 322, 296, 14); + panel.add(lblTechnischeDaten); + + JLabel lblId = new JLabel("ID:"); + lblId.setBounds(10, 23, 296, 14); + panel.add(lblId); + + labelID = new JLabel(""); + labelID.setBounds(10, 37, 296, 14); + panel.add(labelID); + + labelVersion = new JLabel(""); + labelVersion.setBounds(10, 73, 296, 14); + panel.add(labelVersion); + + JLabel lblVersion = new JLabel("Version:"); + lblVersion.setBounds(10, 57, 296, 14); + panel.add(lblVersion); + + JLabel lblBeschreibung = new JLabel("Beschreibung:"); + lblBeschreibung.setBounds(10, 119, 130, 14); + panel.add(lblBeschreibung); + + JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBounds(10, 135, 296, 65); + panel.add(scrollPane); + + textAreadesc = new JTextArea(); + textAreadesc.setLineWrap(true); + textAreadesc.setEditable(false); + textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); + textAreadesc.setBackground(SystemColor.menu); + scrollPane.setViewportView(textAreadesc); + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAbout); + + } + + // Initiale Beffuelung eines Table models + public DefaultTableModel initTableModel(DefaultTableModel model) { + List images; + try { + // Hole eine Liste der Images + images = client.getImageList(); + + Iterator i = images.iterator(); + SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); + int x = 0; + + while (i.hasNext()) { + // erzeuge Objekte fuer die Tabelle + Object[] obj = { images.get(x).getImageName(), + images.get(x).getLicenseRestriction(), + images.get(x).getOsName(), + images.get(x).getLectureName(), + images.get(x).getUserData(), + out.format(in.parse(images.get(x).updateTime)), + images.get(x).id, images.get(x).getVersion(), + images.get(x).getIsTemplate() }; + // Fuege diese Objekte der Tabelle hinzu + + model.addRow(obj); + x++; + i.next(); + + } + + return model; + } catch (TException | ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + JOptionPane.showMessageDialog(null, + e1.getCause() + "\n" + e1.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + return model; + } + + public void writeImageData(String id, String version) { + try { + SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); + Map res = client.getImageData(id, version); + labelName.setText(res.get("name")); + labelOS.setText(res.get("os")); + labelUpdate.setText(out.format(in.parse(res.get("lastupdate")))); + labelVerantwortlicher.setText(res.get("owner")); + labelWeitereVerantwortliche.setText("Noch nicht Verf\u00fcgbar"); + if (res.get("template").equals("true")) { + labelVorlage.setText("Ja"); + } else { + labelVorlage.setText("Nein"); + } + if (res.get("license").equals("1")) { + labelLizenzSoftware.setText("Ja"); + } else { + labelLizenzSoftware.setText("Nein"); + } + if (res.get("internet").equals("1")) { + labelInternet.setText("Ja"); + } else { + labelInternet.setText("Nein"); + } + labelRam.setText(res.get("ram")); + labelCPU.setText(res.get("cpu")); + labelID.setText(res.get("id")); + labelVersion.setText(res.get("version")); + textAreadesc.setText(res.get("desc")); + } catch (TException | ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } +} diff --git a/dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java b/dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java new file mode 100644 index 00000000..f41135b1 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java @@ -0,0 +1,963 @@ +package gui.image; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JSeparator; +import javax.swing.JTabbedPane; +import javax.swing.JTable; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.RowFilter; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import javax.swing.event.TableModelEvent; +import javax.swing.event.TableModelListener; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableModel; +import javax.swing.table.TableRowSorter; + +import models.Image; +import models.Links; +import models.person; + +import org.apache.thrift.TException; + +import server.Server.Client; +import thrift.ThriftConnection; +import util.GuiOrganizer; +import util.OpenLinks; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeEvent; + +@SuppressWarnings("serial") +public class SearchImage_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + JLabel labelName; + JLabel labelUpdate; + JLabel labelVerantwortlicher; + JLabel labelWeitereVerantwortliche; + JLabel labelVorlage; + JLabel labelLizenzSoftware; + JLabel labelInternet; + JLabel labelRam; + JLabel labelCPU; + JLabel labelID; + JLabel labelVersion; + JTextArea textAreadesc; + private JLabel labelOS; + String[] result; + JRadioButton rdbtnInternetJa; + JRadioButton rdbtnInternetNein; + JComboBox comboBox; + JTable tableAllImages; + JTable tablemyImages; + JTable tablePublicVorlagen; + private JTextField textFieldName; + JTabbedPane tabbedPane; + boolean activeSearch = false; + String[] titles = { "Name", "Lizenzpflichtig", "OS", "Veranstaltung", + "Verantwortlicher", "Letztes Update", "ID", "Version", "Template" }; // Angezeigt + // werden + // aber + // nur + // Name + // (0), + // OS + // (2), + // Verantwortlicher + // (4), + // Letztes + // Update + // (5) + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); + final DefaultTableModel modelAll = new DefaultTableModel(titles, 0) { + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0) { + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final DefaultTableModel modelPublicVorlagen = new DefaultTableModel(titles, + 0) { + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final TableRowSorter rowSorterAll = new TableRowSorter( + modelAll); + final TableRowSorter rowSorterMyImages = new TableRowSorter( + modelMyImages); + final TableRowSorter rowSorterPublicVorlagen = new TableRowSorter( + modelPublicVorlagen); + private JTextField textField; + + /** + * Create the dialog. + */ + public SearchImage_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + // Beendet die Anwendung nach klick auf X + con.closeThriftConnection(); + System.exit(0); + } + + @Override + public void windowOpened(WindowEvent arg0) { + initTableModel(modelAll); + initTableModel(modelMyImages); + initTableModel(modelPublicVorlagen); + + // auszublendende Angaben + // 1=Lizenzpflichtig + // 3=Veranstaltung + // 6=ID + // 7=Version + // 8=Template + tablemyImages.getColumnModel().getColumn(1).setWidth(0); + tablemyImages.getColumnModel().getColumn(1).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(3).setWidth(0); + tablemyImages.getColumnModel().getColumn(3).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(3).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(8).setWidth(0); + tablemyImages.getColumnModel().getColumn(8).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(6).setWidth(0); + tablemyImages.getColumnModel().getColumn(6).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(7).setWidth(0); + tablemyImages.getColumnModel().getColumn(7).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0); + + tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(1) + .setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(1) + .setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(3).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(3) + .setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(3) + .setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8) + .setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8) + .setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6) + .setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6) + .setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7) + .setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7) + .setMaxWidth(0); + + tableAllImages.getColumnModel().getColumn(1).setWidth(0); + tableAllImages.getColumnModel().getColumn(1).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(3).setWidth(0); + tableAllImages.getColumnModel().getColumn(3).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(3).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(8).setWidth(0); + tableAllImages.getColumnModel().getColumn(8).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(6).setWidth(0); + tableAllImages.getColumnModel().getColumn(6).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(7).setWidth(0); + tableAllImages.getColumnModel().getColumn(7).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0); + textFieldName.requestFocusInWindow(); + } + }); + // Verhindert das Vergroessern Des Fensters + setResizable(false); + + try { + // Setzt das Look & Feel auf System + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + // Setzt den Fenstertitel + setTitle("bwLehrpool Suite - Image suchen"); + // Zentriert das Fenster in die Bildmitte + setBounds(0, 0, 918, 722); + GuiOrganizer.centerGUI(this); + + final DefaultTableModel model = new DefaultTableModel(titles, 0); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 892, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Imagesuche"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 531); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 49, 557, 98); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel lblNewLabel_2 = new JLabel("Anzeigename:"); + lblNewLabel_2.setBounds(10, 30, 80, 20); + panel_1.add(lblNewLabel_2); + + JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:"); + lblInternetIstInnerhalb.setBounds(10, 58, 80, 20); + panel_1.add(lblInternetIstInnerhalb); + + textFieldName = new JTextField(); + // Key Listener der Tastatureingabe registriert + textFieldName.addKeyListener(new KeyAdapter() { + @Override + public void keyReleased(KeyEvent e) { + // Textfield eingabe auslesen + String stext = textFieldName.getText(); + + // Wenn Textfield nicht leer + if (stext != "") { + activeSearch = true; + // Filtere nach der Eingabe + rowSorterAll.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + + } else { + activeSearch = false; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + "true", 8)); + rowSorterAll.setRowFilter(null); + } + } + }); + + textFieldName.setBounds(96, 30, 166, 20); + panel_1.add(textFieldName); + textFieldName.setColumns(10); + + comboBox = new JComboBox(); + try { + // Holt sich eine Liste aller verfuegbaren Betriebssysteme vom + // Server + List list = client.getAllOS(); + // Leeres Item hinzufuegen + comboBox.addItem(""); + for (int i = 0; i < list.size(); i++) { + // Hinzufuegen der verfuegbaren Betriebssysteme + comboBox.addItem(list.get(i)); + } + } catch (TException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + JOptionPane.showMessageDialog(null, + e2.getCause() + "\n" + e2.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + // Registriert Auswahlaenderungen der Box + comboBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + // Prueft das die Auswahl nicht leer ist + if (comboBox.getSelectedItem().toString() != "") { + activeSearch = true; + rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox + .getSelectedItem().toString(), 2)); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + comboBox.getSelectedItem().toString(), 2)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + comboBox.getSelectedItem().toString(), 2)); + } else { + activeSearch = false; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + "true", 8)); + rowSorterAll.setRowFilter(null); + } + } + + }); + comboBox.setBounds(96, 58, 166, 20); + panel_1.add(comboBox); + + JLabel label_3 = new JLabel("Beschreibung:"); + label_3.setBounds(291, 30, 80, 20); + panel_1.add(label_3); + + textField = new JTextField(); + textField.setColumns(10); + textField.setBounds(381, 30, 166, 20); + panel_1.add(textField); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + // oeffnet das Hauuetmenue + + SearchImage_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Image"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 45, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(116, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Imageauswahl"); + lblNewLabel_1.setBounds(129, 11, 85, 14); + contentPanel.add(lblNewLabel_1); + + tabbedPane = new JTabbedPane(JTabbedPane.TOP); + tabbedPane.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent arg0) { + if (tabbedPane.getSelectedIndex() == 0 && activeSearch == false) { + + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + } else if (tabbedPane.getSelectedIndex() == 1 + && activeSearch == false) { + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + "true", 8)); + } else if (tabbedPane.getSelectedIndex() == 2 + && activeSearch == false) { + rowSorterAll.setRowFilter(null); + } + + } + }); + + tabbedPane.setBounds(10, 158, 557, 339); + contentPanel.add(tabbedPane); + + JScrollPane scrollPaneAllImages = new JScrollPane(); + tableAllImages = new JTable(); + tableAllImages.getSelectionModel().addListSelectionListener( + new ListSelectionListener() { + public void valueChanged(ListSelectionEvent e) { + + String imageid = modelAll.getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 6) + .toString(); + //System.out.println(imageid); + String version = modelAll.getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 7) + .toString(); + //System.out.println(version); + writeImageData(imageid, version); + + } + }); + tableAllImages.setModel(modelAll); + tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit(); + + JScrollPane scrollPaneMyImage = new JScrollPane(); + tablemyImages = new JTable(); + tablemyImages.getSelectionModel().addListSelectionListener( + new ListSelectionListener() { + public void valueChanged(ListSelectionEvent e) { + String imageid = modelMyImages.getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 6) + .toString(); + //System.out.println(imageid); + String version = modelMyImages.getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 7) + .toString(); + //System.out.println(version); + writeImageData(imageid, version); + } + }); + tablemyImages.setModel(modelMyImages); + tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit(); + tablemyImages.setRowSorter(rowSorterMyImages); + + scrollPaneMyImage.setViewportView(tablemyImages); + tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null); + + JScrollPane scrollPanePublicVorlagen = new JScrollPane(); + tablePublicVorlagen = new JTable(); + tablePublicVorlagen.getSelectionModel().addListSelectionListener( + new ListSelectionListener() { + public void valueChanged(ListSelectionEvent e) { + String imageid = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 6) + .toString(); + //System.out.println(imageid); + String version = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 7) + .toString(); + //System.out.println(version); + writeImageData(imageid, version); + } + }); + tablePublicVorlagen.setModel(modelPublicVorlagen); + tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit(); + tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen); + scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen); + tabbedPane.addTab("Vorlagen", null, scrollPanePublicVorlagen, null); + tableAllImages.setRowSorter(rowSorterAll); + + scrollPaneAllImages.setViewportView(tableAllImages); + tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); + + JScrollPane scrollPaneCoopImages = new JScrollPane(); + JTable tableCoopImages = new JTable(); + tableCoopImages.setModel(model); + tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit(); + + scrollPaneCoopImages.setViewportView(tableCoopImages); + tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages, null); + tabbedPane.setEnabledAt(3, false); + + JButton btnDownload = new JButton("Download"); + btnDownload.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + // oeffnet den Downloader + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + // + // meine Images + // + if (tabbedPane.getSelectedIndex() == 0) { + if (tablemyImages.getSelectedRow() != -1) { + String imageid = modelMyImages.getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 6) + .toString(); + + Image.image.setImageId(imageid); + String imageversion = modelMyImages.getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 7) + .toString(); + + Image.image.setVersion(imageversion); + SearchImage_GUI.this.setVisible(false); + FTPSearchDownloader_GUI down = new FTPSearchDownloader_GUI(); + down.setVisible(true); + + } + } else if (tabbedPane.getSelectedIndex() == 1) { + // + // Vorlagen Images + // + + if (tablePublicVorlagen.getSelectedRow() != -1 + // && modelPublicVorlagen + // .getValueAt( + // tablePublicVorlagen + // .convertRowIndexToModel(tablePublicVorlagen + // .getSelectedRow()), + // 4).equals(username) == true + ) { + String imageid = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 6) + .toString(); + + Image.image.setImageId(imageid); + String imageversion = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 7) + .toString(); + + Image.image.setVersion(imageversion); + + SearchImage_GUI.this.setVisible(false); + FTPSearchDownloader_GUI down = new FTPSearchDownloader_GUI(); + down.setVisible(true); + } + } else if (tabbedPane.getSelectedIndex() == 2) { + // + // Alle Images + // + /** + * if (tableAllImages.getSelectedRow() != -1 && modelAll + * .getValueAt( tableAllImages + * .convertRowIndexToModel(tableAllImages + * .getSelectedRow()), 4).equals(username) == true) { + **/ + if (tableAllImages.getSelectedRow() != -1) { + // nur eigene Images downloadbar + if (modelAll.getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 4).equals( + username) == true + || modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), + 8).equals("true") == true) { + String imageid = modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), + 6).toString(); + + Image.image.setImageId(imageid); + String imageversion = modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), + 7).toString(); + + Image.image.setVersion(imageversion); + + SearchImage_GUI.this.setVisible(false); + FTPSearchDownloader_GUI down = new FTPSearchDownloader_GUI(); + down.setVisible(true); + } else { + JOptionPane + .showMessageDialog( + null, + "Sie haben keine Berechtigung fremde Images herunterzuladen.", + "Message", + JOptionPane.INFORMATION_MESSAGE); + } + + } + + } else { + // + // nichts markiert + // + JOptionPane + .showMessageDialog( + null, + "Bitte w\u00e4hlen Sie ein Image f\u00fcr den Download aus", + "Message", JOptionPane.INFORMATION_MESSAGE); + } + } + }); + btnDownload.setBounds(449, 508, 118, 23); + contentPanel.add(btnDownload); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 902, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton okButton = new JButton("Zur\u00FCck"); + okButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + // oeffnet das Hauptmenue + + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + dispose(); + } + }); + okButton.setActionCommand("OK"); + buttonPane.add(okButton); + getRootPane().setDefaultButton(okButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 79, 912, 1); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 912, 2); + getContentPane().add(separator_1); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBorder(new TitledBorder(null, "Detailinformationen", + + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel.setBackground(SystemColor.menu); + panel.setBounds(586, 85, 316, 531); + getContentPane().add(panel); + + JLabel lblName = new JLabel("Name:"); + lblName.setBounds(10, 87, 130, 14); + panel.add(lblName); + + labelName = new JLabel(""); + labelName.setBounds(10, 102, 296, 14); + panel.add(labelName); + + JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); + lblVerantwortlicher.setBounds(10, 259, 130, 14); + panel.add(lblVerantwortlicher); + + labelOS = new JLabel(""); + labelOS.setBounds(10, 216, 296, 14); + panel.add(labelOS); + + JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:"); + lblWeitereVerantwortliche.setBounds(10, 202, 130, 14); + panel.add(lblWeitereVerantwortliche); + + labelVerantwortlicher = new JLabel(""); + labelVerantwortlicher.setBounds(10, 272, 296, 14); + panel.add(labelVerantwortlicher); + + JLabel label = new JLabel("Weitere Ansprechpartner:"); + label.setBounds(10, 284, 130, 14); + panel.add(label); + + labelWeitereVerantwortliche = new JLabel(""); + labelWeitereVerantwortliche.setBounds(10, 297, 296, 14); + panel.add(labelWeitereVerantwortliche); + + labelUpdate = new JLabel(""); + labelUpdate.setBounds(10, 245, 296, 14); + panel.add(labelUpdate); + + JLabel lblLetztesUpdate = new JLabel("Letztes Update:"); + lblLetztesUpdate.setBounds(10, 231, 130, 14); + panel.add(lblLetztesUpdate); + + JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:"); + lblImageIstVorlage.setBounds(10, 336, 130, 14); + panel.add(lblImageIstVorlage); + + labelVorlage = new JLabel(""); + labelVorlage.setBounds(10, 350, 296, 14); + panel.add(labelVorlage); + + labelLizenzSoftware = new JLabel(""); + labelLizenzSoftware.setBounds(10, 383, 296, 14); + panel.add(labelLizenzSoftware); + + JLabel lblLizenzpflichtigeSoftware = new JLabel( + "Lizenzpflichtige Software:"); + lblLizenzpflichtigeSoftware.setBounds(10, 367, 130, 14); + panel.add(lblLizenzpflichtigeSoftware); + + JLabel lblInternet = new JLabel("Internetsperre vorhanden:"); + lblInternet.setBounds(10, 400, 130, 14); + panel.add(lblInternet); + + labelInternet = new JLabel(""); + labelInternet.setBounds(10, 417, 296, 14); + panel.add(labelInternet); + + JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:"); + lblEmpfehlungRam.setBounds(10, 432, 130, 14); + panel.add(lblEmpfehlungRam); + + labelRam = new JLabel(""); + labelRam.setBounds(10, 455, 296, 14); + panel.add(labelRam); + + JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:"); + lblEmpfehlungCpu.setBounds(10, 469, 130, 14); + panel.add(lblEmpfehlungCpu); + + labelCPU = new JLabel(""); + labelCPU.setBounds(10, 487, 296, 14); + panel.add(labelCPU); + + JLabel lblTechnischeDaten = new JLabel("Technische Daten:"); + lblTechnischeDaten.setBounds(10, 322, 296, 14); + panel.add(lblTechnischeDaten); + + JLabel lblId = new JLabel("ID:"); + lblId.setBounds(10, 23, 296, 14); + panel.add(lblId); + + labelID = new JLabel(""); + labelID.setBounds(10, 37, 296, 14); + panel.add(labelID); + + labelVersion = new JLabel(""); + labelVersion.setBounds(10, 73, 296, 14); + panel.add(labelVersion); + + JLabel lblVersion = new JLabel("Version:"); + lblVersion.setBounds(10, 57, 296, 14); + panel.add(lblVersion); + + JLabel lblBeschreibung = new JLabel("Beschreibung:"); + lblBeschreibung.setBounds(10, 119, 130, 14); + panel.add(lblBeschreibung); + + JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBounds(10, 135, 296, 65); + panel.add(scrollPane); + + textAreadesc = new JTextArea(); + textAreadesc.setEditable(false); + textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); + textAreadesc.setLineWrap(true); + textAreadesc.setBackground(SystemColor.menu); + scrollPane.setViewportView(textAreadesc); + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAbout); + + } + + // Initiale Beffuelung eines Table models + public DefaultTableModel initTableModel(DefaultTableModel model) { + List images; + try { + // Hole eine Liste der Images + images = client.getImageList(); + + Iterator i = images.iterator(); + SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); + int x = 0; + + while (i.hasNext()) { + // erzeuge Objekte fuer die Tabelle + Object[] obj = { images.get(x).getImageName(), + images.get(x).getLicenseRestriction(), + images.get(x).getOsName(), + images.get(x).getLectureName(), + images.get(x).getUserData(), + out.format(in.parse(images.get(x).updateTime)), + images.get(x).id, images.get(x).getVersion(), + images.get(x).getIsTemplate() }; + // Fuege diese Objekte der Tabelle hinzu + model.addRow(obj); + x++; + i.next(); + + } + + return model; + } catch (TException | ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + JOptionPane.showMessageDialog(null, + e1.getCause() + "\n" + e1.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + return model; + } + + public void writeImageData(String id, String version) { + try { + SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); + Map res = client.getImageData(id, version); + labelName.setText(res.get("name")); + labelOS.setText(res.get("os")); + labelUpdate.setText(out.format(in.parse(res.get("lastupdate")))); + labelVerantwortlicher.setText(res.get("owner") + " (" + res.get("mail") + ")"); + labelWeitereVerantwortliche.setText("Keine"); + if (res.get("template").equals("true")) { + labelVorlage.setText("Ja"); + } else { + labelVorlage.setText("Nein"); + } + if (res.get("license").equals("1")) { + labelLizenzSoftware.setText("Ja"); + } else { + labelLizenzSoftware.setText("Nein"); + } + if (res.get("internet").equals("1")) { + labelInternet.setText("Ja"); + } else { + labelInternet.setText("Nein"); + } + labelRam.setText(res.get("ram")); + labelCPU.setText(res.get("cpu")); + labelID.setText(res.get("id")); + labelVersion.setText(res.get("version")); + textAreadesc.setText(res.get("desc")); + } catch (TException | ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } +} diff --git a/dozentenmodul/src/main/java/gui/intro/About_GUI.java b/dozentenmodul/src/main/java/gui/intro/About_GUI.java new file mode 100644 index 00000000..a97a217b --- /dev/null +++ b/dozentenmodul/src/main/java/gui/intro/About_GUI.java @@ -0,0 +1,97 @@ +package gui.intro; + +import java.awt.Image; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; + +import models.Version; + +import util.GuiOrganizer; + +@SuppressWarnings("serial") +public class About_GUI extends JFrame { + + private JPanel contentPane; + private JTextPane txtpnVersionVBuilddate; + + /** + * Create the frame. + */ + public About_GUI() { + // Fenster darf nicht vergroessert werden + setResizable(false); + + try { + // Setzt das Look and Feel auf System + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog(null, + e.getCause() + "\n" + e.getStackTrace(), "Debug-Message", + JOptionPane.ERROR_MESSAGE); + } + // Titel des Fensters setzen + setTitle("Dozentenmodul - About"); + // Aktion die beim Schliessen durchgefuehrt werden soll + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + // Groesse des Fensters definieren + setBounds(0, 0, 355, 309); + GuiOrganizer.centerGUI(this); + // Erzeugen eines Panels + contentPane = new JPanel(); + // Hintergrund Farbe des Panels setzen + contentPane.setBackground(SystemColor.menu); + // Rahmen des Fensters setzen + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + // Layout setzen + contentPane.setLayout(null); + // Label fuer das Logo erzeugen + JLabel imgLabel = new JLabel(); + // Groesse und Position des Logos festelegen + imgLabel.setBounds(30, 18, 294, 80); + // Pfadangabe des Logos + + ImageIcon icon = new ImageIcon(getClass().getResource( + "/img/Logo_bwLehrpool.png"), "Logo"); + // Skalierung des Logos + Image scaled = icon.getImage().getScaledInstance(270, 64, 0); + imgLabel.setIcon(new ImageIcon(scaled)); + // Hinzufuegen des Logos in das Fenster + contentPane.add(imgLabel); + + // Erzeugen, Hinzufuegen und definierung der Aktion des Buttons + JButton BtnClose = new JButton("Close"); + BtnClose.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + dispose(); + + }// end actionPerformed + }); + + BtnClose.setBounds(62, 226, 237, 23); + contentPane.add(BtnClose); + + txtpnVersionVBuilddate = new JTextPane(); + txtpnVersionVBuilddate + .setText("Version: "+Version.getVersion()+"\r\nBuild-Date: "+Version.getBuildDate()+"\r\n\r\nContact: michael.wilson@hs-offenburg.de\r\nWebsite: http://bwlehrpool.hs-offenburg.de/"); + txtpnVersionVBuilddate.setEditable(false); + txtpnVersionVBuilddate.setBackground(SystemColor.menu); + txtpnVersionVBuilddate.setBounds(62, 95, 224, 90); + contentPane.add(txtpnVersionVBuilddate); + }// end LoginGUI() +}// end class diff --git a/dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java b/dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java new file mode 100644 index 00000000..b11dc746 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java @@ -0,0 +1,241 @@ +package gui.intro; + + +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JSeparator; +import javax.swing.JTextArea; +import javax.swing.JTextPane; +import javax.swing.SwingConstants; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +import models.Links; + +import org.ini4j.InvalidFileFormatException; +import org.ini4j.Wini; + +import util.GuiOrganizer; +import util.OpenLinks; + + + +@SuppressWarnings("serial") +public class BillOfRights_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JButton fwdButton; + JCheckBox chckbxAkzeptieren; + + /** + * Create the dialog. + */ + public BillOfRights_GUI() { + setResizable(false); + + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + //Beendet das Programm beim Klick auf das X + System.exit(0); + } + }); + try { + //Setzt das Look & Feel auf das System + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + //Setzt den Fenstertitel + setTitle("bwLehrpool Suite"); + + //Zentiert das Fenster in der Bildschirmmitte + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 567, 60); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Hinweis"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie.setText("Bitte lesen und best\u00E4tigen Sie folgende rechtliche Hinweise"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 22); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 95, 567, 485); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JTextArea txtrLoremIpsumDolor = new JTextArea(); + txtrLoremIpsumDolor.setWrapStyleWord(true); + txtrLoremIpsumDolor.setLineWrap(true); + txtrLoremIpsumDolor.setEditable(false); + JScrollPane scr=new JScrollPane(txtrLoremIpsumDolor); + scr.setBounds(0, 0, 567, 477); + txtrLoremIpsumDolor.setBounds(0, 0, 567, 477); + txtrLoremIpsumDolor.setText("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \r\n\r\nDuis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. \r\n\r\nUt wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. \r\n\r\nNam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. \r\n\r\nDuis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis. \r\n\r\nAt vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat. \r\n\r\nConsetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus. \r\n\r\nLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \r\n\r\nDuis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. \r\n\r\nUt wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. \r\n\r\nNam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo"); + + contentPanel.add(scr); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 630, 587, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + fwdButton = new JButton("Weiter"); + fwdButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + try { + Wini ini=new Wini(new File("C:\\Users\\"+System.getProperty("user.name")+"\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + ini.put("main", "BillOfRights",true); + ini.store(); + } catch (InvalidFileFormatException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + JOptionPane.showMessageDialog(null, + e1.getCause()+"\n"+e1.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } catch (IOException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + JOptionPane.showMessageDialog(null, + e1.getCause()+"\n"+e1.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } + VmWareLink_GUI ac=new VmWareLink_GUI(); + ac.setVisible(true); + dispose(); + } + }); + fwdButton.setEnabled(false); + + buttonPane.add(fwdButton); + } + } + { + JSeparator separator = new JSeparator(); + separator.setBounds(0, 617, 587, 2); + getContentPane().add(separator); + } + { + JSeparator separator = new JSeparator(); + separator.setBounds(0, 82, 587, 2); + getContentPane().add(separator); + } + + chckbxAkzeptieren = new JCheckBox("Ja, ich akzeptiere die Vereinbarung. Benachrichtigung nicht mehr anzeigen."); + chckbxAkzeptieren.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent arg0) { + //Beim Akzeptieren der Bestaetigung wird der Weiter-Button verfuegbar gemacht + if(chckbxAkzeptieren.isSelected()==true) + { + + fwdButton.setEnabled(true); + + } + else + { + + } + } + }); + chckbxAkzeptieren.setBackground(SystemColor.menu); + chckbxAkzeptieren.setBounds(10, 587, 567, 23); + getContentPane().add(chckbxAkzeptieren); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + mnNewMenu_1.setHorizontalAlignment(SwingConstants.CENTER); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + } +} diff --git a/dozentenmodul/src/main/java/gui/intro/Login_GUI.java b/dozentenmodul/src/main/java/gui/intro/Login_GUI.java new file mode 100644 index 00000000..b27c7179 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/intro/Login_GUI.java @@ -0,0 +1,434 @@ +package gui.intro; + +import java.awt.Color; +import java.awt.EventQueue; +import java.awt.Image; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.File; +import java.io.IOException; + +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JPasswordField; +import javax.swing.JTextField; +import javax.swing.SwingConstants; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; + +import models.SessionData; +import models.person; + +import org.apache.thrift.TException; +import org.ini4j.InvalidFileFormatException; +import org.ini4j.Wini; + +import org.openslx.imagemaster.thrift.iface.ImageServer.Client; +import thrift.MasterThriftConnection; +import thrift.ThriftConnection; +import org.openslx.imagemaster.thrift.iface.UserInfo; +import util.GuiOrganizer; +import config.config_file; +import javax.swing.JCheckBox; + +@SuppressWarnings("serial") +public class Login_GUI extends JFrame { + + private JPanel contentPane; + private JTextField lblusername; + private JPasswordField lblpass; + JLabel lblConnectionInfo = new JLabel(""); + boolean isClientReturnedCorrectly = false; + boolean login; + String masterServerIP = MasterThriftConnection.MASTERSERVERIP; + MasterThriftConnection thrift; + Client client; + String token; + JCheckBox chckbxBenutzernameSpeichern; + + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + // Pruefe und Erzeuge gegebenfalls Config + config_file cf = new config_file(); + boolean conf = cf.createConfig(); + if (conf == true) { + // Aufruf und Anzeige des Login Fensters + Login_GUI frame = new Login_GUI(); + frame.setVisible(true); + } else { + JOptionPane.showMessageDialog(null, + "Fehler beim erzeugen der Konfigurationsfile", + "Message", JOptionPane.ERROR_MESSAGE); + } + + } catch (Exception e) { + e.printStackTrace(); + JOptionPane.showMessageDialog(null, e.getStackTrace(), + "Message", JOptionPane.ERROR_MESSAGE); + } + } + }); + } + + /** + * Create the frame. + */ + public Login_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + System.exit(0); + } + }); + + // Fenster darf nicht vergroessert werden + setResizable(false); + + try { + // Setzt das Look and Feel auf System + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + // Titel des Fensters setzen + setTitle("bwLehrpool Suite"); + // Aktion die beim Schliessen durchgefuehrt werden soll + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + //Größe setzen und mittig ausrichten + setBounds(0, 0, 603, 400); + GuiOrganizer.centerGUI(this); + + + + // Erzeugen eines Panels + contentPane = new JPanel(); + // Hintergrund Farbe des Panels setzen + contentPane.setBackground(SystemColor.menu); + // Rahmen des Fensters setzen + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + // Layout setzen + contentPane.setLayout(null); + // Label fuer das Logo erzeugen + JLabel imgLabel = new JLabel(); + // Groesse und Position des Logos festelegen + imgLabel.setBounds(150, 11, 350, 142); + // Pfadangabe des Logos + + ImageIcon icon = new ImageIcon(getClass().getResource( + "/img/Logo_bwLehrpool.png"), "Logo"); + // Skalierung des Logos + Image scaled = icon.getImage().getScaledInstance(270, 64, 0); + imgLabel.setIcon(new ImageIcon(scaled)); + // Hinzufuegen des Logos in das Fenster + contentPane.add(imgLabel); + + chckbxBenutzernameSpeichern = new JCheckBox("Benutzername speichern"); + chckbxBenutzernameSpeichern.setBounds(292, 222, 237, 23); + contentPane.add(chckbxBenutzernameSpeichern); + + // Erzeugen und Hinzufuegen des Labels + JLabel LabelUser = new JLabel("bwIDM-Benutzername:"); + LabelUser.setBounds(111, 164, 134, 20); + contentPane.add(LabelUser); + + // Erzeugen und Hinzufuegen des Passwortfeldes + lblpass = new JPasswordField(); + lblpass.setToolTipText("Bitte geben Sie Ihr bwIDM-Passwort ein."); + lblpass.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + performLogin(); + } + }); + lblpass.setBounds(292, 195, 237, 20); + contentPane.add(lblpass); + + // Erzeugen und Hinzufuegen des Textfeldes + lblusername = new JTextField(); + lblusername + .setToolTipText("Bitte geben Sie Ihren bwIDM-Benutzernamen ein."); + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + if(ini.get("main", "Benutzername").isEmpty()){ + + }else{ + lblusername.setText(ini.get("main", "Benutzername").toString()); + + } + + if(ini.get("main", "Benutzername speichern", Boolean.class)==true){ + chckbxBenutzernameSpeichern.setSelected(true); + + } + } catch (InvalidFileFormatException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (IOException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + lblusername.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + performLogin(); + } + }); + lblusername.setBounds(292, 164, 237, 20); + contentPane.add(lblusername); + lblusername.setColumns(10); + + // Erzeugen und Hinzufuegen des Labels + JLabel LabelPass = new JLabel("bwIDM-Passwort:"); + LabelPass.setBounds(111, 195, 134, 20); + contentPane.add(LabelPass); + + lblConnectionInfo.setHorizontalAlignment(SwingConstants.LEFT); + lblConnectionInfo.setBounds(111, 290, 418, 20); + lblConnectionInfo.setEnabled(true); + lblConnectionInfo.setText("Info: Bereit f\u00FCr Login"); + + contentPane.add(lblConnectionInfo); + + // Erzeugen, Hinzufuegen und definierung der Aktion des Buttons + JButton BtnLogin = new JButton("Login"); + BtnLogin.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + + performLogin(); + }// end actionPerformed + }); + + BtnLogin.setBounds(292, 252, 237, 23); + contentPane.add(BtnLogin); + + + + + + + //GuiOrganizer.centerGUI(this); + }// end LoginGUI() + + // Versuche den Benutzer einzuloggen + public void performLogin() { + + login = false; + thrift = new MasterThriftConnection(); + client = thrift.getMasterThriftConnection(); + token = null; + org.openslx.imagemaster.thrift.iface.SessionData result = null; + + try { + + login = true; + String passText = new String(lblpass.getPassword()); + // check if client has received a connection with information or a + // null package + if (checkClientPackage() == true) { + + // package has information + //User-Info + + System.out.println("Authentifiziere - warte auf Masterserver"); + lblConnectionInfo.setForeground(Color.black); + + lblConnectionInfo.setText("Authentifiziere - warte auf Antwort von Server..."); + + result = client.authenticate(lblusername.getText(), passText); + + //User-Info + System.out.println("Authentifizierung erfolgreich"); + lblConnectionInfo.setForeground(Color.green); + lblConnectionInfo.setText("Authentifizierung erfolgreich"); + + //set Information + SessionData.session.setAuthToken(result.authToken); + SessionData.session.setSessionID(result.sessionId); + SessionData.session.setServerAdress(result.serverAddress); + + + //User-Info + lblConnectionInfo.setForeground(Color.black); + lblConnectionInfo.setText("Hole Verbindungsdaten von Server..."); + System.out.println("warte auf Masterserver"); + // set connection to bwLehrpoolSuiteServer + ThriftConnection bwthrift = new ThriftConnection(); + server.Server.Client bwClient = bwthrift.getThriftConnection(); + models.Client.clientcon.setClient(bwClient); + + //User-Info + System.out.println("Client macht weiter"); + System.out.println("Session-ID: " + result.sessionId + + "\nToken: " + result.authToken); + lblConnectionInfo.setForeground(Color.green); + lblConnectionInfo.setText("Daten erhalten."); + + if (login == true) { + //Daten speichern + if (SessionData.session.getAuthToken() == null) { + System.out.println("Token ist null"); + JOptionPane.showMessageDialog(null, + "Error: Token ist null", "Token defekt", + JOptionPane.ERROR_MESSAGE); + } + System.out.println("Arbeite ab jetzt mit Infos aus SessionData."); + UserInfo user = client.getUserFromToken(SessionData.session + .getAuthToken()); + + String hochschule = user.eMail.substring(user.eMail + .indexOf("@") + 1); + + person.verantwortlicher.setUsername(lblusername.getText() + .substring(0, lblusername.getText().indexOf("@"))); + person.verantwortlicher.setName(user.lastName); + person.verantwortlicher.setVorname(user.firstName); + person.verantwortlicher.setEMail(user.eMail); + person.verantwortlicher.setHochschule(hochschule); + + + //Sp�ter �ber result.getRole zum Beispiel die Rolle holen + person.verantwortlicher.setRole("Dozent"); + //person.verantwortlicher.setRole("Admin"); + //person.verantwortlicher.setRole("Student"); + //person.verantwortlicher.setRole("GetToTheChopper!"); + + + try { + // Lege config File an und entscheide welches Fenster + // als naechstes geoeffnet wird + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + if(lblusername.getText().equals(ini.get("main","Benutzername",String.class))==true){ + if(chckbxBenutzernameSpeichern.isSelected()){ + ini.put("main", "Benutzername", lblusername.getText()); + ini.put("main", "Benutzername speichern", true); + ini.store(); + } + else{ + ini.put("main", "Benutzername", ""); + ini.put("main", "Benutzername speichern", false); + ini.store(); + } + }else{ + + if(chckbxBenutzernameSpeichern.isSelected()){ + ini.put("main", "Benutzername", lblusername.getText()); + ini.put("main", "Benutzername speichern", true); + ini.put("main", "BillOfRights",false); + ini.put("main", "vmware",false); + ini.store(); + } + else{ + ini.put("main", "Benutzername", ""); + ini.put("main", "Benutzername speichern", false); + ini.put("main", "BillOfRights",false); + ini.put("main", "vmware",false); + ini.store(); + } + } + + // Pruefe ob Bills Of Rights schon akzeptiert wurden, + // wenn + // nicht zeige diese an + if (ini.get("main", "BillOfRights", boolean.class) == false) { + // Erstellen einer Instanz der Aktionsauswahl + BillOfRights_GUI re = new BillOfRights_GUI(); + re.setVisible(true); + // Schliessen des Fensters nach erfolgreichen Login + setVisible(false); + } else { + // Pruefe ob die Links zu vmware angezeigt werden + // sollen + if (ini.get("main", "vmware", boolean.class) == false) { + VmWareLink_GUI vm = new VmWareLink_GUI(); + vm.setVisible(true); + setVisible(false); + } else { + + // oeffne das Hauptmenue + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + setVisible(false); + } + } + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + + } + + } else { + JOptionPane.showMessageDialog(null, "Login denied!", + "Message", JOptionPane.INFORMATION_MESSAGE); + } + + } else { + // package from server is null + login = false; + lblConnectionInfo.setForeground(Color.red); + lblConnectionInfo + .setText("Fehler: Client nicht mit Server verbunden."); + + } + + } catch (org.openslx.imagemaster.thrift.iface.AuthenticationException e) { + lblConnectionInfo.setForeground(Color.red); + lblConnectionInfo + .setText("Fehler: Falscher Benutzername oder Passwort."); + System.out + .println("Authentifizierung fehlgeschlagen: " + e.message); + JOptionPane + .showMessageDialog( + null, + "Benutzeranmeldung fehlgeschlagen: Bitte Benutzername und Passwort \u00fcberpr\u00fcfen.", + "Anmeldung fehlgeschlagen", + JOptionPane.ERROR_MESSAGE); + e.printStackTrace(); + return; + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + + } + }// end performLogin + + public boolean checkClientPackage() { + // check if client is null or has been returned with information + System.out.println("Prüfe Eingangsdaten"); + if (client != null) { + // client contains information + isClientReturnedCorrectly = true; + System.out.println("Verbindungsdaten erhalten"); + } else { + // client has returned with error + isClientReturnedCorrectly = false; + System.out + .println("Fehler: Keine korrekten Verbindungsdaten erhalten."); + } + + return isClientReturnedCorrectly; + }// end checkServerConnection() +}// end class diff --git a/dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java b/dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java new file mode 100644 index 00000000..a14525f0 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java @@ -0,0 +1,606 @@ +package gui.intro; + +import gui.image.CreateImageAllgemein_GUI; +import gui.image.DeleteImage_GUI; +import gui.image.SearchEditImage_GUI; +import gui.image.SearchImage_GUI; +import gui.lecture.CreateLectureAllgemein_GUI; +import gui.lecture.DeleteLecture_GUI; +import gui.lecture.EditLectureSearch_GUI; +import gui.lecture.SearchLecture_GUI; + +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.ScrollPane; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.net.URI; +import java.net.URISyntaxException; + +import javax.swing.ButtonGroup; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JSeparator; +import javax.swing.JTextArea; +import javax.swing.JTextPane; +import javax.swing.SwingConstants; +import javax.swing.ToolTipManager; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; + +import models.ImageRights; +import models.Links; +import models.SessionData; +import models.person; +import util.GuiOrganizer; +import util.OpenLinks; + +@SuppressWarnings("serial") +public class MainMenue_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + String descNewImage, descEditImage, descDeleteImage, descSearchImage, + descNewLecture, descEditLecture, descDeleteLecture, + descSearchLecture = ""; + JRadioButton rdbtnImageNew; + JRadioButton rdbtnImageEdit; + JRadioButton rdbtnImageSearchDownload; + JRadioButton rdbtnLectureNew; + JRadioButton rdbtnImageDelete; + JRadioButton rdbtnLectureEdit; + JRadioButton rdbtnLectureDelete; + JRadioButton rdbtnLectureSearch; + private final ButtonGroup buttonGroup = new ButtonGroup(); + private JMenuItem mntmAbout; + + // for testing + ImageRights imageRights = new ImageRights(); + + /** + * Create the dialog. + */ + public MainMenue_GUI() { + + // Leerzeile auf Konsole bei Rueckkehr ins Hauptmenue fuer leichteres + // Lesen + System.out.println("\n"); + + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + System.exit(0); + } + }); + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("bwLehrpool Suite - Connected Server: " + + SessionData.session.getServerAdress()); + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 567, 69); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Hauptmen\u00FC"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("Bitte w\u00E4hlen Sie ihre gew\u00FCnschte Aktion."); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 22); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 104, 567, 502); + contentPanel.setBackground(SystemColor.menu); + + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panelImage = new JPanel(); + panelImage.setBackground(SystemColor.menu); + panelImage.setBorder(new TitledBorder(null, "Image", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panelImage.setBounds(10, 221, 270, 133); + contentPanel.add(panelImage); + panelImage.setLayout(null); + + rdbtnImageNew = new JRadioButton("Neu"); + rdbtnImageNew + .setToolTipText("Hier k\u00F6nnen Sie eine standard Laborvorlage downloaden"); + rdbtnImageNew.setBounds(20, 22, 159, 23); + panelImage.add(rdbtnImageNew); + buttonGroup.add(rdbtnImageNew); + rdbtnImageNew.setBackground(SystemColor.menu); + + rdbtnImageEdit = new JRadioButton("Bearbeiten"); + rdbtnImageEdit + .setToolTipText("Hier k\u00F6nnen Sie ein bestehendes Labor zum ver\u00E4ndern downloaden"); + rdbtnImageEdit.setBounds(20, 48, 185, 23); + panelImage.add(rdbtnImageEdit); + buttonGroup.add(rdbtnImageEdit); + rdbtnImageEdit.setHorizontalAlignment(SwingConstants.LEFT); + rdbtnImageEdit.setBackground(SystemColor.menu); + + rdbtnImageDelete = new JRadioButton("L\u00F6schen"); + rdbtnImageDelete.setEnabled(true); + buttonGroup.add(rdbtnImageDelete); + rdbtnImageDelete + .setToolTipText("Hier k\u00F6nnen Sie ein bestehendes Labor zum ver\u00E4ndern downloaden"); + rdbtnImageDelete.setHorizontalAlignment(SwingConstants.LEFT); + rdbtnImageDelete.setBackground(SystemColor.menu); + rdbtnImageDelete.setBounds(20, 74, 185, 23); + panelImage.add(rdbtnImageDelete); + + rdbtnImageSearchDownload = new JRadioButton("Suche und Download"); + buttonGroup.add(rdbtnImageSearchDownload); + rdbtnImageSearchDownload + .setToolTipText("Hier k\u00F6nnen Sie ein bestehendes Labor zum ver\u00E4ndern downloaden"); + rdbtnImageSearchDownload.setHorizontalAlignment(SwingConstants.LEFT); + rdbtnImageSearchDownload.setBackground(SystemColor.menu); + rdbtnImageSearchDownload.setBounds(20, 100, 185, 23); + panelImage.add(rdbtnImageSearchDownload); + + JPanel panelDesc = new JPanel(); + panelDesc.setLayout(null); + panelDesc.setBorder(new TitledBorder(UIManager + .getBorder("TitledBorder.border"), "Erkl\u00e4rung", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panelDesc.setBackground(SystemColor.menu); + panelDesc.setBounds(10, 364, 270, 133); + contentPanel.add(panelDesc); + + ScrollPane scrollPaneDesc = new ScrollPane(); + scrollPaneDesc.setBounds(10, 15, 250, 110); + final JTextArea txtDesc = new JTextArea(); + txtDesc.setEditable(false); + txtDesc.setBounds(280, 211, 10, 10); + txtDesc.setLineWrap(true); + txtDesc.setWrapStyleWord(true); + txtDesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); + txtDesc.setBackground(SystemColor.menu); + scrollPaneDesc.add(txtDesc); + // Pro AUswahl + txtDesc.setText("Legen Sie ein neues Image an und laden Sie anschlie\u00dfend die passende .vmdk-Datei hoch. Ein Image (wenn auch von einem anderen Dozenten) ist die Voraussetzung f\u00fcr eine Veranstaltung."); + panelDesc.add(scrollPaneDesc); + + JPanel panelVeranstaltung = new JPanel(); + panelVeranstaltung.setLayout(null); + panelVeranstaltung.setBorder(new TitledBorder(UIManager + .getBorder("TitledBorder.border"), "Veranstaltung (VMChooser)", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panelVeranstaltung.setBackground(SystemColor.menu); + panelVeranstaltung.setBounds(290, 221, 270, 133); + contentPanel.add(panelVeranstaltung); + + rdbtnLectureNew = new JRadioButton("Neu"); + buttonGroup.add(rdbtnLectureNew); + rdbtnLectureNew + .setToolTipText("Hier k\u00F6nnen Sie Ihre Labordaten eingeben"); + rdbtnLectureNew.setBounds(20, 24, 185, 23); + panelVeranstaltung.add(rdbtnLectureNew); + rdbtnLectureNew.setBackground(SystemColor.menu); + + rdbtnLectureEdit = new JRadioButton("Bearbeiten"); + rdbtnLectureEdit + .setToolTipText("Hier k\u00F6nnen Sie einen Link auf ein bestehendes Labor erzeugen"); + rdbtnLectureEdit.setBounds(20, 50, 230, 23); + panelVeranstaltung.add(rdbtnLectureEdit); + buttonGroup.add(rdbtnLectureEdit); + rdbtnLectureEdit.setBackground(SystemColor.menu); + + rdbtnLectureDelete = new JRadioButton("L\u00F6schen"); + rdbtnLectureDelete + .setToolTipText("Hier k\u00F6nnen Sie ein Labor l\u00F6schen"); + rdbtnLectureDelete.setBounds(20, 76, 175, 23); + panelVeranstaltung.add(rdbtnLectureDelete); + buttonGroup.add(rdbtnLectureDelete); + rdbtnLectureDelete.setBackground(SystemColor.menu); + + rdbtnLectureSearch = new JRadioButton("Suche"); + buttonGroup.add(rdbtnLectureSearch); + rdbtnLectureSearch + .setToolTipText("Hier k\u00F6nnen Sie ein Labor l\u00F6schen"); + rdbtnLectureSearch.setBackground(SystemColor.menu); + rdbtnLectureSearch.setBounds(20, 102, 175, 23); + panelVeranstaltung.add(rdbtnLectureSearch); + + JPanel panelNews = new JPanel(); + panelNews.setLayout(null); + panelNews.setBorder(new TitledBorder(UIManager + .getBorder("TitledBorder.border"), "News", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panelNews.setBackground(SystemColor.menu); + panelNews.setBounds(290, 364, 270, 133); + contentPanel.add(panelNews); + + ScrollPane scrollPaneNews = new ScrollPane(); + scrollPaneNews.setBounds(10, 15, 250, 110); + JTextArea txtNews = new JTextArea(); + txtNews.setEditable(false); + txtNews.setFont(new Font("Tahoma", Font.PLAIN, 11)); + txtNews.setBackground(SystemColor.menu); + txtNews.setWrapStyleWord(true); + txtNews.setLineWrap(true); + txtNews.setText("Hier werden mal die Neuigkeiten stehen. Diese kommen direkt vom Satelliten und sind HS-spezifisch."); + scrollPaneNews.add(txtNews); + panelNews.add(scrollPaneNews); + + /* + * Ber\u00fccksichtigen der Rechte für GUI + */ + // set the rights for this user + setRoleRights(); + processRights(); + setCorrectRadioButton(); + + /* + * Funktion Texte f\u00fcr das Klicken der RadioButtons + */ + rdbtnImageNew.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + descNewImage = "Legen Sie ein neues Image an und laden Sie anschlie\u00dfend die passende .vmdk-Datei hoch. Ein Image (wenn auch von einem anderen Dozenten) ist die Voraussetzung f\u00fcr eine Veranstaltung."; + txtDesc.setText(descNewImage); + } + }); + rdbtnImageEdit.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + descEditImage = "Bearbeiten Sie die hinterlegten Informationen zu einem Image oder laden Sie eine neue .vmdk-Datei hoch."; + txtDesc.setText(descEditImage); + } + }); + rdbtnImageDelete.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + descDeleteImage = "Suchen Sie alte und nicht mehr ben\u00f6tigte Images und l\u00f6schen Sie diese."; + txtDesc.setText(descDeleteImage); + } + }); + rdbtnImageSearchDownload.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + descSearchImage = "Suchen Sie nach bestimmten Images oder verschaffen Sie sich einen \u00fcberblick \u00fcber alle verf\u00fcgbaren Images. Sie k\u00f6nnen gew\u00fcnschte Images umgehend herunterladen."; + txtDesc.setText(descSearchImage); + } + }); + rdbtnLectureNew.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + descNewLecture = "Legen Sie eine neue Veranstaltung an und verkn\u00fcpfen Sie diese mit einem bereits vorhandenem Image. Ihre neue Veranstaltung kann auch auf dem Image eines anderen Dozenten beruhen."; + txtDesc.setText(descNewLecture); + } + }); + rdbtnLectureEdit.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + descEditLecture = "Bearbeiten Sie die hinterlegten Informationen zu einer Veranstaltung."; + txtDesc.setText(descEditLecture); + } + }); + rdbtnLectureDelete.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + descDeleteLecture = "Suchen und l\u00f6schen Sie eine Veranstaltung. Das hiermit verbundene Image bleibt erhalten."; + txtDesc.setText(descDeleteLecture); + } + }); + rdbtnLectureSearch.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + descSearchLecture = "Suchen Sie nach bestimmten Veranstaltungen oder verschaffen Sie sich einen \u00fcberblick \u00fcber alle verf\u00fcgbaren Veranstaltungen. Eventuell gibt es bereits etwas passendes f\u00fcr Ihre Vorlesung."; + txtDesc.setText(descSearchLecture); + } + }); + /* + * Ende der Radiobuttons + */ + + JLabel lblGrafik = new JLabel(""); + // ToolTipp fuer Grafik + lblGrafik + .setToolTipText("" + + "Ein virtuelles Labor besteht immer aus den beiden Komponenten
" + + "Image und Veranstaltung. Ein Image ist dabei die Grundlage f\u00FCr
" + + "mehrere Veranstaltungen. Somit kann eine neue Veranstaltung
" + + "erstellt werden, ohne ein neues Image hochladen zu m\u00FCssen.


" + + "Image: Das Image enth\u00E4lt die ben\u00F6tigte Software, die im
" + + "virtuellen Labor ben\u00F6tigt wird. Es wird von genau einem Dozenten
" + + "angelegt und besitzt einen allgemeinen Namen, z.B. \"Programmieren\".
" + + "Bei einem Image handelt es sich um eine Datei vom Typ VMDK.


" + + "Veranstaltung: Es k\u00F6nnen nun, basierend auf einem Image,
" + + " beliebig viele Veranstaltungen von unterschiedlichen Dozenten erstellt
" + + "werden. Diese k\u00F6nnten z.B. konkret \"Web-Entwicklung\" oder \"K\u00FCnstliche
" + + "Intelligenz\" lauten und referenzieren dabei auf das allgemeine Image
" + + "\"Programmieren\"."); + lblGrafik.setIcon(new ImageIcon(MainMenue_GUI.class + .getResource("/img/e4_n_imgs2_bwl_vmc_v2.png"))); + + // ToolTipp lange anzeigen - 60sec + ToolTipManager.sharedInstance().setDismissDelay(60000); + ToolTipManager.sharedInstance().registerComponent(lblGrafik); + lblGrafik.setBounds(10, -12, 547, 189); + contentPanel.add(lblGrafik); + + JTextPane txtpnUmDetaillierteInformationen = new JTextPane(); + txtpnUmDetaillierteInformationen + .setText("Um detaillierte Informationen zu erhalten, fahren Sie bitte mit der Maus \u00FCber die Grafik."); + txtpnUmDetaillierteInformationen.setEditable(false); + txtpnUmDetaillierteInformationen.setBackground(SystemColor.menu); + txtpnUmDetaillierteInformationen.setBounds(10, 188, 509, 22); + contentPanel.add(txtpnUmDetaillierteInformationen); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 630, 587, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton continueButton = new JButton("Weiter"); + + continueButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + // Images + if (rdbtnImageNew.isSelected() == true) { + CreateImageAllgemein_GUI sr = new CreateImageAllgemein_GUI(); + sr.setVisible(true); + dispose(); + } else if (rdbtnImageEdit.isSelected() == true) { + SearchEditImage_GUI si = new SearchEditImage_GUI(); + si.setVisible(true); + dispose(); + } else if (rdbtnImageDelete.isSelected() == true) { + DeleteImage_GUI di = new DeleteImage_GUI(); + di.setVisible(true); + dispose(); + } else if (rdbtnImageSearchDownload.isSelected() == true) { + // SearchMethodLecture_GUI sm = new + // SearchMethodLecture_GUI(); + SearchImage_GUI si = new SearchImage_GUI(); + si.setVisible(true); + dispose(); + // Lectures + } else if (rdbtnLectureNew.isSelected() == true) { + CreateLectureAllgemein_GUI av = new CreateLectureAllgemein_GUI(); + av.setVisible(true); + dispose(); + } else if (rdbtnLectureEdit.isSelected() == true) { + EditLectureSearch_GUI el = new EditLectureSearch_GUI(); + el.setVisible(true); + dispose(); + } else if (rdbtnLectureDelete.isSelected() == true) { + DeleteLecture_GUI dl = new DeleteLecture_GUI(); + dl.setVisible(true); + dispose(); + } else if (rdbtnLectureSearch.isSelected() == true) { + SearchLecture_GUI sl = new SearchLecture_GUI(); + sl.setVisible(true); + dispose(); + } else + JOptionPane.showMessageDialog(null, + "Keine Auswahl getroffen.", + "Auswahl fehlt", JOptionPane.ERROR_MESSAGE); + } + }); + continueButton.setActionCommand("OK"); + buttonPane.add(continueButton); + getRootPane().setDefaultButton(continueButton); + } + } + { + JSeparator separator = new JSeparator(); + separator.setBounds(0, 617, 587, 2); + getContentPane().add(separator); + } + { + JSeparator separator = new JSeparator(); + separator.setBounds(0, 91, 587, 2); + getContentPane().add(separator); + } + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + OpenLinks open = new OpenLinks(); + URI windows; + try { + windows = new URI(Links.getFAQ()); + open.openWebpage(windows); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + OpenLinks open = new OpenLinks(); + URI windows; + try { + windows = new URI(Links.getOTRS()); + open.openWebpage(windows); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmOtrs); + + mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAbout); + + }// end main + + private void processRights() { + + /* + * Legt anhand der Rolle fest, welche Operationen der user machen darf. + * Rolle kommt vom Masterserver + */ + + // Image + if (person.verantwortlicher.getRole().equals("Student")) { + rdbtnImageNew.setEnabled(false); + rdbtnImageEdit.setEnabled(false); + rdbtnImageDelete.setEnabled(false); + rdbtnImageSearchDownload.setEnabled(true); + } else if (person.verantwortlicher.getRole().equals("Dozent") + || person.verantwortlicher.getRole().equals("Admin")) { + rdbtnImageNew.setEnabled(true); + rdbtnImageEdit.setEnabled(true); + rdbtnImageDelete.setEnabled(true); + rdbtnImageSearchDownload.setEnabled(true); + } else { + rdbtnImageNew.setEnabled(false); + rdbtnImageEdit.setEnabled(false); + rdbtnImageDelete.setEnabled(false); + rdbtnImageSearchDownload.setEnabled(false); + } + + // Veranstaltung + if (person.verantwortlicher.getRole().equals("Student")) { + rdbtnLectureNew.setEnabled(false); + rdbtnLectureEdit.setEnabled(false); + rdbtnLectureDelete.setEnabled(false); + rdbtnLectureSearch.setEnabled(true); + } else if (person.verantwortlicher.getRole().equals("Dozent") + || person.verantwortlicher.getRole().equals("Admin")) { + rdbtnLectureNew.setEnabled(true); + rdbtnLectureEdit.setEnabled(true); + rdbtnLectureDelete.setEnabled(true); + rdbtnLectureSearch.setEnabled(true); + } else { + rdbtnLectureNew.setEnabled(false); + rdbtnLectureEdit.setEnabled(false); + rdbtnLectureDelete.setEnabled(false); + rdbtnLectureSearch.setEnabled(false); + } + + }// end processRights() + + public void setRoleRights() { + // Set rights for user, depending on the role that is returned by the + // masterserver + + System.out.println("Ihre Rolle ist nun: " + + person.verantwortlicher.getRole()); + // role==Student + if (person.verantwortlicher.getRole().equals("Student")) { + ImageRights.rights.setRead(1); + ImageRights.rights.setWrite(0); + ImageRights.rights.setChangePermission(0); + ImageRights.rights.setAdmin(0); + ImageRights.rights.setLinkAllowed(0); + System.out.println("Rechte (r,w,cp,a,la): " + + ImageRights.rights.getRead() + "," + + ImageRights.rights.getWrite() + "," + + ImageRights.rights.getChangePermission() + "," + + ImageRights.rights.getAdmin() + "," + + ImageRights.rights.getLinkAllowed()); + + } else if (person.verantwortlicher.getRole().equals("Dozent")) { // role==Dozent + ImageRights.rights.setRead(1); + ImageRights.rights.setWrite(1); + ImageRights.rights.setChangePermission(0); + ImageRights.rights.setAdmin(0); + ImageRights.rights.setLinkAllowed(1); + System.out.println("Rechte (r,w,cp,a,la): " + + ImageRights.rights.getRead() + "," + + ImageRights.rights.getWrite() + "," + + ImageRights.rights.getChangePermission() + "," + + ImageRights.rights.getAdmin() + "," + + ImageRights.rights.getLinkAllowed()); + } else if (person.verantwortlicher.getRole().equals("Admin")) { // role==Admin + ImageRights.rights.setRead(1); + ImageRights.rights.setWrite(1); + ImageRights.rights.setChangePermission(1); + ImageRights.rights.setAdmin(1); + ImageRights.rights.setLinkAllowed(1); + System.out.println("Rechte (r,w,cp,a,la): " + + ImageRights.rights.getRead() + "," + + ImageRights.rights.getWrite() + "," + + ImageRights.rights.getChangePermission() + "," + + ImageRights.rights.getAdmin() + "," + + ImageRights.rights.getLinkAllowed()); + } else { // role==Nothing + ImageRights.rights.setRead(0); + ImageRights.rights.setWrite(0); + ImageRights.rights.setChangePermission(0); + ImageRights.rights.setAdmin(0); + ImageRights.rights.setLinkAllowed(0); + System.out.println("Rechte (r,w,cp,a,la): " + + ImageRights.rights.getRead() + "," + + ImageRights.rights.getWrite() + "," + + ImageRights.rights.getChangePermission() + "," + + ImageRights.rights.getAdmin() + "," + + ImageRights.rights.getLinkAllowed()); + }// end if else + }// end setRoleRights + + public void setCorrectRadioButton() { + // get the first enabled RadioButton depending on role an rights. Start + // at top + + if (rdbtnImageNew.isEnabled() == true) { + rdbtnImageNew.setSelected(true); + } else if (rdbtnImageEdit.isEnabled() == true) { + rdbtnImageEdit.setSelected(true); + } else if (rdbtnImageDelete.isEnabled() == true) { + rdbtnImageDelete.setSelected(true); + } else if (rdbtnImageSearchDownload.isEnabled() == true) { + rdbtnImageSearchDownload.setSelected(true); + } else if (rdbtnLectureNew.isEnabled() == true) { + rdbtnLectureNew.setSelected(true); + } else if (rdbtnLectureEdit.isEnabled() == true) { + rdbtnLectureEdit.setSelected(true); + } else if (rdbtnLectureDelete.isEnabled() == true) { + rdbtnLectureDelete.setSelected(true); + } else if (rdbtnLectureSearch.isEnabled() == true) { + rdbtnLectureSearch.setSelected(true); + } + + }// end setCorrectRadioButton() +}// end class diff --git a/dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java b/dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java new file mode 100644 index 00000000..d5350fbd --- /dev/null +++ b/dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java @@ -0,0 +1,274 @@ +package gui.intro; + + +import java.awt.Desktop; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.JTextPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +import models.Links; + +import org.ini4j.InvalidFileFormatException; +import org.ini4j.Wini; + +import util.GuiOrganizer; +import util.OpenLinks; + + +@SuppressWarnings("serial") +public class VmWareLink_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JCheckBox chckbxNewCheckBox; + private JButton btnWindows; + + + /** + * Create the dialog. + */ + public VmWareLink_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + System.exit(0); + } + }); + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("bwLehrpool Suite"); + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBounds(0, 0, 577, 80); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Hinweis VMWare Player"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 42); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 104, 567, 502); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JTextPane txtpnUmIhreVmdk = new JTextPane(); + txtpnUmIhreVmdk.setBackground(SystemColor.menu); + txtpnUmIhreVmdk.setEditable(false); + txtpnUmIhreVmdk.setText("F\u00FCr die Arbeit mit der bwLehrpool Suite wird zwingend ein VMWare Player ben\u00F6tigt. Diesen k\u00F6nnen Sie sich unter folgendem Link kostenfrei downloaden."); + txtpnUmIhreVmdk.setBounds(10, 16, 499, 66); + contentPanel.add(txtpnUmIhreVmdk); + + JLabel lblNewLabel_1 = new JLabel("Windows: "); + lblNewLabel_1.setBounds(10, 93, 499, 14); + contentPanel.add(lblNewLabel_1); + + chckbxNewCheckBox = new JCheckBox("Diese Benachrichtigung nicht mehr anzeigen."); + chckbxNewCheckBox.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent arg0) { + if(chckbxNewCheckBox.isSelected()==true) + { + try { + Wini ini=new Wini(new File("C:\\Users\\"+System.getProperty("user.name")+"\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + ini.put("main", "vmware",true); + ini.store(); + } catch (InvalidFileFormatException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + JOptionPane.showMessageDialog(null, + e1.getCause()+"\n"+e1.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } catch (IOException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + JOptionPane.showMessageDialog(null, + e1.getCause()+"\n"+e1.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } + } + } + }); + chckbxNewCheckBox.setBounds(6, 472, 555, 23); + contentPanel.add(chckbxNewCheckBox); + + JLabel lbllinuxvmwarePlayer = new JLabel("Linux: "); + lbllinuxvmwarePlayer.setBounds(10, 178, 499, 14); + contentPanel.add(lbllinuxvmwarePlayer); + + btnWindows = new JButton("VMware Player herunterladen"); + btnWindows.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + try { + + OpenLinks open = new OpenLinks(); + + URI windows= new URI(Links.getUriWindows()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + btnWindows.setBounds(10, 119, 186, 23); + contentPanel.add(btnWindows); + + JButton btnLinux = new JButton("VMware Player herunterladen"); + btnLinux.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + try { + OpenLinks open = new OpenLinks(); + + URI linux= new URI(Links.getUriLinux()); + + open.openWebpage(linux); + + } catch (URISyntaxException f) { + // TODO Auto-generated catch block + f.printStackTrace(); + } + } + }); + btnLinux.setBounds(10, 203, 186, 23); + contentPanel.add(btnLinux); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 630, 587, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton cancelButton = new JButton("Weiter"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + MainMenue_GUI ea=new MainMenue_GUI(); + ea.setVisible(true); + dispose(); + } + }); + cancelButton.setActionCommand("Cancel"); + buttonPane.add(cancelButton); + } + } + { + JSeparator separator = new JSeparator(); + separator.setBounds(0, 617, 587, 2); + getContentPane().add(separator); + } + { + JSeparator separator = new JSeparator(); + separator.setBounds(0, 91, 587, 2); + getContentPane().add(separator); + } + { + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + { + JMenu mnHilfe = new JMenu("Hilfe"); + menuBar.add(mnHilfe); + { + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + + mnHilfe.add(mntmFaq); + } + { + JMenuItem mntmOTRS = new JMenuItem("OTRS"); + mntmOTRS.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + + mnHilfe.add(mntmOTRS); + } + } + } + + + + }//end constructor + + + +}// end class diff --git a/dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java b/dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java new file mode 100644 index 00000000..76bf3933 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java @@ -0,0 +1,579 @@ +package gui.lecture; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.ScrollPane; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JSeparator; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; + +import models.Image; +import models.Lecture; +import models.Links; +import models.person; +import util.GuiOrganizer; +import util.OpenLinks; + +import com.toedter.calendar.JDateChooser; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeEvent; + +@SuppressWarnings("serial") +public class CreateLectureAllgemein_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + private JTextField Vorname; + private JTextField Nachname; + private JTextField Hochschule; + private JTextField EMail; + private JTextField txtFldVeranstaltungsname; + JTextArea description; + JRadioButton radioButtonyes; + JRadioButton radioButtonno; + JDateChooser dateChooserend; + JDateChooser dateChooserstart; + Date startDate = new Date(); + Date endDate; + private boolean descriptionLengthOK = false; // description may not be + // longer than + // MAX_DESCRIPTION_LENGTH + private final int MAX_DESCRIPTION_LENGTH = 254; + + int maxLifeTime = 180; // Anzahl Tage, die eine Veranstaltung in der Zukunft + // aktiv sein darf + boolean isDateOrderCorrect, isDateMaxLifeTimeCorrect, + isAllInformationReady = false; + + /** + * Create the dialog. + */ + public CreateLectureAllgemein_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + System.exit(0); + } + + @Override + public void windowOpened(WindowEvent arg0) { + txtFldVeranstaltungsname.requestFocusInWindow(); + } + }); + setResizable(false); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("bwLehrpool Suite - Veranstaltung erzeugen"); + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Eingabe Ihrer Daten"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 21); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 493); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 331, 557, 162); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel label = new JLabel("Vorname: *"); + label.setBackground(SystemColor.menu); + label.setBounds(10, 33, 125, 20); + panel_1.add(label); + + Vorname = new JTextField(); + Vorname.setEditable(false); + Vorname.setEnabled(false); + Vorname.setText(person.verantwortlicher.getVorname()); + Vorname.setBackground(Color.WHITE); + Vorname.setColumns(10); + Vorname.setBounds(145, 33, 350, 20); + panel_1.add(Vorname); + + JLabel label_7 = new JLabel("Nachname: *"); + label_7.setBackground(SystemColor.menu); + label_7.setBounds(10, 64, 125, 20); + panel_1.add(label_7); + + Nachname = new JTextField(); + Nachname.setEnabled(false); + Nachname.setEditable(false); + Nachname.setText(person.verantwortlicher.getName()); + Nachname.setBackground(Color.WHITE); + Nachname.setColumns(10); + Nachname.setBounds(145, 64, 350, 20); + panel_1.add(Nachname); + + JLabel label_8 = new JLabel("Hochschule: *"); + label_8.setBackground(SystemColor.menu); + label_8.setBounds(10, 95, 125, 20); + panel_1.add(label_8); + + Hochschule = new JTextField(); + Hochschule.setEnabled(false); + Hochschule.setEditable(false); + Hochschule.setText(person.verantwortlicher.getHochschule()); + Hochschule.setBackground(Color.WHITE); + Hochschule.setColumns(10); + Hochschule.setBounds(145, 95, 350, 20); + panel_1.add(Hochschule); + + JLabel label_9 = new JLabel("E-Mail: *"); + label_9.setBackground(SystemColor.menu); + label_9.setBounds(10, 126, 125, 20); + panel_1.add(label_9); + + EMail = new JTextField(); + EMail.setEnabled(false); + EMail.setEditable(false); + EMail.setText(person.verantwortlicher.getEMail()); + EMail.setBackground(Color.WHITE); + EMail.setColumns(10); + EMail.setBounds(145, 126, 350, 20); + panel_1.add(EMail); + + JPanel panel = new JPanel(); + panel.setBounds(10, 402, 577, 33); + contentPanel.add(panel); + panel.setLayout(null); + panel.setBorder(new EmptyBorder(5, 5, 5, 5)); + panel.setBackground(SystemColor.menu); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + + CreateLectureAllgemein_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Veranstaltung"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 70, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(161, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Neu"); + lblNewLabel_1.setBounds(174, 11, 46, 14); + contentPanel.add(lblNewLabel_1); + + JPanel panel_2 = new JPanel(); + panel_2.setLayout(null); + panel_2.setBorder(new TitledBorder(null, "Veranstaltungsdaten", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_2.setBackground(SystemColor.menu); + panel_2.setBounds(10, 36, 557, 284); + contentPanel.add(panel_2); + + JLabel lblAnzeigename = new JLabel("Anzeigename: *"); + lblAnzeigename.setBounds(10, 25, 180, 14); + panel_2.add(lblAnzeigename); + + txtFldVeranstaltungsname = new JTextField(); + txtFldVeranstaltungsname.setColumns(10); + txtFldVeranstaltungsname.setBounds(200, 22, 347, 20); + txtFldVeranstaltungsname.setText(Lecture.lecture.getName()); + panel_2.add(txtFldVeranstaltungsname); + + JTextArea textArea = new JTextArea(); + textArea.setEditable(false); + textArea.setWrapStyleWord(true); + textArea.setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an. Dieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\""); + textArea.setLineWrap(true); + textArea.setFont(new Font("Tahoma", Font.PLAIN, 12)); + textArea.setBackground(SystemColor.menu); + textArea.setBounds(10, 49, 537, 49); + panel_2.add(textArea); + + JLabel lblDesc = new JLabel("Beschreibung: *"); + lblDesc.setBounds(10, 111, 180, 14); + panel_2.add(lblDesc); + + ScrollPane scrollPane = new ScrollPane(); + scrollPane.setBounds(200, 104, 347, 78); + panel_2.add(scrollPane); + description = new JTextArea(); + description.setFont(new Font("Tahoma", Font.PLAIN, 11)); + description.setLineWrap(true); + description.setText(Lecture.lecture.getDesc()); + scrollPane.add(description); + description.setBounds(0, 0, 4, 22); + scrollPane.add(description); + dateChooserstart = new JDateChooser(); + dateChooserstart + .addPropertyChangeListener(new PropertyChangeListener() { + public void propertyChange(PropertyChangeEvent arg0) { + endDate = addDays(dateChooserstart.getDate(), + maxLifeTime); // Datum darf weiter als 6 + // Monate in der Zukunft + // liegen + } + }); + if (Lecture.lecture.getStartdate() == null) { + // is not defined yet + dateChooserstart.setDate(startDate); + } else { + // already defined from last visit on this page + dateChooserstart.setDate(Lecture.lecture.getStartdate()); + } + dateChooserstart.setDateFormatString("yyyy-MM-dd HH:mm:ss"); + dateChooserstart.setBounds(226, 188, 143, 20); + panel_2.add(dateChooserstart); + + dateChooserend = new JDateChooser(); + endDate = addDays(dateChooserstart.getDate(), maxLifeTime); // Datum + // darf + // weiter + // als 6 + // Monate in der Zukunft + // liegen + dateChooserend.setDate(endDate); + if (Lecture.lecture.getEnddate() == null) { + // is not defined yet + dateChooserend.setDate(endDate); + } else { + // already defined from last visit on this page + dateChooserend.setDate(Lecture.lecture.getEnddate()); + } + dateChooserend.setDateFormatString("yyyy-MM-dd HH:mm:ss"); + dateChooserend.setBounds(404, 188, 143, 20); + panel_2.add(dateChooserend); + + JLabel lblBis = new JLabel("bis:"); + lblBis.setBounds(378, 188, 21, 20); + panel_2.add(lblBis); + + JLabel label_6 = new JLabel("von:"); + label_6.setBounds(200, 188, 30, 20); + panel_2.add(label_6); + + JLabel label_10 = new JLabel("G\u00FCltigkeitsdatum: *"); + label_10.setBounds(10, 194, 127, 14); + panel_2.add(label_10); + + JLabel label_11 = new JLabel("Aktiv:"); + label_11.setBounds(10, 229, 127, 14); + panel_2.add(label_11); + + radioButtonyes = new JRadioButton("Ja"); + radioButtonyes.setSelected(true); + radioButtonyes.setBounds(200, 225, 73, 23); + panel_2.add(radioButtonyes); + + radioButtonno = new JRadioButton("Nein"); + radioButtonyes.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + radioButtonyes.setSelected(true); + radioButtonno.setSelected(false); + } + }); + radioButtonno.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + radioButtonno.setSelected(true); + radioButtonyes.setSelected(false); + } + }); + radioButtonno.setBounds(296, 225, 73, 23); + panel_2.add(radioButtonno); + + JLabel lblimVmchooserSichtbar = new JLabel("(im VMChooser sichtbar)"); + lblimVmchooserSichtbar.setBounds(10, 245, 127, 14); + panel_2.add(lblimVmchooserSichtbar); + + JLabel lblmaxMonate = new JLabel("(max. 6 Monate)"); + lblmaxMonate.setBounds(10, 208, 127, 14); + panel_2.add(lblmaxMonate); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton backButton = new JButton("Zur\u00FCck"); + backButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + if (radioButtonyes.isSelected() == true) { + Lecture.lecture.setActive(true); + } else { + Lecture.lecture.setActive(false); + } + + Lecture.lecture.setName(txtFldVeranstaltungsname + .getText()); + Lecture.lecture.setDesc(description.getText()); + Lecture.lecture.setEnddate(dateChooserend.getDate()); + Lecture.lecture.setStartdate(dateChooserstart.getDate()); + Image.image.setImagename(txtFldVeranstaltungsname + .getText()); + + MainMenue_GUI sr = new MainMenue_GUI(); + sr.setVisible(true); + dispose(); + } + }); + backButton.setActionCommand("Cancel"); + buttonPane.add(backButton); + getRootPane().setDefaultButton(backButton); + } + { + JButton continueButton = new JButton("Weiter"); + continueButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + // liegt das End-Datum vor dem Start-Datum? + if (dateChooserend.getDate().before( + dateChooserstart.getDate())) { + // datum ist falsch rum + isDateOrderCorrect = false; + JOptionPane + .showMessageDialog( + null, + "Das End-Datum liegt vor dem Start-Datum. Bitte \u00e4ndern.", + "Datum fehlerhaft", + JOptionPane.INFORMATION_MESSAGE); + } else { + // bereit + isDateOrderCorrect = true; + } + // liegt das eingegebene Datum nach dem erlaubten + // End-Datum? + if (dateChooserend.getDate().after(endDate)) { + // Datum zu weit weg + isDateMaxLifeTimeCorrect = false; + JOptionPane.showMessageDialog(null, + "Das End-Datum liegt zu weit in der Zukunft. Erlaubt ist maximal:\n" + + endDate, "Datum fehlerhaft", + JOptionPane.INFORMATION_MESSAGE); + + dateChooserend.setDate(endDate); // setze Datum auf + // maximum + } else { + // bereit + isDateMaxLifeTimeCorrect = true; + } + // Pruefen ob alles eingegeben wurde + if (txtFldVeranstaltungsname.getText().isEmpty() == true + || description.getText().isEmpty() == true) { + // mind 1 Textfeld ist leer + isAllInformationReady = false; + JOptionPane + .showMessageDialog( + null, + "Bitte geben Sie einen Veranstaltungsnamen und eine Beschreibung ein.", + "Datum fehlerhaft", + JOptionPane.INFORMATION_MESSAGE); + } else { + // Textfelder bereit + isAllInformationReady = true; + } + + // welcher Radiobutton ist geklickt? + if (radioButtonyes.isSelected() == true) { + Lecture.lecture.setActive(true); + } else { + Lecture.lecture.setActive(false); + } + // Pruefe ob alle Eingaben korrekt sind, dann mache + // weiter + if (isAllInformationReady == true + && isDateMaxLifeTimeCorrect == true + && isDateOrderCorrect == true + && descriptionLenghtOK() == true) { + // everything is ok, proceed + Lecture.lecture.setName(txtFldVeranstaltungsname + .getText()); + Lecture.lecture.setDesc(description.getText()); + Lecture.lecture.setEnddate(dateChooserend.getDate()); + Lecture.lecture.setStartdate(dateChooserstart + .getDate()); + + Image.image.setImagename(txtFldVeranstaltungsname + .getText()); + + PermissionCreateLecture_GUI ev = new PermissionCreateLecture_GUI(); + ev.setVisible(true); + dispose(); + } + + } + }); + continueButton.setActionCommand("OK"); + buttonPane.add(continueButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 78, 597, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + getContentPane().add(separator_1); + + JLabel lblPflichtfelder = new JLabel("* Pflichtfelder"); + lblPflichtfelder.setBounds(32, 602, 136, 14); + getContentPane().add(lblPflichtfelder); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu = new JMenu("Suchen"); + menuBar.add(mnNewMenu); + + JMenuItem mntmVlSuche = new JMenuItem("VL Suche"); + mnNewMenu.add(mntmVlSuche); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + OpenLinks open = new OpenLinks(); + URI windows; + try { + windows = new URI(Links.getFAQ()); + open.openWebpage(windows); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + open.openWebpage(windows); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem mnmtAbout = new JMenuItem("About"); + mnmtAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mnmtAbout); + + } + + public Date addDays(Date date, int days) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + cal.add(Calendar.DATE, days); // minus number would decrement the days + return cal.getTime(); + }// end addDays() + + public boolean descriptionLenghtOK() { + descriptionLengthOK = false; + + // max length is 254 chars + if (description.getText().length() >= MAX_DESCRIPTION_LENGTH) { + descriptionLengthOK = false; + JOptionPane.showMessageDialog(null, + "Die Beschreibung darf max 254 Zeichen enthalten. Aktuell enthält sie " + + description.getText().length() + ".", + "Beschreibung zu umfangreich", + JOptionPane.INFORMATION_MESSAGE); + } else { + descriptionLengthOK = true; + + } + + return descriptionLengthOK; + }// enddescriptionLenghtOK() + +}// end class diff --git a/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java b/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java new file mode 100644 index 00000000..f4d1bdd8 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java @@ -0,0 +1,1013 @@ +package gui.lecture; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JSeparator; +import javax.swing.JTabbedPane; +import javax.swing.JTable; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.RowFilter; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableModel; +import javax.swing.table.TableRowSorter; + +import models.Lecture; +import models.Links; +import models.person; + +import org.apache.thrift.TException; + +import server.Server.Client; +import thrift.ThriftConnection; +import util.GuiOrganizer; +import util.OpenLinks; +import javax.swing.event.ChangeListener; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; + +@SuppressWarnings("serial") +public class CreateLectureLink_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JRadioButton rdbtnInternetJa; + JRadioButton rdbtnInternetNein; + JComboBox comboBox; + JTabbedPane tabbedPane; + JLabel labelName; + JLabel labelUpdate; + JLabel labelVerantwortlicher; + JLabel labelWeitereVerantwortliche; + JLabel labelVorlage; + JLabel labelLizenzSoftware; + JLabel labelInternet; + JLabel labelRam; + JLabel labelCPU; + JLabel labelID; + JLabel labelVersion; + JTextArea textAreadesc; + private JLabel labelOS; + JTable tableAllImages = new JTable(); + JTable tablemyImages = new JTable(); + JTable tableCoopImages = new JTable(); + JTable tablePublicVorlagen = new JTable(); + boolean activeSearch=false; + private JTextField textFieldName; + String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung", + "Verantwortlicher", "Letztes Update", "ID", "Version","Template" }; + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); + final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){ + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0){ + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final DefaultTableModel modelPublicVorlagen = new DefaultTableModel(titles, 0){ + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final TableRowSorter rowSorterAll = new TableRowSorter( + modelAll); + final TableRowSorter rowSorterMyImages = new TableRowSorter( + modelMyImages); + final TableRowSorter rowSorterPublicVorlagen = new TableRowSorter( + modelPublicVorlagen); + private JTextField textField; + + /** + * Create the dialog. + */ + public CreateLectureLink_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + con.closeThriftConnection(); + System.exit(0); + } + + @Override + public void windowOpened(WindowEvent arg0) { + try { + initTableModel(modelMyImages); + initTableModel(modelAll); + initTableModel(modelPublicVorlagen); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + // auszublendende Angaben + // 1=Lizenzpflichtig + // 3=Veranstaltung + // 6=ID + // 7=Version + // 8=Template + tablemyImages.getColumnModel().getColumn(1).setWidth(0); + tablemyImages.getColumnModel().getColumn(1).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(3).setWidth(0); + tablemyImages.getColumnModel().getColumn(3).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(3).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(8).setWidth(0); + tablemyImages.getColumnModel().getColumn(8).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(6).setWidth(0); + tablemyImages.getColumnModel().getColumn(6).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(7).setWidth(0); + tablemyImages.getColumnModel().getColumn(7).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0); + + tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(1).setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(1).setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(3).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(3).setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(3).setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8).setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8).setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6).setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6).setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7).setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7).setMaxWidth(0); + + tableAllImages.getColumnModel().getColumn(1).setWidth(0); + tableAllImages.getColumnModel().getColumn(1).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(3).setWidth(0); + tableAllImages.getColumnModel().getColumn(3).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(3).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(8).setWidth(0); + tableAllImages.getColumnModel().getColumn(8).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(6).setWidth(0); + tableAllImages.getColumnModel().getColumn(6).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(7).setWidth(0); + tableAllImages.getColumnModel().getColumn(7).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0); + textFieldName.requestFocusInWindow(); + } + }); + setResizable(false); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("bwLehrpool Suite - Veranstaltung erzeugen"); + setBounds(0, 0, 918, 722); + GuiOrganizer.centerGUI(this); + + + final DefaultTableModel model = new DefaultTableModel(titles, 0); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 892, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Image verlinken"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("W\u00E4hlen Sie bitte ein Image aus, auf dem Ihre Versanstaltung basiert."); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 531); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 49, 557, 92); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel lblNewLabel_2 = new JLabel("Anzeigename:"); + lblNewLabel_2.setBounds(10, 30, 80, 20); + panel_1.add(lblNewLabel_2); + + JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:"); + lblInternetIstInnerhalb.setBounds(10, 58, 80, 20); + panel_1.add(lblInternetIstInnerhalb); + + textFieldName = new JTextField(); + textFieldName.addKeyListener(new KeyAdapter() { + @Override + public void keyReleased(KeyEvent e) { + String stext = textFieldName.getText(); + // Wenn Textfield nicht leer + if (stext != "") { + activeSearch=true; + // Filtere nach der Eingabe + rowSorterAll.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + + }else{ + activeSearch=false; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + "true", 8)); + rowSorterAll.setRowFilter(null); + } + + } + + }); + + textFieldName.setBounds(96, 30, 166, 20); + panel_1.add(textFieldName); + textFieldName.setColumns(10); + + + comboBox = new JComboBox(); + try { + List list = client.getAllOS(); + comboBox.addItem(""); + for (int i = 0; i < list.size(); i++) { + comboBox.addItem(list.get(i)); + } + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + JOptionPane.showMessageDialog(null, + e.getCause()+"\n"+e.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } + comboBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + // Prueft das die Auswahl nicht leer ist + if (comboBox.getSelectedItem().toString() != "") { + activeSearch=true; + rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox + .getSelectedItem().toString(), 2)); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + comboBox.getSelectedItem().toString(), 2)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + comboBox.getSelectedItem().toString(), 2)); + }else{ + activeSearch=false; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + "true", 8)); + rowSorterAll.setRowFilter(null); + } + } + }); + comboBox.setBounds(96, 58, 166, 20); + panel_1.add(comboBox); + + JLabel label_3 = new JLabel("Beschreibung:"); + label_3.setBounds(291, 30, 80, 20); + panel_1.add(label_3); + + textField = new JTextField(); + textField.setColumns(10); + textField.setBounds(381, 30, 166, 20); + panel_1.add(textField); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + + CreateLectureLink_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Veranstaltung"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 76, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(151, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Imageauswahl"); + lblNewLabel_1.setBounds(164, 11, 85, 14); + contentPanel.add(lblNewLabel_1); + + tabbedPane = new JTabbedPane(JTabbedPane.TOP); + tabbedPane.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent arg0) { + if (tabbedPane.getSelectedIndex() == 0 && activeSearch==false) { + + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + }else if(tabbedPane.getSelectedIndex()==1 && activeSearch==false){ + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter("true", 8)); + } else if(tabbedPane.getSelectedIndex()==2 && activeSearch==false){ + rowSorterAll.setRowFilter(null); + } + + } + + }); + + tabbedPane.setBounds(10, 152, 557, 345); + contentPanel.add(tabbedPane); + + JScrollPane scrollPaneMyImage = new JScrollPane(); + tablemyImages.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + String imageid = modelMyImages + .getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 6) + .toString(); + //System.out.println(imageid); + String version = modelMyImages + .getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 7) + .toString(); + //System.out.println(version); + try { + writeImageData(imageid, version); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); + tablemyImages.setModel(modelMyImages); + tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit(); + tablemyImages.setRowSorter(rowSorterMyImages); + + scrollPaneMyImage.setViewportView(tablemyImages); + tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null); + + JScrollPane scrollPaneCoopImages = new JScrollPane(); + + tableCoopImages.setModel(model); + tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit(); + + + JScrollPane scrollPanePublicVorlagen = new JScrollPane(); + tablePublicVorlagen.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + String imageid = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 6) + .toString(); + //System.out.println(imageid); + String version = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 7) + .toString(); + //System.out.println(version); + try { + writeImageData(imageid, version); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); + tablePublicVorlagen.setModel(modelPublicVorlagen); + tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit(); + tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen); + scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen); + tabbedPane.addTab("Vorlagen", null, + scrollPanePublicVorlagen, null); + + JScrollPane scrollPaneAllImages = new JScrollPane(); + tableAllImages = new JTable(); + tableAllImages.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + + String imageid = modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 6) + .toString(); + //System.out.println(imageid); + String version = modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 7) + .toString(); + //System.out.println(version); + try { + writeImageData(imageid, version); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + } + }); + tableAllImages.setModel(modelAll); + tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit(); + tableAllImages.setRowSorter(rowSorterAll); + + scrollPaneAllImages.setViewportView(tableAllImages); + tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); + + + + scrollPaneCoopImages.setViewportView(tableCoopImages); + tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages, + null); + tabbedPane.setEnabledAt(3, false); + + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 902, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton cancelButton = new JButton("Zur\u00FCck"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + PermissionCreateLecture_GUI eVAG = new PermissionCreateLecture_GUI(); + eVAG.setVisible(true); + dispose(); + } + }); + cancelButton.setActionCommand("CANCEL"); + buttonPane.add(cancelButton); + getRootPane().setDefaultButton(cancelButton); + } + { + JButton doLinkButton = new JButton( + "Veranstaltung erzeugen und abschlie\u00DFen"); + doLinkButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + // check if a row is selected + if (tablemyImages.getSelectedRow() != -1){ + + // a row is selected, do operations + String imagename = tablemyImages.getValueAt( + tablemyImages.getSelectedRow(), 0) + .toString(); + try { + DateFormat formatter = new SimpleDateFormat( + "yyyy-MM-dd HH:mm:ss"); + client.writeLecturedata( + Lecture.lecture.getName(), + Lecture.lecture.getShortDesc(), + Lecture.lecture.getDesc(), + formatter.format( + Lecture.lecture.getStartdate()) + .toString(), + formatter.format( + Lecture.lecture.getEnddate()) + .toString(), + Lecture.lecture.isActive(), + imagename, + person.verantwortlicher.getUsername(), + person.verantwortlicher.getVorname(), + person.verantwortlicher.getName(), + person.verantwortlicher.getHochschule(), + person.verantwortlicher.getEMail(), + person.verantwortlicher.getTel(), + person.verantwortlicher.getFakultaet()); + client.writeLectureRights(Lecture.lecture.getName(), person.verantwortlicher.getUsername(), person.verantwortlicher.getName(), person.verantwortlicher.getVorname(), person.verantwortlicher.getEMail(), person.verantwortlicher.getHochschule(), person.verantwortlicher.getRole()); + JOptionPane + .showMessageDialog( + null, + "Ihre Veranstaltung wurde erfolgreich angelegt. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", + "Veranstaltung angelegt", + JOptionPane.INFORMATION_MESSAGE); + // zurueck zum Menue + MainMenue_GUI m = new MainMenue_GUI(); + m.setVisible(true); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + JOptionPane + .showMessageDialog( + null, + "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.", + "Error", + JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(null, + e1.getCause()+"\n"+e1.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } + + dispose(); + + }else if (tablePublicVorlagen.getSelectedRow() != -1){ + + // a row is selected, do operations + String imagename = tablePublicVorlagen.getValueAt( + tablePublicVorlagen.getSelectedRow(), 0) + .toString(); + try { + DateFormat formatter = new SimpleDateFormat( + "yyyy-MM-dd hh:mm:ss"); + client.writeLecturedata( + Lecture.lecture.getName(), + Lecture.lecture.getShortDesc(), + Lecture.lecture.getDesc(), + formatter.format( + Lecture.lecture.getStartdate()) + .toString(), + formatter.format( + Lecture.lecture.getEnddate()) + .toString(), + Lecture.lecture.isActive(), + imagename, + person.verantwortlicher.getUsername(), + person.verantwortlicher.getVorname(), + person.verantwortlicher.getName(), + person.verantwortlicher.getHochschule(), + person.verantwortlicher.getEMail(), + person.verantwortlicher.getTel(), + person.verantwortlicher.getFakultaet()); + client.writeLectureRights(Lecture.lecture.getName(), person.verantwortlicher.getUsername(), person.verantwortlicher.getName(), person.verantwortlicher.getVorname(), person.verantwortlicher.getEMail(), person.verantwortlicher.getHochschule(), person.verantwortlicher.getRole()); + JOptionPane + .showMessageDialog( + null, + "Ihre Veranstaltung wurde erfolgreich angelegt. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", + "Veranstaltung angelegt", + JOptionPane.INFORMATION_MESSAGE); + // zurueck zum Menue + MainMenue_GUI m = new MainMenue_GUI(); + m.setVisible(true); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + JOptionPane + .showMessageDialog( + null, + "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.", + "Error", + JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(null, + e1.getCause()+"\n"+e1.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } + + dispose(); + + }else if (tableAllImages.getSelectedRow() != -1 &&tableAllImages.getValueAt(tableAllImages.getSelectedRow(), 4).toString().equals(username)){ + + // a row is selected, do operations + String imagename = tableAllImages.getValueAt( + tableAllImages.getSelectedRow(), 0) + .toString(); + try { + DateFormat formatter = new SimpleDateFormat( + "yyyy-MM-dd hh:mm:ss"); + client.writeLecturedata( + Lecture.lecture.getName(), + Lecture.lecture.getShortDesc(), + Lecture.lecture.getDesc(), + formatter.format( + Lecture.lecture.getStartdate()) + .toString(), + formatter.format( + Lecture.lecture.getEnddate()) + .toString(), + Lecture.lecture.isActive(), + imagename, + person.verantwortlicher.getUsername(), + person.verantwortlicher.getVorname(), + person.verantwortlicher.getName(), + person.verantwortlicher.getHochschule(), + person.verantwortlicher.getEMail(), + person.verantwortlicher.getTel(), + person.verantwortlicher.getFakultaet()); + client.writeLectureRights(Lecture.lecture.getName(), person.verantwortlicher.getUsername(), person.verantwortlicher.getName(), person.verantwortlicher.getVorname(), person.verantwortlicher.getEMail(), person.verantwortlicher.getHochschule(), person.verantwortlicher.getRole()); + JOptionPane + .showMessageDialog( + null, + "Ihre Veranstaltung wurde erfolgreich angelegt. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", + "Veranstaltung angelegt", + JOptionPane.INFORMATION_MESSAGE); + // zurueck zum Menue + MainMenue_GUI m = new MainMenue_GUI(); + m.setVisible(true); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + JOptionPane + .showMessageDialog( + null, + "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.", + "Error", + JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(null, + e1.getCause()+"\n"+e1.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } + + dispose(); + + } + else { + // nothing selected + JOptionPane.showMessageDialog(null, + "Bitte w\u00e4hlen Sie ein Image aus.", + "Image Auswahl", + JOptionPane.INFORMATION_MESSAGE); + } + + } + }); + doLinkButton.setActionCommand("OK"); + buttonPane.add(doLinkButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 79, 912, 1); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 912, 2); + getContentPane().add(separator_1); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBorder(new TitledBorder(null, "Detailinformationen", + + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel.setBackground(SystemColor.menu); + panel.setBounds(586, 85, 316, 531); + getContentPane().add(panel); + + JLabel lblName = new JLabel("Name:"); + lblName.setBounds(10, 87, 130, 14); + panel.add(lblName); + + labelName = new JLabel(""); + labelName.setBounds(10, 102, 296, 14); + panel.add(labelName); + + JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); + lblVerantwortlicher.setBounds(10, 259, 130, 14); + panel.add(lblVerantwortlicher); + + labelOS = new JLabel(""); + labelOS.setBounds(10, 216, 296, 14); + panel.add(labelOS); + + JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:"); + lblWeitereVerantwortliche.setBounds(10, 202, 130, 14); + panel.add(lblWeitereVerantwortliche); + + labelVerantwortlicher = new JLabel(""); + labelVerantwortlicher.setBounds(10, 272, 296, 14); + panel.add(labelVerantwortlicher); + + JLabel label = new JLabel("Weitere Verantwortliche:"); + label.setBounds(10, 284, 130, 14); + panel.add(label); + + labelWeitereVerantwortliche = new JLabel(""); + labelWeitereVerantwortliche.setBounds(10, 297, 296, 14); + panel.add(labelWeitereVerantwortliche); + + labelUpdate = new JLabel(""); + labelUpdate.setBounds(10, 245, 296, 14); + panel.add(labelUpdate); + + JLabel lblLetztesUpdate = new JLabel("Letztes Update:"); + lblLetztesUpdate.setBounds(10, 231, 130, 14); + panel.add(lblLetztesUpdate); + + JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:"); + lblImageIstVorlage.setBounds(10, 336, 130, 14); + panel.add(lblImageIstVorlage); + + labelVorlage = new JLabel(""); + labelVorlage.setBounds(10, 350, 296, 14); + panel.add(labelVorlage); + + labelLizenzSoftware = new JLabel(""); + labelLizenzSoftware.setBounds(10, 383, 296, 14); + panel.add(labelLizenzSoftware); + + JLabel lblLizenzpflichtigeSoftware = new JLabel("Lizenzpflichtige Software:"); + lblLizenzpflichtigeSoftware.setBounds(10, 367, 130, 14); + panel.add(lblLizenzpflichtigeSoftware); + + JLabel lblInternet = new JLabel("Internetsperre vorhanden:"); + lblInternet.setBounds(10, 400, 130, 14); + panel.add(lblInternet); + + labelInternet = new JLabel(""); + labelInternet.setBounds(10, 417, 296, 14); + panel.add(labelInternet); + + JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:"); + lblEmpfehlungRam.setBounds(10, 432, 130, 14); + panel.add(lblEmpfehlungRam); + + labelRam = new JLabel(""); + labelRam.setBounds(10, 455, 296, 14); + panel.add(labelRam); + + JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:"); + lblEmpfehlungCpu.setBounds(10, 469, 130, 14); + panel.add(lblEmpfehlungCpu); + + labelCPU = new JLabel(""); + labelCPU.setBounds(10, 487, 296, 14); + panel.add(labelCPU); + + JLabel lblTechnischeDaten = new JLabel("Technische Daten:"); + lblTechnischeDaten.setBounds(10, 322, 296, 14); + panel.add(lblTechnischeDaten); + + JLabel lblId = new JLabel("ID:"); + lblId.setBounds(10, 23, 296, 14); + panel.add(lblId); + + labelID = new JLabel(""); + labelID.setBounds(10, 37, 296, 14); + panel.add(labelID); + + labelVersion = new JLabel(""); + labelVersion.setBounds(10, 73, 296, 14); + panel.add(labelVersion); + + JLabel lblVersion = new JLabel("Version:"); + lblVersion.setBounds(10, 57, 296, 14); + panel.add(lblVersion); + + JLabel lblBeschreibung = new JLabel("Beschreibung:"); + lblBeschreibung.setBounds(10, 119, 130, 14); + panel.add(lblBeschreibung); + + JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBounds(10, 135, 296, 65); + panel.add(scrollPane); + + textAreadesc = new JTextArea(); + textAreadesc.setLineWrap(true); + textAreadesc.setBackground(SystemColor.menu); + scrollPane.setViewportView(textAreadesc); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAbout); + + } + + // Initiale Beffuelung eines Table models + public DefaultTableModel initTableModel(DefaultTableModel model) throws TException, ParseException { + List images; + + // Hole eine Liste der Images + images = client.getImageList(); + + Iterator i = images.iterator(); + SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); + int x = 0; + + while (i.hasNext()) { + // erzeuge Objekte fuer die Tabelle + Object[] obj = { images.get(x).getImageName(), + images.get(x).getLicenseRestriction(), + images.get(x).getOsName(), + images.get(x).getLectureName(), + images.get(x).getUserData(), + out.format(in.parse(images.get(x).updateTime)), images.get(x).id, + images.get(x).getVersion(), + images.get(x).getIsTemplate()}; + // Fuege diese Objekte der Tabelle hinzu + + model.addRow(obj); + x++; + i.next(); + + } + + return model; + + + } + public void writeImageData(String id, String version) throws TException, ParseException{ + + SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); + Map res=client.getImageData(id,version); + labelName.setText(res.get("name")); + labelOS.setText(res.get("os")); + labelUpdate.setText(out.format(in.parse(res.get("lastupdate")))); + labelVerantwortlicher.setText(res.get("owner")); + labelWeitereVerantwortliche.setText("Noch nicht Verf�gbar"); + if(res.get("template").equals("true")){ + labelVorlage.setText("Ja"); + }else{ + labelVorlage.setText("Nein"); + } + if(res.get("license").equals("1")){ + labelLizenzSoftware.setText("Ja"); + } + else + { + labelLizenzSoftware.setText("Nein"); + } + if(res.get("internet").equals("1")){ + labelInternet.setText("Ja"); + } + else + { + labelInternet.setText("Nein"); + } + labelRam.setText(res.get("ram")); + labelCPU.setText(res.get("cpu")); + labelID.setText(res.get("id")); + labelVersion.setText(res.get("version")); + textAreadesc.setText(res.get("desc")); + + } +} diff --git a/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java new file mode 100644 index 00000000..ffadde1c --- /dev/null +++ b/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java @@ -0,0 +1,720 @@ +package gui.lecture; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JSeparator; +import javax.swing.JTabbedPane; +import javax.swing.JTable; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.RowFilter; +import javax.swing.ScrollPaneConstants; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableModel; +import javax.swing.table.TableRowSorter; + +import models.Links; +import models.person; + +import org.apache.thrift.TException; + +import server.Server.Client; +import thrift.ThriftConnection; +import util.GuiOrganizer; +import util.OpenLinks; + +@SuppressWarnings("serial") +public class DeleteLecture_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JRadioButton rdbtnInternetJa; + JRadioButton rdbtnInternetNein; + JLabel labelAktiv; + JLabel labelstartdate; + JLabel labelenddate; + JLabel labelimageversion; + JTextArea labelName; + JTextArea labelimage; + JTextArea labeldesc; + JLabel labelVerantwortlicher; + JTable tableAllLectures; + JTable tablemyLectures; + private JTextField textFieldName; + JTabbedPane tabbedPane; + boolean activeSearch=false; + String[] titles = { "Veranstaltungsname", "Beschreibung", + "G\u00fcltigkeitsdatum", "Aktiv", "Letzte Benutzung", + "Verantwortlicher", "Image", "Schlagwort", "ID" }; + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); + final DefaultTableModel modelAll = new DefaultTableModel(titles, 0); + final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0); + final TableRowSorter rowSorterAll = new TableRowSorter( + modelAll); + final TableRowSorter rowSorterMyLectures = new TableRowSorter( + modelMyLectures); + private JButton button; + private JTextField textField; + + + /** + * Create the dialog. + */ + public DeleteLecture_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + // Beendet die Anwendung nach klick auf X + con.closeThriftConnection(); + System.exit(0); + } + @Override + public void windowOpened(WindowEvent arg0) { + textFieldName.requestFocusInWindow(); + try { + initTableModel(modelMyLectures); + initTableModel(modelAll); + + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + // auszublendende Angaben + // 1=Beschreibung + // 2=G\u00fcltigkeitsdatum + // 3=Aktiv + // 6=Image + // 7=Schlagwort + // 8=ID + tablemyLectures.getColumnModel().getColumn(1).setWidth(0); + tablemyLectures.getColumnModel().getColumn(1).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(1).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(2).setWidth(0); + tablemyLectures.getColumnModel().getColumn(2).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(2).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(3).setWidth(0); + tablemyLectures.getColumnModel().getColumn(3).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(3).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(6).setWidth(0); + tablemyLectures.getColumnModel().getColumn(6).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(6).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(7).setWidth(0); + tablemyLectures.getColumnModel().getColumn(7).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(7).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(8).setWidth(0); + tablemyLectures.getColumnModel().getColumn(8).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(8).setMaxWidth(0); + + tableAllLectures.getColumnModel().getColumn(1).setWidth(0); + tableAllLectures.getColumnModel().getColumn(1).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(1).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(2).setWidth(0); + tableAllLectures.getColumnModel().getColumn(2).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(2).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(3).setWidth(0); + tableAllLectures.getColumnModel().getColumn(3).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(3).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(6).setWidth(0); + tableAllLectures.getColumnModel().getColumn(6).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(6).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(7).setWidth(0); + tableAllLectures.getColumnModel().getColumn(7).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(7).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(8).setWidth(0); + tableAllLectures.getColumnModel().getColumn(8).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(8).setMaxWidth(0); + } + }); + // Verhindert das Vergroessern Des Fensters + setResizable(false); + + try { + // Setzt das Look & Feel auf System + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + // Setzt den Fenstertitel + setTitle("bwLehrpool Suite - Veranstaltung l\u00F6schen"); + // Zentriert das Fenster in die Bildmitte + setBounds(0, 0, 842, 722); + GuiOrganizer.centerGUI(this); + + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 816, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel( + "Zu l\u00F6schende Veranstaltung w\u00E4hlen"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("W\u00E4hlen Sie bitte aus der unten stehenden Liste die zu l\u00F6schende Veranstaltung aus."); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 570, 518); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 49, 557, 64); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel lblNewLabel_2 = new JLabel("Name:"); + lblNewLabel_2.setBounds(10, 30, 80, 20); + panel_1.add(lblNewLabel_2); + + textFieldName = new JTextField(); + // Key Listener der Tastatureingabe registriert + textFieldName.addKeyListener(new KeyAdapter() { + @Override + public void keyReleased(KeyEvent e) { + // Textfield eingabe auslesen + String stext = textFieldName.getText(); + // Wenn Textfield nicht leer + if (stext != "") { + activeSearch=true; + // Filtere nach der Eingabe + rowSorterAll.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + + }else{ + activeSearch=false; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( + username, 5)); + rowSorterAll.setRowFilter(null); + } + } + }); + + textFieldName.setBounds(96, 30, 166, 20); + panel_1.add(textFieldName); + textFieldName.setColumns(10); + + JLabel label = new JLabel("Beschreibung:"); + label.setBounds(291, 30, 80, 20); + panel_1.add(label); + + textField = new JTextField(); + textField.setColumns(10); + textField.setBounds(381, 30, 166, 20); + panel_1.add(textField); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + // oeffnet das Hauptmenue + + DeleteLecture_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Veranstaltung"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 75, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(152, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Veranstaltung l\u00F6schen"); + lblNewLabel_1.setBounds(166, 11, 128, 14); + contentPanel.add(lblNewLabel_1); + + tabbedPane = new JTabbedPane(JTabbedPane.TOP); + tabbedPane.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent arg0) { + if (tabbedPane.getSelectedIndex() == 0) { + + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( + username, 5)); + } else if (tabbedPane.getSelectedIndex() == 1) { + rowSorterAll.setRowFilter(null); + } + + } + }); + + tabbedPane.setBounds(10, 123, 557, 397); + contentPanel.add(tabbedPane); + + + JScrollPane scrollPaneAllImages = new JScrollPane(); + tableAllLectures = new JTable(); + tableAllLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + String imageid = modelAll + .getValueAt( + tableAllLectures + .convertRowIndexToModel(tableAllLectures + .getSelectedRow()), 8) + .toString(); + //System.out.println(imageid); + + try { + writeLectureData(imageid); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); + tableAllLectures.setModel(modelAll); + tableAllLectures.getColumnModel().getColumn(1).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(2).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(3).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(4).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(5).sizeWidthToFit(); + tableAllLectures.setRowSorter(rowSorterAll); + JScrollPane scrollPaneMyImage = new JScrollPane(); + tablemyLectures = new JTable(); + tablemyLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + String imageid = modelMyLectures + .getValueAt( + tablemyLectures + .convertRowIndexToModel(tablemyLectures + .getSelectedRow()), 8) + .toString(); + //System.out.println(imageid); + + try { + writeLectureData(imageid); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); + tablemyLectures.setModel(modelMyLectures); + + tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(2).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(3).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(4).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(5).sizeWidthToFit(); + tablemyLectures.setRowSorter(rowSorterMyLectures); + + scrollPaneMyImage.setViewportView(tablemyLectures); + tabbedPane.addTab("Meine Veranstaltungen", null, scrollPaneMyImage, + null); + + + scrollPaneAllImages.setViewportView(tableAllLectures); + tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 826, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton btnBack = new JButton("Zur\u00FCck"); + btnBack.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + // oeffnet das Hauptmenue + + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + dispose(); + } + }); + btnBack.setActionCommand("OK"); + buttonPane.add(btnBack); + getRootPane().setDefaultButton(btnBack); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 79, 836, 1); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 628, 836, 1); + getContentPane().add(separator_1); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBorder(new TitledBorder(null, "Detailinformationen", + + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel.setBackground(SystemColor.menu); + panel.setBounds(591, 85, 235, 518); + getContentPane().add(panel); + + JLabel lblNewLabel_3 = new JLabel("Name:"); + lblNewLabel_3.setBounds(10, 27, 104, 14); + panel.add(lblNewLabel_3); + + JLabel lblAktiv = new JLabel("Aktiv:"); + lblAktiv.setBounds(10, 98, 104, 14); + panel.add(lblAktiv); + + labelAktiv = new JLabel(""); + labelAktiv.setBounds(10, 114, 218, 14); + panel.add(labelAktiv); + + labelstartdate = new JLabel(""); + labelstartdate.setBounds(10, 147, 218, 14); + panel.add(labelstartdate); + + JLabel lblStartdatum = new JLabel("Startdatum:"); + lblStartdatum.setBounds(10, 129, 104, 14); + panel.add(lblStartdatum); + + labelenddate = new JLabel(""); + labelenddate.setBounds(10, 175, 218, 14); + panel.add(labelenddate); + + JLabel lblEnddatum = new JLabel("Enddatum:"); + lblEnddatum.setBounds(10, 161, 104, 14); + panel.add(lblEnddatum); + + JLabel lblBeschreibung = new JLabel("Beschreibung:"); + lblBeschreibung.setBounds(10, 189, 104, 14); + panel.add(lblBeschreibung); + + JLabel lblImage = new JLabel("Image:"); + lblImage.setBounds(10, 293, 104, 14); + panel.add(lblImage); + + labelVerantwortlicher = new JLabel(""); + labelVerantwortlicher.setBounds(10, 426, 218, 14); + panel.add(labelVerantwortlicher); + + JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); + lblVerantwortlicher.setBounds(10, 411, 104, 14); + panel.add(lblVerantwortlicher); + + JLabel lblImageversion = new JLabel("Imageversion:"); + lblImageversion.setBounds(10, 381, 104, 14); + panel.add(lblImageversion); + + labelimageversion = new JLabel(""); + labelimageversion.setBounds(10, 399, 218, 14); + panel.add(labelimageversion); + + + labeldesc = new JTextArea(); + labeldesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); + labeldesc.setEditable(false); + labeldesc.setLineWrap(true); + labeldesc.setBackground(SystemColor.menu); + labeldesc.setBounds(124, 127, 104, 110); + JScrollPane scrollPane = new JScrollPane(labeldesc); + scrollPane.setBounds(10, 209, 218, 81); + panel.add(scrollPane); + //panel.add(labeldesc); + + labelimage = new JTextArea(); + labelimage.setLineWrap(true); + labelimage.setFont(new Font("Tahoma", Font.PLAIN, 11)); + labelimage.setEditable(false); + labelimage.setBackground(SystemColor.menu); + labelimage.setBounds(124, 248, 101, 81); + JScrollPane scrollPaneImage = new JScrollPane(labelimage); + scrollPaneImage.setBounds(10, 309, 215, 69); + panel.add(scrollPaneImage); + + labelName = new JTextArea(); + labelName.setEditable(false); + labelName.setFont(new Font("Tahoma", Font.PLAIN, 11)); + labelName.setBackground(SystemColor.menu); + labelName.setBounds(124, 22, 101, 55); + JScrollPane scrollPaneName = new JScrollPane(labelName); + scrollPaneName.setBounds(10, 40, 218, 55); + panel.add(scrollPaneName); + + button = new JButton("L\u00F6schen"); + button.setBounds(469, 606, 118, 23); + getContentPane().add(button); + button.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + String lectureID=""; + int eingabe; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + //check if a row is selected + if (tablemyLectures.getSelectedRowCount() !=0){ + //a row is selected + //ask for confirmation + eingabe = JOptionPane.showConfirmDialog(null, + "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?", + JOptionPane.YES_NO_OPTION); + + if (eingabe == JOptionPane.YES_OPTION) { + //user has confirmed deletion, now get the ID of the selected lecture + lectureID = modelMyLectures.getValueAt(tablemyLectures.convertColumnIndexToModel(tablemyLectures.getSelectedRow()), 8).toString(); + System.out.println("L\u00f6sche Lecture "+lectureID); + try { + if(client.deleteLecture(lectureID, person.verantwortlicher.getHochschule(),person.verantwortlicher.getUsername())){ + System.out.println("L\u00f6schen erfolgreich"); + //delete successful + + DeleteLecture_GUI dl = new DeleteLecture_GUI(); + dl.setVisible(true); + dispose(); + } else { + //delete not successful + JOptionPane + .showMessageDialog( + null, + "L\u00f6schen aus Datenbank fehlgeschlagen.", + "Fehler", + JOptionPane.INFORMATION_MESSAGE); + } + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + }//end delete + }//end ask for confirmation + + }//end check if a row is selected + else if (tableAllLectures.getSelectedRowCount() !=0 && tableAllLectures.getValueAt(tableAllLectures.getSelectedRow(), 5).toString().equals(username)){ + //a row is selected + //ask for confirmation + eingabe = JOptionPane.showConfirmDialog(null, + "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?", + JOptionPane.YES_NO_OPTION); + + if (eingabe == JOptionPane.YES_OPTION) { + //user has confirmed deletion, now get the ID of the selected lecture + lectureID = tableAllLectures.getValueAt(tableAllLectures.convertColumnIndexToModel(tableAllLectures.getSelectedRow()), 8).toString(); + System.out.println("L\u00f6sche Lecture "+lectureID); + try { + if(client.deleteLecture(lectureID, person.verantwortlicher.getHochschule(),person.verantwortlicher.getUsername())){ + System.out.println("L\u00f6schen erfolgreich"); + //delete successful + + DeleteLecture_GUI dl = new DeleteLecture_GUI(); + dl.setVisible(true); + dispose(); + } else { + //delete not successful + JOptionPane + .showMessageDialog( + null, + "L\u00f6schen aus Datenbank fehlgeschlagen.", + "Fehler", + JOptionPane.INFORMATION_MESSAGE); + } + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + }//end delete + }//end ask for confirmation + + } else { //end check if a row is selected + JOptionPane + .showMessageDialog( + null, + "Bitte w\u00e4hlen Sie ein eigenes Image aus.", + "Message", + JOptionPane.INFORMATION_MESSAGE); + } + + } + }); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAbout); + + } + + // Initiale Beffuelung eines Table models + public DefaultTableModel initTableModel(DefaultTableModel model) throws ParseException { + List lectures; + try { + // Hole eine Liste der Images + lectures = client.getLectureList(); + Iterator i = lectures.iterator(); + SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); + int x = 0; + + while (i.hasNext()) { + // erzeuge Objekte fuer die Tabelle + Object[] obj = { + lectures.get(x).lecturename, + lectures.get(x).desc, + out.format(in.parse(lectures.get(x).starttime)) + " " + + out.format(in.parse(lectures.get(x).endtime)), + lectures.get(x).isActive, out.format(in.parse(lectures.get(x).lastused)), + lectures.get(x).username, + lectures.get(x).imagename," " ,lectures.get(x).id }; + // Fuege diese Objekte der Tabelle hinzu + model.addRow(obj); + x++; + i.next(); + + } + + return model; + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + return model; + } + public void writeLectureData(String id) throws TException, ParseException{ + + SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); + Map res=client.getLectureData(id); + labelName.setText(res.get("name")); + labelAktiv.setText(res.get("isActive")); + labeldesc.setText(res.get("desc")); + labelVerantwortlicher.setText(res.get("owner")); + labelstartdate.setText(out.format(in.parse(res.get("startTime")))); + labelenddate.setText(out.format(in.parse(res.get("endTime")))); + labelimage.setText(res.get("imagepath").substring(res.get("imagepath").indexOf("/")+1)); + labelimageversion.setText(res.get("imageversion")); + + +} +} diff --git a/dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java b/dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java new file mode 100644 index 00000000..457b67db --- /dev/null +++ b/dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java @@ -0,0 +1,594 @@ +package gui.lecture; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.ScrollPane; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Calendar; +import java.util.Date; + +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JSeparator; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; + +import models.Image; +import models.Lecture; +import models.Links; +import models.person; +import util.GuiOrganizer; +import util.OpenLinks; + +import com.toedter.calendar.JDateChooser; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeEvent; + +@SuppressWarnings("serial") +public class EditLectureAllgemein_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + private JTextField Vorname; + private JTextField Nachname; + private JTextField Hochschule; + private JTextField EMail; + private JTextField textFieldLaborname; + JTextArea description; + JRadioButton radioButtonyes; + JDateChooser dateChooserend; + JDateChooser dateChooserstart; + JRadioButton radioButtonno; + Date startDate = new Date(); + Date endDate; + private final ButtonGroup buttonGroup = new ButtonGroup(); + private boolean descriptionLengthOK = false; // description may not be + // longer than + // MAX_DESCRIPTION_LENGTH + private final int MAX_DESCRIPTION_LENGTH = 254; + + int maxLifeTime = 180; // Anzahl Tage, die eine Veranstaltung in der Zukunft + // aktiv sein darf + boolean isDateOrderCorrect, isDateMaxLifeTimeCorrect, + isAllInformationReady = false; + + /** + * Create the dialog. + */ + public EditLectureAllgemein_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + System.exit(0); + } + }); + setResizable(false); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("bwLehrpool Suite - Veranstaltung bearbeiten"); + ; + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Eingabe Ihrer Daten"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 21); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 493); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 331, 557, 162); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel label = new JLabel("Vorname: *"); + label.setBackground(SystemColor.menu); + label.setBounds(10, 33, 125, 20); + panel_1.add(label); + + Vorname = new JTextField(); + Vorname.setEditable(false); + Vorname.setEnabled(false); + Vorname.setText(person.verantwortlicher.getVorname()); + Vorname.setBackground(Color.WHITE); + Vorname.setColumns(10); + Vorname.setBounds(145, 33, 350, 20); + panel_1.add(Vorname); + + JLabel label_7 = new JLabel("Nachname: *"); + label_7.setBackground(SystemColor.menu); + label_7.setBounds(10, 64, 125, 20); + panel_1.add(label_7); + + Nachname = new JTextField(); + Nachname.setEnabled(false); + Nachname.setEditable(false); + Nachname.setText(person.verantwortlicher.getName()); + Nachname.setBackground(Color.WHITE); + Nachname.setColumns(10); + Nachname.setBounds(145, 64, 350, 20); + panel_1.add(Nachname); + + JLabel label_8 = new JLabel("Hochschule: *"); + label_8.setBackground(SystemColor.menu); + label_8.setBounds(10, 95, 125, 20); + panel_1.add(label_8); + + Hochschule = new JTextField(); + Hochschule.setEnabled(false); + Hochschule.setEditable(false); + Hochschule.setText(person.verantwortlicher.getHochschule()); + Hochschule.setBackground(Color.WHITE); + Hochschule.setColumns(10); + Hochschule.setBounds(145, 95, 350, 20); + panel_1.add(Hochschule); + + JLabel label_9 = new JLabel("E-Mail: *"); + label_9.setBackground(SystemColor.menu); + label_9.setBounds(10, 126, 125, 20); + panel_1.add(label_9); + + EMail = new JTextField(); + EMail.setEnabled(false); + EMail.setEditable(false); + EMail.setText(person.verantwortlicher.getEMail()); + EMail.setBackground(Color.WHITE); + EMail.setColumns(10); + EMail.setBounds(145, 126, 350, 20); + panel_1.add(EMail); + + JPanel panel = new JPanel(); + panel.setBounds(10, 402, 577, 33); + contentPanel.add(panel); + panel.setLayout(null); + panel.setBorder(new EmptyBorder(5, 5, 5, 5)); + panel.setBackground(SystemColor.menu); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + + EditLectureAllgemein_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Veranstaltung"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 84, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(175, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Bearbeiten"); + lblNewLabel_1.setBounds(188, 11, 72, 14); + contentPanel.add(lblNewLabel_1); + + JPanel panel_2 = new JPanel(); + panel_2.setLayout(null); + panel_2.setBorder(new TitledBorder(null, "Veranstaltungsdaten", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_2.setBackground(SystemColor.menu); + panel_2.setBounds(10, 36, 557, 284); + contentPanel.add(panel_2); + + JLabel label_3 = new JLabel("Laborname (Anzeigename): *"); + label_3.setBounds(10, 25, 180, 14); + panel_2.add(label_3); + + textFieldLaborname = new JTextField(); + textFieldLaborname.setText(Lecture.lecture.getName()); + textFieldLaborname.setColumns(10); + textFieldLaborname.setBounds(200, 22, 347, 20); + panel_2.add(textFieldLaborname); + + JTextArea textArea = new JTextArea(); + textArea.setEditable(false); + textArea.setWrapStyleWord(true); + textArea.setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an. Dieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\""); + textArea.setLineWrap(true); + textArea.setFont(new Font("Tahoma", Font.PLAIN, 12)); + textArea.setBackground(SystemColor.menu); + textArea.setBounds(10, 49, 537, 49); + panel_2.add(textArea); + + JLabel label_4 = new JLabel("Beschreibung: *"); + label_4.setBounds(10, 111, 180, 14); + panel_2.add(label_4); + + ScrollPane scrollPane = new ScrollPane(); + scrollPane.setBounds(200, 104, 347, 78); + panel_2.add(scrollPane); + description = new JTextArea(); + description.setFont(new Font("Tahoma", Font.PLAIN, 11)); + description.setText(Lecture.lecture.getDesc()); + description.setLineWrap(true); + scrollPane.add(description); + description.setBounds(0, 0, 4, 22); + scrollPane.add(description); + + dateChooserend = new JDateChooser(); + dateChooserend.setDateFormatString("dd-MM-yyyy HH:mm:ss"); + dateChooserend.setDate(Lecture.lecture.getEnddate()); + dateChooserend.setBounds(404, 188, 143, 20); + panel_2.add(dateChooserend); + + JLabel label_5 = new JLabel("bis"); + label_5.setBounds(378, 188, 21, 20); + panel_2.add(label_5); + + dateChooserstart = new JDateChooser(); + dateChooserstart + .addPropertyChangeListener(new PropertyChangeListener() { + public void propertyChange(PropertyChangeEvent arg0) { + endDate = addDays(dateChooserstart.getDate(), + maxLifeTime); // Datum darf weiter als 6 + // Monate in der Zukunft + // liegen + } + }); + + // initialize + if (Lecture.lecture.getStartdate() == null) { + // is not defined yet + dateChooserstart.setDate(startDate); + } else { + // already defined from last visit on this page + dateChooserstart.setDate(Lecture.lecture.getStartdate()); + } + + if (Lecture.lecture.getEnddate() == null) { + // is not defined yet + dateChooserend.setDate(endDate); + } else { + // already defined from last visit on this page + dateChooserend.setDate(Lecture.lecture.getEnddate()); + } + + dateChooserstart.setDateFormatString("yyyy-MM-dd HH:mm:ss"); + dateChooserstart.setDate(Lecture.lecture.getStartdate()); + dateChooserstart.setBounds(226, 188, 143, 20); + panel_2.add(dateChooserstart); + + JLabel label_6 = new JLabel("von:"); + label_6.setBounds(200, 188, 30, 20); + panel_2.add(label_6); + + JLabel label_10 = new JLabel("G\u00FCltigkeitsdatum: *"); + label_10.setBounds(10, 188, 250, 14); + panel_2.add(label_10); + + JLabel label_11 = new JLabel("Aktiv:"); + label_11.setBounds(10, 229, 250, 14); + panel_2.add(label_11); + + radioButtonyes = new JRadioButton("Ja"); + buttonGroup.add(radioButtonyes); + radioButtonyes.setBounds(240, 225, 109, 23); + panel_2.add(radioButtonyes); + radioButtonno = new JRadioButton("Nein"); + buttonGroup.add(radioButtonno); + radioButtonno.setBounds(385, 225, 109, 23); + panel_2.add(radioButtonno); + + radioButtonyes.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + radioButtonyes.setSelected(true); + radioButtonno.setSelected(false); + } + }); + radioButtonno.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + radioButtonno.setSelected(true); + radioButtonyes.setSelected(false); + } + }); + + JLabel label_12 = new JLabel("(Im VMChooser sichtbar)"); + label_12.setBounds(10, 254, 250, 14); + panel_2.add(label_12); + + JLabel lblmaxMonate = new JLabel("(max. 6 Monate)"); + lblmaxMonate.setBounds(10, 208, 127, 14); + panel_2.add(lblmaxMonate); + + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton okButton = new JButton("Zur\u00FCck"); + okButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + if (radioButtonyes.isSelected() == true) { + Lecture.lecture.setActive(true); + } else { + Lecture.lecture.setActive(false); + } + + Lecture.lecture.setName(textFieldLaborname.getText()); + Lecture.lecture.setDesc(description.getText()); + Lecture.lecture.setEnddate(dateChooserend.getDate()); + Lecture.lecture.setStartdate(dateChooserstart.getDate()); + Image.image.setImagename(textFieldLaborname.getText()); + + MainMenue_GUI sr = new MainMenue_GUI(); + sr.setVisible(true); + dispose(); + } + }); + okButton.setActionCommand("OK"); + buttonPane.add(okButton); + getRootPane().setDefaultButton(okButton); + } + { + JButton cancelButton = new JButton("Weiter"); + cancelButton.addActionListener(new ActionListener() { + /* + * public void actionPerformed(ActionEvent e) { + * if(radioButtonyes.isSelected()==true) { + * Lecture.lecture.setActive(true); } else { + * Lecture.lecture.setActive(false); } + * + * Lecture.lecture.setName(textFieldLaborname.getText()); + * Lecture.lecture.setNewName(textFieldLaborname.getText()); + * Lecture.lecture.setDesc(description.getText()); + * Lecture.lecture.setEnddate(dateChooserend.getDate()); + * Lecture.lecture.setStartdate(dateChooserstart.getDate()); + * Image.image.setImagename(textFieldLaborname.getText()); + * + * + * PermissionEditLecture_GUI ev=new + * PermissionEditLecture_GUI(); ev.setVisible(true); + * dispose(); } + */ + public void actionPerformed(ActionEvent e) { + // liegt das End-Datum vor dem Start-Datum? + if (dateChooserend.getDate().before( + dateChooserstart.getDate())) { + // datum ist falsch rum + isDateOrderCorrect = false; + JOptionPane + .showMessageDialog( + null, + "Das End-Datum liegt vor dem Start-Datum. Bitte \u00e4ndern.", + "Datum fehlerhaft", + JOptionPane.INFORMATION_MESSAGE); + } else { + // bereit + isDateOrderCorrect = true; + } + // liegt das eingegebene Datum nach dem erlaubten + // End-Datum? + if (dateChooserend.getDate().after(endDate)) { + // Datum zu weit weg + isDateMaxLifeTimeCorrect = false; + JOptionPane.showMessageDialog(null, + "Das End-Datum liegt zu weit in der Zukunft. Erlaubt ist maximal:\n" + + endDate, "Datum fehlerhaft", + JOptionPane.INFORMATION_MESSAGE); + + dateChooserend.setDate(endDate); // setze Datum auf + // maximum + } else { + // bereit + isDateMaxLifeTimeCorrect = true; + } + // Pruefen ob alles eingegeben wurde + if (textFieldLaborname.getText().isEmpty() == true + || description.getText().isEmpty() == true) { + // mind 1 Textfeld ist leer + isAllInformationReady = false; + JOptionPane + .showMessageDialog( + null, + "Bitte geben Sie einen Veranstaltungsnamen und eine Beschreibung ein.", + "Datum fehlerhaft", + JOptionPane.INFORMATION_MESSAGE); + } else { + // Textfelder bereit + isAllInformationReady = true; + } + + // welcher Radiobutton ist geklickt? + if (radioButtonyes.isSelected() == true) { + Lecture.lecture.setActive(true); + } else { + Lecture.lecture.setActive(false); + } + // Pruefe ob alle Eingaben korrekt sind, dann mache + // weiter + if (isAllInformationReady == true + && isDateMaxLifeTimeCorrect == true + && isDateOrderCorrect == true + && descriptionLenghtOK() == true) { + // everything is ok, proceed + Lecture.lecture.setName(textFieldLaborname + .getText()); + Lecture.lecture.setDesc(description.getText()); + Lecture.lecture.setEnddate(dateChooserend.getDate()); + Lecture.lecture.setStartdate(dateChooserstart + .getDate()); + + Image.image.setImagename(textFieldLaborname + .getText()); + + PermissionCreateLecture_GUI ev = new PermissionCreateLecture_GUI(); + ev.setVisible(true); + dispose(); + } + + } + + }); + cancelButton.setActionCommand("Cancel"); + buttonPane.add(cancelButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 78, 597, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + getContentPane().add(separator_1); + + JLabel lblPflichtfelder = new JLabel("* Pflichtfelder"); + lblPflichtfelder.setBounds(32, 602, 136, 14); + getContentPane().add(lblPflichtfelder); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu = new JMenu("Suchen"); + menuBar.add(mnNewMenu); + + JMenuItem mntmVlSuche = new JMenuItem("VL Suche"); + mnNewMenu.add(mntmVlSuche); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + OpenLinks open = new OpenLinks(); + URI windows; + try { + windows = new URI(Links.getFAQ()); + open.openWebpage(windows); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + OpenLinks open = new OpenLinks(); + URI windows; + try { + windows = new URI(Links.getOTRS()); + open.openWebpage(windows); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAbout); + + } + + public Date addDays(Date date, int days) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + cal.add(Calendar.DATE, days); // minus number would decrement the days + return cal.getTime(); + }// end addDays() + + public boolean descriptionLenghtOK() { + descriptionLengthOK = false; + + // max length is 254 chars + if (description.getText().length() >= MAX_DESCRIPTION_LENGTH) { + descriptionLengthOK = false; + JOptionPane.showMessageDialog(null, + "Die Beschreibung darf max 254 Zeichen enthalten. Aktuell enthält sie " + + description.getText().length() + ".", + "Beschreibung zu umfangreich", + JOptionPane.INFORMATION_MESSAGE); + } else { + descriptionLengthOK = true; + + } + + return descriptionLengthOK; + }// enddescriptionLenghtOK() + +}// end class \ No newline at end of file diff --git a/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java b/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java new file mode 100644 index 00000000..773a01b7 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java @@ -0,0 +1,1020 @@ +package gui.lecture; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JSeparator; +import javax.swing.JTabbedPane; +import javax.swing.JTable; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.RowFilter; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableModel; +import javax.swing.table.TableRowSorter; + +import models.Lecture; +import models.Links; +import models.person; + +import org.apache.thrift.TException; + +import server.Server.Client; +import thrift.ThriftConnection; +import util.GuiOrganizer; +import util.OpenLinks; +import javax.swing.event.ChangeListener; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; + +@SuppressWarnings("serial") +public class EditLectureLink_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JRadioButton rdbtnInternetJa; + JRadioButton rdbtnInternetNein; + JComboBox comboBox; + JLabel labelName; + JLabel labelUpdate; + JLabel labelVerantwortlicher; + JLabel labelWeitereVerantwortliche; + JLabel labelVorlage; + JLabel labelLizenzSoftware; + JLabel labelInternet; + JLabel labelRam; + JLabel labelID; + JLabel labelVersion; + JTextArea textAreadesc; + JLabel labelCPU; + private JLabel labelOS; + JTable tableAllImages = new JTable(); + JTable tablemyImages = new JTable(); + JTable tableCoopImages = new JTable(); + JTable tablePublicVorlagen = new JTable(); + private JTextField textFieldName; + JTabbedPane tabbedPane; + boolean activeSearch=false; + String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung", + "Verantwortlicher", "Letztes Update", "ID", "Version","Template" }; + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); + final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){ + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0){ + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final DefaultTableModel modelPublicVorlagen = new DefaultTableModel(titles, 0){ + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final TableRowSorter rowSorterAll = new TableRowSorter( + modelAll); + final TableRowSorter rowSorterMyImages = new TableRowSorter( + modelMyImages); + final TableRowSorter rowSorterPublicVorlagen = new TableRowSorter( + modelPublicVorlagen); + private JTextField textField; + /** + * Create the dialog. + */ + public EditLectureLink_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + con.closeThriftConnection(); + System.exit(0); + } + @Override + public void windowOpened(WindowEvent arg0) { + try { + initTableModel(modelAll); + initTableModel(modelMyImages); + initTableModel(modelPublicVorlagen); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + // auszublendende Angaben + // 1=Lizenzpflichtig + // 3=Veranstaltung + // 6=ID + // 7=Version + // 8=Template + tablemyImages.getColumnModel().getColumn(1).setWidth(0); + tablemyImages.getColumnModel().getColumn(1).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(1).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(3).setWidth(0); + tablemyImages.getColumnModel().getColumn(3).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(3).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(8).setWidth(0); + tablemyImages.getColumnModel().getColumn(8).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(8).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(6).setWidth(0); + tablemyImages.getColumnModel().getColumn(6).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(6).setMaxWidth(0); + tablemyImages.getColumnModel().getColumn(7).setWidth(0); + tablemyImages.getColumnModel().getColumn(7).setMinWidth(0); + tablemyImages.getColumnModel().getColumn(7).setMaxWidth(0); + + tablePublicVorlagen.getColumnModel().getColumn(1).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(1).setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(1).setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(3).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(3).setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(3).setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8).setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(8).setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6).setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(6).setMaxWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7).setWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7).setMinWidth(0); + tablePublicVorlagen.getColumnModel().getColumn(7).setMaxWidth(0); + + tableAllImages.getColumnModel().getColumn(1).setWidth(0); + tableAllImages.getColumnModel().getColumn(1).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(1).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(3).setWidth(0); + tableAllImages.getColumnModel().getColumn(3).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(3).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(8).setWidth(0); + tableAllImages.getColumnModel().getColumn(8).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(8).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(6).setWidth(0); + tableAllImages.getColumnModel().getColumn(6).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(6).setMaxWidth(0); + tableAllImages.getColumnModel().getColumn(7).setWidth(0); + tableAllImages.getColumnModel().getColumn(7).setMinWidth(0); + tableAllImages.getColumnModel().getColumn(7).setMaxWidth(0); + textFieldName.requestFocusInWindow(); + } + }); + setResizable(false); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("bwLehrpool Suite - Veranstaltung bearbeiten"); + + setBounds(0, 0, 918, 722); + GuiOrganizer.centerGUI(this); + + + final DefaultTableModel model = new DefaultTableModel(titles, 0); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Image verlinken"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("W\u00E4hlen Sie bitte ein Image aus, auf dem Ihre Versanstaltung basiert."); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 531); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 49, 557, 91); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel lblNewLabel_2 = new JLabel("Name:"); + lblNewLabel_2.setBounds(10, 30, 80, 20); + panel_1.add(lblNewLabel_2); + + JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:"); + lblInternetIstInnerhalb.setBounds(10, 58, 80, 20); + panel_1.add(lblInternetIstInnerhalb); + + textFieldName = new JTextField(); + textFieldName.addKeyListener(new KeyAdapter() { + @Override + public void keyReleased(KeyEvent e) { + String stext = textFieldName.getText(); + // Wenn Textfield nicht leer + if (stext != "") { + activeSearch=true; + // Filtere nach der Eingabe + rowSorterAll.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + + }else{ + activeSearch=false; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + "true", 8)); + rowSorterAll.setRowFilter(null); + } + + } + + }); + + textFieldName.setBounds(96, 30, 166, 20); + panel_1.add(textFieldName); + textFieldName.setColumns(10); + + comboBox = new JComboBox(); + try { + List list = client.getAllOS(); + comboBox.addItem(""); + for (int i = 0; i < list.size(); i++) { + comboBox.addItem(list.get(i)); + } + } catch (TException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + comboBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + // Prueft das die Auswahl nicht leer ist + if (comboBox.getSelectedItem().toString() != "") { + activeSearch=true; + rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox + .getSelectedItem().toString(), 2)); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + comboBox.getSelectedItem().toString(), 2)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + comboBox.getSelectedItem().toString(), 2)); + }else{ + activeSearch=false; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter( + "true", 8)); + rowSorterAll.setRowFilter(null); + } + } + }); + comboBox.setBounds(96, 58, 166, 20); + panel_1.add(comboBox); + + JLabel label_3 = new JLabel("Beschreibung:"); + label_3.setBounds(291, 30, 80, 20); + panel_1.add(label_3); + + textField = new JTextField(); + textField.setColumns(10); + textField.setBounds(381, 30, 166, 20); + panel_1.add(textField); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + + EditLectureLink_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Veranstaltung"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 76, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(151, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Veranstaltung verlinken"); + lblNewLabel_1.setBounds(164, 11, 113, 14); + contentPanel.add(lblNewLabel_1); + + tabbedPane = new JTabbedPane(JTabbedPane.TOP); + tabbedPane.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent arg0) { + if (tabbedPane.getSelectedIndex() == 0 && activeSearch==false) { + + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + }else if(tabbedPane.getSelectedIndex()==1 && activeSearch==false){ + rowSorterPublicVorlagen.setRowFilter(RowFilter.regexFilter("true", 8)); + } else if(tabbedPane.getSelectedIndex()==2 && activeSearch==false){ + rowSorterAll.setRowFilter(null); + } + + } + }); + + tabbedPane.setBounds(10, 158, 557, 339); + contentPanel.add(tabbedPane); + + JScrollPane scrollPaneAllImages = new JScrollPane(); + tableAllImages.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + + String imageid = modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 6) + .toString(); + //System.out.println(imageid); + String version = modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 7) + .toString(); + //System.out.println(version); + writeImageData(imageid, version); + + } + }); + tableAllImages.setModel(modelAll); + tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit(); + tableAllImages.setRowSorter(rowSorterAll); + JScrollPane scrollPaneMyImage = new JScrollPane(); + tablemyImages.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + String imageid = modelMyImages + .getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 6) + .toString(); + //System.out.println(imageid); + String version = modelMyImages + .getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 7) + .toString(); + //System.out.println(version); + writeImageData(imageid, version); + } + }); + tablemyImages.setModel(modelMyImages); + tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit(); + tablemyImages.setRowSorter(rowSorterMyImages); + scrollPaneMyImage.setViewportView(tablemyImages); + tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null); + + JScrollPane scrollPanePublicVorlagen = new JScrollPane(); + scrollPanePublicVorlagen.setEnabled(false); + tablePublicVorlagen.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + String imageid = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 6) + .toString(); + //System.out.println(imageid); + String version = modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 7) + .toString(); + //System.out.println(version); + writeImageData(imageid, version); + } + }); + tablePublicVorlagen.setModel(modelPublicVorlagen); + tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit(); + tablePublicVorlagen.setRowSorter(rowSorterPublicVorlagen); + scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen); + tabbedPane.addTab("Vorlagen", null, + scrollPanePublicVorlagen, null); + + + scrollPaneAllImages.setViewportView(tableAllImages); + tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); + + JScrollPane scrollPaneCoopImages = new JScrollPane(); + + tableCoopImages.setModel(model); + tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit(); + + scrollPaneCoopImages.setViewportView(tableCoopImages); + tabbedPane.addTab("bwLehrpool", null, scrollPaneCoopImages, + null); + tabbedPane.setEnabledAt(3, false); + + JButton btnLinkLschen = new JButton("Link l\u00F6schen"); + btnLinkLschen.setEnabled(false); + btnLinkLschen.setBounds(478, 508, 89, 23); + contentPanel.add(btnLinkLschen); + + + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 902, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton okButton = new JButton("Zur\u00FCck"); + okButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + PermissionEditLecture_GUI el = new PermissionEditLecture_GUI(); + el.setVisible(true); + dispose(); + } + }); + okButton.setActionCommand("OK"); + buttonPane.add(okButton); + getRootPane().setDefaultButton(okButton); + } + { + JButton cancelButton = new JButton( + "Veranstaltung \u00e4ndern und abschlie\u00DFen"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + // check if a row is selected + if (tablemyImages.getSelectedRow() != -1){ + + // a row is selected, do operations + String imagename = tablemyImages.getValueAt( + tablemyImages.getSelectedRow(), 0) + .toString(); + try { + DateFormat formatter = new SimpleDateFormat( + "yyyy-MM-dd hh:mm:ss"); + client.updateLecturedata( + Lecture.lecture.getName(), + Lecture.lecture.getNewName(), + Lecture.lecture.getShortDesc(), + Lecture.lecture.getDesc(), + formatter.format( + Lecture.lecture.getStartdate()) + .toString(), + formatter.format( + Lecture.lecture.getEnddate()) + .toString(), + Lecture.lecture.isActive(), + modelMyImages + .getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 6).toString(), + modelMyImages + .getValueAt( + tablemyImages + .convertRowIndexToModel(tablemyImages + .getSelectedRow()), 7) + .toString(), + person.verantwortlicher.getUsername(), + person.verantwortlicher.getVorname(), + person.verantwortlicher.getName(), + person.verantwortlicher.getHochschule(), + person.verantwortlicher.getEMail(), + person.verantwortlicher.getTel(), + person.verantwortlicher.getFakultaet(), + Lecture.lecture.getid()); + JOptionPane + .showMessageDialog( + null, + "Ihre Veranstaltung wurde erfolgreich ge�ndert. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", + "Veranstaltung angelegt", + JOptionPane.INFORMATION_MESSAGE); + // zurueck zum Menue + MainMenue_GUI m = new MainMenue_GUI(); + m.setVisible(true); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + JOptionPane + .showMessageDialog( + null, + "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.", + "Error", + JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(null, + e1.getCause()+"\n"+e1.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } + + dispose(); + + }else if (tablePublicVorlagen.getSelectedRow() != -1 &&tablePublicVorlagen.getValueAt(tablePublicVorlagen.getSelectedRow(), 4).toString().equals(username)){ + + // a row is selected, do operations + String imagename = tablePublicVorlagen.getValueAt( + tablePublicVorlagen.getSelectedRow(), 0) + .toString(); + try { + DateFormat formatter = new SimpleDateFormat( + "yyyy-MM-dd hh:mm:ss"); + client.updateLecturedata( + Lecture.lecture.getName(), + Lecture.lecture.getNewName(), + Lecture.lecture.getShortDesc(), + Lecture.lecture.getDesc(), + formatter.format( + Lecture.lecture.getStartdate()) + .toString(), + formatter.format( + Lecture.lecture.getEnddate()) + .toString(), + Lecture.lecture.isActive(), + modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 6).toString(), + modelPublicVorlagen + .getValueAt( + tablePublicVorlagen + .convertRowIndexToModel(tablePublicVorlagen + .getSelectedRow()), 7).toString(), + person.verantwortlicher.getUsername(), + person.verantwortlicher.getVorname(), + person.verantwortlicher.getName(), + person.verantwortlicher.getHochschule(), + person.verantwortlicher.getEMail(), + person.verantwortlicher.getTel(), + person.verantwortlicher.getFakultaet(), + Lecture.lecture.getid()); + JOptionPane + .showMessageDialog( + null, + "Ihre Veranstaltung wurde erfolgreich ge�ndert. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", + "Veranstaltung angelegt", + JOptionPane.INFORMATION_MESSAGE); + // zurueck zum Menue + MainMenue_GUI m = new MainMenue_GUI(); + m.setVisible(true); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + JOptionPane + .showMessageDialog( + null, + "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.", + "Error", + JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(null, + e1.getCause()+"\n"+e1.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } + + dispose(); + + }else if (tableAllImages.getSelectedRow() != -1 &&tableAllImages.getValueAt(tableAllImages.getSelectedRow(), 4).toString().equals(username)){ + + // a row is selected, do operations + String imagename = tableAllImages.getValueAt( + tableAllImages.getSelectedRow(), 0) + .toString(); + try { + DateFormat formatter = new SimpleDateFormat( + "yyyy-MM-dd hh:mm:ss"); + client.updateLecturedata( + Lecture.lecture.getName(), + Lecture.lecture.getNewName(), + Lecture.lecture.getShortDesc(), + Lecture.lecture.getDesc(), + formatter.format( + Lecture.lecture.getStartdate()) + .toString(), + formatter.format( + Lecture.lecture.getEnddate()) + .toString(), + Lecture.lecture.isActive(), + modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 6) + .toString(), + modelAll + .getValueAt( + tableAllImages + .convertRowIndexToModel(tableAllImages + .getSelectedRow()), 7) + .toString(), + person.verantwortlicher.getUsername(), + person.verantwortlicher.getVorname(), + person.verantwortlicher.getName(), + person.verantwortlicher.getHochschule(), + person.verantwortlicher.getEMail(), + person.verantwortlicher.getTel(), + person.verantwortlicher.getFakultaet(), + Lecture.lecture.getid()); + JOptionPane + .showMessageDialog( + null, + "Ihre Veranstaltung wurde erfolgreich ge�ndert. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.", + "Veranstaltung angelegt", + JOptionPane.INFORMATION_MESSAGE); + // zurueck zum Menue + MainMenue_GUI m = new MainMenue_GUI(); + m.setVisible(true); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + JOptionPane + .showMessageDialog( + null, + "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.", + "Error", + JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(null, + e1.getCause()+"\n"+e1.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } + + dispose(); + + } + else { + // nothing selected + JOptionPane.showMessageDialog(null, + "Bitte w\u00e4hlen Sie ein Image aus.", + "Image Auswahl", + JOptionPane.INFORMATION_MESSAGE); + } + + } + }); + cancelButton.setActionCommand("Cancel"); + buttonPane.add(cancelButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 79, 912, 1); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 912, 2); + getContentPane().add(separator_1); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBorder(new TitledBorder(null, "Detailinformationen", + + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel.setBackground(SystemColor.menu); + panel.setBounds(586, 85, 316, 531); + getContentPane().add(panel); + + JLabel lblName = new JLabel("Name:"); + lblName.setBounds(10, 87, 130, 14); + panel.add(lblName); + + labelName = new JLabel(""); + labelName.setBounds(10, 102, 296, 14); + panel.add(labelName); + + JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); + lblVerantwortlicher.setBounds(10, 259, 130, 14); + panel.add(lblVerantwortlicher); + + labelOS = new JLabel(""); + labelOS.setBounds(10, 216, 296, 14); + panel.add(labelOS); + + JLabel lblWeitereVerantwortliche = new JLabel("Betriebssystem:"); + lblWeitereVerantwortliche.setBounds(10, 202, 130, 14); + panel.add(lblWeitereVerantwortliche); + + labelVerantwortlicher = new JLabel(""); + labelVerantwortlicher.setBounds(10, 272, 296, 14); + panel.add(labelVerantwortlicher); + + JLabel label = new JLabel("Weitere Verantwortliche:"); + label.setBounds(10, 284, 130, 14); + panel.add(label); + + labelWeitereVerantwortliche = new JLabel(""); + labelWeitereVerantwortliche.setBounds(10, 297, 296, 14); + panel.add(labelWeitereVerantwortliche); + + labelUpdate = new JLabel(""); + labelUpdate.setBounds(10, 245, 296, 14); + panel.add(labelUpdate); + + JLabel lblLetztesUpdate = new JLabel("Letztes Update:"); + lblLetztesUpdate.setBounds(10, 231, 130, 14); + panel.add(lblLetztesUpdate); + + JLabel lblImageIstVorlage = new JLabel("Image ist Vorlage:"); + lblImageIstVorlage.setBounds(10, 336, 130, 14); + panel.add(lblImageIstVorlage); + + labelVorlage = new JLabel(""); + labelVorlage.setBounds(10, 350, 296, 14); + panel.add(labelVorlage); + + labelLizenzSoftware = new JLabel(""); + labelLizenzSoftware.setBounds(10, 383, 296, 14); + panel.add(labelLizenzSoftware); + + JLabel lblLizenzpflichtigeSoftware = new JLabel("Lizenzpflichtige Software:"); + lblLizenzpflichtigeSoftware.setBounds(10, 367, 130, 14); + panel.add(lblLizenzpflichtigeSoftware); + + JLabel lblInternet = new JLabel("Internetsperre vorhanden:"); + lblInternet.setBounds(10, 400, 130, 14); + panel.add(lblInternet); + + labelInternet = new JLabel(""); + labelInternet.setBounds(10, 417, 296, 14); + panel.add(labelInternet); + + JLabel lblEmpfehlungRam = new JLabel("Empfehlung RAM:"); + lblEmpfehlungRam.setBounds(10, 432, 130, 14); + panel.add(lblEmpfehlungRam); + + labelRam = new JLabel(""); + labelRam.setBounds(10, 455, 296, 14); + panel.add(labelRam); + + JLabel lblEmpfehlungCpu = new JLabel("Empfehlung CPU:"); + lblEmpfehlungCpu.setBounds(10, 469, 130, 14); + panel.add(lblEmpfehlungCpu); + + labelCPU = new JLabel(""); + labelCPU.setBounds(10, 487, 296, 14); + panel.add(labelCPU); + + JLabel lblTechnischeDaten = new JLabel("Technische Daten:"); + lblTechnischeDaten.setBounds(10, 322, 296, 14); + panel.add(lblTechnischeDaten); + + JLabel lblId = new JLabel("ID:"); + lblId.setBounds(10, 23, 296, 14); + panel.add(lblId); + + labelID = new JLabel(""); + labelID.setBounds(10, 37, 296, 14); + panel.add(labelID); + + labelVersion = new JLabel(""); + labelVersion.setBounds(10, 73, 296, 14); + panel.add(labelVersion); + + JLabel lblVersion = new JLabel("Version:"); + lblVersion.setBounds(10, 57, 296, 14); + panel.add(lblVersion); + + JLabel lblBeschreibung = new JLabel("Beschreibung:"); + lblBeschreibung.setBounds(10, 119, 130, 14); + panel.add(lblBeschreibung); + + JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBounds(10, 135, 296, 65); + panel.add(scrollPane); + + textAreadesc = new JTextArea(); + textAreadesc.setLineWrap(true); + textAreadesc.setBackground(SystemColor.menu); + scrollPane.setViewportView(textAreadesc); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAbout); + + } + + // Initiale Beffuelung eines Table models + public DefaultTableModel initTableModel(DefaultTableModel model) throws TException, ParseException { + List images; + + // Hole eine Liste der Images + images = client.getImageList(); + + Iterator i = images.iterator(); + SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); + int x = 0; + + while (i.hasNext()) { + // erzeuge Objekte fuer die Tabelle + Object[] obj = { images.get(x).getImageName(), + images.get(x).getLicenseRestriction(), + images.get(x).getOsName(), + images.get(x).getLectureName(), + images.get(x).getUserData(), + out.format(in.parse(images.get(x).updateTime)), images.get(x).id, + images.get(x).getVersion(), + images.get(x).getIsTemplate() }; + // Fuege diese Objekte der Tabelle hinzu + model.addRow(obj); + x++; + i.next(); + + } + + return model; + + + } + public void writeImageData(String id, String version){ + try { + SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); + Map res=client.getImageData(id,version); + labelName.setText(res.get("name")); + labelOS.setText(res.get("os")); + labelUpdate.setText(out.format(in.parse(res.get("lastupdate")))); + labelVerantwortlicher.setText(res.get("owner")); + labelWeitereVerantwortliche.setText("Noch nicht Verf�gbar"); + if(res.get("template").equals("true")){ + labelVorlage.setText("Ja"); + }else{ + labelVorlage.setText("Nein"); + } + if(res.get("license").equals("1")){ + labelLizenzSoftware.setText("Ja"); + } + else + { + labelLizenzSoftware.setText("Nein"); + } + if(res.get("internet").equals("1")){ + labelInternet.setText("Ja"); + } + else + { + labelInternet.setText("Nein"); + } + labelRam.setText(res.get("ram")); + labelCPU.setText(res.get("cpu")); + labelID.setText(res.get("id")); + labelVersion.setText(res.get("version")); + textAreadesc.setText(res.get("desc")); + } catch (TException | ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } +} diff --git a/dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java b/dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java new file mode 100644 index 00000000..6f0786ef --- /dev/null +++ b/dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java @@ -0,0 +1,824 @@ +package gui.lecture; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JSeparator; +import javax.swing.JTabbedPane; +import javax.swing.JTable; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.RowFilter; +import javax.swing.ScrollPaneConstants; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableModel; +import javax.swing.table.TableRowSorter; + +import models.Lecture; +import models.Links; +import models.person; + +import org.apache.thrift.TException; + +import server.Server.Client; +import thrift.ThriftConnection; +import util.GuiOrganizer; +import util.OpenLinks; + +@SuppressWarnings("serial") +public class EditLectureSearch_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JRadioButton rdbtnInternetJa; + JRadioButton rdbtnInternetNein; + JLabel labelAktiv; + JLabel labelstartdate; + JLabel labelenddate; + JLabel labelimageversion; + JTextArea labelName; + JTextArea labelimage; + JTextArea labeldesc; + JLabel labelVerantwortlicher; + JTable tableAllLectures; + JTable tablemyLectures; + private JTextField textFieldName; + JTabbedPane tabbedPane; + boolean activeSearch = false; + String[] titles = { "Veranstaltungsname", "Beschreibung", + "G\u00fcltigkeitsdatum", "Aktiv", "Letzte Benutzung", + "Verantwortlicher", "Image", "Schlagwort", "ID" }; + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); + final DefaultTableModel modelAll = new DefaultTableModel(titles, 0) { + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0) { + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final TableRowSorter rowSorterAll = new TableRowSorter( + modelAll); + final TableRowSorter rowSorterMyLectures = new TableRowSorter( + modelMyLectures); + private JTextField textField; + + /** + * Create the dialog. + */ + public EditLectureSearch_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + // Beendet die Anwendung nach klick auf X + con.closeThriftConnection(); + System.exit(0); + } + + @Override + public void windowOpened(WindowEvent arg0) { + textFieldName.requestFocusInWindow(); + try { + initTableModel(modelMyLectures); + initTableModel(modelAll); + + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + // auszublendende Angaben + // 1=Beschreibung + // 2=G\u00fcltigkeitsdatum + // 3=Aktiv + // 6=Image + // 7=Schlagwort + // 8=ID + tablemyLectures.getColumnModel().getColumn(1).setWidth(0); + tablemyLectures.getColumnModel().getColumn(1).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(1).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(2).setWidth(0); + tablemyLectures.getColumnModel().getColumn(2).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(2).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(3).setWidth(0); + tablemyLectures.getColumnModel().getColumn(3).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(3).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(6).setWidth(0); + tablemyLectures.getColumnModel().getColumn(6).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(6).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(7).setWidth(0); + tablemyLectures.getColumnModel().getColumn(7).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(7).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(8).setWidth(0); + tablemyLectures.getColumnModel().getColumn(8).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(8).setMaxWidth(0); + + tableAllLectures.getColumnModel().getColumn(1).setWidth(0); + tableAllLectures.getColumnModel().getColumn(1).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(1).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(2).setWidth(0); + tableAllLectures.getColumnModel().getColumn(2).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(2).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(3).setWidth(0); + tableAllLectures.getColumnModel().getColumn(3).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(3).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(6).setWidth(0); + tableAllLectures.getColumnModel().getColumn(6).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(6).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(7).setWidth(0); + tableAllLectures.getColumnModel().getColumn(7).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(7).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(8).setWidth(0); + tableAllLectures.getColumnModel().getColumn(8).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(8).setMaxWidth(0); + } + }); + // Verhindert das Vergroessern Des Fensters + setResizable(false); + + try { + // Setzt das Look & Feel auf System + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + // Setzt den Fenstertitel + setTitle("bwLehrpool Suite - Veranstaltung bearbeiten"); + // Zentriert das Fenster in die Bildmitte + setBounds(0, 0, 842, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 816, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Suche nach Veranstaltung"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten VL-Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 531); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 49, 557, 66); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel lblNewLabel_2 = new JLabel("Name:"); + lblNewLabel_2.setBounds(10, 30, 80, 20); + panel_1.add(lblNewLabel_2); + + textFieldName = new JTextField(); + // Key Listener der Tastatureingabe registriert + textFieldName.addKeyListener(new KeyAdapter() { + @Override + public void keyReleased(KeyEvent e) { + // Textfield eingabe auslesen + String stext = textFieldName.getText(); + // Wenn Textfield nicht leer + if (stext != "") { + activeSearch = true; + // Filtere nach der Eingabe + rowSorterAll.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + + } else { + activeSearch = false; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( + username, 5)); + rowSorterAll.setRowFilter(null); + } + } + }); + + textFieldName.setBounds(96, 30, 166, 20); + panel_1.add(textFieldName); + textFieldName.setColumns(10); + + JLabel label = new JLabel("Beschreibung:"); + label.setBounds(291, 30, 80, 20); + panel_1.add(label); + + textField = new JTextField(); + textField.setColumns(10); + textField.setBounds(381, 30, 166, 20); + panel_1.add(textField); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + // oeffnet das Hauptmenue + + EditLectureSearch_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Veranstaltung"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 75, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(152, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Veranstaltungsauswahl"); + lblNewLabel_1.setBounds(166, 11, 128, 14); + contentPanel.add(lblNewLabel_1); + + tabbedPane = new JTabbedPane(JTabbedPane.TOP); + tabbedPane.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent arg0) { + if (tabbedPane.getSelectedIndex() == 0) { + + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( + username, 5)); + } else if (tabbedPane.getSelectedIndex() == 1) { + rowSorterAll.setRowFilter(null); + } + + } + }); + + tabbedPane.setBounds(10, 123, 557, 397); + contentPanel.add(tabbedPane); + + JScrollPane scrollPaneAllImages = new JScrollPane(); + tableAllLectures = new JTable(); + tableAllLectures.getSelectionModel().addListSelectionListener( + new ListSelectionListener() { + public void valueChanged(ListSelectionEvent e) { + String imageid = modelAll + .getValueAt( + tableAllLectures + .convertRowIndexToModel(tableAllLectures + .getSelectedRow()), 8) + .toString(); + //System.out.println(imageid); + + try { + writeLectureData(imageid); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); + tableAllLectures.setModel(modelAll); + tableAllLectures.getColumnModel().getColumn(1).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(2).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(3).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(4).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(5).sizeWidthToFit(); + + JScrollPane scrollPaneMyImage = new JScrollPane(); + tablemyLectures = new JTable(); + tablemyLectures.getSelectionModel().addListSelectionListener( + new ListSelectionListener() { + public void valueChanged(ListSelectionEvent e) { + String imageid = modelMyLectures.getValueAt( + tablemyLectures + .convertRowIndexToModel(tablemyLectures + .getSelectedRow()), 8) + .toString(); + //System.out.println(imageid); + + try { + writeLectureData(imageid); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); + tablemyLectures.setModel(modelMyLectures); + + tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(2).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(3).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(4).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(5).sizeWidthToFit(); + tablemyLectures.setRowSorter(rowSorterMyLectures); + + scrollPaneMyImage.setViewportView(tablemyLectures); + tabbedPane.addTab("Meine Veranstaltungen", null, scrollPaneMyImage, + null); + tableAllLectures.setRowSorter(rowSorterAll); + + scrollPaneAllImages.setViewportView(tableAllLectures); + tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 826, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton btnBack = new JButton("Zur\u00FCck"); + btnBack.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + // oeffnet das Hauptmenue + + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + dispose(); + } + }); + btnBack.setActionCommand("OK"); + buttonPane.add(btnBack); + getRootPane().setDefaultButton(btnBack); + } + { + JButton btnContinue = new JButton("Weiter"); + btnContinue.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + String username = person.verantwortlicher.getName() + + " " + person.verantwortlicher.getVorname(); + // check if a row is selected + if (tablemyLectures.getSelectedRow() != -1) { + + // a row is selected, do operations + + Lecture.lecture.setid(modelMyLectures + .getValueAt( + tablemyLectures + .convertRowIndexToModel(tablemyLectures + .getSelectedRow()), + 8).toString()); + Lecture.lecture.setName(modelMyLectures + .getValueAt( + tablemyLectures + .convertRowIndexToModel(tablemyLectures + .getSelectedRow()), + 0).toString()); + Lecture.lecture.setDesc(modelMyLectures + .getValueAt( + tablemyLectures + .convertRowIndexToModel(tablemyLectures + .getSelectedRow()), + 1).toString()); + String date = modelMyLectures + .getValueAt( + tablemyLectures + .convertRowIndexToModel(tablemyLectures + .getSelectedRow()), + 2).toString(); + + Lecture.lecture.setLinkedImagename(modelMyLectures + .getValueAt( + tablemyLectures + .convertRowIndexToModel(tablemyLectures + .getSelectedRow()), + 6).toString()); + + int zweitesLeerzeichen = date.indexOf(" ", + date.indexOf(" ") + 1); + + String startdate = date.substring(0, + zweitesLeerzeichen); + String enddate = date.substring(zweitesLeerzeichen); + SimpleDateFormat out = new SimpleDateFormat( + "yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat in = new SimpleDateFormat( + "dd.MM.yyyy HH:mm:ss"); + try { + enddate = out.format(in.parse(enddate)); + startdate = out.format(in.parse(startdate)); + } catch (ParseException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + + DateFormat df = new SimpleDateFormat( + "yyyy-MM-dd HH:mm:ss"); + + try { + // Format has to be "yyyy-MM-dd HH:mm:ss" + Lecture.lecture.setEnddate(df.parse(enddate)); + Lecture.lecture.setStartdate(df + .parse(startdate)); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + if (modelMyLectures + .getValueAt( + tablemyLectures + .convertRowIndexToModel(tablemyLectures + .getSelectedRow()), + 3).toString().equals("1")) { + Lecture.lecture.setActive(true); + } else { + Lecture.lecture.setActive(false); + } + + // EditImageAllgemein_GUI ea=new + // EditImageAllgemein_GUI(); + EditLectureAllgemein_GUI el = new EditLectureAllgemein_GUI(); + el.setVisible(true); + dispose(); + } else if (tableAllLectures.getSelectedRow() != -1 + && tableAllLectures + .getValueAt( + tableAllLectures + .getSelectedRow(), 5) + .toString().equals(username)) { + + // a row is selected, do operations + + Lecture.lecture.setid(modelAll + .getValueAt( + tableAllLectures + .convertRowIndexToModel(tableAllLectures + .getSelectedRow()), + 8).toString()); + Lecture.lecture.setName(modelAll + .getValueAt( + tableAllLectures + .convertRowIndexToModel(tableAllLectures + .getSelectedRow()), + 0).toString()); + Lecture.lecture.setDesc(modelAll + .getValueAt( + tableAllLectures + .convertRowIndexToModel(tableAllLectures + .getSelectedRow()), + 1).toString()); + String date = modelAll + .getValueAt( + tableAllLectures + .convertRowIndexToModel(tableAllLectures + .getSelectedRow()), + 2).toString(); + + Lecture.lecture.setLinkedImagename(modelAll + .getValueAt( + tableAllLectures + .convertRowIndexToModel(tableAllLectures + .getSelectedRow()), + 6).toString()); + + int zweitesLeerzeichen = date.indexOf(" ", + date.indexOf(" ") + 1); + + String startdate = date.substring(0, + zweitesLeerzeichen); + String enddate = date.substring(zweitesLeerzeichen); + SimpleDateFormat out = new SimpleDateFormat( + "yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat in = new SimpleDateFormat( + "dd.MM.yyyy HH:mm:ss"); + try { + enddate = out.format(in.parse(enddate)); + startdate = out.format(in.parse(startdate)); + } catch (ParseException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + DateFormat df = new SimpleDateFormat( + "yyyy-MM-dd HH:mm:ss"); + + try { + // Format has to be "yyyy-MM-dd HH:mm:ss" + Lecture.lecture.setEnddate(df.parse(enddate)); + Lecture.lecture.setStartdate(df + .parse(startdate)); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + if (modelAll + .getValueAt( + tableAllLectures + .convertRowIndexToModel(tableAllLectures + .getSelectedRow()), + 3).toString().equals("1")) { + Lecture.lecture.setActive(true); + } else { + Lecture.lecture.setActive(false); + } + + EditLectureAllgemein_GUI el = new EditLectureAllgemein_GUI(); + el.setVisible(true); + dispose(); + } else { + JOptionPane + .showMessageDialog( + null, + "Bitte w\u00e4hlen Sie ein eigenes Image aus.", + "Message", + JOptionPane.INFORMATION_MESSAGE); + } // End Else + } // Action + + }); + btnContinue.setActionCommand("Cancel"); + buttonPane.add(btnContinue); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 79, 836, 1); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 628, 836, 1); + getContentPane().add(separator_1); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBorder(new TitledBorder(null, "Detailinformationen", + + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel.setBackground(SystemColor.menu); + panel.setBounds(591, 85, 235, 518); + getContentPane().add(panel); + + JLabel lblNewLabel_3 = new JLabel("Name:"); + lblNewLabel_3.setBounds(10, 27, 104, 14); + panel.add(lblNewLabel_3); + + JLabel lblAktiv = new JLabel("Aktiv:"); + lblAktiv.setBounds(10, 98, 104, 14); + panel.add(lblAktiv); + + labelAktiv = new JLabel(""); + labelAktiv.setBounds(10, 114, 218, 14); + panel.add(labelAktiv); + + labelstartdate = new JLabel(""); + labelstartdate.setBounds(10, 147, 218, 14); + panel.add(labelstartdate); + + JLabel lblStartdatum = new JLabel("Startdatum:"); + lblStartdatum.setBounds(10, 129, 104, 14); + panel.add(lblStartdatum); + + labelenddate = new JLabel(""); + labelenddate.setBounds(10, 175, 218, 14); + panel.add(labelenddate); + + JLabel lblEnddatum = new JLabel("Enddatum:"); + lblEnddatum.setBounds(10, 161, 104, 14); + panel.add(lblEnddatum); + + JLabel lblBeschreibung = new JLabel("Beschreibung:"); + lblBeschreibung.setBounds(10, 189, 104, 14); + panel.add(lblBeschreibung); + + JLabel lblImage = new JLabel("Image:"); + lblImage.setBounds(10, 293, 104, 14); + panel.add(lblImage); + + labelVerantwortlicher = new JLabel(""); + labelVerantwortlicher.setBounds(10, 426, 218, 14); + panel.add(labelVerantwortlicher); + + JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); + lblVerantwortlicher.setBounds(10, 411, 104, 14); + panel.add(lblVerantwortlicher); + + JLabel lblImageversion = new JLabel("Imageversion:"); + lblImageversion.setBounds(10, 381, 104, 14); + panel.add(lblImageversion); + + labelimageversion = new JLabel(""); + labelimageversion.setBounds(10, 399, 218, 14); + panel.add(labelimageversion); + + labeldesc = new JTextArea(); + labeldesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); + labeldesc.setEditable(false); + labeldesc.setLineWrap(true); + labeldesc.setBackground(SystemColor.menu); + labeldesc.setBounds(124, 127, 104, 110); + JScrollPane scrollPane = new JScrollPane(labeldesc); + scrollPane.setBounds(10, 209, 218, 81); + panel.add(scrollPane); + // panel.add(labeldesc); + + labelimage = new JTextArea(); + labelimage.setLineWrap(true); + labelimage.setFont(new Font("Tahoma", Font.PLAIN, 11)); + labelimage.setEditable(false); + labelimage.setBackground(SystemColor.menu); + labelimage.setBounds(124, 248, 101, 81); + JScrollPane scrollPaneImage = new JScrollPane(labelimage); + scrollPaneImage.setBounds(10, 309, 215, 69); + panel.add(scrollPaneImage); + + labelName = new JTextArea(); + labelName.setEditable(false); + labelName.setFont(new Font("Tahoma", Font.PLAIN, 11)); + labelName.setBackground(SystemColor.menu); + labelName.setBounds(124, 22, 101, 55); + JScrollPane scrollPaneName = new JScrollPane(labelName); + scrollPaneName.setBounds(10, 40, 218, 55); + panel.add(scrollPaneName); + // panel.add(labelName); + // panel.add(labelimage); + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAbout); + + } + + // Initiale Beffuelung eines Table models + public DefaultTableModel initTableModel(DefaultTableModel model) + throws ParseException { + List lectures; + try { + // Hole eine Liste der Images + lectures = client.getLectureList(); + Iterator i = lectures.iterator(); + SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); + int x = 0; + + while (i.hasNext()) { + // erzeuge Objekte fuer die Tabelle + + Object[] obj = { + lectures.get(x).lecturename, + lectures.get(x).desc, + out.format(in.parse(lectures.get(x).starttime)) + " " + + out.format(in.parse(lectures.get(x).endtime)), + lectures.get(x).isActive, + out.format(in.parse(lectures.get(x).lastused)), + lectures.get(x).username, lectures.get(x).imagename, + " ", lectures.get(x).id }; + // Fuege diese Objekte der Tabelle hinzu + model.addRow(obj); + + x++; + i.next(); + + } + + return model; + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + return model; + } + + public void writeLectureData(String id) throws TException, ParseException { + + SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); + Map res = client.getLectureData(id); + labelName.setText(res.get("name")); + labelAktiv.setText(res.get("isActive")); + labeldesc.setText(res.get("desc")); + labelVerantwortlicher.setText(res.get("owner")); + labelstartdate.setText(out.format(in.parse(res.get("startTime")))); + labelenddate.setText(out.format(in.parse(res.get("endTime")))); + labelimage.setText(res.get("imagepath").substring( + res.get("imagepath").indexOf("/") + 1)); + labelimageversion.setText(res.get("imageversion")); + + } + +} diff --git a/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java new file mode 100644 index 00000000..cfd2337c --- /dev/null +++ b/dozentenmodul/src/main/java/gui/lecture/PermissionCreateLecture_GUI.java @@ -0,0 +1,546 @@ +package gui.lecture; + + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Checkbox; +import java.awt.Color; +import java.awt.Component; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +import javax.swing.AbstractButton; +import javax.swing.ButtonGroup; +import javax.swing.DefaultComboBoxModel; +import javax.swing.Icon; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.JTextPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.JTableHeader; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import javax.swing.table.TableColumn; +import javax.swing.table.TableColumnModel; + +import models.Image; +import models.Links; +import util.GuiOrganizer; +import util.OpenLinks; +import javax.swing.JTable; +import javax.swing.JScrollPane; +import javax.swing.ScrollPaneConstants; +import javax.swing.JTextField; + +import org.eclipse.jface.viewers.CheckboxCellEditor; + +import java.awt.Choice; +import javax.swing.JRadioButton; + +@SuppressWarnings("serial") +public class PermissionCreateLecture_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + private JTable table; + private Class[] classes; + Object[] titles = { "Name","Read", "Write","Admin"}; + + final DefaultTableModel model = new DefaultTableModel(titles, 0){ + + + + public boolean isCellEditable(int rowIndex, int mColIndex) { + if(mColIndex>=1){ + return true; + } + return false; + } + public Class getColumnClass(int c) { + switch(c){ + case 0: + return String.class; + default: + return Boolean.class; + } + } + + + + }; + private JTextField textField; + private JTable table_1; + private final ButtonGroup buttonGroup = new ButtonGroup(); + + public PermissionCreateLecture_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + System.exit(0); + } + }); + setResizable(false); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("bwLehrpool Suite - Berechtigungen"); + + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Veranstaltungen - Berechtigungen (Nur zur Veranschaulichung)"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie.setText("Definieren Sie hier bitte die gew\u00FCnschten Berechtigungen f\u00FCr ihr Lecture"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 531); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Suite-Berechtigungen", TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 207, 311, 313); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JScrollPane scrollPane = new JScrollPane(); + scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + scrollPane.setBounds(10, 21, 291, 249); + panel_1.add(scrollPane); + + table = new JTable(); + table.setModel(model); + table.setSelectionForeground(Color.WHITE); + Object[] rowdata={"Max Mustermann", new Boolean(false),new Boolean(false),new Boolean(false),new Boolean(false)}; + model.addRow(rowdata); + + TableCellRenderer rend=table.getTableHeader().getDefaultRenderer(); + + + TableColumn tc1 = table.getColumnModel().getColumn(1); + tc1.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc1.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc1.setHeaderRenderer(new CheckBoxHeader(new MyItemListener1(),(String) titles[1])); + + TableColumn tc2 = table.getColumnModel().getColumn(2); + tc2.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc2.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc2.setHeaderRenderer(new CheckBoxHeader(new MyItemListener2(),(String) titles[2])); + + TableColumn tc3 = table.getColumnModel().getColumn(3); + tc3.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc3.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc3.setHeaderRenderer(new CheckBoxHeader(new MyItemListener3(),(String) titles[3])); + /* + TableColumn tc4 = table.getColumnModel().getColumn(4); + tc4.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc4.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc4.setHeaderRenderer(new CheckBoxHeader(new MyItemListener4(),(String) titles[4])); + */ + scrollPane.setViewportView(table); + + JButton btnHinzufgen_1 = new JButton("Hinzuf\u00FCgen"); + btnHinzufgen_1.setEnabled(false); + btnHinzufgen_1.setBounds(10, 279, 89, 23); + panel_1.add(btnHinzufgen_1); + + JButton btnLschen_1 = new JButton("L\u00F6schen"); + btnLschen_1.setEnabled(false); + btnLschen_1.setBounds(109, 279, 89, 23); + panel_1.add(btnLschen_1); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + + PermissionCreateLecture_GUI.this.setVisible(false); + MainMenue_GUI main=new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Veranstaltung"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 90, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(181, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Berechtigungen"); + lblNewLabel_1.setBounds(194, 11, 95, 14); + contentPanel.add(lblNewLabel_1); + + JLabel lblName = new JLabel("Name:"); + lblName.setBounds(10, 36, 46, 20); + contentPanel.add(lblName); + + textField = new JTextField(); + textField.setBounds(69, 36, 171, 20); + contentPanel.add(textField); + textField.setColumns(10); + + JLabel lblHochschule = new JLabel("Hochschule:"); + lblHochschule.setBounds(275, 36, 80, 20); + contentPanel.add(lblHochschule); + + JComboBox comboBox = new JComboBox(); + comboBox.setModel(new DefaultComboBoxModel(new String[] {"Hochschule Offenburg", "Hochschule Reutlingen", "Universit\u00E4t Freiburg"})); + comboBox.setBounds(365, 36, 202, 20); + contentPanel.add(comboBox); + + JPanel panel = new JPanel(); + panel.setBounds(10, 67, 557, 129); + contentPanel.add(panel); + panel.setLayout(null); + panel.setBorder(new TitledBorder(null, "Beschreibung", TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel.setBackground(SystemColor.menu); + + JLabel label = new JLabel("Read"); + label.setBounds(20, 18, 90, 20); + panel.add(label); + + JLabel label_3 = new JLabel("Write"); + label_3.setBounds(20, 38, 90, 20); + panel.add(label_3); + + JLabel label_5 = new JLabel("Admin"); + label_5.setBounds(20, 78, 90, 20); + panel.add(label_5); + + JLabel label_7 = new JLabel("Image darf gelesen und gestartet werden und ist in Suchfenster sichtbar."); + label_7.setBounds(120, 18, 380, 20); + panel.add(label_7); + + JLabel lblimageDarfAngepasst = new JLabel("Image darf angepasst und überschrieben, jedoch nicht gelöscht werden. Berechtigungen für andere Benutzer festlegen"); + lblimageDarfAngepasst.setBounds(120, 38, 380, 45); + panel.add(lblimageDarfAngepasst); + + JLabel lblvolleRechteRead = new JLabel("Volle Rechte: read, write, löschen und Berechtigungen für andere Benutzer festlegen."); + lblvolleRechteRead.setBounds(120, 78, 380, 40); + panel.add(lblvolleRechteRead); + + JPanel panel_2 = new JPanel(); + panel_2.setBounds(331, 207, 236, 313); + contentPanel.add(panel_2); + panel_2.setLayout(null); + panel_2.setBorder(new TitledBorder(null, "Sichtbarkeit im VMChooser", TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_2.setBackground(SystemColor.menu); + + JScrollPane scrollPane_1 = new JScrollPane(); + scrollPane_1.setEnabled(false); + scrollPane_1.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + scrollPane_1.setBounds(23, 83, 203, 185); + panel_2.add(scrollPane_1); + + table_1 = new JTable(); + scrollPane_1.setViewportView(table_1); + + JRadioButton rdbtnAlle = new JRadioButton("Sichtbar f\u00FCr alle"); + rdbtnAlle.setEnabled(false); + rdbtnAlle.setSelected(true); + buttonGroup.add(rdbtnAlle); + rdbtnAlle.setBounds(6, 27, 109, 23); + panel_2.add(rdbtnAlle); + + JRadioButton rdbtnIndividuell = new JRadioButton("Individuell"); + rdbtnIndividuell.setEnabled(false); + buttonGroup.add(rdbtnIndividuell); + rdbtnIndividuell.setBounds(6, 53, 109, 23); + panel_2.add(rdbtnIndividuell); + + JButton btnHinzufgen = new JButton("Hinzuf\u00FCgen"); + btnHinzufgen.setEnabled(false); + btnHinzufgen.setBounds(23, 279, 89, 23); + panel_2.add(btnHinzufgen); + + JButton btnLschen = new JButton("L\u00F6schen"); + btnLschen.setEnabled(false); + btnLschen.setBounds(122, 279, 89, 23); + panel_2.add(btnLschen); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton cancelButton = new JButton("Zur\u00FCck"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + + CreateLectureAllgemein_GUI sr=new CreateLectureAllgemein_GUI(); + sr.setVisible(true); + dispose(); + } + }); + cancelButton.setActionCommand("OK"); + buttonPane.add(cancelButton); + //getRootPane().setDefaultButton(cancelButton); + } + { + JButton continueButton = new JButton("Weiter"); + continueButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + CreateLectureLink_GUI ea=new CreateLectureLink_GUI(); + ea.setVisible(true); + dispose(); + + } + }); + continueButton.setActionCommand("Cancel"); + buttonPane.add(continueButton); + getRootPane().setDefaultButton(continueButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 78, 597, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + getContentPane().add(separator_1); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu = new JMenu("Suchen"); + menuBar.add(mnNewMenu); + + JMenuItem mntmVlSuche = new JMenuItem("VL Suche"); + mnNewMenu.add(mntmVlSuche); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAbout); + + } + class MyItemListener1 implements ItemListener + { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for(int x = 0, y = table.getRowCount(); x < y; x++) + { + table.setValueAt(new Boolean(checked),x,1); + } + } + } + class MyItemListener2 implements ItemListener + { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for(int x = 0, y = table.getRowCount(); x < y; x++) + { + table.setValueAt(new Boolean(checked),x,2); + } + } + } + class MyItemListener3 implements ItemListener + { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for(int x = 0, y = table.getRowCount(); x < y; x++) + { + table.setValueAt(new Boolean(checked),x,3); + } + } + } + class MyItemListener4 implements ItemListener + { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for(int x = 0, y = table.getRowCount(); x < y; x++) + { + table.setValueAt(new Boolean(checked),x,4); + } + } + } +} +class CheckBoxHeader extends JCheckBox +implements TableCellRenderer, MouseListener { +protected CheckBoxHeader rendererComponent; +protected int column; +protected boolean mousePressed = false; + +public CheckBoxHeader(ItemListener itemListener ,String text) { +rendererComponent = this; +rendererComponent.addItemListener(itemListener); +rendererComponent.setText(text); +} + +public Component getTableCellRendererComponent( + JTable table, Object value, + boolean isSelected, boolean hasFocus, int row, int column) { +if (table != null) { + JTableHeader header = table.getTableHeader(); + if (header != null) { + rendererComponent.setForeground(header.getForeground()); + rendererComponent.setBackground(header.getBackground()); + rendererComponent.setFont(header.getFont()); + rendererComponent.setBorder(header.getBorder()); + header.addMouseListener(rendererComponent); + } +} +setColumn(column); +//rendererComponent.setText("Check All"); +//setBorder(UIManager.getBorder("TableHeader.cellBorder")); + +return rendererComponent; +} +protected void setColumn(int column) { +this.column = column; +} +public int getColumn() { +return column; +} +protected void handleClickEvent(MouseEvent e) { +if (mousePressed) { + mousePressed=false; + JTableHeader header = (JTableHeader)(e.getSource()); + JTable tableView = header.getTable(); + TableColumnModel columnModel = tableView.getColumnModel(); + int viewColumn = columnModel.getColumnIndexAtX(e.getX()); + int column = tableView.convertColumnIndexToModel(viewColumn); + + if (viewColumn == this.column && e.getClickCount() == 1 && column != -1) { + doClick(); + } +} +} +public void mouseClicked(MouseEvent e) { +handleClickEvent(e); +((JTableHeader)e.getSource()).repaint(); +} +public void mousePressed(MouseEvent e) { +mousePressed = true; +} +public void mouseReleased(MouseEvent e) { +} +public void mouseEntered(MouseEvent e) { +} +public void mouseExited(MouseEvent e) { +} +} diff --git a/dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java new file mode 100644 index 00000000..da8864c7 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/lecture/PermissionEditLecture_GUI.java @@ -0,0 +1,494 @@ +package gui.lecture; + + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Checkbox; +import java.awt.Color; +import java.awt.Component; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +import javax.swing.AbstractButton; +import javax.swing.ButtonGroup; +import javax.swing.DefaultComboBoxModel; +import javax.swing.Icon; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.JTextPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.JTableHeader; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import javax.swing.table.TableColumn; +import javax.swing.table.TableColumnModel; + +import models.Image; +import models.Links; +import util.GuiOrganizer; +import util.OpenLinks; +import javax.swing.JTable; +import javax.swing.JScrollPane; +import javax.swing.ScrollPaneConstants; +import javax.swing.JTextField; + +import org.eclipse.jface.viewers.CheckboxCellEditor; + +import java.awt.Choice; + +@SuppressWarnings("serial") +public class PermissionEditLecture_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + private JTable table; + private Class[] classes; + Object[] titles = { "Name","Read", "Write","Admin"}; + + final DefaultTableModel model = new DefaultTableModel(titles, 0){ + + + + public boolean isCellEditable(int rowIndex, int mColIndex) { + if(mColIndex>=1){ + return true; + } + return false; + } + public Class getColumnClass(int c) { + switch(c){ + case 0: + return String.class; + default: + return Boolean.class; + } + } + + + + }; + private JTextField textField; + + public PermissionEditLecture_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + System.exit(0); + } + }); + setResizable(false); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("bwLehrpool Suite - Berechtigungen"); + + setBounds(0, 0, 603, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Lecture Berechtigungen (Nur zur Veranschaulichung)"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie.setText("Definieren Sie hier bitte die gew\u00FCnschten Berechtigungen f\u00FCr ihr Lecture"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 531); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBorder(new TitledBorder(null, "Beschreibung", TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 67, 557, 129); + contentPanel.add(panel); + + JLabel label = new JLabel("Read"); + label.setBounds(20, 18, 90, 20); + panel.add(label); + + JLabel label_3 = new JLabel("Image darf gelesen und gestartet werden und ist in Suchfenster sichtbar."); + label_3.setBounds(120, 18, 380, 20); + panel.add(label_3); + + JLabel label_4 = new JLabel("Write"); + label_4.setBounds(20, 38, 90, 20); + panel.add(label_4); + + JLabel label_5 = new JLabel("Image darf angepasst und überschrieben, jedoch nicht gelöscht werden. Berechtigungen für andere Benutzer festlegen"); + label_5.setBounds(120, 38, 380, 45); + panel.add(label_5); + + JLabel label_6 = new JLabel("Admin"); + label_6.setBounds(20, 78, 90, 20); + panel.add(label_6); + + JLabel label_7 = new JLabel("Volle Rechte: read, write, löschen und Berechtigungen für andere Benutzer festlegen."); + label_7.setBounds(120, 78, 380, 40); + panel.add(label_7); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Berechtigungen", TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 207, 557, 313); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JScrollPane scrollPane = new JScrollPane(); + scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + scrollPane.setBounds(10, 21, 537, 281); + panel_1.add(scrollPane); + + table = new JTable(); + table.setModel(model); + table.setSelectionForeground(Color.WHITE); + Object[] rowdata={"Max Mustermann", new Boolean(false),new Boolean(false),new Boolean(false),new Boolean(false)}; + model.addRow(rowdata); + + TableCellRenderer rend=table.getTableHeader().getDefaultRenderer(); + + + TableColumn tc1 = table.getColumnModel().getColumn(1); + tc1.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc1.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc1.setHeaderRenderer(new CheckBoxHeader(new MyItemListener1(),(String) titles[1])); + + TableColumn tc2 = table.getColumnModel().getColumn(2); + tc2.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc2.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc2.setHeaderRenderer(new CheckBoxHeader(new MyItemListener2(),(String) titles[2])); + + TableColumn tc3 = table.getColumnModel().getColumn(3); + tc3.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc3.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc3.setHeaderRenderer(new CheckBoxHeader(new MyItemListener3(),(String) titles[3])); + /* + TableColumn tc4 = table.getColumnModel().getColumn(4); + tc4.setCellEditor(table.getDefaultEditor(Boolean.class)); + tc4.setCellRenderer(table.getDefaultRenderer(Boolean.class)); + tc4.setHeaderRenderer(new CheckBoxHeader(new MyItemListener4(),(String) titles[4])); + */ + scrollPane.setViewportView(table); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + + PermissionEditLecture_GUI.this.setVisible(false); + MainMenue_GUI main=new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Veranstaltung"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 90, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(181, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Berechtigungen"); + lblNewLabel_1.setBounds(194, 11, 99, 14); + contentPanel.add(lblNewLabel_1); + + JLabel lblName = new JLabel("Name:"); + lblName.setBounds(10, 36, 46, 20); + contentPanel.add(lblName); + + textField = new JTextField(); + textField.setBounds(69, 36, 171, 20); + contentPanel.add(textField); + textField.setColumns(10); + + JLabel lblHochschule = new JLabel("Hochschule:"); + lblHochschule.setBounds(275, 36, 80, 20); + contentPanel.add(lblHochschule); + + JComboBox comboBox = new JComboBox(); + comboBox.setModel(new DefaultComboBoxModel(new String[] {"Hochschule Offenburg", "Hochschule Reutlingen", "Universit\u00E4t Freiburg"})); + comboBox.setBounds(365, 36, 202, 20); + contentPanel.add(comboBox); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton cancelButton = new JButton("Zur\u00FCck"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + + EditLectureAllgemein_GUI sr=new EditLectureAllgemein_GUI(); + sr.setVisible(true); + dispose(); + } + }); + cancelButton.setActionCommand("OK"); + buttonPane.add(cancelButton); + //getRootPane().setDefaultButton(cancelButton); + } + { + JButton continueButton = new JButton("Weiter"); + continueButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + EditLectureLink_GUI ea=new EditLectureLink_GUI(); + ea.setVisible(true); + dispose(); + + } + }); + continueButton.setActionCommand("Cancel"); + buttonPane.add(continueButton); + getRootPane().setDefaultButton(continueButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 78, 597, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + getContentPane().add(separator_1); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu = new JMenu("Suchen"); + menuBar.add(mnNewMenu); + + JMenuItem mntmVlSuche = new JMenuItem("VL Suche"); + mnNewMenu.add(mntmVlSuche); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAbout); + + } + class MyItemListener1 implements ItemListener + { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for(int x = 0, y = table.getRowCount(); x < y; x++) + { + table.setValueAt(new Boolean(checked),x,1); + } + } + } + class MyItemListener2 implements ItemListener + { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for(int x = 0, y = table.getRowCount(); x < y; x++) + { + table.setValueAt(new Boolean(checked),x,2); + } + } + } + class MyItemListener3 implements ItemListener + { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for(int x = 0, y = table.getRowCount(); x < y; x++) + { + table.setValueAt(new Boolean(checked),x,3); + } + } + } + class MyItemListener4 implements ItemListener + { + public void itemStateChanged(ItemEvent e) { + Object source = e.getSource(); + if (source instanceof AbstractButton == false) return; + boolean checked = e.getStateChange() == ItemEvent.SELECTED; + for(int x = 0, y = table.getRowCount(); x < y; x++) + { + table.setValueAt(new Boolean(checked),x,4); + } + } + } +} +/*class CheckBoxHeader extends JCheckBox +implements TableCellRenderer, MouseListener { +protected CheckBoxHeader rendererComponent; +protected int column; +protected boolean mousePressed = false; + +public CheckBoxHeader(ItemListener itemListener ,String text) { +rendererComponent = this; +rendererComponent.addItemListener(itemListener); +rendererComponent.setText(text); +} + +public Component getTableCellRendererComponent( + JTable table, Object value, + boolean isSelected, boolean hasFocus, int row, int column) { +if (table != null) { + JTableHeader header = table.getTableHeader(); + if (header != null) { + rendererComponent.setForeground(header.getForeground()); + rendererComponent.setBackground(header.getBackground()); + rendererComponent.setFont(header.getFont()); + rendererComponent.setBorder(header.getBorder()); + header.addMouseListener(rendererComponent); + } +} +setColumn(column); +//rendererComponent.setText("Check All"); +//setBorder(UIManager.getBorder("TableHeader.cellBorder")); + +return rendererComponent; +} +protected void setColumn(int column) { +this.column = column; +} +public int getColumn() { +return column; +} +protected void handleClickEvent(MouseEvent e) { +if (mousePressed) { + mousePressed=false; + JTableHeader header = (JTableHeader)(e.getSource()); + JTable tableView = header.getTable(); + TableColumnModel columnModel = tableView.getColumnModel(); + int viewColumn = columnModel.getColumnIndexAtX(e.getX()); + int column = tableView.convertColumnIndexToModel(viewColumn); + + if (viewColumn == this.column && e.getClickCount() == 1 && column != -1) { + doClick(); + } +} +} +public void mouseClicked(MouseEvent e) { +handleClickEvent(e); +((JTableHeader)e.getSource()).repaint(); +} +public void mousePressed(MouseEvent e) { +mousePressed = true; +} +public void mouseReleased(MouseEvent e) { +} +public void mouseEntered(MouseEvent e) { +} +public void mouseExited(MouseEvent e) { +} +} */ diff --git a/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java new file mode 100644 index 00000000..7a6c2118 --- /dev/null +++ b/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java @@ -0,0 +1,627 @@ +package gui.lecture; + +import gui.intro.About_GUI; +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Point; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JSeparator; +import javax.swing.JTabbedPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.RowFilter; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableModel; +import javax.swing.table.TableRowSorter; + +import models.Links; +import models.person; + +import org.apache.thrift.TException; + +import server.Server.Client; +import thrift.ThriftConnection; +import util.GuiOrganizer; +import util.OpenLinks; +import javax.swing.JTextArea; +import javax.swing.ScrollPaneConstants; + +@SuppressWarnings("serial") +public class SearchLecture_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JRadioButton rdbtnInternetJa; + JRadioButton rdbtnInternetNein; + JLabel labelAktiv; + JLabel labelstartdate; + JLabel labelenddate; + JLabel labelimageversion; + JTextArea labelName; + JTextArea labelimage; + JTextArea labeldesc; + JLabel labelVerantwortlicher; + JTable tableAllLectures; + JTable tablemyLectures; + private JTextField textFieldName; + JTabbedPane tabbedPane; + boolean activeSearch=false; + String[] titles = { "Veranstaltungsname", "Beschreibung", + "G\u00fcltigkeitsdatum", "Aktiv", "Letzte Benutzung", + "Verantwortlicher", "Image", "Schlagwort", "ID" }; + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); + final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){ + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0){ + public boolean isCellEditable(int rowIndex, int mColIndex) { + return false; + } + }; + final TableRowSorter rowSorterAll = new TableRowSorter( + modelAll); + final TableRowSorter rowSorterMyLectures = new TableRowSorter( + modelMyLectures); + private JTextField textField; + + + /** + * Create the dialog. + */ + public SearchLecture_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + // Beendet die Anwendung nach klick auf X + con.closeThriftConnection(); + System.exit(0); + } + @Override + public void windowOpened(WindowEvent arg0) { + try { + initTableModel(modelMyLectures); + initTableModel(modelAll); + + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + tablemyLectures.getColumnModel().getColumn(1).setWidth(0); + tablemyLectures.getColumnModel().getColumn(1).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(1).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(2).setWidth(0); + tablemyLectures.getColumnModel().getColumn(2).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(2).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(3).setWidth(0); + tablemyLectures.getColumnModel().getColumn(3).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(3).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(6).setWidth(0); + tablemyLectures.getColumnModel().getColumn(6).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(6).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(7).setWidth(0); + tablemyLectures.getColumnModel().getColumn(7).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(7).setMaxWidth(0); + tablemyLectures.getColumnModel().getColumn(8).setWidth(0); + tablemyLectures.getColumnModel().getColumn(8).setMinWidth(0); + tablemyLectures.getColumnModel().getColumn(8).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(1).setWidth(0); + tableAllLectures.getColumnModel().getColumn(1).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(1).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(2).setWidth(0); + tableAllLectures.getColumnModel().getColumn(2).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(2).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(3).setWidth(0); + tableAllLectures.getColumnModel().getColumn(3).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(3).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(6).setWidth(0); + tableAllLectures.getColumnModel().getColumn(6).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(6).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(7).setWidth(0); + tableAllLectures.getColumnModel().getColumn(7).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(7).setMaxWidth(0); + tableAllLectures.getColumnModel().getColumn(8).setWidth(0); + tableAllLectures.getColumnModel().getColumn(8).setMinWidth(0); + tableAllLectures.getColumnModel().getColumn(8).setMaxWidth(0); + } + }); + // Verhindert das Vergroessern Des Fensters + setResizable(false); + + try { + // Setzt das Look & Feel auf System + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + // Setzt den Fenstertitel + setTitle("bwLehrpool Suite - Veranstaltung suchen"); + // Zentriert das Fenster in die Bildmitte 2; + setBounds(0, 0, 842, 722); + GuiOrganizer.centerGUI(this); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 816, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Suche nach Veranstaltung"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("Hier k\u00F6nnen Sie nach Ihrer gew\u00fcnschten Veranstaltung suchen und diese f\u00fcr weitere Schritte ausw\u00e4hlen."); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 531); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 49, 557, 63); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel lblNewLabel_2 = new JLabel("Name:"); + lblNewLabel_2.setBounds(10, 30, 80, 20); + panel_1.add(lblNewLabel_2); + + textFieldName = new JTextField(); + // Key Listener der Tastatureingabe registriert + textFieldName.addKeyListener(new KeyAdapter() { + @Override + public void keyReleased(KeyEvent e) { + // Textfield eingabe auslesen + String stext = textFieldName.getText(); + // Wenn Textfield nicht leer + if (stext != "") { + activeSearch=true; + // Filtere nach der Eingabe + rowSorterAll.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + + }else{ + activeSearch=false; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( + username, 5)); + rowSorterAll.setRowFilter(null); + } + } + }); + + textFieldName.setBounds(96, 30, 166, 20); + panel_1.add(textFieldName); + textFieldName.setColumns(10); + + JLabel label = new JLabel("Beschreibung:"); + label.setBounds(291, 30, 80, 20); + panel_1.add(label); + + textField = new JTextField(); + textField.setColumns(10); + textField.setBounds(381, 30, 166, 20); + panel_1.add(textField); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00fc"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + // oeffnet das Hauptmenue + + SearchLecture_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Veranstaltung"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 75, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(152, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Veranstaltungssuche"); + lblNewLabel_1.setBounds(166, 11, 128, 14); + contentPanel.add(lblNewLabel_1); + + tabbedPane = new JTabbedPane(JTabbedPane.TOP); + tabbedPane.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent arg0) { + if (tabbedPane.getSelectedIndex() == 0) { + + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( + username, 5)); + } else if (tabbedPane.getSelectedIndex() == 1) { + + } + + } + }); + + tabbedPane.setBounds(10, 123, 557, 397); + contentPanel.add(tabbedPane); + + + JScrollPane scrollPaneAllImages = new JScrollPane(); + tableAllLectures = new JTable(); + tableAllLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + String imageid = modelAll + .getValueAt( + tableAllLectures + .convertRowIndexToModel(tableAllLectures + .getSelectedRow()), 8) + .toString(); + //System.out.println(imageid); + + try { + writeLectureData(imageid); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); + tableAllLectures.setModel(modelAll); + tableAllLectures.getColumnModel().getColumn(1).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(2).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(3).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(4).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(5).sizeWidthToFit(); + + JScrollPane scrollPaneMyImage = new JScrollPane(); + tablemyLectures = new JTable(); + tablemyLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + String imageid = modelMyLectures + .getValueAt( + tablemyLectures + .convertRowIndexToModel(tablemyLectures + .getSelectedRow()), 8) + .toString(); + //System.out.println(imageid); + + try { + writeLectureData(imageid); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (ParseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); + tablemyLectures.setModel(modelMyLectures); + + tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(2).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(3).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(4).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(5).sizeWidthToFit(); + tablemyLectures.setRowSorter(rowSorterMyLectures); + + scrollPaneMyImage.setViewportView(tablemyLectures); + tabbedPane.addTab("Meine Veranstaltungen", null, scrollPaneMyImage, + null); + tableAllLectures.setRowSorter(rowSorterAll); + + scrollPaneAllImages.setViewportView(tableAllLectures); + tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 826, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton btnBack = new JButton("Zur\u00FCck"); + btnBack.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + // oeffnet das Hauptmenue + + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + dispose(); + } + }); + btnBack.setActionCommand("OK"); + buttonPane.add(btnBack); + getRootPane().setDefaultButton(btnBack); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 79, 836, 1); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 628, 836, 1); + getContentPane().add(separator_1); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBorder(new TitledBorder(null, "Detailinformationen", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel.setBackground(SystemColor.menu); + panel.setBounds(591, 85, 235, 518); + getContentPane().add(panel); + + JLabel lblNewLabel_3 = new JLabel("Name:"); + lblNewLabel_3.setBounds(10, 27, 104, 14); + panel.add(lblNewLabel_3); + + JLabel lblAktiv = new JLabel("Aktiv:"); + lblAktiv.setBounds(10, 98, 104, 14); + panel.add(lblAktiv); + + labelAktiv = new JLabel(""); + labelAktiv.setBounds(10, 114, 218, 14); + panel.add(labelAktiv); + + labelstartdate = new JLabel(""); + labelstartdate.setBounds(10, 147, 218, 14); + panel.add(labelstartdate); + + JLabel lblStartdatum = new JLabel("Startdatum:"); + lblStartdatum.setBounds(10, 129, 104, 14); + panel.add(lblStartdatum); + + labelenddate = new JLabel(""); + labelenddate.setBounds(10, 175, 218, 14); + panel.add(labelenddate); + + JLabel lblEnddatum = new JLabel("Enddatum:"); + lblEnddatum.setBounds(10, 161, 104, 14); + panel.add(lblEnddatum); + + JLabel lblBeschreibung = new JLabel("Beschreibung:"); + lblBeschreibung.setBounds(10, 189, 104, 14); + panel.add(lblBeschreibung); + + JLabel lblImage = new JLabel("Image:"); + lblImage.setBounds(10, 293, 104, 14); + panel.add(lblImage); + + labelVerantwortlicher = new JLabel(""); + labelVerantwortlicher.setBounds(10, 426, 218, 14); + panel.add(labelVerantwortlicher); + + JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:"); + lblVerantwortlicher.setBounds(10, 411, 104, 14); + panel.add(lblVerantwortlicher); + + JLabel lblImageversion = new JLabel("Imageversion:"); + lblImageversion.setBounds(10, 381, 104, 14); + panel.add(lblImageversion); + + labelimageversion = new JLabel(""); + labelimageversion.setBounds(10, 399, 218, 14); + panel.add(labelimageversion); + + + labeldesc = new JTextArea(); + labeldesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); + labeldesc.setEditable(false); + labeldesc.setLineWrap(true); + labeldesc.setBackground(SystemColor.menu); + labeldesc.setBounds(124, 127, 104, 110); + JScrollPane scrollPane = new JScrollPane(labeldesc); + scrollPane.setBounds(10, 209, 218, 81); + panel.add(scrollPane); + //panel.add(labeldesc); + + labelimage = new JTextArea(); + labelimage.setLineWrap(true); + labelimage.setFont(new Font("Tahoma", Font.PLAIN, 11)); + labelimage.setEditable(false); + labelimage.setBackground(SystemColor.menu); + labelimage.setBounds(124, 248, 101, 81); + JScrollPane scrollPaneImage = new JScrollPane(labelimage); + scrollPaneImage.setBounds(10, 309, 215, 69); + panel.add(scrollPaneImage); + + labelName = new JTextArea(); + labelName.setEditable(false); + labelName.setFont(new Font("Tahoma", Font.PLAIN, 11)); + labelName.setBackground(SystemColor.menu); + labelName.setBounds(124, 22, 101, 55); + JScrollPane scrollPaneName = new JScrollPane(labelName); + scrollPaneName.setBounds(10, 40, 218, 55); + panel.add(scrollPaneName); + //panel.add(labelName); + //panel.add(labelimage); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mntmFaq.addMouseListener(new MouseAdapter() { + @SuppressWarnings("static-access") + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getFAQ()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + mnNewMenu_1.add(mntmFaq); + + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mntmOtrs.addMouseListener(new MouseAdapter() { + @SuppressWarnings("static-access") + @Override + public void mousePressed(MouseEvent arg0) { + + OpenLinks open = new OpenLinks(); + + URI windows; + try { + windows = new URI(Links.getOTRS()); + + open.openWebpage(windows); + + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + mnNewMenu_1.add(mntmOtrs); + + JMenuItem mntmAbout = new JMenuItem("About"); + mntmAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + About_GUI ab = new About_GUI(); + ab.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAbout); + + } + + // Initiale Beffuelung eines Table models + public DefaultTableModel initTableModel(DefaultTableModel model) throws ParseException { + List lectures; + try { + // Hole eine Liste der Images + lectures = client.getLectureList(); + Iterator i = lectures.iterator(); + SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); + int x = 0; + + while (i.hasNext()) { + // erzeuge Objekte fuer die Tabelle + Object[] obj = { + lectures.get(x).lecturename, + lectures.get(x).desc, + out.format(in.parse(lectures.get(x).starttime)) + " " + + out.format(in.parse(lectures.get(x).endtime)), + lectures.get(x).isActive, out.format(in.parse(lectures.get(x).lastused)), + lectures.get(x).username, + lectures.get(x).imagename," " ,lectures.get(x).id }; + // Fuege diese Objekte der Tabelle hinzu + model.addRow(obj); + x++; + i.next(); + + } + + return model; + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + return model; + } + public void writeLectureData(String id) throws TException, ParseException{ + + SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); + Map res=client.getLectureData(id); + labelName.setText(res.get("name")); + labelAktiv.setText(res.get("isActive")); + labeldesc.setText(res.get("desc")); + labelVerantwortlicher.setText(res.get("owner")); + labelstartdate.setText(out.format(in.parse(res.get("startTime")))); + labelenddate.setText(out.format(in.parse(res.get("endTime")))); + labelimage.setText(res.get("imagepath").substring(res.get("imagepath").indexOf("/")+1)); + labelimageversion.setText(res.get("imageversion")); + + + } +} diff --git a/dozentenmodul/src/main/java/models/Client.java b/dozentenmodul/src/main/java/models/Client.java new file mode 100644 index 00000000..42eccdec --- /dev/null +++ b/dozentenmodul/src/main/java/models/Client.java @@ -0,0 +1,18 @@ +package models; + +public class Client { + + private server.Server.Client client; + public static Client clientcon=new Client(); + + public server.Server.Client getClient() { + return client; + } + + public void setClient(server.Server.Client client) { + this.client = client; + } + + + +} diff --git a/dozentenmodul/src/main/java/models/Image.java b/dozentenmodul/src/main/java/models/Image.java new file mode 100644 index 00000000..fc31e583 --- /dev/null +++ b/dozentenmodul/src/main/java/models/Image.java @@ -0,0 +1,203 @@ +package models; + +public class Image { + + + + private String ImageId; + + private String version; + + private String imagename; + + private String newName; + + private String imagepath; + + private String OS; + + private int shareMode; + + private boolean licensed; + + private boolean internet; + + private boolean vorlage; + + private int ram; + + private int cpu; + + private long filesize; + + private String desc; + + public static Image image =new Image(); + + + + + + + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getOS() { + return OS; + } + + public void setOS(String oS) { + OS = oS; + } + + public int getShareMode() { + + return shareMode; + + } + + public void setShareMode(int shareMode) { + + this.shareMode = shareMode; + + } + + public String getImagepath() { + + return imagepath; + + } + + public void setImagepath(String imagepath) { + + this.imagepath = imagepath; + + } + + public String getImagename() { + + return imagename; + + } + + public void setImagename(String imagename) { + + this.imagename = imagename; + + } + + public boolean isLicensed() { + + return licensed; + + } + + public void setLicensed(boolean licensed) { + + this.licensed = licensed; + + } + + public boolean isInternet() { + + return internet; + + } + + public void setInternet(boolean internet) { + + this.internet = internet; + + } + + public int getRam() { + + return ram; + + } + + public void setRam(int ram) { + + this.ram = ram; + + } + + public int getCpu() { + + return cpu; + + } + + public void setCpu(int cpu) { + + this.cpu = cpu; + + } + + public String getNewName() { + + return newName; + + } + + public void setNewName(String newName) { + + this.newName = newName; + + } + + public String getImageId() { + + return ImageId; + + } + + public void setImageId(String imageId) { + + ImageId = imageId; + + } + + public String getVersion() { + + return version; + + } + + public void setVersion(String version) { + + this.version = version; + + } + + public long getFilesize() { + + return filesize; + + } + + public void setFilesize(long filesize) { + + this.filesize = filesize; + + } + + public boolean isVorlage() { + return vorlage; + } + + public void setVorlage(boolean vorlage) { + this.vorlage = vorlage; + } + + + + +} + diff --git a/dozentenmodul/src/main/java/models/ImageRights.java b/dozentenmodul/src/main/java/models/ImageRights.java new file mode 100644 index 00000000..1b7e0e55 --- /dev/null +++ b/dozentenmodul/src/main/java/models/ImageRights.java @@ -0,0 +1,45 @@ +package models; + +public class ImageRights { + + private int read; + private int write; + private int changePermission; + private int admin; + private int linkAllowed; + + public static ImageRights rights =new ImageRights(); + public int getRead() { + return read; + } + public void setRead(int read) { + this.read = read; + } + public int getWrite() { + return write; + } + public void setWrite(int write) { + this.write = write; + } + public int getChangePermission() { + return changePermission; + } + public void setChangePermission(int changePermission) { + this.changePermission = changePermission; + } + public int getAdmin() { + return admin; + } + public void setAdmin(int admin) { + this.admin = admin; + } + public int getLinkAllowed() { + return linkAllowed; + } + public void setLinkAllowed(int linkAllowed) { + this.linkAllowed = linkAllowed; + } + + + +} diff --git a/dozentenmodul/src/main/java/models/Lecture.java b/dozentenmodul/src/main/java/models/Lecture.java new file mode 100644 index 00000000..8f67baba --- /dev/null +++ b/dozentenmodul/src/main/java/models/Lecture.java @@ -0,0 +1,141 @@ +package models; + +import java.util.Date; + +public class Lecture { + + private String name; + + private String newName; + + private String shortDesc; + + private String desc; + + private Date startdate; + + private Date enddate; + + private boolean active; + + private String id; + + private String linkedImagename; + + public static Lecture lecture =new Lecture(); + + + + public String getNewName() { + + return newName; + + } + + public void setNewName(String newName) { + + this.newName = newName; + + } + + public String getLinkedImagename() { + + return linkedImagename; + + } + + public void setLinkedImagename(String linkedImagename) { + + this.linkedImagename = linkedImagename; + + } + + public String getid() { + + return id; + + } + + public void setid(String id) { + + this.id = id; + + } + + public String getName() { + + return name; + + } + + public void setName(String name) { + + this.name = name; + + } + + public String getShortDesc() { + + return shortDesc; + + } + + public void setShortDesc(String shortDesc) { + + this.shortDesc = shortDesc; + + } + + public String getDesc() { + + return desc; + + } + + public void setDesc(String desc) { + + this.desc = desc; + + } + + public Date getStartdate() { + + return startdate; + + } + + public void setStartdate(Date startdate) { + + this.startdate = startdate; + + } + + public Date getEnddate() { + + return enddate; + + } + + public void setEnddate(Date enddate) { + + this.enddate = enddate; + + } + + public boolean isActive() { + + return active; + + } + + public void setActive(boolean active) { + + this.active = active; + + } + + + + + +} diff --git a/dozentenmodul/src/main/java/models/LectureRights.java b/dozentenmodul/src/main/java/models/LectureRights.java new file mode 100644 index 00000000..c136141f --- /dev/null +++ b/dozentenmodul/src/main/java/models/LectureRights.java @@ -0,0 +1,37 @@ +package models; + +public class LectureRights { + private int recRead; + private int recWrite; + private int recChangePermission; + private int recAdmin; + + public static LectureRights rights =new LectureRights(); + + public int getRecRead() { + return recRead; + } + public void setRecRead(int recRead) { + this.recRead = recRead; + } + public int getRecWrite() { + return recWrite; + } + public void setRecWrite(int recWrite) { + this.recWrite = recWrite; + } + public int getRecChangePermission() { + return recChangePermission; + } + public void setRecChangePermission(int recChangePermission) { + this.recChangePermission = recChangePermission; + } + public int getRecAdmin() { + return recAdmin; + } + public void setRecAdmin(int recAdmin) { + this.recAdmin = recAdmin; + } + + +} diff --git a/dozentenmodul/src/main/java/models/Links.java b/dozentenmodul/src/main/java/models/Links.java new file mode 100644 index 00000000..80e3182e --- /dev/null +++ b/dozentenmodul/src/main/java/models/Links.java @@ -0,0 +1,31 @@ +package models; + +public class Links { + + private static String FAQ = "http://bwlehrpool.hs-offenburg.de/"; + private static String OTRS = "http://bwlehrpool.hs-offenburg.de/"; + private static String uriWindows = "https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0"; + private static String uriLinux = "https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0"; + private static String AnleitungVMDK = "http://www.hs-offenburg.de/fileadmin/Einrichtungen/hrz/Projekte/bwLehrpool/3_bwLehrpool_-_Image_einbinden_und_starten.pdf"; + + public static String getFAQ() { + return FAQ; + } + + public static String getAnleitungVMDK(){ + return AnleitungVMDK; + } + + public static String getOTRS() { + return OTRS; + } + + public static String getUriWindows() { + return uriWindows; + } + + public static String getUriLinux() { + return uriLinux; + } + +}// end class diff --git a/dozentenmodul/src/main/java/models/Search.java b/dozentenmodul/src/main/java/models/Search.java new file mode 100644 index 00000000..59a28b21 --- /dev/null +++ b/dozentenmodul/src/main/java/models/Search.java @@ -0,0 +1,46 @@ +package models; + +public class Search { + + + private String Software; + private String Hochschule; + private String Creator; + private boolean ExistingImage; + private boolean Rohling; + public static Search search =new Search(); + + public String getSoftware() { + return Software; + } + public void setSoftware(String software) { + Software = software; + } + public String getHochschule() { + return Hochschule; + } + public void setHochschule(String hochschule) { + Hochschule = hochschule; + } + public String getCreator() { + return Creator; + } + public void setCreator(String creator) { + Creator = creator; + } + public boolean isExistingImage() { + return ExistingImage; + } + public void setExistingImage(boolean existingImage) { + ExistingImage = existingImage; + } + public boolean isRohling() { + return Rohling; + } + public void setRohling(boolean rohling) { + Rohling = rohling; + } + + + +} diff --git a/dozentenmodul/src/main/java/models/SessionData.java b/dozentenmodul/src/main/java/models/SessionData.java new file mode 100644 index 00000000..d085bc29 --- /dev/null +++ b/dozentenmodul/src/main/java/models/SessionData.java @@ -0,0 +1,32 @@ +package models; + +public class SessionData { + + private String sessionID; + private String authToken; + private String serverAdress; + + public static SessionData session =new SessionData(); + + public String getSessionID() { + return sessionID; + } + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + public String getAuthToken() { + return authToken; + } + public void setAuthToken(String authToken) { + this.authToken = authToken; + } + public String getServerAdress() { + return serverAdress; + } + public void setServerAdress(String serverAdress) { + this.serverAdress = serverAdress; + } + + + +} diff --git a/dozentenmodul/src/main/java/models/Version.java b/dozentenmodul/src/main/java/models/Version.java new file mode 100644 index 00000000..b44819e4 --- /dev/null +++ b/dozentenmodul/src/main/java/models/Version.java @@ -0,0 +1,24 @@ +package models; + +public class Version { + + private static String Version = "1.06"; + private static String BuildDate = "04.09.2014"; + + + public static String getVersion() { + return Version; + } + public static void setVersion(String version) { + Version = version; + } + public static String getBuildDate() { + return BuildDate; + } + public static void setBuildDate(String buildDate) { + BuildDate = buildDate; + } + + + +} diff --git a/dozentenmodul/src/main/java/models/person.java b/dozentenmodul/src/main/java/models/person.java new file mode 100644 index 00000000..479c2ecd --- /dev/null +++ b/dozentenmodul/src/main/java/models/person.java @@ -0,0 +1,131 @@ +package models; + +public class person{ + + private String username; + + private String Name; + + private String Vorname; + + private String Hochschule; + + private String EMail; + + private String Tel; + + private String Fakultaet; + + private boolean ischecked; + + private String role; + + public static person verantwortlicher=new person(); + + + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public String getUsername() { + + return username; + + } + + public void setUsername(String username) { + + this.username = username; + + } + + public String getName() { + + return Name; + + } + + public void setName(String name) { + + Name = name; + + } + + public String getVorname() { + + return Vorname; + + } + + public void setVorname(String vorname) { + + Vorname = vorname; + + } + + public String getHochschule() { + + return Hochschule; + + } + + public void setHochschule(String hochschule) { + + Hochschule = hochschule; + + } + + public String getEMail() { + + return EMail; + + } + + public void setEMail(String eMail) { + + EMail = eMail; + + } + + public String getTel() { + + return Tel; + + } + + public void setTel(String tel) { + + Tel = tel; + + } + + public String getFakultaet() { + + return Fakultaet; + + } + + public void setFakultaet(String fakultaet) { + + Fakultaet = fakultaet; + + } + + public boolean isIschecked() { + + return ischecked; + + } + + public void setIschecked(boolean ischecked) { + + this.ischecked = ischecked; + + } + +} diff --git a/dozentenmodul/src/main/java/models/user.java b/dozentenmodul/src/main/java/models/user.java new file mode 100644 index 00000000..9aa958a4 --- /dev/null +++ b/dozentenmodul/src/main/java/models/user.java @@ -0,0 +1,23 @@ +package models; + +public class user { + + private String userName; + private String Password; + + public String getUserName() { + return userName; + } + public void setUserName(String userName) { + this.userName = userName; + } + public String getPassword() { + return Password; + } + public void setPassword(String password) { + Password = password; + } + + + +} diff --git a/dozentenmodul/src/main/java/org/eclipse/wb/swt/SWTResourceManager.java b/dozentenmodul/src/main/java/org/eclipse/wb/swt/SWTResourceManager.java new file mode 100644 index 00000000..8b6d4cc3 --- /dev/null +++ b/dozentenmodul/src/main/java/org/eclipse/wb/swt/SWTResourceManager.java @@ -0,0 +1,447 @@ +/******************************************************************************* + * Copyright (c) 2011 Google, Inc. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Google, Inc. - initial API and implementation + *******************************************************************************/ +package org.eclipse.wb.swt; + +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Cursor; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.ImageData; +import org.eclipse.swt.graphics.RGB; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.widgets.Display; + +/** + * Utility class for managing OS resources associated with SWT controls such as colors, fonts, images, etc. + *

+ * !!! IMPORTANT !!! Application code must explicitly invoke the dispose() method to release the + * operating system resources managed by cached objects when those objects and OS resources are no longer + * needed (e.g. on application shutdown) + *

+ * This class may be freely distributed as part of any application or plugin. + *

+ * @author scheglov_ke + * @author Dan Rubel + */ +public class SWTResourceManager { + //////////////////////////////////////////////////////////////////////////// + // + // Color + // + //////////////////////////////////////////////////////////////////////////// + private static Map m_colorMap = new HashMap(); + /** + * Returns the system {@link Color} matching the specific ID. + * + * @param systemColorID + * the ID value for the color + * @return the system {@link Color} matching the specific ID + */ + public static Color getColor(int systemColorID) { + Display display = Display.getCurrent(); + return display.getSystemColor(systemColorID); + } + /** + * Returns a {@link Color} given its red, green and blue component values. + * + * @param r + * the red component of the color + * @param g + * the green component of the color + * @param b + * the blue component of the color + * @return the {@link Color} matching the given red, green and blue component values + */ + public static Color getColor(int r, int g, int b) { + return getColor(new RGB(r, g, b)); + } + /** + * Returns a {@link Color} given its RGB value. + * + * @param rgb + * the {@link RGB} value of the color + * @return the {@link Color} matching the RGB value + */ + public static Color getColor(RGB rgb) { + Color color = m_colorMap.get(rgb); + if (color == null) { + Display display = Display.getCurrent(); + color = new Color(display, rgb); + m_colorMap.put(rgb, color); + } + return color; + } + /** + * Dispose of all the cached {@link Color}'s. + */ + public static void disposeColors() { + for (Color color : m_colorMap.values()) { + color.dispose(); + } + m_colorMap.clear(); + } + //////////////////////////////////////////////////////////////////////////// + // + // Image + // + //////////////////////////////////////////////////////////////////////////// + /** + * Maps image paths to images. + */ + private static Map m_imageMap = new HashMap(); + /** + * Returns an {@link Image} encoded by the specified {@link InputStream}. + * + * @param stream + * the {@link InputStream} encoding the image data + * @return the {@link Image} encoded by the specified input stream + */ + protected static Image getImage(InputStream stream) throws IOException { + try { + Display display = Display.getCurrent(); + ImageData data = new ImageData(stream); + if (data.transparentPixel > 0) { + return new Image(display, data, data.getTransparencyMask()); + } + return new Image(display, data); + } finally { + stream.close(); + } + } + /** + * Returns an {@link Image} stored in the file at the specified path. + * + * @param path + * the path to the image file + * @return the {@link Image} stored in the file at the specified path + */ + public static Image getImage(String path) { + Image image = m_imageMap.get(path); + if (image == null) { + try { + image = getImage(new FileInputStream(path)); + m_imageMap.put(path, image); + } catch (Exception e) { + image = getMissingImage(); + m_imageMap.put(path, image); + } + } + return image; + } + /** + * Returns an {@link Image} stored in the file at the specified path relative to the specified class. + * + * @param clazz + * the {@link Class} relative to which to find the image + * @param path + * the path to the image file, if starts with '/' + * @return the {@link Image} stored in the file at the specified path + */ + public static Image getImage(Class clazz, String path) { + String key = clazz.getName() + '|' + path; + Image image = m_imageMap.get(key); + if (image == null) { + try { + image = getImage(clazz.getResourceAsStream(path)); + m_imageMap.put(key, image); + } catch (Exception e) { + image = getMissingImage(); + m_imageMap.put(key, image); + } + } + return image; + } + private static final int MISSING_IMAGE_SIZE = 10; + /** + * @return the small {@link Image} that can be used as placeholder for missing image. + */ + private static Image getMissingImage() { + Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); + // + GC gc = new GC(image); + gc.setBackground(getColor(SWT.COLOR_RED)); + gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); + gc.dispose(); + // + return image; + } + /** + * Style constant for placing decorator image in top left corner of base image. + */ + public static final int TOP_LEFT = 1; + /** + * Style constant for placing decorator image in top right corner of base image. + */ + public static final int TOP_RIGHT = 2; + /** + * Style constant for placing decorator image in bottom left corner of base image. + */ + public static final int BOTTOM_LEFT = 3; + /** + * Style constant for placing decorator image in bottom right corner of base image. + */ + public static final int BOTTOM_RIGHT = 4; + /** + * Internal value. + */ + protected static final int LAST_CORNER_KEY = 5; + /** + * Maps images to decorated images. + */ + @SuppressWarnings("unchecked") + private static Map>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY]; + /** + * Returns an {@link Image} composed of a base image decorated by another image. + * + * @param baseImage + * the base {@link Image} that should be decorated + * @param decorator + * the {@link Image} to decorate the base image + * @return {@link Image} The resulting decorated image + */ + public static Image decorateImage(Image baseImage, Image decorator) { + return decorateImage(baseImage, decorator, BOTTOM_RIGHT); + } + /** + * Returns an {@link Image} composed of a base image decorated by another image. + * + * @param baseImage + * the base {@link Image} that should be decorated + * @param decorator + * the {@link Image} to decorate the base image + * @param corner + * the corner to place decorator image + * @return the resulting decorated {@link Image} + */ + public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) { + if (corner <= 0 || corner >= LAST_CORNER_KEY) { + throw new IllegalArgumentException("Wrong decorate corner"); + } + Map> cornerDecoratedImageMap = m_decoratedImageMap[corner]; + if (cornerDecoratedImageMap == null) { + cornerDecoratedImageMap = new HashMap>(); + m_decoratedImageMap[corner] = cornerDecoratedImageMap; + } + Map decoratedMap = cornerDecoratedImageMap.get(baseImage); + if (decoratedMap == null) { + decoratedMap = new HashMap(); + cornerDecoratedImageMap.put(baseImage, decoratedMap); + } + // + Image result = decoratedMap.get(decorator); + if (result == null) { + Rectangle bib = baseImage.getBounds(); + Rectangle dib = decorator.getBounds(); + // + result = new Image(Display.getCurrent(), bib.width, bib.height); + // + GC gc = new GC(result); + gc.drawImage(baseImage, 0, 0); + if (corner == TOP_LEFT) { + gc.drawImage(decorator, 0, 0); + } else if (corner == TOP_RIGHT) { + gc.drawImage(decorator, bib.width - dib.width, 0); + } else if (corner == BOTTOM_LEFT) { + gc.drawImage(decorator, 0, bib.height - dib.height); + } else if (corner == BOTTOM_RIGHT) { + gc.drawImage(decorator, bib.width - dib.width, bib.height - dib.height); + } + gc.dispose(); + // + decoratedMap.put(decorator, result); + } + return result; + } + /** + * Dispose all of the cached {@link Image}'s. + */ + public static void disposeImages() { + // dispose loaded images + { + for (Image image : m_imageMap.values()) { + image.dispose(); + } + m_imageMap.clear(); + } + // dispose decorated images + for (int i = 0; i < m_decoratedImageMap.length; i++) { + Map> cornerDecoratedImageMap = m_decoratedImageMap[i]; + if (cornerDecoratedImageMap != null) { + for (Map decoratedMap : cornerDecoratedImageMap.values()) { + for (Image image : decoratedMap.values()) { + image.dispose(); + } + decoratedMap.clear(); + } + cornerDecoratedImageMap.clear(); + } + } + } + //////////////////////////////////////////////////////////////////////////// + // + // Font + // + //////////////////////////////////////////////////////////////////////////// + /** + * Maps font names to fonts. + */ + private static Map m_fontMap = new HashMap(); + /** + * Maps fonts to their bold versions. + */ + private static Map m_fontToBoldFontMap = new HashMap(); + /** + * Returns a {@link Font} based on its name, height and style. + * + * @param name + * the name of the font + * @param height + * the height of the font + * @param style + * the style of the font + * @return {@link Font} The font matching the name, height and style + */ + public static Font getFont(String name, int height, int style) { + return getFont(name, height, style, false, false); + } + /** + * Returns a {@link Font} based on its name, height and style. Windows-specific strikeout and underline + * flags are also supported. + * + * @param name + * the name of the font + * @param size + * the size of the font + * @param style + * the style of the font + * @param strikeout + * the strikeout flag (warning: Windows only) + * @param underline + * the underline flag (warning: Windows only) + * @return {@link Font} The font matching the name, height, style, strikeout and underline + */ + public static Font getFont(String name, int size, int style, boolean strikeout, boolean underline) { + String fontName = name + '|' + size + '|' + style + '|' + strikeout + '|' + underline; + Font font = m_fontMap.get(fontName); + if (font == null) { + FontData fontData = new FontData(name, size, style); + if (strikeout || underline) { + try { + Class logFontClass = Class.forName("org.eclipse.swt.internal.win32.LOGFONT"); //$NON-NLS-1$ + Object logFont = FontData.class.getField("data").get(fontData); //$NON-NLS-1$ + if (logFont != null && logFontClass != null) { + if (strikeout) { + logFontClass.getField("lfStrikeOut").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$ + } + if (underline) { + logFontClass.getField("lfUnderline").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$ + } + } + } catch (Throwable e) { + System.err.println("Unable to set underline or strikeout" + " (probably on a non-Windows platform). " + e); //$NON-NLS-1$ //$NON-NLS-2$ + } + } + font = new Font(Display.getCurrent(), fontData); + m_fontMap.put(fontName, font); + } + return font; + } + /** + * Returns a bold version of the given {@link Font}. + * + * @param baseFont + * the {@link Font} for which a bold version is desired + * @return the bold version of the given {@link Font} + */ + public static Font getBoldFont(Font baseFont) { + Font font = m_fontToBoldFontMap.get(baseFont); + if (font == null) { + FontData fontDatas[] = baseFont.getFontData(); + FontData data = fontDatas[0]; + font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD); + m_fontToBoldFontMap.put(baseFont, font); + } + return font; + } + /** + * Dispose all of the cached {@link Font}'s. + */ + public static void disposeFonts() { + // clear fonts + for (Font font : m_fontMap.values()) { + font.dispose(); + } + m_fontMap.clear(); + // clear bold fonts + for (Font font : m_fontToBoldFontMap.values()) { + font.dispose(); + } + m_fontToBoldFontMap.clear(); + } + //////////////////////////////////////////////////////////////////////////// + // + // Cursor + // + //////////////////////////////////////////////////////////////////////////// + /** + * Maps IDs to cursors. + */ + private static Map m_idToCursorMap = new HashMap(); + /** + * Returns the system cursor matching the specific ID. + * + * @param id + * int The ID value for the cursor + * @return Cursor The system cursor matching the specific ID + */ + public static Cursor getCursor(int id) { + Integer key = Integer.valueOf(id); + Cursor cursor = m_idToCursorMap.get(key); + if (cursor == null) { + cursor = new Cursor(Display.getDefault(), id); + m_idToCursorMap.put(key, cursor); + } + return cursor; + } + /** + * Dispose all of the cached cursors. + */ + public static void disposeCursors() { + for (Cursor cursor : m_idToCursorMap.values()) { + cursor.dispose(); + } + m_idToCursorMap.clear(); + } + //////////////////////////////////////////////////////////////////////////// + // + // General + // + //////////////////////////////////////////////////////////////////////////// + /** + * Dispose of cached objects and their underlying OS resources. This should only be called when the cached + * objects are no longer needed (e.g. on application shutdown). + */ + public static void dispose() { + disposeColors(); + disposeImages(); + disposeFonts(); + disposeCursors(); + } +} \ No newline at end of file diff --git a/dozentenmodul/src/main/java/thrift/MasterThriftConnection.java b/dozentenmodul/src/main/java/thrift/MasterThriftConnection.java new file mode 100644 index 00000000..a84931c6 --- /dev/null +++ b/dozentenmodul/src/main/java/thrift/MasterThriftConnection.java @@ -0,0 +1,43 @@ +package thrift; + +import javax.swing.JOptionPane; + +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.transport.TSocket; +import org.apache.thrift.transport.TTransport; +import org.apache.thrift.transport.TTransportException; + +import org.openslx.imagemaster.thrift.iface.ImageServer.Client; + + + +public class MasterThriftConnection { + + public static final String MASTERSERVERIP="132.230.4.16"; + //public static final String MASTERSERVERIP="127.0.0.1"; + + final TTransport transport = new TSocket(MASTERSERVERIP, 9090); + + public Client getMasterThriftConnection() + { + + try { + transport.open(); + } catch (TTransportException e) { + System.out.println("Keine Verbindung m\u00f6glich!"); + return null; + } + + final TProtocol protocol = new TBinaryProtocol(transport); + final Client client = new Client(protocol); + System.out.println("Masterserver erreichbar."); + + return client; + } + + public void closeMasterThriftConnection() + { + transport.close(); + } +} diff --git a/dozentenmodul/src/main/java/thrift/ThriftConnection.java b/dozentenmodul/src/main/java/thrift/ThriftConnection.java new file mode 100644 index 00000000..3eec5d25 --- /dev/null +++ b/dozentenmodul/src/main/java/thrift/ThriftConnection.java @@ -0,0 +1,53 @@ +package thrift; + +import javax.swing.JOptionPane; + +import models.SessionData; + +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.transport.TSocket; +import org.apache.thrift.transport.TTransport; +import org.apache.thrift.transport.TTransportException; + +import server.Server; +import server.Server.Client; + +public class ThriftConnection { + + private String satAddress = ""+SessionData.session.getServerAdress(); + final TTransport transport = new TSocket(satAddress, 9090); + + public ThriftConnection() { + // TODO Auto-generated constructor stub + } + + public Client getThriftConnection() + { + + try { + transport.open(); + } catch (TTransportException e) { + System.out.println("Keine Verbindung m\u00f6glich! Satellit="+satAddress); + e.printStackTrace(); + JOptionPane.showMessageDialog(null, + e.getCause()+"\n"+e.getMessage(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + //System.out.println("Keine Verbindung moeglich! Satellit="); + return null; + } + + final TProtocol protocol = new TBinaryProtocol(transport); + + final Server.Client client = new Server.Client(protocol); + System.out.println("Verbindung zu "+satAddress+" wurde aufgebaut."); + + return client; + } + + public void closeThriftConnection() + { + System.out.println("Verbindung wird geplant getrennt..."); + transport.close(); + } +} diff --git a/dozentenmodul/src/main/java/util/GuiOrganizer.java b/dozentenmodul/src/main/java/util/GuiOrganizer.java new file mode 100644 index 00000000..5d6b2de8 --- /dev/null +++ b/dozentenmodul/src/main/java/util/GuiOrganizer.java @@ -0,0 +1,19 @@ +package util; + +import java.awt.Dimension; +import java.awt.Toolkit; +import java.awt.Window; + +public abstract class GuiOrganizer { + + /* receive GUI, set it to center of the screen */ + public static void centerGUI(Window gui) { + Dimension dm = Toolkit.getDefaultToolkit().getScreenSize(); + double width = dm.getWidth(); + double height = dm.getHeight(); + double xPosition = (width / 2 - gui.getWidth() / 2); + double yPosition = (height / 2 - gui.getHeight() / 2); + gui.setLocation((int) xPosition, (int) yPosition); + } + +} diff --git a/dozentenmodul/src/main/java/util/OpenLinks.java b/dozentenmodul/src/main/java/util/OpenLinks.java new file mode 100644 index 00000000..2dd7b936 --- /dev/null +++ b/dozentenmodul/src/main/java/util/OpenLinks.java @@ -0,0 +1,25 @@ +package util; + +import java.awt.Desktop; +import java.net.URI; + +import javax.swing.JOptionPane; + +public class OpenLinks { + + public static void openWebpage(URI uri) { + Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() + : null; + if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) { + try { + desktop.browse(uri); + } catch (Exception e) { + e.printStackTrace(); + JOptionPane.showMessageDialog(null, + e.getCause() + "\n" + e.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } + } + }// end openWebpage + +} diff --git a/dozentenmodul/src/main/resources/img/Image_zu_Veranstaltung_HDD.png b/dozentenmodul/src/main/resources/img/Image_zu_Veranstaltung_HDD.png new file mode 100644 index 00000000..39b3bac6 Binary files /dev/null and b/dozentenmodul/src/main/resources/img/Image_zu_Veranstaltung_HDD.png differ diff --git a/dozentenmodul/src/main/resources/img/Logo_bwLehrpool.png b/dozentenmodul/src/main/resources/img/Logo_bwLehrpool.png new file mode 100644 index 00000000..b897d9f1 Binary files /dev/null and b/dozentenmodul/src/main/resources/img/Logo_bwLehrpool.png differ diff --git a/dozentenmodul/src/main/resources/img/e4_n_imgs2_bwl_vmc_v2.png b/dozentenmodul/src/main/resources/img/e4_n_imgs2_bwl_vmc_v2.png new file mode 100644 index 00000000..95e8a293 Binary files /dev/null and b/dozentenmodul/src/main/resources/img/e4_n_imgs2_bwl_vmc_v2.png differ diff --git a/dozentenmodul/src/test/java/bwlehrpool/AppTest.java b/dozentenmodul/src/test/java/bwlehrpool/AppTest.java new file mode 100644 index 00000000..ffcdcc2e --- /dev/null +++ b/dozentenmodul/src/test/java/bwlehrpool/AppTest.java @@ -0,0 +1,38 @@ +package bwlehrpool; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/dozentenmodulserver/Dozentenmodulserver/pom.xml b/dozentenmodulserver/Dozentenmodulserver/pom.xml deleted file mode 100644 index 762ccb1a..00000000 --- a/dozentenmodulserver/Dozentenmodulserver/pom.xml +++ /dev/null @@ -1,116 +0,0 @@ - - 4.0.0 - - bwlehrpool - dozmod-server - 1.0-SNAPSHOT - jar - - DozMod-Server - http://maven.apache.org - - - UTF-8 - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - - maven-assembly-plugin - - - package - - single - - - - - - - server.StartServer - - - - jar-with-dependencies - - - - - org.apache.maven.plugins - maven-shade-plugin - - - package - - shade - - - true - - - server.StartServer - - - - - - - - - - - - org.apache.thrift - libthrift - 0.9.1 - compile - - - mysql - mysql-connector-java - 5.1.28 - compile - - - commons-io - commons-io - 2.4 - compile - - - log4j - log4j - 1.2.17 - compile - - - org.ini4j - ini4j - 0.5.2 - - - org.slf4j - slf4j-log4j12 - 1.5.8 - compile - - - junit - junit - 3.8.1 - test - - - - diff --git a/dozentenmodulserver/Dozentenmodulserver/src/main/java/models/Configuration.java b/dozentenmodulserver/Dozentenmodulserver/src/main/java/models/Configuration.java deleted file mode 100644 index 1e616466..00000000 --- a/dozentenmodulserver/Dozentenmodulserver/src/main/java/models/Configuration.java +++ /dev/null @@ -1,39 +0,0 @@ -package models; - -public class Configuration { - - private String absolute_path; - private String sql_connection; - private String sql_user; - private String sql_pass; - - public static Configuration config =new Configuration(); - - public String getAbsolute_path() { - return absolute_path; - } - public void setAbsolute_path(String absolute_path) { - this.absolute_path = absolute_path; - } - public String getSql_connection() { - return sql_connection; - } - public void setSql_connection(String sql_connection) { - this.sql_connection = sql_connection; - } - public String getSql_user() { - return sql_user; - } - public void setSql_user(String sql_user) { - this.sql_user = sql_user; - } - public String getSql_pass() { - return sql_pass; - } - public void setSql_pass(String sql_pass) { - this.sql_pass = sql_pass; - } - - - -} diff --git a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/BinaryListener.java b/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/BinaryListener.java deleted file mode 100644 index ffeb9bd5..00000000 --- a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/BinaryListener.java +++ /dev/null @@ -1,48 +0,0 @@ -package server; - -import java.util.Date; - -import org.apache.log4j.Logger; -import org.apache.thrift.protocol.TProtocolFactory; -import org.apache.thrift.server.TServer; -import org.apache.thrift.server.TThreadPoolServer.Args; -import org.apache.thrift.server.TThreadPoolServer; -import org.apache.thrift.transport.TServerSocket; -import org.apache.thrift.transport.TServerTransport; -import org.apache.thrift.transport.TTransportException; - -public class BinaryListener implements Runnable { - private static Logger log = Logger.getLogger(BinaryListener.class); - - private final int MINWORKERTHREADS = 20; // keine ahnung ob das passt... - private final int MAXWORKERTHREADS = 80; // ebenso - - @Override - public void run() { - final ServerHandler handler = new ServerHandler(); - final Server.Processor processor = new Server.Processor( - handler); - final TServerTransport transport; - final TProtocolFactory protFactory = new TBinaryProtocolSafe.Factory( - true, true); - try { - transport = new TServerSocket(9090); - log.info(new Date() + " - Connected to Port 9090"); - - } catch (TTransportException e) { - log.fatal(new Date() + " - Could not listen on port 9090"); - return; - } - TServer server = new TThreadPoolServer(new Args(transport) - .protocolFactory(protFactory).processor(processor) - .minWorkerThreads(MINWORKERTHREADS) - .maxWorkerThreads(MAXWORKERTHREADS)); - - log.info(new Date() + " - Started running BinaryListener"); - log.info(new Date() + " - MINWORKERTHREADS=" + MINWORKERTHREADS - + " and MAXWORKERTHREADS=" + MAXWORKERTHREADS + "\n"); - server.serve(); - - } - -} diff --git a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/Image.java b/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/Image.java deleted file mode 100644 index 16fc1ef5..00000000 --- a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/Image.java +++ /dev/null @@ -1,1188 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.1) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package server; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Image implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Image"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-2); - private static final org.apache.thrift.protocol.TField IMAGE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imageName", org.apache.thrift.protocol.TType.STRING, (short)-3); - private static final org.apache.thrift.protocol.TField LICENSE_RESTRICTION_FIELD_DESC = new org.apache.thrift.protocol.TField("licenseRestriction", org.apache.thrift.protocol.TType.STRING, (short)-4); - private static final org.apache.thrift.protocol.TField OS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("osName", org.apache.thrift.protocol.TType.STRING, (short)-5); - private static final org.apache.thrift.protocol.TField LECTURE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lectureName", org.apache.thrift.protocol.TType.STRING, (short)-6); - private static final org.apache.thrift.protocol.TField UPDATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("updateTime", org.apache.thrift.protocol.TType.STRING, (short)-7); - private static final org.apache.thrift.protocol.TField USER_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("userData", org.apache.thrift.protocol.TType.STRING, (short)-8); - private static final org.apache.thrift.protocol.TField IS_TEMPLATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isTemplate", org.apache.thrift.protocol.TType.STRING, (short)-9); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ImageStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ImageTupleSchemeFactory()); - } - - public String id; // required - public String version; // required - public String imageName; // required - public String licenseRestriction; // required - public String osName; // required - public String lectureName; // required - public String updateTime; // required - public String userData; // required - public String isTemplate; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - ID((short)-1, "id"), - VERSION((short)-2, "version"), - IMAGE_NAME((short)-3, "imageName"), - LICENSE_RESTRICTION((short)-4, "licenseRestriction"), - OS_NAME((short)-5, "osName"), - LECTURE_NAME((short)-6, "lectureName"), - UPDATE_TIME((short)-7, "updateTime"), - USER_DATA((short)-8, "userData"), - IS_TEMPLATE((short)-9, "isTemplate"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // ID - return ID; - case -2: // VERSION - return VERSION; - case -3: // IMAGE_NAME - return IMAGE_NAME; - case -4: // LICENSE_RESTRICTION - return LICENSE_RESTRICTION; - case -5: // OS_NAME - return OS_NAME; - case -6: // LECTURE_NAME - return LECTURE_NAME; - case -7: // UPDATE_TIME - return UPDATE_TIME; - case -8: // USER_DATA - return USER_DATA; - case -9: // IS_TEMPLATE - return IS_TEMPLATE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IMAGE_NAME, new org.apache.thrift.meta_data.FieldMetaData("imageName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.LICENSE_RESTRICTION, new org.apache.thrift.meta_data.FieldMetaData("licenseRestriction", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.OS_NAME, new org.apache.thrift.meta_data.FieldMetaData("osName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.LECTURE_NAME, new org.apache.thrift.meta_data.FieldMetaData("lectureName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.UPDATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("updateTime", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.USER_DATA, new org.apache.thrift.meta_data.FieldMetaData("userData", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IS_TEMPLATE, new org.apache.thrift.meta_data.FieldMetaData("isTemplate", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Image.class, metaDataMap); - } - - public Image() { - } - - public Image( - String id, - String version, - String imageName, - String licenseRestriction, - String osName, - String lectureName, - String updateTime, - String userData, - String isTemplate) - { - this(); - this.id = id; - this.version = version; - this.imageName = imageName; - this.licenseRestriction = licenseRestriction; - this.osName = osName; - this.lectureName = lectureName; - this.updateTime = updateTime; - this.userData = userData; - this.isTemplate = isTemplate; - } - - /** - * Performs a deep copy on other. - */ - public Image(Image other) { - if (other.isSetId()) { - this.id = other.id; - } - if (other.isSetVersion()) { - this.version = other.version; - } - if (other.isSetImageName()) { - this.imageName = other.imageName; - } - if (other.isSetLicenseRestriction()) { - this.licenseRestriction = other.licenseRestriction; - } - if (other.isSetOsName()) { - this.osName = other.osName; - } - if (other.isSetLectureName()) { - this.lectureName = other.lectureName; - } - if (other.isSetUpdateTime()) { - this.updateTime = other.updateTime; - } - if (other.isSetUserData()) { - this.userData = other.userData; - } - if (other.isSetIsTemplate()) { - this.isTemplate = other.isTemplate; - } - } - - public Image deepCopy() { - return new Image(this); - } - - @Override - public void clear() { - this.id = null; - this.version = null; - this.imageName = null; - this.licenseRestriction = null; - this.osName = null; - this.lectureName = null; - this.updateTime = null; - this.userData = null; - this.isTemplate = null; - } - - public String getId() { - return this.id; - } - - public Image setId(String id) { - this.id = id; - return this; - } - - public void unsetId() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean isSetId() { - return this.id != null; - } - - public void setIdIsSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public String getVersion() { - return this.version; - } - - public Image setVersion(String version) { - this.version = version; - return this; - } - - public void unsetVersion() { - this.version = null; - } - - /** Returns true if field version is set (has been assigned a value) and false otherwise */ - public boolean isSetVersion() { - return this.version != null; - } - - public void setVersionIsSet(boolean value) { - if (!value) { - this.version = null; - } - } - - public String getImageName() { - return this.imageName; - } - - public Image setImageName(String imageName) { - this.imageName = imageName; - return this; - } - - public void unsetImageName() { - this.imageName = null; - } - - /** Returns true if field imageName is set (has been assigned a value) and false otherwise */ - public boolean isSetImageName() { - return this.imageName != null; - } - - public void setImageNameIsSet(boolean value) { - if (!value) { - this.imageName = null; - } - } - - public String getLicenseRestriction() { - return this.licenseRestriction; - } - - public Image setLicenseRestriction(String licenseRestriction) { - this.licenseRestriction = licenseRestriction; - return this; - } - - public void unsetLicenseRestriction() { - this.licenseRestriction = null; - } - - /** Returns true if field licenseRestriction is set (has been assigned a value) and false otherwise */ - public boolean isSetLicenseRestriction() { - return this.licenseRestriction != null; - } - - public void setLicenseRestrictionIsSet(boolean value) { - if (!value) { - this.licenseRestriction = null; - } - } - - public String getOsName() { - return this.osName; - } - - public Image setOsName(String osName) { - this.osName = osName; - return this; - } - - public void unsetOsName() { - this.osName = null; - } - - /** Returns true if field osName is set (has been assigned a value) and false otherwise */ - public boolean isSetOsName() { - return this.osName != null; - } - - public void setOsNameIsSet(boolean value) { - if (!value) { - this.osName = null; - } - } - - public String getLectureName() { - return this.lectureName; - } - - public Image setLectureName(String lectureName) { - this.lectureName = lectureName; - return this; - } - - public void unsetLectureName() { - this.lectureName = null; - } - - /** Returns true if field lectureName is set (has been assigned a value) and false otherwise */ - public boolean isSetLectureName() { - return this.lectureName != null; - } - - public void setLectureNameIsSet(boolean value) { - if (!value) { - this.lectureName = null; - } - } - - public String getUpdateTime() { - return this.updateTime; - } - - public Image setUpdateTime(String updateTime) { - this.updateTime = updateTime; - return this; - } - - public void unsetUpdateTime() { - this.updateTime = null; - } - - /** Returns true if field updateTime is set (has been assigned a value) and false otherwise */ - public boolean isSetUpdateTime() { - return this.updateTime != null; - } - - public void setUpdateTimeIsSet(boolean value) { - if (!value) { - this.updateTime = null; - } - } - - public String getUserData() { - return this.userData; - } - - public Image setUserData(String userData) { - this.userData = userData; - return this; - } - - public void unsetUserData() { - this.userData = null; - } - - /** Returns true if field userData is set (has been assigned a value) and false otherwise */ - public boolean isSetUserData() { - return this.userData != null; - } - - public void setUserDataIsSet(boolean value) { - if (!value) { - this.userData = null; - } - } - - public String getIsTemplate() { - return this.isTemplate; - } - - public Image setIsTemplate(String isTemplate) { - this.isTemplate = isTemplate; - return this; - } - - public void unsetIsTemplate() { - this.isTemplate = null; - } - - /** Returns true if field isTemplate is set (has been assigned a value) and false otherwise */ - public boolean isSetIsTemplate() { - return this.isTemplate != null; - } - - public void setIsTemplateIsSet(boolean value) { - if (!value) { - this.isTemplate = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unsetId(); - } else { - setId((String)value); - } - break; - - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((String)value); - } - break; - - case IMAGE_NAME: - if (value == null) { - unsetImageName(); - } else { - setImageName((String)value); - } - break; - - case LICENSE_RESTRICTION: - if (value == null) { - unsetLicenseRestriction(); - } else { - setLicenseRestriction((String)value); - } - break; - - case OS_NAME: - if (value == null) { - unsetOsName(); - } else { - setOsName((String)value); - } - break; - - case LECTURE_NAME: - if (value == null) { - unsetLectureName(); - } else { - setLectureName((String)value); - } - break; - - case UPDATE_TIME: - if (value == null) { - unsetUpdateTime(); - } else { - setUpdateTime((String)value); - } - break; - - case USER_DATA: - if (value == null) { - unsetUserData(); - } else { - setUserData((String)value); - } - break; - - case IS_TEMPLATE: - if (value == null) { - unsetIsTemplate(); - } else { - setIsTemplate((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return getId(); - - case VERSION: - return getVersion(); - - case IMAGE_NAME: - return getImageName(); - - case LICENSE_RESTRICTION: - return getLicenseRestriction(); - - case OS_NAME: - return getOsName(); - - case LECTURE_NAME: - return getLectureName(); - - case UPDATE_TIME: - return getUpdateTime(); - - case USER_DATA: - return getUserData(); - - case IS_TEMPLATE: - return getIsTemplate(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case ID: - return isSetId(); - case VERSION: - return isSetVersion(); - case IMAGE_NAME: - return isSetImageName(); - case LICENSE_RESTRICTION: - return isSetLicenseRestriction(); - case OS_NAME: - return isSetOsName(); - case LECTURE_NAME: - return isSetLectureName(); - case UPDATE_TIME: - return isSetUpdateTime(); - case USER_DATA: - return isSetUserData(); - case IS_TEMPLATE: - return isSetIsTemplate(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof Image) - return this.equals((Image)that); - return false; - } - - public boolean equals(Image that) { - if (that == null) - return false; - - boolean this_present_id = true && this.isSetId(); - boolean that_present_id = true && that.isSetId(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - boolean this_present_version = true && this.isSetVersion(); - boolean that_present_version = true && that.isSetVersion(); - if (this_present_version || that_present_version) { - if (!(this_present_version && that_present_version)) - return false; - if (!this.version.equals(that.version)) - return false; - } - - boolean this_present_imageName = true && this.isSetImageName(); - boolean that_present_imageName = true && that.isSetImageName(); - if (this_present_imageName || that_present_imageName) { - if (!(this_present_imageName && that_present_imageName)) - return false; - if (!this.imageName.equals(that.imageName)) - return false; - } - - boolean this_present_licenseRestriction = true && this.isSetLicenseRestriction(); - boolean that_present_licenseRestriction = true && that.isSetLicenseRestriction(); - if (this_present_licenseRestriction || that_present_licenseRestriction) { - if (!(this_present_licenseRestriction && that_present_licenseRestriction)) - return false; - if (!this.licenseRestriction.equals(that.licenseRestriction)) - return false; - } - - boolean this_present_osName = true && this.isSetOsName(); - boolean that_present_osName = true && that.isSetOsName(); - if (this_present_osName || that_present_osName) { - if (!(this_present_osName && that_present_osName)) - return false; - if (!this.osName.equals(that.osName)) - return false; - } - - boolean this_present_lectureName = true && this.isSetLectureName(); - boolean that_present_lectureName = true && that.isSetLectureName(); - if (this_present_lectureName || that_present_lectureName) { - if (!(this_present_lectureName && that_present_lectureName)) - return false; - if (!this.lectureName.equals(that.lectureName)) - return false; - } - - boolean this_present_updateTime = true && this.isSetUpdateTime(); - boolean that_present_updateTime = true && that.isSetUpdateTime(); - if (this_present_updateTime || that_present_updateTime) { - if (!(this_present_updateTime && that_present_updateTime)) - return false; - if (!this.updateTime.equals(that.updateTime)) - return false; - } - - boolean this_present_userData = true && this.isSetUserData(); - boolean that_present_userData = true && that.isSetUserData(); - if (this_present_userData || that_present_userData) { - if (!(this_present_userData && that_present_userData)) - return false; - if (!this.userData.equals(that.userData)) - return false; - } - - boolean this_present_isTemplate = true && this.isSetIsTemplate(); - boolean that_present_isTemplate = true && that.isSetIsTemplate(); - if (this_present_isTemplate || that_present_isTemplate) { - if (!(this_present_isTemplate && that_present_isTemplate)) - return false; - if (!this.isTemplate.equals(that.isTemplate)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(Image other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetVersion()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetImageName()).compareTo(other.isSetImageName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetImageName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageName, other.imageName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLicenseRestriction()).compareTo(other.isSetLicenseRestriction()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLicenseRestriction()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.licenseRestriction, other.licenseRestriction); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOsName()).compareTo(other.isSetOsName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOsName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.osName, other.osName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLectureName()).compareTo(other.isSetLectureName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLectureName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lectureName, other.lectureName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUpdateTime()).compareTo(other.isSetUpdateTime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUpdateTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updateTime, other.updateTime); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUserData()).compareTo(other.isSetUserData()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUserData()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userData, other.userData); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIsTemplate()).compareTo(other.isSetIsTemplate()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIsTemplate()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isTemplate, other.isTemplate); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("Image("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - if (!first) sb.append(", "); - sb.append("version:"); - if (this.version == null) { - sb.append("null"); - } else { - sb.append(this.version); - } - first = false; - if (!first) sb.append(", "); - sb.append("imageName:"); - if (this.imageName == null) { - sb.append("null"); - } else { - sb.append(this.imageName); - } - first = false; - if (!first) sb.append(", "); - sb.append("licenseRestriction:"); - if (this.licenseRestriction == null) { - sb.append("null"); - } else { - sb.append(this.licenseRestriction); - } - first = false; - if (!first) sb.append(", "); - sb.append("osName:"); - if (this.osName == null) { - sb.append("null"); - } else { - sb.append(this.osName); - } - first = false; - if (!first) sb.append(", "); - sb.append("lectureName:"); - if (this.lectureName == null) { - sb.append("null"); - } else { - sb.append(this.lectureName); - } - first = false; - if (!first) sb.append(", "); - sb.append("updateTime:"); - if (this.updateTime == null) { - sb.append("null"); - } else { - sb.append(this.updateTime); - } - first = false; - if (!first) sb.append(", "); - sb.append("userData:"); - if (this.userData == null) { - sb.append("null"); - } else { - sb.append(this.userData); - } - first = false; - if (!first) sb.append(", "); - sb.append("isTemplate:"); - if (this.isTemplate == null) { - sb.append("null"); - } else { - sb.append(this.isTemplate); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class ImageStandardSchemeFactory implements SchemeFactory { - public ImageStandardScheme getScheme() { - return new ImageStandardScheme(); - } - } - - private static class ImageStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, Image struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // VERSION - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.version = iprot.readString(); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -3: // IMAGE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.imageName = iprot.readString(); - struct.setImageNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -4: // LICENSE_RESTRICTION - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.licenseRestriction = iprot.readString(); - struct.setLicenseRestrictionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -5: // OS_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.osName = iprot.readString(); - struct.setOsNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -6: // LECTURE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.lectureName = iprot.readString(); - struct.setLectureNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -7: // UPDATE_TIME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.updateTime = iprot.readString(); - struct.setUpdateTimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -8: // USER_DATA - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.userData = iprot.readString(); - struct.setUserDataIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -9: // IS_TEMPLATE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.isTemplate = iprot.readString(); - struct.setIsTemplateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, Image struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isTemplate != null) { - oprot.writeFieldBegin(IS_TEMPLATE_FIELD_DESC); - oprot.writeString(struct.isTemplate); - oprot.writeFieldEnd(); - } - if (struct.userData != null) { - oprot.writeFieldBegin(USER_DATA_FIELD_DESC); - oprot.writeString(struct.userData); - oprot.writeFieldEnd(); - } - if (struct.updateTime != null) { - oprot.writeFieldBegin(UPDATE_TIME_FIELD_DESC); - oprot.writeString(struct.updateTime); - oprot.writeFieldEnd(); - } - if (struct.lectureName != null) { - oprot.writeFieldBegin(LECTURE_NAME_FIELD_DESC); - oprot.writeString(struct.lectureName); - oprot.writeFieldEnd(); - } - if (struct.osName != null) { - oprot.writeFieldBegin(OS_NAME_FIELD_DESC); - oprot.writeString(struct.osName); - oprot.writeFieldEnd(); - } - if (struct.licenseRestriction != null) { - oprot.writeFieldBegin(LICENSE_RESTRICTION_FIELD_DESC); - oprot.writeString(struct.licenseRestriction); - oprot.writeFieldEnd(); - } - if (struct.imageName != null) { - oprot.writeFieldBegin(IMAGE_NAME_FIELD_DESC); - oprot.writeString(struct.imageName); - oprot.writeFieldEnd(); - } - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeString(struct.version); - oprot.writeFieldEnd(); - } - if (struct.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(struct.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class ImageTupleSchemeFactory implements SchemeFactory { - public ImageTupleScheme getScheme() { - return new ImageTupleScheme(); - } - } - - private static class ImageTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, Image struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetId()) { - optionals.set(0); - } - if (struct.isSetVersion()) { - optionals.set(1); - } - if (struct.isSetImageName()) { - optionals.set(2); - } - if (struct.isSetLicenseRestriction()) { - optionals.set(3); - } - if (struct.isSetOsName()) { - optionals.set(4); - } - if (struct.isSetLectureName()) { - optionals.set(5); - } - if (struct.isSetUpdateTime()) { - optionals.set(6); - } - if (struct.isSetUserData()) { - optionals.set(7); - } - if (struct.isSetIsTemplate()) { - optionals.set(8); - } - oprot.writeBitSet(optionals, 9); - if (struct.isSetId()) { - oprot.writeString(struct.id); - } - if (struct.isSetVersion()) { - oprot.writeString(struct.version); - } - if (struct.isSetImageName()) { - oprot.writeString(struct.imageName); - } - if (struct.isSetLicenseRestriction()) { - oprot.writeString(struct.licenseRestriction); - } - if (struct.isSetOsName()) { - oprot.writeString(struct.osName); - } - if (struct.isSetLectureName()) { - oprot.writeString(struct.lectureName); - } - if (struct.isSetUpdateTime()) { - oprot.writeString(struct.updateTime); - } - if (struct.isSetUserData()) { - oprot.writeString(struct.userData); - } - if (struct.isSetIsTemplate()) { - oprot.writeString(struct.isTemplate); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, Image struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(9); - if (incoming.get(0)) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } - if (incoming.get(1)) { - struct.version = iprot.readString(); - struct.setVersionIsSet(true); - } - if (incoming.get(2)) { - struct.imageName = iprot.readString(); - struct.setImageNameIsSet(true); - } - if (incoming.get(3)) { - struct.licenseRestriction = iprot.readString(); - struct.setLicenseRestrictionIsSet(true); - } - if (incoming.get(4)) { - struct.osName = iprot.readString(); - struct.setOsNameIsSet(true); - } - if (incoming.get(5)) { - struct.lectureName = iprot.readString(); - struct.setLectureNameIsSet(true); - } - if (incoming.get(6)) { - struct.updateTime = iprot.readString(); - struct.setUpdateTimeIsSet(true); - } - if (incoming.get(7)) { - struct.userData = iprot.readString(); - struct.setUserDataIsSet(true); - } - if (incoming.get(8)) { - struct.isTemplate = iprot.readString(); - struct.setIsTemplateIsSet(true); - } - } - } - -} - diff --git a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/Lecture.java b/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/Lecture.java deleted file mode 100644 index 0c61ad84..00000000 --- a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/Lecture.java +++ /dev/null @@ -1,1188 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.1) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package server; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Lecture implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Lecture"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField LECTURENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lecturename", org.apache.thrift.protocol.TType.STRING, (short)-2); - private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.STRING, (short)-3); - private static final org.apache.thrift.protocol.TField STARTTIME_FIELD_DESC = new org.apache.thrift.protocol.TField("starttime", org.apache.thrift.protocol.TType.STRING, (short)-4); - private static final org.apache.thrift.protocol.TField ENDTIME_FIELD_DESC = new org.apache.thrift.protocol.TField("endtime", org.apache.thrift.protocol.TType.STRING, (short)-5); - private static final org.apache.thrift.protocol.TField LASTUSED_FIELD_DESC = new org.apache.thrift.protocol.TField("lastused", org.apache.thrift.protocol.TType.STRING, (short)-6); - private static final org.apache.thrift.protocol.TField DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("desc", org.apache.thrift.protocol.TType.STRING, (short)-7); - private static final org.apache.thrift.protocol.TField IMAGENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imagename", org.apache.thrift.protocol.TType.STRING, (short)-8); - private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)-9); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new LectureStandardSchemeFactory()); - schemes.put(TupleScheme.class, new LectureTupleSchemeFactory()); - } - - public String id; // required - public String lecturename; // required - public String isActive; // required - public String starttime; // required - public String endtime; // required - public String lastused; // required - public String desc; // required - public String imagename; // required - public String username; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - ID((short)-1, "id"), - LECTURENAME((short)-2, "lecturename"), - IS_ACTIVE((short)-3, "isActive"), - STARTTIME((short)-4, "starttime"), - ENDTIME((short)-5, "endtime"), - LASTUSED((short)-6, "lastused"), - DESC((short)-7, "desc"), - IMAGENAME((short)-8, "imagename"), - USERNAME((short)-9, "username"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // ID - return ID; - case -2: // LECTURENAME - return LECTURENAME; - case -3: // IS_ACTIVE - return IS_ACTIVE; - case -4: // STARTTIME - return STARTTIME; - case -5: // ENDTIME - return ENDTIME; - case -6: // LASTUSED - return LASTUSED; - case -7: // DESC - return DESC; - case -8: // IMAGENAME - return IMAGENAME; - case -9: // USERNAME - return USERNAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.LECTURENAME, new org.apache.thrift.meta_data.FieldMetaData("lecturename", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.STARTTIME, new org.apache.thrift.meta_data.FieldMetaData("starttime", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ENDTIME, new org.apache.thrift.meta_data.FieldMetaData("endtime", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.LASTUSED, new org.apache.thrift.meta_data.FieldMetaData("lastused", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.DESC, new org.apache.thrift.meta_data.FieldMetaData("desc", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IMAGENAME, new org.apache.thrift.meta_data.FieldMetaData("imagename", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Lecture.class, metaDataMap); - } - - public Lecture() { - } - - public Lecture( - String id, - String lecturename, - String isActive, - String starttime, - String endtime, - String lastused, - String desc, - String imagename, - String username) - { - this(); - this.id = id; - this.lecturename = lecturename; - this.isActive = isActive; - this.starttime = starttime; - this.endtime = endtime; - this.lastused = lastused; - this.desc = desc; - this.imagename = imagename; - this.username = username; - } - - /** - * Performs a deep copy on other. - */ - public Lecture(Lecture other) { - if (other.isSetId()) { - this.id = other.id; - } - if (other.isSetLecturename()) { - this.lecturename = other.lecturename; - } - if (other.isSetIsActive()) { - this.isActive = other.isActive; - } - if (other.isSetStarttime()) { - this.starttime = other.starttime; - } - if (other.isSetEndtime()) { - this.endtime = other.endtime; - } - if (other.isSetLastused()) { - this.lastused = other.lastused; - } - if (other.isSetDesc()) { - this.desc = other.desc; - } - if (other.isSetImagename()) { - this.imagename = other.imagename; - } - if (other.isSetUsername()) { - this.username = other.username; - } - } - - public Lecture deepCopy() { - return new Lecture(this); - } - - @Override - public void clear() { - this.id = null; - this.lecturename = null; - this.isActive = null; - this.starttime = null; - this.endtime = null; - this.lastused = null; - this.desc = null; - this.imagename = null; - this.username = null; - } - - public String getId() { - return this.id; - } - - public Lecture setId(String id) { - this.id = id; - return this; - } - - public void unsetId() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean isSetId() { - return this.id != null; - } - - public void setIdIsSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public String getLecturename() { - return this.lecturename; - } - - public Lecture setLecturename(String lecturename) { - this.lecturename = lecturename; - return this; - } - - public void unsetLecturename() { - this.lecturename = null; - } - - /** Returns true if field lecturename is set (has been assigned a value) and false otherwise */ - public boolean isSetLecturename() { - return this.lecturename != null; - } - - public void setLecturenameIsSet(boolean value) { - if (!value) { - this.lecturename = null; - } - } - - public String getIsActive() { - return this.isActive; - } - - public Lecture setIsActive(String isActive) { - this.isActive = isActive; - return this; - } - - public void unsetIsActive() { - this.isActive = null; - } - - /** Returns true if field isActive is set (has been assigned a value) and false otherwise */ - public boolean isSetIsActive() { - return this.isActive != null; - } - - public void setIsActiveIsSet(boolean value) { - if (!value) { - this.isActive = null; - } - } - - public String getStarttime() { - return this.starttime; - } - - public Lecture setStarttime(String starttime) { - this.starttime = starttime; - return this; - } - - public void unsetStarttime() { - this.starttime = null; - } - - /** Returns true if field starttime is set (has been assigned a value) and false otherwise */ - public boolean isSetStarttime() { - return this.starttime != null; - } - - public void setStarttimeIsSet(boolean value) { - if (!value) { - this.starttime = null; - } - } - - public String getEndtime() { - return this.endtime; - } - - public Lecture setEndtime(String endtime) { - this.endtime = endtime; - return this; - } - - public void unsetEndtime() { - this.endtime = null; - } - - /** Returns true if field endtime is set (has been assigned a value) and false otherwise */ - public boolean isSetEndtime() { - return this.endtime != null; - } - - public void setEndtimeIsSet(boolean value) { - if (!value) { - this.endtime = null; - } - } - - public String getLastused() { - return this.lastused; - } - - public Lecture setLastused(String lastused) { - this.lastused = lastused; - return this; - } - - public void unsetLastused() { - this.lastused = null; - } - - /** Returns true if field lastused is set (has been assigned a value) and false otherwise */ - public boolean isSetLastused() { - return this.lastused != null; - } - - public void setLastusedIsSet(boolean value) { - if (!value) { - this.lastused = null; - } - } - - public String getDesc() { - return this.desc; - } - - public Lecture setDesc(String desc) { - this.desc = desc; - return this; - } - - public void unsetDesc() { - this.desc = null; - } - - /** Returns true if field desc is set (has been assigned a value) and false otherwise */ - public boolean isSetDesc() { - return this.desc != null; - } - - public void setDescIsSet(boolean value) { - if (!value) { - this.desc = null; - } - } - - public String getImagename() { - return this.imagename; - } - - public Lecture setImagename(String imagename) { - this.imagename = imagename; - return this; - } - - public void unsetImagename() { - this.imagename = null; - } - - /** Returns true if field imagename is set (has been assigned a value) and false otherwise */ - public boolean isSetImagename() { - return this.imagename != null; - } - - public void setImagenameIsSet(boolean value) { - if (!value) { - this.imagename = null; - } - } - - public String getUsername() { - return this.username; - } - - public Lecture setUsername(String username) { - this.username = username; - return this; - } - - public void unsetUsername() { - this.username = null; - } - - /** Returns true if field username is set (has been assigned a value) and false otherwise */ - public boolean isSetUsername() { - return this.username != null; - } - - public void setUsernameIsSet(boolean value) { - if (!value) { - this.username = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unsetId(); - } else { - setId((String)value); - } - break; - - case LECTURENAME: - if (value == null) { - unsetLecturename(); - } else { - setLecturename((String)value); - } - break; - - case IS_ACTIVE: - if (value == null) { - unsetIsActive(); - } else { - setIsActive((String)value); - } - break; - - case STARTTIME: - if (value == null) { - unsetStarttime(); - } else { - setStarttime((String)value); - } - break; - - case ENDTIME: - if (value == null) { - unsetEndtime(); - } else { - setEndtime((String)value); - } - break; - - case LASTUSED: - if (value == null) { - unsetLastused(); - } else { - setLastused((String)value); - } - break; - - case DESC: - if (value == null) { - unsetDesc(); - } else { - setDesc((String)value); - } - break; - - case IMAGENAME: - if (value == null) { - unsetImagename(); - } else { - setImagename((String)value); - } - break; - - case USERNAME: - if (value == null) { - unsetUsername(); - } else { - setUsername((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return getId(); - - case LECTURENAME: - return getLecturename(); - - case IS_ACTIVE: - return getIsActive(); - - case STARTTIME: - return getStarttime(); - - case ENDTIME: - return getEndtime(); - - case LASTUSED: - return getLastused(); - - case DESC: - return getDesc(); - - case IMAGENAME: - return getImagename(); - - case USERNAME: - return getUsername(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case ID: - return isSetId(); - case LECTURENAME: - return isSetLecturename(); - case IS_ACTIVE: - return isSetIsActive(); - case STARTTIME: - return isSetStarttime(); - case ENDTIME: - return isSetEndtime(); - case LASTUSED: - return isSetLastused(); - case DESC: - return isSetDesc(); - case IMAGENAME: - return isSetImagename(); - case USERNAME: - return isSetUsername(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof Lecture) - return this.equals((Lecture)that); - return false; - } - - public boolean equals(Lecture that) { - if (that == null) - return false; - - boolean this_present_id = true && this.isSetId(); - boolean that_present_id = true && that.isSetId(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - boolean this_present_lecturename = true && this.isSetLecturename(); - boolean that_present_lecturename = true && that.isSetLecturename(); - if (this_present_lecturename || that_present_lecturename) { - if (!(this_present_lecturename && that_present_lecturename)) - return false; - if (!this.lecturename.equals(that.lecturename)) - return false; - } - - boolean this_present_isActive = true && this.isSetIsActive(); - boolean that_present_isActive = true && that.isSetIsActive(); - if (this_present_isActive || that_present_isActive) { - if (!(this_present_isActive && that_present_isActive)) - return false; - if (!this.isActive.equals(that.isActive)) - return false; - } - - boolean this_present_starttime = true && this.isSetStarttime(); - boolean that_present_starttime = true && that.isSetStarttime(); - if (this_present_starttime || that_present_starttime) { - if (!(this_present_starttime && that_present_starttime)) - return false; - if (!this.starttime.equals(that.starttime)) - return false; - } - - boolean this_present_endtime = true && this.isSetEndtime(); - boolean that_present_endtime = true && that.isSetEndtime(); - if (this_present_endtime || that_present_endtime) { - if (!(this_present_endtime && that_present_endtime)) - return false; - if (!this.endtime.equals(that.endtime)) - return false; - } - - boolean this_present_lastused = true && this.isSetLastused(); - boolean that_present_lastused = true && that.isSetLastused(); - if (this_present_lastused || that_present_lastused) { - if (!(this_present_lastused && that_present_lastused)) - return false; - if (!this.lastused.equals(that.lastused)) - return false; - } - - boolean this_present_desc = true && this.isSetDesc(); - boolean that_present_desc = true && that.isSetDesc(); - if (this_present_desc || that_present_desc) { - if (!(this_present_desc && that_present_desc)) - return false; - if (!this.desc.equals(that.desc)) - return false; - } - - boolean this_present_imagename = true && this.isSetImagename(); - boolean that_present_imagename = true && that.isSetImagename(); - if (this_present_imagename || that_present_imagename) { - if (!(this_present_imagename && that_present_imagename)) - return false; - if (!this.imagename.equals(that.imagename)) - return false; - } - - boolean this_present_username = true && this.isSetUsername(); - boolean that_present_username = true && that.isSetUsername(); - if (this_present_username || that_present_username) { - if (!(this_present_username && that_present_username)) - return false; - if (!this.username.equals(that.username)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(Lecture other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLecturename()).compareTo(other.isSetLecturename()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLecturename()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lecturename, other.lecturename); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(other.isSetIsActive()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIsActive()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isActive, other.isActive); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStarttime()).compareTo(other.isSetStarttime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStarttime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.starttime, other.starttime); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetEndtime()).compareTo(other.isSetEndtime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEndtime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endtime, other.endtime); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLastused()).compareTo(other.isSetLastused()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLastused()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastused, other.lastused); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDesc()).compareTo(other.isSetDesc()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDesc()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.desc, other.desc); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetImagename()).compareTo(other.isSetImagename()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetImagename()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagename, other.imagename); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUsername()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("Lecture("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - if (!first) sb.append(", "); - sb.append("lecturename:"); - if (this.lecturename == null) { - sb.append("null"); - } else { - sb.append(this.lecturename); - } - first = false; - if (!first) sb.append(", "); - sb.append("isActive:"); - if (this.isActive == null) { - sb.append("null"); - } else { - sb.append(this.isActive); - } - first = false; - if (!first) sb.append(", "); - sb.append("starttime:"); - if (this.starttime == null) { - sb.append("null"); - } else { - sb.append(this.starttime); - } - first = false; - if (!first) sb.append(", "); - sb.append("endtime:"); - if (this.endtime == null) { - sb.append("null"); - } else { - sb.append(this.endtime); - } - first = false; - if (!first) sb.append(", "); - sb.append("lastused:"); - if (this.lastused == null) { - sb.append("null"); - } else { - sb.append(this.lastused); - } - first = false; - if (!first) sb.append(", "); - sb.append("desc:"); - if (this.desc == null) { - sb.append("null"); - } else { - sb.append(this.desc); - } - first = false; - if (!first) sb.append(", "); - sb.append("imagename:"); - if (this.imagename == null) { - sb.append("null"); - } else { - sb.append(this.imagename); - } - first = false; - if (!first) sb.append(", "); - sb.append("username:"); - if (this.username == null) { - sb.append("null"); - } else { - sb.append(this.username); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class LectureStandardSchemeFactory implements SchemeFactory { - public LectureStandardScheme getScheme() { - return new LectureStandardScheme(); - } - } - - private static class LectureStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, Lecture struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // LECTURENAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.lecturename = iprot.readString(); - struct.setLecturenameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -3: // IS_ACTIVE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.isActive = iprot.readString(); - struct.setIsActiveIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -4: // STARTTIME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.starttime = iprot.readString(); - struct.setStarttimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -5: // ENDTIME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.endtime = iprot.readString(); - struct.setEndtimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -6: // LASTUSED - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.lastused = iprot.readString(); - struct.setLastusedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -7: // DESC - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.desc = iprot.readString(); - struct.setDescIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -8: // IMAGENAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.imagename = iprot.readString(); - struct.setImagenameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -9: // USERNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, Lecture struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.username != null) { - oprot.writeFieldBegin(USERNAME_FIELD_DESC); - oprot.writeString(struct.username); - oprot.writeFieldEnd(); - } - if (struct.imagename != null) { - oprot.writeFieldBegin(IMAGENAME_FIELD_DESC); - oprot.writeString(struct.imagename); - oprot.writeFieldEnd(); - } - if (struct.desc != null) { - oprot.writeFieldBegin(DESC_FIELD_DESC); - oprot.writeString(struct.desc); - oprot.writeFieldEnd(); - } - if (struct.lastused != null) { - oprot.writeFieldBegin(LASTUSED_FIELD_DESC); - oprot.writeString(struct.lastused); - oprot.writeFieldEnd(); - } - if (struct.endtime != null) { - oprot.writeFieldBegin(ENDTIME_FIELD_DESC); - oprot.writeString(struct.endtime); - oprot.writeFieldEnd(); - } - if (struct.starttime != null) { - oprot.writeFieldBegin(STARTTIME_FIELD_DESC); - oprot.writeString(struct.starttime); - oprot.writeFieldEnd(); - } - if (struct.isActive != null) { - oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC); - oprot.writeString(struct.isActive); - oprot.writeFieldEnd(); - } - if (struct.lecturename != null) { - oprot.writeFieldBegin(LECTURENAME_FIELD_DESC); - oprot.writeString(struct.lecturename); - oprot.writeFieldEnd(); - } - if (struct.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(struct.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class LectureTupleSchemeFactory implements SchemeFactory { - public LectureTupleScheme getScheme() { - return new LectureTupleScheme(); - } - } - - private static class LectureTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, Lecture struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetId()) { - optionals.set(0); - } - if (struct.isSetLecturename()) { - optionals.set(1); - } - if (struct.isSetIsActive()) { - optionals.set(2); - } - if (struct.isSetStarttime()) { - optionals.set(3); - } - if (struct.isSetEndtime()) { - optionals.set(4); - } - if (struct.isSetLastused()) { - optionals.set(5); - } - if (struct.isSetDesc()) { - optionals.set(6); - } - if (struct.isSetImagename()) { - optionals.set(7); - } - if (struct.isSetUsername()) { - optionals.set(8); - } - oprot.writeBitSet(optionals, 9); - if (struct.isSetId()) { - oprot.writeString(struct.id); - } - if (struct.isSetLecturename()) { - oprot.writeString(struct.lecturename); - } - if (struct.isSetIsActive()) { - oprot.writeString(struct.isActive); - } - if (struct.isSetStarttime()) { - oprot.writeString(struct.starttime); - } - if (struct.isSetEndtime()) { - oprot.writeString(struct.endtime); - } - if (struct.isSetLastused()) { - oprot.writeString(struct.lastused); - } - if (struct.isSetDesc()) { - oprot.writeString(struct.desc); - } - if (struct.isSetImagename()) { - oprot.writeString(struct.imagename); - } - if (struct.isSetUsername()) { - oprot.writeString(struct.username); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, Lecture struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(9); - if (incoming.get(0)) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } - if (incoming.get(1)) { - struct.lecturename = iprot.readString(); - struct.setLecturenameIsSet(true); - } - if (incoming.get(2)) { - struct.isActive = iprot.readString(); - struct.setIsActiveIsSet(true); - } - if (incoming.get(3)) { - struct.starttime = iprot.readString(); - struct.setStarttimeIsSet(true); - } - if (incoming.get(4)) { - struct.endtime = iprot.readString(); - struct.setEndtimeIsSet(true); - } - if (incoming.get(5)) { - struct.lastused = iprot.readString(); - struct.setLastusedIsSet(true); - } - if (incoming.get(6)) { - struct.desc = iprot.readString(); - struct.setDescIsSet(true); - } - if (incoming.get(7)) { - struct.imagename = iprot.readString(); - struct.setImagenameIsSet(true); - } - if (incoming.get(8)) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - } - } - } - -} - diff --git a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/Server.java b/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/Server.java deleted file mode 100644 index ab527168..00000000 --- a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/Server.java +++ /dev/null @@ -1,27824 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.1) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package server; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Server { - - public interface Iface { - - public User getFtpUser() throws org.apache.thrift.TException; - - public long DeleteFtpUser(String user) throws org.apache.thrift.TException; - - public String getPathOfImage(String image_id, String version) throws org.apache.thrift.TException; - - public boolean writeVLdata(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException; - - public List getImageList() throws org.apache.thrift.TException; - - public List getLectureList() throws org.apache.thrift.TException; - - public List getAllOS() throws org.apache.thrift.TException; - - public List getAllUniversities() throws org.apache.thrift.TException; - - public Map getPersonData(String Vorname, String Nachname) throws org.apache.thrift.TException; - - public boolean writeLecturedata(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak) throws org.apache.thrift.TException; - - public boolean startFileCopy(String file) throws org.apache.thrift.TException; - - public Map getImageData(String imageid, String imageversion) throws org.apache.thrift.TException; - - public Map getLectureData(String lectureid) throws org.apache.thrift.TException; - - public boolean updateImageData(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException; - - public boolean deleteImageData(String id, String version) throws org.apache.thrift.TException; - - public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException; - - public boolean deleteImageServer(String id, String version) throws org.apache.thrift.TException; - - public boolean connectedToLecture(String id, String version) throws org.apache.thrift.TException; - - public boolean deleteLecture(String id, String hs, String user) throws org.apache.thrift.TException; - - public boolean checkUser(String username) throws org.apache.thrift.TException; - - public boolean createUser(String loginName, String lastName, String firstName, String mail, String university) throws org.apache.thrift.TException; - - public boolean writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException; - - public boolean writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException; - - } - - public interface AsyncIface { - - public void getFtpUser(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void DeleteFtpUser(String user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getPathOfImage(String image_id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void writeVLdata(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getImageList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getLectureList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getAllOS(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getAllUniversities(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getPersonData(String Vorname, String Nachname, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void writeLecturedata(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void startFileCopy(String file, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getImageData(String imageid, String imageversion, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getLectureData(String lectureid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void updateImageData(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void deleteImageData(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void deleteImageServer(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void connectedToLecture(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void deleteLecture(String id, String hs, String user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void checkUser(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void createUser(String loginName, String lastName, String firstName, String mail, String university, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - } - - public static class Client extends org.apache.thrift.TServiceClient implements Iface { - public static class Factory implements org.apache.thrift.TServiceClientFactory { - public Factory() {} - public Client getClient(org.apache.thrift.protocol.TProtocol prot) { - return new Client(prot); - } - public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - return new Client(iprot, oprot); - } - } - - public Client(org.apache.thrift.protocol.TProtocol prot) - { - super(prot, prot); - } - - public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - super(iprot, oprot); - } - - public User getFtpUser() throws org.apache.thrift.TException - { - send_getFtpUser(); - return recv_getFtpUser(); - } - - public void send_getFtpUser() throws org.apache.thrift.TException - { - getFtpUser_args args = new getFtpUser_args(); - sendBase("getFtpUser", args); - } - - public User recv_getFtpUser() throws org.apache.thrift.TException - { - getFtpUser_result result = new getFtpUser_result(); - receiveBase(result, "getFtpUser"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getFtpUser failed: unknown result"); - } - - public long DeleteFtpUser(String user) throws org.apache.thrift.TException - { - send_DeleteFtpUser(user); - return recv_DeleteFtpUser(); - } - - public void send_DeleteFtpUser(String user) throws org.apache.thrift.TException - { - DeleteFtpUser_args args = new DeleteFtpUser_args(); - args.setUser(user); - sendBase("DeleteFtpUser", args); - } - - public long recv_DeleteFtpUser() throws org.apache.thrift.TException - { - DeleteFtpUser_result result = new DeleteFtpUser_result(); - receiveBase(result, "DeleteFtpUser"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "DeleteFtpUser failed: unknown result"); - } - - public String getPathOfImage(String image_id, String version) throws org.apache.thrift.TException - { - send_getPathOfImage(image_id, version); - return recv_getPathOfImage(); - } - - public void send_getPathOfImage(String image_id, String version) throws org.apache.thrift.TException - { - getPathOfImage_args args = new getPathOfImage_args(); - args.setImage_id(image_id); - args.setVersion(version); - sendBase("getPathOfImage", args); - } - - public String recv_getPathOfImage() throws org.apache.thrift.TException - { - getPathOfImage_result result = new getPathOfImage_result(); - receiveBase(result, "getPathOfImage"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPathOfImage failed: unknown result"); - } - - public boolean writeVLdata(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException - { - send_writeVLdata(imagename, desc, login, firstname, lastname, university, Mail, Tel, Fak, license, internet, ram, cpu, imagePath, isTemplate, filesize, shareMode, os); - return recv_writeVLdata(); - } - - public void send_writeVLdata(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException - { - writeVLdata_args args = new writeVLdata_args(); - args.setImagename(imagename); - args.setDesc(desc); - args.setLogin(login); - args.setFirstname(firstname); - args.setLastname(lastname); - args.setUniversity(university); - args.setMail(Mail); - args.setTel(Tel); - args.setFak(Fak); - args.setLicense(license); - args.setInternet(internet); - args.setRam(ram); - args.setCpu(cpu); - args.setImagePath(imagePath); - args.setIsTemplate(isTemplate); - args.setFilesize(filesize); - args.setShareMode(shareMode); - args.setOs(os); - sendBase("writeVLdata", args); - } - - public boolean recv_writeVLdata() throws org.apache.thrift.TException - { - writeVLdata_result result = new writeVLdata_result(); - receiveBase(result, "writeVLdata"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "writeVLdata failed: unknown result"); - } - - public List getImageList() throws org.apache.thrift.TException - { - send_getImageList(); - return recv_getImageList(); - } - - public void send_getImageList() throws org.apache.thrift.TException - { - getImageList_args args = new getImageList_args(); - sendBase("getImageList", args); - } - - public List recv_getImageList() throws org.apache.thrift.TException - { - getImageList_result result = new getImageList_result(); - receiveBase(result, "getImageList"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getImageList failed: unknown result"); - } - - public List getLectureList() throws org.apache.thrift.TException - { - send_getLectureList(); - return recv_getLectureList(); - } - - public void send_getLectureList() throws org.apache.thrift.TException - { - getLectureList_args args = new getLectureList_args(); - sendBase("getLectureList", args); - } - - public List recv_getLectureList() throws org.apache.thrift.TException - { - getLectureList_result result = new getLectureList_result(); - receiveBase(result, "getLectureList"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLectureList failed: unknown result"); - } - - public List getAllOS() throws org.apache.thrift.TException - { - send_getAllOS(); - return recv_getAllOS(); - } - - public void send_getAllOS() throws org.apache.thrift.TException - { - getAllOS_args args = new getAllOS_args(); - sendBase("getAllOS", args); - } - - public List recv_getAllOS() throws org.apache.thrift.TException - { - getAllOS_result result = new getAllOS_result(); - receiveBase(result, "getAllOS"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllOS failed: unknown result"); - } - - public List getAllUniversities() throws org.apache.thrift.TException - { - send_getAllUniversities(); - return recv_getAllUniversities(); - } - - public void send_getAllUniversities() throws org.apache.thrift.TException - { - getAllUniversities_args args = new getAllUniversities_args(); - sendBase("getAllUniversities", args); - } - - public List recv_getAllUniversities() throws org.apache.thrift.TException - { - getAllUniversities_result result = new getAllUniversities_result(); - receiveBase(result, "getAllUniversities"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllUniversities failed: unknown result"); - } - - public Map getPersonData(String Vorname, String Nachname) throws org.apache.thrift.TException - { - send_getPersonData(Vorname, Nachname); - return recv_getPersonData(); - } - - public void send_getPersonData(String Vorname, String Nachname) throws org.apache.thrift.TException - { - getPersonData_args args = new getPersonData_args(); - args.setVorname(Vorname); - args.setNachname(Nachname); - sendBase("getPersonData", args); - } - - public Map recv_getPersonData() throws org.apache.thrift.TException - { - getPersonData_result result = new getPersonData_result(); - receiveBase(result, "getPersonData"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPersonData failed: unknown result"); - } - - public boolean writeLecturedata(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak) throws org.apache.thrift.TException - { - send_writeLecturedata(name, shortdesc, desc, startDate, endDate, isActive, imagename, login, firstname, lastname, university, Mail, Tel, Fak); - return recv_writeLecturedata(); - } - - public void send_writeLecturedata(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak) throws org.apache.thrift.TException - { - writeLecturedata_args args = new writeLecturedata_args(); - args.setName(name); - args.setShortdesc(shortdesc); - args.setDesc(desc); - args.setStartDate(startDate); - args.setEndDate(endDate); - args.setIsActive(isActive); - args.setImagename(imagename); - args.setLogin(login); - args.setFirstname(firstname); - args.setLastname(lastname); - args.setUniversity(university); - args.setMail(Mail); - args.setTel(Tel); - args.setFak(Fak); - sendBase("writeLecturedata", args); - } - - public boolean recv_writeLecturedata() throws org.apache.thrift.TException - { - writeLecturedata_result result = new writeLecturedata_result(); - receiveBase(result, "writeLecturedata"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "writeLecturedata failed: unknown result"); - } - - public boolean startFileCopy(String file) throws org.apache.thrift.TException - { - send_startFileCopy(file); - return recv_startFileCopy(); - } - - public void send_startFileCopy(String file) throws org.apache.thrift.TException - { - startFileCopy_args args = new startFileCopy_args(); - args.setFile(file); - sendBase("startFileCopy", args); - } - - public boolean recv_startFileCopy() throws org.apache.thrift.TException - { - startFileCopy_result result = new startFileCopy_result(); - receiveBase(result, "startFileCopy"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startFileCopy failed: unknown result"); - } - - public Map getImageData(String imageid, String imageversion) throws org.apache.thrift.TException - { - send_getImageData(imageid, imageversion); - return recv_getImageData(); - } - - public void send_getImageData(String imageid, String imageversion) throws org.apache.thrift.TException - { - getImageData_args args = new getImageData_args(); - args.setImageid(imageid); - args.setImageversion(imageversion); - sendBase("getImageData", args); - } - - public Map recv_getImageData() throws org.apache.thrift.TException - { - getImageData_result result = new getImageData_result(); - receiveBase(result, "getImageData"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getImageData failed: unknown result"); - } - - public Map getLectureData(String lectureid) throws org.apache.thrift.TException - { - send_getLectureData(lectureid); - return recv_getLectureData(); - } - - public void send_getLectureData(String lectureid) throws org.apache.thrift.TException - { - getLectureData_args args = new getLectureData_args(); - args.setLectureid(lectureid); - sendBase("getLectureData", args); - } - - public Map recv_getLectureData() throws org.apache.thrift.TException - { - getLectureData_result result = new getLectureData_result(); - receiveBase(result, "getLectureData"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLectureData failed: unknown result"); - } - - public boolean updateImageData(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException - { - send_updateImageData(name, newName, desc, image_path, license, internet, ram, cpu, id, version, isTemplate, filesize, shareMode, os); - return recv_updateImageData(); - } - - public void send_updateImageData(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException - { - updateImageData_args args = new updateImageData_args(); - args.setName(name); - args.setNewName(newName); - args.setDesc(desc); - args.setImage_path(image_path); - args.setLicense(license); - args.setInternet(internet); - args.setRam(ram); - args.setCpu(cpu); - args.setId(id); - args.setVersion(version); - args.setIsTemplate(isTemplate); - args.setFilesize(filesize); - args.setShareMode(shareMode); - args.setOs(os); - sendBase("updateImageData", args); - } - - public boolean recv_updateImageData() throws org.apache.thrift.TException - { - updateImageData_result result = new updateImageData_result(); - receiveBase(result, "updateImageData"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateImageData failed: unknown result"); - } - - public boolean deleteImageData(String id, String version) throws org.apache.thrift.TException - { - send_deleteImageData(id, version); - return recv_deleteImageData(); - } - - public void send_deleteImageData(String id, String version) throws org.apache.thrift.TException - { - deleteImageData_args args = new deleteImageData_args(); - args.setId(id); - args.setVersion(version); - sendBase("deleteImageData", args); - } - - public boolean recv_deleteImageData() throws org.apache.thrift.TException - { - deleteImageData_result result = new deleteImageData_result(); - receiveBase(result, "deleteImageData"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteImageData failed: unknown result"); - } - - public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException - { - send_updateLecturedata(name, newName, shortdesc, desc, startDate, endDate, isActive, imageid, imageversion, user, firstname, lastname, university, Mail, Tel, Fak, id); - return recv_updateLecturedata(); - } - - public void send_updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException - { - updateLecturedata_args args = new updateLecturedata_args(); - args.setName(name); - args.setNewName(newName); - args.setShortdesc(shortdesc); - args.setDesc(desc); - args.setStartDate(startDate); - args.setEndDate(endDate); - args.setIsActive(isActive); - args.setImageid(imageid); - args.setImageversion(imageversion); - args.setUser(user); - args.setFirstname(firstname); - args.setLastname(lastname); - args.setUniversity(university); - args.setMail(Mail); - args.setTel(Tel); - args.setFak(Fak); - args.setId(id); - sendBase("updateLecturedata", args); - } - - public boolean recv_updateLecturedata() throws org.apache.thrift.TException - { - updateLecturedata_result result = new updateLecturedata_result(); - receiveBase(result, "updateLecturedata"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateLecturedata failed: unknown result"); - } - - public boolean deleteImageServer(String id, String version) throws org.apache.thrift.TException - { - send_deleteImageServer(id, version); - return recv_deleteImageServer(); - } - - public void send_deleteImageServer(String id, String version) throws org.apache.thrift.TException - { - deleteImageServer_args args = new deleteImageServer_args(); - args.setId(id); - args.setVersion(version); - sendBase("deleteImageServer", args); - } - - public boolean recv_deleteImageServer() throws org.apache.thrift.TException - { - deleteImageServer_result result = new deleteImageServer_result(); - receiveBase(result, "deleteImageServer"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteImageServer failed: unknown result"); - } - - public boolean connectedToLecture(String id, String version) throws org.apache.thrift.TException - { - send_connectedToLecture(id, version); - return recv_connectedToLecture(); - } - - public void send_connectedToLecture(String id, String version) throws org.apache.thrift.TException - { - connectedToLecture_args args = new connectedToLecture_args(); - args.setId(id); - args.setVersion(version); - sendBase("connectedToLecture", args); - } - - public boolean recv_connectedToLecture() throws org.apache.thrift.TException - { - connectedToLecture_result result = new connectedToLecture_result(); - receiveBase(result, "connectedToLecture"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "connectedToLecture failed: unknown result"); - } - - public boolean deleteLecture(String id, String hs, String user) throws org.apache.thrift.TException - { - send_deleteLecture(id, hs, user); - return recv_deleteLecture(); - } - - public void send_deleteLecture(String id, String hs, String user) throws org.apache.thrift.TException - { - deleteLecture_args args = new deleteLecture_args(); - args.setId(id); - args.setHs(hs); - args.setUser(user); - sendBase("deleteLecture", args); - } - - public boolean recv_deleteLecture() throws org.apache.thrift.TException - { - deleteLecture_result result = new deleteLecture_result(); - receiveBase(result, "deleteLecture"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteLecture failed: unknown result"); - } - - public boolean checkUser(String username) throws org.apache.thrift.TException - { - send_checkUser(username); - return recv_checkUser(); - } - - public void send_checkUser(String username) throws org.apache.thrift.TException - { - checkUser_args args = new checkUser_args(); - args.setUsername(username); - sendBase("checkUser", args); - } - - public boolean recv_checkUser() throws org.apache.thrift.TException - { - checkUser_result result = new checkUser_result(); - receiveBase(result, "checkUser"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "checkUser failed: unknown result"); - } - - public boolean createUser(String loginName, String lastName, String firstName, String mail, String university) throws org.apache.thrift.TException - { - send_createUser(loginName, lastName, firstName, mail, university); - return recv_createUser(); - } - - public void send_createUser(String loginName, String lastName, String firstName, String mail, String university) throws org.apache.thrift.TException - { - createUser_args args = new createUser_args(); - args.setLoginName(loginName); - args.setLastName(lastName); - args.setFirstName(firstName); - args.setMail(mail); - args.setUniversity(university); - sendBase("createUser", args); - } - - public boolean recv_createUser() throws org.apache.thrift.TException - { - createUser_result result = new createUser_result(); - receiveBase(result, "createUser"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createUser failed: unknown result"); - } - - public boolean writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException - { - send_writeImageRights(imagename, username, lastName, firstName, mail, university, role); - return recv_writeImageRights(); - } - - public void send_writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException - { - writeImageRights_args args = new writeImageRights_args(); - args.setImagename(imagename); - args.setUsername(username); - args.setLastName(lastName); - args.setFirstName(firstName); - args.setMail(mail); - args.setUniversity(university); - args.setRole(role); - sendBase("writeImageRights", args); - } - - public boolean recv_writeImageRights() throws org.apache.thrift.TException - { - writeImageRights_result result = new writeImageRights_result(); - receiveBase(result, "writeImageRights"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "writeImageRights failed: unknown result"); - } - - public boolean writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException - { - send_writeLectureRights(lecturename, username, lastName, firstName, mail, university, role); - return recv_writeLectureRights(); - } - - public void send_writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException - { - writeLectureRights_args args = new writeLectureRights_args(); - args.setLecturename(lecturename); - args.setUsername(username); - args.setLastName(lastName); - args.setFirstName(firstName); - args.setMail(mail); - args.setUniversity(university); - args.setRole(role); - sendBase("writeLectureRights", args); - } - - public boolean recv_writeLectureRights() throws org.apache.thrift.TException - { - writeLectureRights_result result = new writeLectureRights_result(); - receiveBase(result, "writeLectureRights"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "writeLectureRights failed: unknown result"); - } - - } - public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { - public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { - private org.apache.thrift.async.TAsyncClientManager clientManager; - private org.apache.thrift.protocol.TProtocolFactory protocolFactory; - public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { - this.clientManager = clientManager; - this.protocolFactory = protocolFactory; - } - public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { - return new AsyncClient(protocolFactory, clientManager, transport); - } - } - - public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { - super(protocolFactory, clientManager, transport); - } - - public void getFtpUser(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getFtpUser_call method_call = new getFtpUser_call(resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getFtpUser_call extends org.apache.thrift.async.TAsyncMethodCall { - public getFtpUser_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getFtpUser", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getFtpUser_args args = new getFtpUser_args(); - args.write(prot); - prot.writeMessageEnd(); - } - - public User getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getFtpUser(); - } - } - - public void DeleteFtpUser(String user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - DeleteFtpUser_call method_call = new DeleteFtpUser_call(user, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class DeleteFtpUser_call extends org.apache.thrift.async.TAsyncMethodCall { - private String user; - public DeleteFtpUser_call(String user, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.user = user; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("DeleteFtpUser", org.apache.thrift.protocol.TMessageType.CALL, 0)); - DeleteFtpUser_args args = new DeleteFtpUser_args(); - args.setUser(user); - args.write(prot); - prot.writeMessageEnd(); - } - - public long getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_DeleteFtpUser(); - } - } - - public void getPathOfImage(String image_id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getPathOfImage_call method_call = new getPathOfImage_call(image_id, version, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getPathOfImage_call extends org.apache.thrift.async.TAsyncMethodCall { - private String image_id; - private String version; - public getPathOfImage_call(String image_id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.image_id = image_id; - this.version = version; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPathOfImage", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getPathOfImage_args args = new getPathOfImage_args(); - args.setImage_id(image_id); - args.setVersion(version); - args.write(prot); - prot.writeMessageEnd(); - } - - public String getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getPathOfImage(); - } - } - - public void writeVLdata(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - writeVLdata_call method_call = new writeVLdata_call(imagename, desc, login, firstname, lastname, university, Mail, Tel, Fak, license, internet, ram, cpu, imagePath, isTemplate, filesize, shareMode, os, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class writeVLdata_call extends org.apache.thrift.async.TAsyncMethodCall { - private String imagename; - private String desc; - private String login; - private String firstname; - private String lastname; - private String university; - private String Mail; - private String Tel; - private String Fak; - private boolean license; - private boolean internet; - private long ram; - private long cpu; - private String imagePath; - private boolean isTemplate; - private long filesize; - private long shareMode; - private String os; - public writeVLdata_call(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.imagename = imagename; - this.desc = desc; - this.login = login; - this.firstname = firstname; - this.lastname = lastname; - this.university = university; - this.Mail = Mail; - this.Tel = Tel; - this.Fak = Fak; - this.license = license; - this.internet = internet; - this.ram = ram; - this.cpu = cpu; - this.imagePath = imagePath; - this.isTemplate = isTemplate; - this.filesize = filesize; - this.shareMode = shareMode; - this.os = os; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("writeVLdata", org.apache.thrift.protocol.TMessageType.CALL, 0)); - writeVLdata_args args = new writeVLdata_args(); - args.setImagename(imagename); - args.setDesc(desc); - args.setLogin(login); - args.setFirstname(firstname); - args.setLastname(lastname); - args.setUniversity(university); - args.setMail(Mail); - args.setTel(Tel); - args.setFak(Fak); - args.setLicense(license); - args.setInternet(internet); - args.setRam(ram); - args.setCpu(cpu); - args.setImagePath(imagePath); - args.setIsTemplate(isTemplate); - args.setFilesize(filesize); - args.setShareMode(shareMode); - args.setOs(os); - args.write(prot); - prot.writeMessageEnd(); - } - - public boolean getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_writeVLdata(); - } - } - - public void getImageList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getImageList_call method_call = new getImageList_call(resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getImageList_call extends org.apache.thrift.async.TAsyncMethodCall { - public getImageList_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getImageList", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getImageList_args args = new getImageList_args(); - args.write(prot); - prot.writeMessageEnd(); - } - - public List getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getImageList(); - } - } - - public void getLectureList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getLectureList_call method_call = new getLectureList_call(resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getLectureList_call extends org.apache.thrift.async.TAsyncMethodCall { - public getLectureList_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getLectureList", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getLectureList_args args = new getLectureList_args(); - args.write(prot); - prot.writeMessageEnd(); - } - - public List getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getLectureList(); - } - } - - public void getAllOS(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getAllOS_call method_call = new getAllOS_call(resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getAllOS_call extends org.apache.thrift.async.TAsyncMethodCall { - public getAllOS_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllOS", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getAllOS_args args = new getAllOS_args(); - args.write(prot); - prot.writeMessageEnd(); - } - - public List getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getAllOS(); - } - } - - public void getAllUniversities(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getAllUniversities_call method_call = new getAllUniversities_call(resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getAllUniversities_call extends org.apache.thrift.async.TAsyncMethodCall { - public getAllUniversities_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllUniversities", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getAllUniversities_args args = new getAllUniversities_args(); - args.write(prot); - prot.writeMessageEnd(); - } - - public List getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getAllUniversities(); - } - } - - public void getPersonData(String Vorname, String Nachname, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getPersonData_call method_call = new getPersonData_call(Vorname, Nachname, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getPersonData_call extends org.apache.thrift.async.TAsyncMethodCall { - private String Vorname; - private String Nachname; - public getPersonData_call(String Vorname, String Nachname, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.Vorname = Vorname; - this.Nachname = Nachname; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPersonData", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getPersonData_args args = new getPersonData_args(); - args.setVorname(Vorname); - args.setNachname(Nachname); - args.write(prot); - prot.writeMessageEnd(); - } - - public Map getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getPersonData(); - } - } - - public void writeLecturedata(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - writeLecturedata_call method_call = new writeLecturedata_call(name, shortdesc, desc, startDate, endDate, isActive, imagename, login, firstname, lastname, university, Mail, Tel, Fak, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class writeLecturedata_call extends org.apache.thrift.async.TAsyncMethodCall { - private String name; - private String shortdesc; - private String desc; - private String startDate; - private String endDate; - private boolean isActive; - private String imagename; - private String login; - private String firstname; - private String lastname; - private String university; - private String Mail; - private String Tel; - private String Fak; - public writeLecturedata_call(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.name = name; - this.shortdesc = shortdesc; - this.desc = desc; - this.startDate = startDate; - this.endDate = endDate; - this.isActive = isActive; - this.imagename = imagename; - this.login = login; - this.firstname = firstname; - this.lastname = lastname; - this.university = university; - this.Mail = Mail; - this.Tel = Tel; - this.Fak = Fak; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("writeLecturedata", org.apache.thrift.protocol.TMessageType.CALL, 0)); - writeLecturedata_args args = new writeLecturedata_args(); - args.setName(name); - args.setShortdesc(shortdesc); - args.setDesc(desc); - args.setStartDate(startDate); - args.setEndDate(endDate); - args.setIsActive(isActive); - args.setImagename(imagename); - args.setLogin(login); - args.setFirstname(firstname); - args.setLastname(lastname); - args.setUniversity(university); - args.setMail(Mail); - args.setTel(Tel); - args.setFak(Fak); - args.write(prot); - prot.writeMessageEnd(); - } - - public boolean getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_writeLecturedata(); - } - } - - public void startFileCopy(String file, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - startFileCopy_call method_call = new startFileCopy_call(file, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class startFileCopy_call extends org.apache.thrift.async.TAsyncMethodCall { - private String file; - public startFileCopy_call(String file, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.file = file; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startFileCopy", org.apache.thrift.protocol.TMessageType.CALL, 0)); - startFileCopy_args args = new startFileCopy_args(); - args.setFile(file); - args.write(prot); - prot.writeMessageEnd(); - } - - public boolean getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_startFileCopy(); - } - } - - public void getImageData(String imageid, String imageversion, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getImageData_call method_call = new getImageData_call(imageid, imageversion, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getImageData_call extends org.apache.thrift.async.TAsyncMethodCall { - private String imageid; - private String imageversion; - public getImageData_call(String imageid, String imageversion, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.imageid = imageid; - this.imageversion = imageversion; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getImageData", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getImageData_args args = new getImageData_args(); - args.setImageid(imageid); - args.setImageversion(imageversion); - args.write(prot); - prot.writeMessageEnd(); - } - - public Map getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getImageData(); - } - } - - public void getLectureData(String lectureid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getLectureData_call method_call = new getLectureData_call(lectureid, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getLectureData_call extends org.apache.thrift.async.TAsyncMethodCall { - private String lectureid; - public getLectureData_call(String lectureid, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.lectureid = lectureid; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getLectureData", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getLectureData_args args = new getLectureData_args(); - args.setLectureid(lectureid); - args.write(prot); - prot.writeMessageEnd(); - } - - public Map getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getLectureData(); - } - } - - public void updateImageData(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - updateImageData_call method_call = new updateImageData_call(name, newName, desc, image_path, license, internet, ram, cpu, id, version, isTemplate, filesize, shareMode, os, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class updateImageData_call extends org.apache.thrift.async.TAsyncMethodCall { - private String name; - private String newName; - private String desc; - private String image_path; - private boolean license; - private boolean internet; - private long ram; - private long cpu; - private String id; - private String version; - private boolean isTemplate; - private long filesize; - private long shareMode; - private String os; - public updateImageData_call(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.name = name; - this.newName = newName; - this.desc = desc; - this.image_path = image_path; - this.license = license; - this.internet = internet; - this.ram = ram; - this.cpu = cpu; - this.id = id; - this.version = version; - this.isTemplate = isTemplate; - this.filesize = filesize; - this.shareMode = shareMode; - this.os = os; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateImageData", org.apache.thrift.protocol.TMessageType.CALL, 0)); - updateImageData_args args = new updateImageData_args(); - args.setName(name); - args.setNewName(newName); - args.setDesc(desc); - args.setImage_path(image_path); - args.setLicense(license); - args.setInternet(internet); - args.setRam(ram); - args.setCpu(cpu); - args.setId(id); - args.setVersion(version); - args.setIsTemplate(isTemplate); - args.setFilesize(filesize); - args.setShareMode(shareMode); - args.setOs(os); - args.write(prot); - prot.writeMessageEnd(); - } - - public boolean getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_updateImageData(); - } - } - - public void deleteImageData(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - deleteImageData_call method_call = new deleteImageData_call(id, version, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class deleteImageData_call extends org.apache.thrift.async.TAsyncMethodCall { - private String id; - private String version; - public deleteImageData_call(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.id = id; - this.version = version; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteImageData", org.apache.thrift.protocol.TMessageType.CALL, 0)); - deleteImageData_args args = new deleteImageData_args(); - args.setId(id); - args.setVersion(version); - args.write(prot); - prot.writeMessageEnd(); - } - - public boolean getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_deleteImageData(); - } - } - - public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - updateLecturedata_call method_call = new updateLecturedata_call(name, newName, shortdesc, desc, startDate, endDate, isActive, imageid, imageversion, user, firstname, lastname, university, Mail, Tel, Fak, id, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class updateLecturedata_call extends org.apache.thrift.async.TAsyncMethodCall { - private String name; - private String newName; - private String shortdesc; - private String desc; - private String startDate; - private String endDate; - private boolean isActive; - private String imageid; - private String imageversion; - private String user; - private String firstname; - private String lastname; - private String university; - private String Mail; - private String Tel; - private String Fak; - private String id; - public updateLecturedata_call(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.name = name; - this.newName = newName; - this.shortdesc = shortdesc; - this.desc = desc; - this.startDate = startDate; - this.endDate = endDate; - this.isActive = isActive; - this.imageid = imageid; - this.imageversion = imageversion; - this.user = user; - this.firstname = firstname; - this.lastname = lastname; - this.university = university; - this.Mail = Mail; - this.Tel = Tel; - this.Fak = Fak; - this.id = id; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateLecturedata", org.apache.thrift.protocol.TMessageType.CALL, 0)); - updateLecturedata_args args = new updateLecturedata_args(); - args.setName(name); - args.setNewName(newName); - args.setShortdesc(shortdesc); - args.setDesc(desc); - args.setStartDate(startDate); - args.setEndDate(endDate); - args.setIsActive(isActive); - args.setImageid(imageid); - args.setImageversion(imageversion); - args.setUser(user); - args.setFirstname(firstname); - args.setLastname(lastname); - args.setUniversity(university); - args.setMail(Mail); - args.setTel(Tel); - args.setFak(Fak); - args.setId(id); - args.write(prot); - prot.writeMessageEnd(); - } - - public boolean getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_updateLecturedata(); - } - } - - public void deleteImageServer(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - deleteImageServer_call method_call = new deleteImageServer_call(id, version, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class deleteImageServer_call extends org.apache.thrift.async.TAsyncMethodCall { - private String id; - private String version; - public deleteImageServer_call(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.id = id; - this.version = version; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteImageServer", org.apache.thrift.protocol.TMessageType.CALL, 0)); - deleteImageServer_args args = new deleteImageServer_args(); - args.setId(id); - args.setVersion(version); - args.write(prot); - prot.writeMessageEnd(); - } - - public boolean getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_deleteImageServer(); - } - } - - public void connectedToLecture(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - connectedToLecture_call method_call = new connectedToLecture_call(id, version, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class connectedToLecture_call extends org.apache.thrift.async.TAsyncMethodCall { - private String id; - private String version; - public connectedToLecture_call(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.id = id; - this.version = version; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("connectedToLecture", org.apache.thrift.protocol.TMessageType.CALL, 0)); - connectedToLecture_args args = new connectedToLecture_args(); - args.setId(id); - args.setVersion(version); - args.write(prot); - prot.writeMessageEnd(); - } - - public boolean getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_connectedToLecture(); - } - } - - public void deleteLecture(String id, String hs, String user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - deleteLecture_call method_call = new deleteLecture_call(id, hs, user, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class deleteLecture_call extends org.apache.thrift.async.TAsyncMethodCall { - private String id; - private String hs; - private String user; - public deleteLecture_call(String id, String hs, String user, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.id = id; - this.hs = hs; - this.user = user; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteLecture", org.apache.thrift.protocol.TMessageType.CALL, 0)); - deleteLecture_args args = new deleteLecture_args(); - args.setId(id); - args.setHs(hs); - args.setUser(user); - args.write(prot); - prot.writeMessageEnd(); - } - - public boolean getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_deleteLecture(); - } - } - - public void checkUser(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - checkUser_call method_call = new checkUser_call(username, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class checkUser_call extends org.apache.thrift.async.TAsyncMethodCall { - private String username; - public checkUser_call(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.username = username; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("checkUser", org.apache.thrift.protocol.TMessageType.CALL, 0)); - checkUser_args args = new checkUser_args(); - args.setUsername(username); - args.write(prot); - prot.writeMessageEnd(); - } - - public boolean getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_checkUser(); - } - } - - public void createUser(String loginName, String lastName, String firstName, String mail, String university, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - createUser_call method_call = new createUser_call(loginName, lastName, firstName, mail, university, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class createUser_call extends org.apache.thrift.async.TAsyncMethodCall { - private String loginName; - private String lastName; - private String firstName; - private String mail; - private String university; - public createUser_call(String loginName, String lastName, String firstName, String mail, String university, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.loginName = loginName; - this.lastName = lastName; - this.firstName = firstName; - this.mail = mail; - this.university = university; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createUser", org.apache.thrift.protocol.TMessageType.CALL, 0)); - createUser_args args = new createUser_args(); - args.setLoginName(loginName); - args.setLastName(lastName); - args.setFirstName(firstName); - args.setMail(mail); - args.setUniversity(university); - args.write(prot); - prot.writeMessageEnd(); - } - - public boolean getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_createUser(); - } - } - - public void writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - writeImageRights_call method_call = new writeImageRights_call(imagename, username, lastName, firstName, mail, university, role, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class writeImageRights_call extends org.apache.thrift.async.TAsyncMethodCall { - private String imagename; - private String username; - private String lastName; - private String firstName; - private String mail; - private String university; - private String role; - public writeImageRights_call(String imagename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.imagename = imagename; - this.username = username; - this.lastName = lastName; - this.firstName = firstName; - this.mail = mail; - this.university = university; - this.role = role; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("writeImageRights", org.apache.thrift.protocol.TMessageType.CALL, 0)); - writeImageRights_args args = new writeImageRights_args(); - args.setImagename(imagename); - args.setUsername(username); - args.setLastName(lastName); - args.setFirstName(firstName); - args.setMail(mail); - args.setUniversity(university); - args.setRole(role); - args.write(prot); - prot.writeMessageEnd(); - } - - public boolean getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_writeImageRights(); - } - } - - public void writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - writeLectureRights_call method_call = new writeLectureRights_call(lecturename, username, lastName, firstName, mail, university, role, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class writeLectureRights_call extends org.apache.thrift.async.TAsyncMethodCall { - private String lecturename; - private String username; - private String lastName; - private String firstName; - private String mail; - private String university; - private String role; - public writeLectureRights_call(String lecturename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.lecturename = lecturename; - this.username = username; - this.lastName = lastName; - this.firstName = firstName; - this.mail = mail; - this.university = university; - this.role = role; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("writeLectureRights", org.apache.thrift.protocol.TMessageType.CALL, 0)); - writeLectureRights_args args = new writeLectureRights_args(); - args.setLecturename(lecturename); - args.setUsername(username); - args.setLastName(lastName); - args.setFirstName(firstName); - args.setMail(mail); - args.setUniversity(university); - args.setRole(role); - args.write(prot); - prot.writeMessageEnd(); - } - - public boolean getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_writeLectureRights(); - } - } - - } - - public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); - public Processor(I iface) { - super(iface, getProcessMap(new HashMap>())); - } - - protected Processor(I iface, Map> processMap) { - super(iface, getProcessMap(processMap)); - } - - private static Map> getProcessMap(Map> processMap) { - processMap.put("getFtpUser", new getFtpUser()); - processMap.put("DeleteFtpUser", new DeleteFtpUser()); - processMap.put("getPathOfImage", new getPathOfImage()); - processMap.put("writeVLdata", new writeVLdata()); - processMap.put("getImageList", new getImageList()); - processMap.put("getLectureList", new getLectureList()); - processMap.put("getAllOS", new getAllOS()); - processMap.put("getAllUniversities", new getAllUniversities()); - processMap.put("getPersonData", new getPersonData()); - processMap.put("writeLecturedata", new writeLecturedata()); - processMap.put("startFileCopy", new startFileCopy()); - processMap.put("getImageData", new getImageData()); - processMap.put("getLectureData", new getLectureData()); - processMap.put("updateImageData", new updateImageData()); - processMap.put("deleteImageData", new deleteImageData()); - processMap.put("updateLecturedata", new updateLecturedata()); - processMap.put("deleteImageServer", new deleteImageServer()); - processMap.put("connectedToLecture", new connectedToLecture()); - processMap.put("deleteLecture", new deleteLecture()); - processMap.put("checkUser", new checkUser()); - processMap.put("createUser", new createUser()); - processMap.put("writeImageRights", new writeImageRights()); - processMap.put("writeLectureRights", new writeLectureRights()); - return processMap; - } - - public static class getFtpUser extends org.apache.thrift.ProcessFunction { - public getFtpUser() { - super("getFtpUser"); - } - - public getFtpUser_args getEmptyArgsInstance() { - return new getFtpUser_args(); - } - - protected boolean isOneway() { - return false; - } - - public getFtpUser_result getResult(I iface, getFtpUser_args args) throws org.apache.thrift.TException { - getFtpUser_result result = new getFtpUser_result(); - result.success = iface.getFtpUser(); - return result; - } - } - - public static class DeleteFtpUser extends org.apache.thrift.ProcessFunction { - public DeleteFtpUser() { - super("DeleteFtpUser"); - } - - public DeleteFtpUser_args getEmptyArgsInstance() { - return new DeleteFtpUser_args(); - } - - protected boolean isOneway() { - return false; - } - - public DeleteFtpUser_result getResult(I iface, DeleteFtpUser_args args) throws org.apache.thrift.TException { - DeleteFtpUser_result result = new DeleteFtpUser_result(); - result.success = iface.DeleteFtpUser(args.user); - result.setSuccessIsSet(true); - return result; - } - } - - public static class getPathOfImage extends org.apache.thrift.ProcessFunction { - public getPathOfImage() { - super("getPathOfImage"); - } - - public getPathOfImage_args getEmptyArgsInstance() { - return new getPathOfImage_args(); - } - - protected boolean isOneway() { - return false; - } - - public getPathOfImage_result getResult(I iface, getPathOfImage_args args) throws org.apache.thrift.TException { - getPathOfImage_result result = new getPathOfImage_result(); - result.success = iface.getPathOfImage(args.image_id, args.version); - return result; - } - } - - public static class writeVLdata extends org.apache.thrift.ProcessFunction { - public writeVLdata() { - super("writeVLdata"); - } - - public writeVLdata_args getEmptyArgsInstance() { - return new writeVLdata_args(); - } - - protected boolean isOneway() { - return false; - } - - public writeVLdata_result getResult(I iface, writeVLdata_args args) throws org.apache.thrift.TException { - writeVLdata_result result = new writeVLdata_result(); - result.success = iface.writeVLdata(args.imagename, args.desc, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.license, args.internet, args.ram, args.cpu, args.imagePath, args.isTemplate, args.filesize, args.shareMode, args.os); - result.setSuccessIsSet(true); - return result; - } - } - - public static class getImageList extends org.apache.thrift.ProcessFunction { - public getImageList() { - super("getImageList"); - } - - public getImageList_args getEmptyArgsInstance() { - return new getImageList_args(); - } - - protected boolean isOneway() { - return false; - } - - public getImageList_result getResult(I iface, getImageList_args args) throws org.apache.thrift.TException { - getImageList_result result = new getImageList_result(); - result.success = iface.getImageList(); - return result; - } - } - - public static class getLectureList extends org.apache.thrift.ProcessFunction { - public getLectureList() { - super("getLectureList"); - } - - public getLectureList_args getEmptyArgsInstance() { - return new getLectureList_args(); - } - - protected boolean isOneway() { - return false; - } - - public getLectureList_result getResult(I iface, getLectureList_args args) throws org.apache.thrift.TException { - getLectureList_result result = new getLectureList_result(); - result.success = iface.getLectureList(); - return result; - } - } - - public static class getAllOS extends org.apache.thrift.ProcessFunction { - public getAllOS() { - super("getAllOS"); - } - - public getAllOS_args getEmptyArgsInstance() { - return new getAllOS_args(); - } - - protected boolean isOneway() { - return false; - } - - public getAllOS_result getResult(I iface, getAllOS_args args) throws org.apache.thrift.TException { - getAllOS_result result = new getAllOS_result(); - result.success = iface.getAllOS(); - return result; - } - } - - public static class getAllUniversities extends org.apache.thrift.ProcessFunction { - public getAllUniversities() { - super("getAllUniversities"); - } - - public getAllUniversities_args getEmptyArgsInstance() { - return new getAllUniversities_args(); - } - - protected boolean isOneway() { - return false; - } - - public getAllUniversities_result getResult(I iface, getAllUniversities_args args) throws org.apache.thrift.TException { - getAllUniversities_result result = new getAllUniversities_result(); - result.success = iface.getAllUniversities(); - return result; - } - } - - public static class getPersonData extends org.apache.thrift.ProcessFunction { - public getPersonData() { - super("getPersonData"); - } - - public getPersonData_args getEmptyArgsInstance() { - return new getPersonData_args(); - } - - protected boolean isOneway() { - return false; - } - - public getPersonData_result getResult(I iface, getPersonData_args args) throws org.apache.thrift.TException { - getPersonData_result result = new getPersonData_result(); - result.success = iface.getPersonData(args.Vorname, args.Nachname); - return result; - } - } - - public static class writeLecturedata extends org.apache.thrift.ProcessFunction { - public writeLecturedata() { - super("writeLecturedata"); - } - - public writeLecturedata_args getEmptyArgsInstance() { - return new writeLecturedata_args(); - } - - protected boolean isOneway() { - return false; - } - - public writeLecturedata_result getResult(I iface, writeLecturedata_args args) throws org.apache.thrift.TException { - writeLecturedata_result result = new writeLecturedata_result(); - result.success = iface.writeLecturedata(args.name, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imagename, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak); - result.setSuccessIsSet(true); - return result; - } - } - - public static class startFileCopy extends org.apache.thrift.ProcessFunction { - public startFileCopy() { - super("startFileCopy"); - } - - public startFileCopy_args getEmptyArgsInstance() { - return new startFileCopy_args(); - } - - protected boolean isOneway() { - return false; - } - - public startFileCopy_result getResult(I iface, startFileCopy_args args) throws org.apache.thrift.TException { - startFileCopy_result result = new startFileCopy_result(); - result.success = iface.startFileCopy(args.file); - result.setSuccessIsSet(true); - return result; - } - } - - public static class getImageData extends org.apache.thrift.ProcessFunction { - public getImageData() { - super("getImageData"); - } - - public getImageData_args getEmptyArgsInstance() { - return new getImageData_args(); - } - - protected boolean isOneway() { - return false; - } - - public getImageData_result getResult(I iface, getImageData_args args) throws org.apache.thrift.TException { - getImageData_result result = new getImageData_result(); - result.success = iface.getImageData(args.imageid, args.imageversion); - return result; - } - } - - public static class getLectureData extends org.apache.thrift.ProcessFunction { - public getLectureData() { - super("getLectureData"); - } - - public getLectureData_args getEmptyArgsInstance() { - return new getLectureData_args(); - } - - protected boolean isOneway() { - return false; - } - - public getLectureData_result getResult(I iface, getLectureData_args args) throws org.apache.thrift.TException { - getLectureData_result result = new getLectureData_result(); - result.success = iface.getLectureData(args.lectureid); - return result; - } - } - - public static class updateImageData extends org.apache.thrift.ProcessFunction { - public updateImageData() { - super("updateImageData"); - } - - public updateImageData_args getEmptyArgsInstance() { - return new updateImageData_args(); - } - - protected boolean isOneway() { - return false; - } - - public updateImageData_result getResult(I iface, updateImageData_args args) throws org.apache.thrift.TException { - updateImageData_result result = new updateImageData_result(); - result.success = iface.updateImageData(args.name, args.newName, args.desc, args.image_path, args.license, args.internet, args.ram, args.cpu, args.id, args.version, args.isTemplate, args.filesize, args.shareMode, args.os); - result.setSuccessIsSet(true); - return result; - } - } - - public static class deleteImageData extends org.apache.thrift.ProcessFunction { - public deleteImageData() { - super("deleteImageData"); - } - - public deleteImageData_args getEmptyArgsInstance() { - return new deleteImageData_args(); - } - - protected boolean isOneway() { - return false; - } - - public deleteImageData_result getResult(I iface, deleteImageData_args args) throws org.apache.thrift.TException { - deleteImageData_result result = new deleteImageData_result(); - result.success = iface.deleteImageData(args.id, args.version); - result.setSuccessIsSet(true); - return result; - } - } - - public static class updateLecturedata extends org.apache.thrift.ProcessFunction { - public updateLecturedata() { - super("updateLecturedata"); - } - - public updateLecturedata_args getEmptyArgsInstance() { - return new updateLecturedata_args(); - } - - protected boolean isOneway() { - return false; - } - - public updateLecturedata_result getResult(I iface, updateLecturedata_args args) throws org.apache.thrift.TException { - updateLecturedata_result result = new updateLecturedata_result(); - result.success = iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imageid, args.imageversion, args.user, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id); - result.setSuccessIsSet(true); - return result; - } - } - - public static class deleteImageServer extends org.apache.thrift.ProcessFunction { - public deleteImageServer() { - super("deleteImageServer"); - } - - public deleteImageServer_args getEmptyArgsInstance() { - return new deleteImageServer_args(); - } - - protected boolean isOneway() { - return false; - } - - public deleteImageServer_result getResult(I iface, deleteImageServer_args args) throws org.apache.thrift.TException { - deleteImageServer_result result = new deleteImageServer_result(); - result.success = iface.deleteImageServer(args.id, args.version); - result.setSuccessIsSet(true); - return result; - } - } - - public static class connectedToLecture extends org.apache.thrift.ProcessFunction { - public connectedToLecture() { - super("connectedToLecture"); - } - - public connectedToLecture_args getEmptyArgsInstance() { - return new connectedToLecture_args(); - } - - protected boolean isOneway() { - return false; - } - - public connectedToLecture_result getResult(I iface, connectedToLecture_args args) throws org.apache.thrift.TException { - connectedToLecture_result result = new connectedToLecture_result(); - result.success = iface.connectedToLecture(args.id, args.version); - result.setSuccessIsSet(true); - return result; - } - } - - public static class deleteLecture extends org.apache.thrift.ProcessFunction { - public deleteLecture() { - super("deleteLecture"); - } - - public deleteLecture_args getEmptyArgsInstance() { - return new deleteLecture_args(); - } - - protected boolean isOneway() { - return false; - } - - public deleteLecture_result getResult(I iface, deleteLecture_args args) throws org.apache.thrift.TException { - deleteLecture_result result = new deleteLecture_result(); - result.success = iface.deleteLecture(args.id, args.hs, args.user); - result.setSuccessIsSet(true); - return result; - } - } - - public static class checkUser extends org.apache.thrift.ProcessFunction { - public checkUser() { - super("checkUser"); - } - - public checkUser_args getEmptyArgsInstance() { - return new checkUser_args(); - } - - protected boolean isOneway() { - return false; - } - - public checkUser_result getResult(I iface, checkUser_args args) throws org.apache.thrift.TException { - checkUser_result result = new checkUser_result(); - result.success = iface.checkUser(args.username); - result.setSuccessIsSet(true); - return result; - } - } - - public static class createUser extends org.apache.thrift.ProcessFunction { - public createUser() { - super("createUser"); - } - - public createUser_args getEmptyArgsInstance() { - return new createUser_args(); - } - - protected boolean isOneway() { - return false; - } - - public createUser_result getResult(I iface, createUser_args args) throws org.apache.thrift.TException { - createUser_result result = new createUser_result(); - result.success = iface.createUser(args.loginName, args.lastName, args.firstName, args.mail, args.university); - result.setSuccessIsSet(true); - return result; - } - } - - public static class writeImageRights extends org.apache.thrift.ProcessFunction { - public writeImageRights() { - super("writeImageRights"); - } - - public writeImageRights_args getEmptyArgsInstance() { - return new writeImageRights_args(); - } - - protected boolean isOneway() { - return false; - } - - public writeImageRights_result getResult(I iface, writeImageRights_args args) throws org.apache.thrift.TException { - writeImageRights_result result = new writeImageRights_result(); - result.success = iface.writeImageRights(args.imagename, args.username, args.lastName, args.firstName, args.mail, args.university, args.role); - result.setSuccessIsSet(true); - return result; - } - } - - public static class writeLectureRights extends org.apache.thrift.ProcessFunction { - public writeLectureRights() { - super("writeLectureRights"); - } - - public writeLectureRights_args getEmptyArgsInstance() { - return new writeLectureRights_args(); - } - - protected boolean isOneway() { - return false; - } - - public writeLectureRights_result getResult(I iface, writeLectureRights_args args) throws org.apache.thrift.TException { - writeLectureRights_result result = new writeLectureRights_result(); - result.success = iface.writeLectureRights(args.lecturename, args.username, args.lastName, args.firstName, args.mail, args.university, args.role); - result.setSuccessIsSet(true); - return result; - } - } - - } - - public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); - public AsyncProcessor(I iface) { - super(iface, getProcessMap(new HashMap>())); - } - - protected AsyncProcessor(I iface, Map> processMap) { - super(iface, getProcessMap(processMap)); - } - - private static Map> getProcessMap(Map> processMap) { - processMap.put("getFtpUser", new getFtpUser()); - processMap.put("DeleteFtpUser", new DeleteFtpUser()); - processMap.put("getPathOfImage", new getPathOfImage()); - processMap.put("writeVLdata", new writeVLdata()); - processMap.put("getImageList", new getImageList()); - processMap.put("getLectureList", new getLectureList()); - processMap.put("getAllOS", new getAllOS()); - processMap.put("getAllUniversities", new getAllUniversities()); - processMap.put("getPersonData", new getPersonData()); - processMap.put("writeLecturedata", new writeLecturedata()); - processMap.put("startFileCopy", new startFileCopy()); - processMap.put("getImageData", new getImageData()); - processMap.put("getLectureData", new getLectureData()); - processMap.put("updateImageData", new updateImageData()); - processMap.put("deleteImageData", new deleteImageData()); - processMap.put("updateLecturedata", new updateLecturedata()); - processMap.put("deleteImageServer", new deleteImageServer()); - processMap.put("connectedToLecture", new connectedToLecture()); - processMap.put("deleteLecture", new deleteLecture()); - processMap.put("checkUser", new checkUser()); - processMap.put("createUser", new createUser()); - processMap.put("writeImageRights", new writeImageRights()); - processMap.put("writeLectureRights", new writeLectureRights()); - return processMap; - } - - public static class getFtpUser extends org.apache.thrift.AsyncProcessFunction { - public getFtpUser() { - super("getFtpUser"); - } - - public getFtpUser_args getEmptyArgsInstance() { - return new getFtpUser_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(User o) { - getFtpUser_result result = new getFtpUser_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - getFtpUser_result result = new getFtpUser_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, getFtpUser_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.getFtpUser(resultHandler); - } - } - - public static class DeleteFtpUser extends org.apache.thrift.AsyncProcessFunction { - public DeleteFtpUser() { - super("DeleteFtpUser"); - } - - public DeleteFtpUser_args getEmptyArgsInstance() { - return new DeleteFtpUser_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(Long o) { - DeleteFtpUser_result result = new DeleteFtpUser_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - DeleteFtpUser_result result = new DeleteFtpUser_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, DeleteFtpUser_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.DeleteFtpUser(args.user,resultHandler); - } - } - - public static class getPathOfImage extends org.apache.thrift.AsyncProcessFunction { - public getPathOfImage() { - super("getPathOfImage"); - } - - public getPathOfImage_args getEmptyArgsInstance() { - return new getPathOfImage_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(String o) { - getPathOfImage_result result = new getPathOfImage_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - getPathOfImage_result result = new getPathOfImage_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, getPathOfImage_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.getPathOfImage(args.image_id, args.version,resultHandler); - } - } - - public static class writeVLdata extends org.apache.thrift.AsyncProcessFunction { - public writeVLdata() { - super("writeVLdata"); - } - - public writeVLdata_args getEmptyArgsInstance() { - return new writeVLdata_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(Boolean o) { - writeVLdata_result result = new writeVLdata_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - writeVLdata_result result = new writeVLdata_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, writeVLdata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.writeVLdata(args.imagename, args.desc, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.license, args.internet, args.ram, args.cpu, args.imagePath, args.isTemplate, args.filesize, args.shareMode, args.os,resultHandler); - } - } - - public static class getImageList extends org.apache.thrift.AsyncProcessFunction> { - public getImageList() { - super("getImageList"); - } - - public getImageList_args getEmptyArgsInstance() { - return new getImageList_args(); - } - - public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback>() { - public void onComplete(List o) { - getImageList_result result = new getImageList_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - getImageList_result result = new getImageList_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, getImageList_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { - iface.getImageList(resultHandler); - } - } - - public static class getLectureList extends org.apache.thrift.AsyncProcessFunction> { - public getLectureList() { - super("getLectureList"); - } - - public getLectureList_args getEmptyArgsInstance() { - return new getLectureList_args(); - } - - public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback>() { - public void onComplete(List o) { - getLectureList_result result = new getLectureList_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - getLectureList_result result = new getLectureList_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, getLectureList_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { - iface.getLectureList(resultHandler); - } - } - - public static class getAllOS extends org.apache.thrift.AsyncProcessFunction> { - public getAllOS() { - super("getAllOS"); - } - - public getAllOS_args getEmptyArgsInstance() { - return new getAllOS_args(); - } - - public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback>() { - public void onComplete(List o) { - getAllOS_result result = new getAllOS_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - getAllOS_result result = new getAllOS_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, getAllOS_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { - iface.getAllOS(resultHandler); - } - } - - public static class getAllUniversities extends org.apache.thrift.AsyncProcessFunction> { - public getAllUniversities() { - super("getAllUniversities"); - } - - public getAllUniversities_args getEmptyArgsInstance() { - return new getAllUniversities_args(); - } - - public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback>() { - public void onComplete(List o) { - getAllUniversities_result result = new getAllUniversities_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - getAllUniversities_result result = new getAllUniversities_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, getAllUniversities_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { - iface.getAllUniversities(resultHandler); - } - } - - public static class getPersonData extends org.apache.thrift.AsyncProcessFunction> { - public getPersonData() { - super("getPersonData"); - } - - public getPersonData_args getEmptyArgsInstance() { - return new getPersonData_args(); - } - - public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback>() { - public void onComplete(Map o) { - getPersonData_result result = new getPersonData_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - getPersonData_result result = new getPersonData_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, getPersonData_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { - iface.getPersonData(args.Vorname, args.Nachname,resultHandler); - } - } - - public static class writeLecturedata extends org.apache.thrift.AsyncProcessFunction { - public writeLecturedata() { - super("writeLecturedata"); - } - - public writeLecturedata_args getEmptyArgsInstance() { - return new writeLecturedata_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(Boolean o) { - writeLecturedata_result result = new writeLecturedata_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - writeLecturedata_result result = new writeLecturedata_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, writeLecturedata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.writeLecturedata(args.name, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imagename, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak,resultHandler); - } - } - - public static class startFileCopy extends org.apache.thrift.AsyncProcessFunction { - public startFileCopy() { - super("startFileCopy"); - } - - public startFileCopy_args getEmptyArgsInstance() { - return new startFileCopy_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(Boolean o) { - startFileCopy_result result = new startFileCopy_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - startFileCopy_result result = new startFileCopy_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, startFileCopy_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.startFileCopy(args.file,resultHandler); - } - } - - public static class getImageData extends org.apache.thrift.AsyncProcessFunction> { - public getImageData() { - super("getImageData"); - } - - public getImageData_args getEmptyArgsInstance() { - return new getImageData_args(); - } - - public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback>() { - public void onComplete(Map o) { - getImageData_result result = new getImageData_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - getImageData_result result = new getImageData_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, getImageData_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { - iface.getImageData(args.imageid, args.imageversion,resultHandler); - } - } - - public static class getLectureData extends org.apache.thrift.AsyncProcessFunction> { - public getLectureData() { - super("getLectureData"); - } - - public getLectureData_args getEmptyArgsInstance() { - return new getLectureData_args(); - } - - public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback>() { - public void onComplete(Map o) { - getLectureData_result result = new getLectureData_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - getLectureData_result result = new getLectureData_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, getLectureData_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { - iface.getLectureData(args.lectureid,resultHandler); - } - } - - public static class updateImageData extends org.apache.thrift.AsyncProcessFunction { - public updateImageData() { - super("updateImageData"); - } - - public updateImageData_args getEmptyArgsInstance() { - return new updateImageData_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(Boolean o) { - updateImageData_result result = new updateImageData_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - updateImageData_result result = new updateImageData_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, updateImageData_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.updateImageData(args.name, args.newName, args.desc, args.image_path, args.license, args.internet, args.ram, args.cpu, args.id, args.version, args.isTemplate, args.filesize, args.shareMode, args.os,resultHandler); - } - } - - public static class deleteImageData extends org.apache.thrift.AsyncProcessFunction { - public deleteImageData() { - super("deleteImageData"); - } - - public deleteImageData_args getEmptyArgsInstance() { - return new deleteImageData_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(Boolean o) { - deleteImageData_result result = new deleteImageData_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - deleteImageData_result result = new deleteImageData_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, deleteImageData_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.deleteImageData(args.id, args.version,resultHandler); - } - } - - public static class updateLecturedata extends org.apache.thrift.AsyncProcessFunction { - public updateLecturedata() { - super("updateLecturedata"); - } - - public updateLecturedata_args getEmptyArgsInstance() { - return new updateLecturedata_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(Boolean o) { - updateLecturedata_result result = new updateLecturedata_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - updateLecturedata_result result = new updateLecturedata_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, updateLecturedata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imageid, args.imageversion, args.user, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id,resultHandler); - } - } - - public static class deleteImageServer extends org.apache.thrift.AsyncProcessFunction { - public deleteImageServer() { - super("deleteImageServer"); - } - - public deleteImageServer_args getEmptyArgsInstance() { - return new deleteImageServer_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(Boolean o) { - deleteImageServer_result result = new deleteImageServer_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - deleteImageServer_result result = new deleteImageServer_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, deleteImageServer_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.deleteImageServer(args.id, args.version,resultHandler); - } - } - - public static class connectedToLecture extends org.apache.thrift.AsyncProcessFunction { - public connectedToLecture() { - super("connectedToLecture"); - } - - public connectedToLecture_args getEmptyArgsInstance() { - return new connectedToLecture_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(Boolean o) { - connectedToLecture_result result = new connectedToLecture_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - connectedToLecture_result result = new connectedToLecture_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, connectedToLecture_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.connectedToLecture(args.id, args.version,resultHandler); - } - } - - public static class deleteLecture extends org.apache.thrift.AsyncProcessFunction { - public deleteLecture() { - super("deleteLecture"); - } - - public deleteLecture_args getEmptyArgsInstance() { - return new deleteLecture_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(Boolean o) { - deleteLecture_result result = new deleteLecture_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - deleteLecture_result result = new deleteLecture_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, deleteLecture_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.deleteLecture(args.id, args.hs, args.user,resultHandler); - } - } - - public static class checkUser extends org.apache.thrift.AsyncProcessFunction { - public checkUser() { - super("checkUser"); - } - - public checkUser_args getEmptyArgsInstance() { - return new checkUser_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(Boolean o) { - checkUser_result result = new checkUser_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - checkUser_result result = new checkUser_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, checkUser_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.checkUser(args.username,resultHandler); - } - } - - public static class createUser extends org.apache.thrift.AsyncProcessFunction { - public createUser() { - super("createUser"); - } - - public createUser_args getEmptyArgsInstance() { - return new createUser_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(Boolean o) { - createUser_result result = new createUser_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - createUser_result result = new createUser_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, createUser_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.createUser(args.loginName, args.lastName, args.firstName, args.mail, args.university,resultHandler); - } - } - - public static class writeImageRights extends org.apache.thrift.AsyncProcessFunction { - public writeImageRights() { - super("writeImageRights"); - } - - public writeImageRights_args getEmptyArgsInstance() { - return new writeImageRights_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(Boolean o) { - writeImageRights_result result = new writeImageRights_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - writeImageRights_result result = new writeImageRights_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, writeImageRights_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.writeImageRights(args.imagename, args.username, args.lastName, args.firstName, args.mail, args.university, args.role,resultHandler); - } - } - - public static class writeLectureRights extends org.apache.thrift.AsyncProcessFunction { - public writeLectureRights() { - super("writeLectureRights"); - } - - public writeLectureRights_args getEmptyArgsInstance() { - return new writeLectureRights_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(Boolean o) { - writeLectureRights_result result = new writeLectureRights_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - writeLectureRights_result result = new writeLectureRights_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, writeLectureRights_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.writeLectureRights(args.lecturename, args.username, args.lastName, args.firstName, args.mail, args.university, args.role,resultHandler); - } - } - - } - - public static class getFtpUser_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getFtpUser_args"); - - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getFtpUser_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getFtpUser_argsTupleSchemeFactory()); - } - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -; - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getFtpUser_args.class, metaDataMap); - } - - public getFtpUser_args() { - } - - /** - * Performs a deep copy on other. - */ - public getFtpUser_args(getFtpUser_args other) { - } - - public getFtpUser_args deepCopy() { - return new getFtpUser_args(this); - } - - @Override - public void clear() { - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getFtpUser_args) - return this.equals((getFtpUser_args)that); - return false; - } - - public boolean equals(getFtpUser_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getFtpUser_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getFtpUser_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getFtpUser_argsStandardSchemeFactory implements SchemeFactory { - public getFtpUser_argsStandardScheme getScheme() { - return new getFtpUser_argsStandardScheme(); - } - } - - private static class getFtpUser_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getFtpUser_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getFtpUser_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getFtpUser_argsTupleSchemeFactory implements SchemeFactory { - public getFtpUser_argsTupleScheme getScheme() { - return new getFtpUser_argsTupleScheme(); - } - } - - private static class getFtpUser_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getFtpUser_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getFtpUser_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - } - } - - } - - public static class getFtpUser_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getFtpUser_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getFtpUser_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getFtpUser_resultTupleSchemeFactory()); - } - - public User success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, User.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getFtpUser_result.class, metaDataMap); - } - - public getFtpUser_result() { - } - - public getFtpUser_result( - User success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getFtpUser_result(getFtpUser_result other) { - if (other.isSetSuccess()) { - this.success = new User(other.success); - } - } - - public getFtpUser_result deepCopy() { - return new getFtpUser_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public User getSuccess() { - return this.success; - } - - public getFtpUser_result setSuccess(User success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((User)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getFtpUser_result) - return this.equals((getFtpUser_result)that); - return false; - } - - public boolean equals(getFtpUser_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getFtpUser_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getFtpUser_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getFtpUser_resultStandardSchemeFactory implements SchemeFactory { - public getFtpUser_resultStandardScheme getScheme() { - return new getFtpUser_resultStandardScheme(); - } - } - - private static class getFtpUser_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getFtpUser_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new User(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getFtpUser_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getFtpUser_resultTupleSchemeFactory implements SchemeFactory { - public getFtpUser_resultTupleScheme getScheme() { - return new getFtpUser_resultTupleScheme(); - } - } - - private static class getFtpUser_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getFtpUser_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getFtpUser_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new User(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class DeleteFtpUser_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DeleteFtpUser_args"); - - private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRING, (short)-1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new DeleteFtpUser_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new DeleteFtpUser_argsTupleSchemeFactory()); - } - - public String user; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - USER((short)-1, "user"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // USER - return USER; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DeleteFtpUser_args.class, metaDataMap); - } - - public DeleteFtpUser_args() { - } - - public DeleteFtpUser_args( - String user) - { - this(); - this.user = user; - } - - /** - * Performs a deep copy on other. - */ - public DeleteFtpUser_args(DeleteFtpUser_args other) { - if (other.isSetUser()) { - this.user = other.user; - } - } - - public DeleteFtpUser_args deepCopy() { - return new DeleteFtpUser_args(this); - } - - @Override - public void clear() { - this.user = null; - } - - public String getUser() { - return this.user; - } - - public DeleteFtpUser_args setUser(String user) { - this.user = user; - return this; - } - - public void unsetUser() { - this.user = null; - } - - /** Returns true if field user is set (has been assigned a value) and false otherwise */ - public boolean isSetUser() { - return this.user != null; - } - - public void setUserIsSet(boolean value) { - if (!value) { - this.user = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case USER: - if (value == null) { - unsetUser(); - } else { - setUser((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case USER: - return getUser(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case USER: - return isSetUser(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof DeleteFtpUser_args) - return this.equals((DeleteFtpUser_args)that); - return false; - } - - public boolean equals(DeleteFtpUser_args that) { - if (that == null) - return false; - - boolean this_present_user = true && this.isSetUser(); - boolean that_present_user = true && that.isSetUser(); - if (this_present_user || that_present_user) { - if (!(this_present_user && that_present_user)) - return false; - if (!this.user.equals(that.user)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(DeleteFtpUser_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUser()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("DeleteFtpUser_args("); - boolean first = true; - - sb.append("user:"); - if (this.user == null) { - sb.append("null"); - } else { - sb.append(this.user); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class DeleteFtpUser_argsStandardSchemeFactory implements SchemeFactory { - public DeleteFtpUser_argsStandardScheme getScheme() { - return new DeleteFtpUser_argsStandardScheme(); - } - } - - private static class DeleteFtpUser_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, DeleteFtpUser_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // USER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.user = iprot.readString(); - struct.setUserIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, DeleteFtpUser_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.user != null) { - oprot.writeFieldBegin(USER_FIELD_DESC); - oprot.writeString(struct.user); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class DeleteFtpUser_argsTupleSchemeFactory implements SchemeFactory { - public DeleteFtpUser_argsTupleScheme getScheme() { - return new DeleteFtpUser_argsTupleScheme(); - } - } - - private static class DeleteFtpUser_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, DeleteFtpUser_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetUser()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetUser()) { - oprot.writeString(struct.user); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, DeleteFtpUser_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.user = iprot.readString(); - struct.setUserIsSet(true); - } - } - } - - } - - public static class DeleteFtpUser_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DeleteFtpUser_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new DeleteFtpUser_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new DeleteFtpUser_resultTupleSchemeFactory()); - } - - public long success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DeleteFtpUser_result.class, metaDataMap); - } - - public DeleteFtpUser_result() { - } - - public DeleteFtpUser_result( - long success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public DeleteFtpUser_result(DeleteFtpUser_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; - } - - public DeleteFtpUser_result deepCopy() { - return new DeleteFtpUser_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = 0; - } - - public long getSuccess() { - return this.success; - } - - public DeleteFtpUser_result setSuccess(long success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Long)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Long.valueOf(getSuccess()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof DeleteFtpUser_result) - return this.equals((DeleteFtpUser_result)that); - return false; - } - - public boolean equals(DeleteFtpUser_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(DeleteFtpUser_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("DeleteFtpUser_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class DeleteFtpUser_resultStandardSchemeFactory implements SchemeFactory { - public DeleteFtpUser_resultStandardScheme getScheme() { - return new DeleteFtpUser_resultStandardScheme(); - } - } - - private static class DeleteFtpUser_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, DeleteFtpUser_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.success = iprot.readI64(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, DeleteFtpUser_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI64(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class DeleteFtpUser_resultTupleSchemeFactory implements SchemeFactory { - public DeleteFtpUser_resultTupleScheme getScheme() { - return new DeleteFtpUser_resultTupleScheme(); - } - } - - private static class DeleteFtpUser_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, DeleteFtpUser_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeI64(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, DeleteFtpUser_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readI64(); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class getPathOfImage_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPathOfImage_args"); - - private static final org.apache.thrift.protocol.TField IMAGE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("image_id", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getPathOfImage_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getPathOfImage_argsTupleSchemeFactory()); - } - - public String image_id; // required - public String version; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - IMAGE_ID((short)-1, "image_id"), - VERSION((short)-2, "version"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // IMAGE_ID - return IMAGE_ID; - case -2: // VERSION - return VERSION; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.IMAGE_ID, new org.apache.thrift.meta_data.FieldMetaData("image_id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathOfImage_args.class, metaDataMap); - } - - public getPathOfImage_args() { - } - - public getPathOfImage_args( - String image_id, - String version) - { - this(); - this.image_id = image_id; - this.version = version; - } - - /** - * Performs a deep copy on other. - */ - public getPathOfImage_args(getPathOfImage_args other) { - if (other.isSetImage_id()) { - this.image_id = other.image_id; - } - if (other.isSetVersion()) { - this.version = other.version; - } - } - - public getPathOfImage_args deepCopy() { - return new getPathOfImage_args(this); - } - - @Override - public void clear() { - this.image_id = null; - this.version = null; - } - - public String getImage_id() { - return this.image_id; - } - - public getPathOfImage_args setImage_id(String image_id) { - this.image_id = image_id; - return this; - } - - public void unsetImage_id() { - this.image_id = null; - } - - /** Returns true if field image_id is set (has been assigned a value) and false otherwise */ - public boolean isSetImage_id() { - return this.image_id != null; - } - - public void setImage_idIsSet(boolean value) { - if (!value) { - this.image_id = null; - } - } - - public String getVersion() { - return this.version; - } - - public getPathOfImage_args setVersion(String version) { - this.version = version; - return this; - } - - public void unsetVersion() { - this.version = null; - } - - /** Returns true if field version is set (has been assigned a value) and false otherwise */ - public boolean isSetVersion() { - return this.version != null; - } - - public void setVersionIsSet(boolean value) { - if (!value) { - this.version = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case IMAGE_ID: - if (value == null) { - unsetImage_id(); - } else { - setImage_id((String)value); - } - break; - - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case IMAGE_ID: - return getImage_id(); - - case VERSION: - return getVersion(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case IMAGE_ID: - return isSetImage_id(); - case VERSION: - return isSetVersion(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getPathOfImage_args) - return this.equals((getPathOfImage_args)that); - return false; - } - - public boolean equals(getPathOfImage_args that) { - if (that == null) - return false; - - boolean this_present_image_id = true && this.isSetImage_id(); - boolean that_present_image_id = true && that.isSetImage_id(); - if (this_present_image_id || that_present_image_id) { - if (!(this_present_image_id && that_present_image_id)) - return false; - if (!this.image_id.equals(that.image_id)) - return false; - } - - boolean this_present_version = true && this.isSetVersion(); - boolean that_present_version = true && that.isSetVersion(); - if (this_present_version || that_present_version) { - if (!(this_present_version && that_present_version)) - return false; - if (!this.version.equals(that.version)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getPathOfImage_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetImage_id()).compareTo(other.isSetImage_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetImage_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.image_id, other.image_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetVersion()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getPathOfImage_args("); - boolean first = true; - - sb.append("image_id:"); - if (this.image_id == null) { - sb.append("null"); - } else { - sb.append(this.image_id); - } - first = false; - if (!first) sb.append(", "); - sb.append("version:"); - if (this.version == null) { - sb.append("null"); - } else { - sb.append(this.version); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getPathOfImage_argsStandardSchemeFactory implements SchemeFactory { - public getPathOfImage_argsStandardScheme getScheme() { - return new getPathOfImage_argsStandardScheme(); - } - } - - private static class getPathOfImage_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getPathOfImage_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // IMAGE_ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.image_id = iprot.readString(); - struct.setImage_idIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // VERSION - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.version = iprot.readString(); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getPathOfImage_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeString(struct.version); - oprot.writeFieldEnd(); - } - if (struct.image_id != null) { - oprot.writeFieldBegin(IMAGE_ID_FIELD_DESC); - oprot.writeString(struct.image_id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getPathOfImage_argsTupleSchemeFactory implements SchemeFactory { - public getPathOfImage_argsTupleScheme getScheme() { - return new getPathOfImage_argsTupleScheme(); - } - } - - private static class getPathOfImage_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getPathOfImage_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetImage_id()) { - optionals.set(0); - } - if (struct.isSetVersion()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetImage_id()) { - oprot.writeString(struct.image_id); - } - if (struct.isSetVersion()) { - oprot.writeString(struct.version); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getPathOfImage_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.image_id = iprot.readString(); - struct.setImage_idIsSet(true); - } - if (incoming.get(1)) { - struct.version = iprot.readString(); - struct.setVersionIsSet(true); - } - } - } - - } - - public static class getPathOfImage_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPathOfImage_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getPathOfImage_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getPathOfImage_resultTupleSchemeFactory()); - } - - public String success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathOfImage_result.class, metaDataMap); - } - - public getPathOfImage_result() { - } - - public getPathOfImage_result( - String success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getPathOfImage_result(getPathOfImage_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } - } - - public getPathOfImage_result deepCopy() { - return new getPathOfImage_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public String getSuccess() { - return this.success; - } - - public getPathOfImage_result setSuccess(String success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getPathOfImage_result) - return this.equals((getPathOfImage_result)that); - return false; - } - - public boolean equals(getPathOfImage_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getPathOfImage_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getPathOfImage_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getPathOfImage_resultStandardSchemeFactory implements SchemeFactory { - public getPathOfImage_resultStandardScheme getScheme() { - return new getPathOfImage_resultStandardScheme(); - } - } - - private static class getPathOfImage_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getPathOfImage_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.success = iprot.readString(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getPathOfImage_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getPathOfImage_resultTupleSchemeFactory implements SchemeFactory { - public getPathOfImage_resultTupleScheme getScheme() { - return new getPathOfImage_resultTupleScheme(); - } - } - - private static class getPathOfImage_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getPathOfImage_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeString(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getPathOfImage_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readString(); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class writeVLdata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeVLdata_args"); - - private static final org.apache.thrift.protocol.TField IMAGENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imagename", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("desc", org.apache.thrift.protocol.TType.STRING, (short)-2); - private static final org.apache.thrift.protocol.TField LOGIN_FIELD_DESC = new org.apache.thrift.protocol.TField("login", org.apache.thrift.protocol.TType.STRING, (short)-3); - private static final org.apache.thrift.protocol.TField FIRSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstname", org.apache.thrift.protocol.TType.STRING, (short)-4); - private static final org.apache.thrift.protocol.TField LASTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastname", org.apache.thrift.protocol.TType.STRING, (short)-5); - private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-6); - private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("Mail", org.apache.thrift.protocol.TType.STRING, (short)-7); - private static final org.apache.thrift.protocol.TField TEL_FIELD_DESC = new org.apache.thrift.protocol.TField("Tel", org.apache.thrift.protocol.TType.STRING, (short)-8); - private static final org.apache.thrift.protocol.TField FAK_FIELD_DESC = new org.apache.thrift.protocol.TField("Fak", org.apache.thrift.protocol.TType.STRING, (short)-9); - private static final org.apache.thrift.protocol.TField LICENSE_FIELD_DESC = new org.apache.thrift.protocol.TField("license", org.apache.thrift.protocol.TType.BOOL, (short)-10); - private static final org.apache.thrift.protocol.TField INTERNET_FIELD_DESC = new org.apache.thrift.protocol.TField("internet", org.apache.thrift.protocol.TType.BOOL, (short)-11); - private static final org.apache.thrift.protocol.TField RAM_FIELD_DESC = new org.apache.thrift.protocol.TField("ram", org.apache.thrift.protocol.TType.I64, (short)-12); - private static final org.apache.thrift.protocol.TField CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("cpu", org.apache.thrift.protocol.TType.I64, (short)-13); - private static final org.apache.thrift.protocol.TField IMAGE_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("imagePath", org.apache.thrift.protocol.TType.STRING, (short)-14); - private static final org.apache.thrift.protocol.TField IS_TEMPLATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isTemplate", org.apache.thrift.protocol.TType.BOOL, (short)-15); - private static final org.apache.thrift.protocol.TField FILESIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("filesize", org.apache.thrift.protocol.TType.I64, (short)-16); - private static final org.apache.thrift.protocol.TField SHARE_MODE_FIELD_DESC = new org.apache.thrift.protocol.TField("shareMode", org.apache.thrift.protocol.TType.I64, (short)-17); - private static final org.apache.thrift.protocol.TField OS_FIELD_DESC = new org.apache.thrift.protocol.TField("os", org.apache.thrift.protocol.TType.STRING, (short)-18); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new writeVLdata_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new writeVLdata_argsTupleSchemeFactory()); - } - - public String imagename; // required - public String desc; // required - public String login; // required - public String firstname; // required - public String lastname; // required - public String university; // required - public String Mail; // required - public String Tel; // required - public String Fak; // required - public boolean license; // required - public boolean internet; // required - public long ram; // required - public long cpu; // required - public String imagePath; // required - public boolean isTemplate; // required - public long filesize; // required - public long shareMode; // required - public String os; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - IMAGENAME((short)-1, "imagename"), - DESC((short)-2, "desc"), - LOGIN((short)-3, "login"), - FIRSTNAME((short)-4, "firstname"), - LASTNAME((short)-5, "lastname"), - UNIVERSITY((short)-6, "university"), - MAIL((short)-7, "Mail"), - TEL((short)-8, "Tel"), - FAK((short)-9, "Fak"), - LICENSE((short)-10, "license"), - INTERNET((short)-11, "internet"), - RAM((short)-12, "ram"), - CPU((short)-13, "cpu"), - IMAGE_PATH((short)-14, "imagePath"), - IS_TEMPLATE((short)-15, "isTemplate"), - FILESIZE((short)-16, "filesize"), - SHARE_MODE((short)-17, "shareMode"), - OS((short)-18, "os"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // IMAGENAME - return IMAGENAME; - case -2: // DESC - return DESC; - case -3: // LOGIN - return LOGIN; - case -4: // FIRSTNAME - return FIRSTNAME; - case -5: // LASTNAME - return LASTNAME; - case -6: // UNIVERSITY - return UNIVERSITY; - case -7: // MAIL - return MAIL; - case -8: // TEL - return TEL; - case -9: // FAK - return FAK; - case -10: // LICENSE - return LICENSE; - case -11: // INTERNET - return INTERNET; - case -12: // RAM - return RAM; - case -13: // CPU - return CPU; - case -14: // IMAGE_PATH - return IMAGE_PATH; - case -15: // IS_TEMPLATE - return IS_TEMPLATE; - case -16: // FILESIZE - return FILESIZE; - case -17: // SHARE_MODE - return SHARE_MODE; - case -18: // OS - return OS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __LICENSE_ISSET_ID = 0; - private static final int __INTERNET_ISSET_ID = 1; - private static final int __RAM_ISSET_ID = 2; - private static final int __CPU_ISSET_ID = 3; - private static final int __ISTEMPLATE_ISSET_ID = 4; - private static final int __FILESIZE_ISSET_ID = 5; - private static final int __SHAREMODE_ISSET_ID = 6; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.IMAGENAME, new org.apache.thrift.meta_data.FieldMetaData("imagename", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.DESC, new org.apache.thrift.meta_data.FieldMetaData("desc", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.LOGIN, new org.apache.thrift.meta_data.FieldMetaData("login", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.FIRSTNAME, new org.apache.thrift.meta_data.FieldMetaData("firstname", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.LASTNAME, new org.apache.thrift.meta_data.FieldMetaData("lastname", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("Mail", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.TEL, new org.apache.thrift.meta_data.FieldMetaData("Tel", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.FAK, new org.apache.thrift.meta_data.FieldMetaData("Fak", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.LICENSE, new org.apache.thrift.meta_data.FieldMetaData("license", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.INTERNET, new org.apache.thrift.meta_data.FieldMetaData("internet", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.RAM, new org.apache.thrift.meta_data.FieldMetaData("ram", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int"))); - tmpMap.put(_Fields.CPU, new org.apache.thrift.meta_data.FieldMetaData("cpu", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int"))); - tmpMap.put(_Fields.IMAGE_PATH, new org.apache.thrift.meta_data.FieldMetaData("imagePath", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IS_TEMPLATE, new org.apache.thrift.meta_data.FieldMetaData("isTemplate", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.FILESIZE, new org.apache.thrift.meta_data.FieldMetaData("filesize", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.SHARE_MODE, new org.apache.thrift.meta_data.FieldMetaData("shareMode", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int"))); - tmpMap.put(_Fields.OS, new org.apache.thrift.meta_data.FieldMetaData("os", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeVLdata_args.class, metaDataMap); - } - - public writeVLdata_args() { - } - - public writeVLdata_args( - String imagename, - String desc, - String login, - String firstname, - String lastname, - String university, - String Mail, - String Tel, - String Fak, - boolean license, - boolean internet, - long ram, - long cpu, - String imagePath, - boolean isTemplate, - long filesize, - long shareMode, - String os) - { - this(); - this.imagename = imagename; - this.desc = desc; - this.login = login; - this.firstname = firstname; - this.lastname = lastname; - this.university = university; - this.Mail = Mail; - this.Tel = Tel; - this.Fak = Fak; - this.license = license; - setLicenseIsSet(true); - this.internet = internet; - setInternetIsSet(true); - this.ram = ram; - setRamIsSet(true); - this.cpu = cpu; - setCpuIsSet(true); - this.imagePath = imagePath; - this.isTemplate = isTemplate; - setIsTemplateIsSet(true); - this.filesize = filesize; - setFilesizeIsSet(true); - this.shareMode = shareMode; - setShareModeIsSet(true); - this.os = os; - } - - /** - * Performs a deep copy on other. - */ - public writeVLdata_args(writeVLdata_args other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetImagename()) { - this.imagename = other.imagename; - } - if (other.isSetDesc()) { - this.desc = other.desc; - } - if (other.isSetLogin()) { - this.login = other.login; - } - if (other.isSetFirstname()) { - this.firstname = other.firstname; - } - if (other.isSetLastname()) { - this.lastname = other.lastname; - } - if (other.isSetUniversity()) { - this.university = other.university; - } - if (other.isSetMail()) { - this.Mail = other.Mail; - } - if (other.isSetTel()) { - this.Tel = other.Tel; - } - if (other.isSetFak()) { - this.Fak = other.Fak; - } - this.license = other.license; - this.internet = other.internet; - this.ram = other.ram; - this.cpu = other.cpu; - if (other.isSetImagePath()) { - this.imagePath = other.imagePath; - } - this.isTemplate = other.isTemplate; - this.filesize = other.filesize; - this.shareMode = other.shareMode; - if (other.isSetOs()) { - this.os = other.os; - } - } - - public writeVLdata_args deepCopy() { - return new writeVLdata_args(this); - } - - @Override - public void clear() { - this.imagename = null; - this.desc = null; - this.login = null; - this.firstname = null; - this.lastname = null; - this.university = null; - this.Mail = null; - this.Tel = null; - this.Fak = null; - setLicenseIsSet(false); - this.license = false; - setInternetIsSet(false); - this.internet = false; - setRamIsSet(false); - this.ram = 0; - setCpuIsSet(false); - this.cpu = 0; - this.imagePath = null; - setIsTemplateIsSet(false); - this.isTemplate = false; - setFilesizeIsSet(false); - this.filesize = 0; - setShareModeIsSet(false); - this.shareMode = 0; - this.os = null; - } - - public String getImagename() { - return this.imagename; - } - - public writeVLdata_args setImagename(String imagename) { - this.imagename = imagename; - return this; - } - - public void unsetImagename() { - this.imagename = null; - } - - /** Returns true if field imagename is set (has been assigned a value) and false otherwise */ - public boolean isSetImagename() { - return this.imagename != null; - } - - public void setImagenameIsSet(boolean value) { - if (!value) { - this.imagename = null; - } - } - - public String getDesc() { - return this.desc; - } - - public writeVLdata_args setDesc(String desc) { - this.desc = desc; - return this; - } - - public void unsetDesc() { - this.desc = null; - } - - /** Returns true if field desc is set (has been assigned a value) and false otherwise */ - public boolean isSetDesc() { - return this.desc != null; - } - - public void setDescIsSet(boolean value) { - if (!value) { - this.desc = null; - } - } - - public String getLogin() { - return this.login; - } - - public writeVLdata_args setLogin(String login) { - this.login = login; - return this; - } - - public void unsetLogin() { - this.login = null; - } - - /** Returns true if field login is set (has been assigned a value) and false otherwise */ - public boolean isSetLogin() { - return this.login != null; - } - - public void setLoginIsSet(boolean value) { - if (!value) { - this.login = null; - } - } - - public String getFirstname() { - return this.firstname; - } - - public writeVLdata_args setFirstname(String firstname) { - this.firstname = firstname; - return this; - } - - public void unsetFirstname() { - this.firstname = null; - } - - /** Returns true if field firstname is set (has been assigned a value) and false otherwise */ - public boolean isSetFirstname() { - return this.firstname != null; - } - - public void setFirstnameIsSet(boolean value) { - if (!value) { - this.firstname = null; - } - } - - public String getLastname() { - return this.lastname; - } - - public writeVLdata_args setLastname(String lastname) { - this.lastname = lastname; - return this; - } - - public void unsetLastname() { - this.lastname = null; - } - - /** Returns true if field lastname is set (has been assigned a value) and false otherwise */ - public boolean isSetLastname() { - return this.lastname != null; - } - - public void setLastnameIsSet(boolean value) { - if (!value) { - this.lastname = null; - } - } - - public String getUniversity() { - return this.university; - } - - public writeVLdata_args setUniversity(String university) { - this.university = university; - return this; - } - - public void unsetUniversity() { - this.university = null; - } - - /** Returns true if field university is set (has been assigned a value) and false otherwise */ - public boolean isSetUniversity() { - return this.university != null; - } - - public void setUniversityIsSet(boolean value) { - if (!value) { - this.university = null; - } - } - - public String getMail() { - return this.Mail; - } - - public writeVLdata_args setMail(String Mail) { - this.Mail = Mail; - return this; - } - - public void unsetMail() { - this.Mail = null; - } - - /** Returns true if field Mail is set (has been assigned a value) and false otherwise */ - public boolean isSetMail() { - return this.Mail != null; - } - - public void setMailIsSet(boolean value) { - if (!value) { - this.Mail = null; - } - } - - public String getTel() { - return this.Tel; - } - - public writeVLdata_args setTel(String Tel) { - this.Tel = Tel; - return this; - } - - public void unsetTel() { - this.Tel = null; - } - - /** Returns true if field Tel is set (has been assigned a value) and false otherwise */ - public boolean isSetTel() { - return this.Tel != null; - } - - public void setTelIsSet(boolean value) { - if (!value) { - this.Tel = null; - } - } - - public String getFak() { - return this.Fak; - } - - public writeVLdata_args setFak(String Fak) { - this.Fak = Fak; - return this; - } - - public void unsetFak() { - this.Fak = null; - } - - /** Returns true if field Fak is set (has been assigned a value) and false otherwise */ - public boolean isSetFak() { - return this.Fak != null; - } - - public void setFakIsSet(boolean value) { - if (!value) { - this.Fak = null; - } - } - - public boolean isLicense() { - return this.license; - } - - public writeVLdata_args setLicense(boolean license) { - this.license = license; - setLicenseIsSet(true); - return this; - } - - public void unsetLicense() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LICENSE_ISSET_ID); - } - - /** Returns true if field license is set (has been assigned a value) and false otherwise */ - public boolean isSetLicense() { - return EncodingUtils.testBit(__isset_bitfield, __LICENSE_ISSET_ID); - } - - public void setLicenseIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LICENSE_ISSET_ID, value); - } - - public boolean isInternet() { - return this.internet; - } - - public writeVLdata_args setInternet(boolean internet) { - this.internet = internet; - setInternetIsSet(true); - return this; - } - - public void unsetInternet() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INTERNET_ISSET_ID); - } - - /** Returns true if field internet is set (has been assigned a value) and false otherwise */ - public boolean isSetInternet() { - return EncodingUtils.testBit(__isset_bitfield, __INTERNET_ISSET_ID); - } - - public void setInternetIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INTERNET_ISSET_ID, value); - } - - public long getRam() { - return this.ram; - } - - public writeVLdata_args setRam(long ram) { - this.ram = ram; - setRamIsSet(true); - return this; - } - - public void unsetRam() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RAM_ISSET_ID); - } - - /** Returns true if field ram is set (has been assigned a value) and false otherwise */ - public boolean isSetRam() { - return EncodingUtils.testBit(__isset_bitfield, __RAM_ISSET_ID); - } - - public void setRamIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RAM_ISSET_ID, value); - } - - public long getCpu() { - return this.cpu; - } - - public writeVLdata_args setCpu(long cpu) { - this.cpu = cpu; - setCpuIsSet(true); - return this; - } - - public void unsetCpu() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CPU_ISSET_ID); - } - - /** Returns true if field cpu is set (has been assigned a value) and false otherwise */ - public boolean isSetCpu() { - return EncodingUtils.testBit(__isset_bitfield, __CPU_ISSET_ID); - } - - public void setCpuIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CPU_ISSET_ID, value); - } - - public String getImagePath() { - return this.imagePath; - } - - public writeVLdata_args setImagePath(String imagePath) { - this.imagePath = imagePath; - return this; - } - - public void unsetImagePath() { - this.imagePath = null; - } - - /** Returns true if field imagePath is set (has been assigned a value) and false otherwise */ - public boolean isSetImagePath() { - return this.imagePath != null; - } - - public void setImagePathIsSet(boolean value) { - if (!value) { - this.imagePath = null; - } - } - - public boolean isIsTemplate() { - return this.isTemplate; - } - - public writeVLdata_args setIsTemplate(boolean isTemplate) { - this.isTemplate = isTemplate; - setIsTemplateIsSet(true); - return this; - } - - public void unsetIsTemplate() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID); - } - - /** Returns true if field isTemplate is set (has been assigned a value) and false otherwise */ - public boolean isSetIsTemplate() { - return EncodingUtils.testBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID); - } - - public void setIsTemplateIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID, value); - } - - public long getFilesize() { - return this.filesize; - } - - public writeVLdata_args setFilesize(long filesize) { - this.filesize = filesize; - setFilesizeIsSet(true); - return this; - } - - public void unsetFilesize() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILESIZE_ISSET_ID); - } - - /** Returns true if field filesize is set (has been assigned a value) and false otherwise */ - public boolean isSetFilesize() { - return EncodingUtils.testBit(__isset_bitfield, __FILESIZE_ISSET_ID); - } - - public void setFilesizeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILESIZE_ISSET_ID, value); - } - - public long getShareMode() { - return this.shareMode; - } - - public writeVLdata_args setShareMode(long shareMode) { - this.shareMode = shareMode; - setShareModeIsSet(true); - return this; - } - - public void unsetShareMode() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SHAREMODE_ISSET_ID); - } - - /** Returns true if field shareMode is set (has been assigned a value) and false otherwise */ - public boolean isSetShareMode() { - return EncodingUtils.testBit(__isset_bitfield, __SHAREMODE_ISSET_ID); - } - - public void setShareModeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SHAREMODE_ISSET_ID, value); - } - - public String getOs() { - return this.os; - } - - public writeVLdata_args setOs(String os) { - this.os = os; - return this; - } - - public void unsetOs() { - this.os = null; - } - - /** Returns true if field os is set (has been assigned a value) and false otherwise */ - public boolean isSetOs() { - return this.os != null; - } - - public void setOsIsSet(boolean value) { - if (!value) { - this.os = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case IMAGENAME: - if (value == null) { - unsetImagename(); - } else { - setImagename((String)value); - } - break; - - case DESC: - if (value == null) { - unsetDesc(); - } else { - setDesc((String)value); - } - break; - - case LOGIN: - if (value == null) { - unsetLogin(); - } else { - setLogin((String)value); - } - break; - - case FIRSTNAME: - if (value == null) { - unsetFirstname(); - } else { - setFirstname((String)value); - } - break; - - case LASTNAME: - if (value == null) { - unsetLastname(); - } else { - setLastname((String)value); - } - break; - - case UNIVERSITY: - if (value == null) { - unsetUniversity(); - } else { - setUniversity((String)value); - } - break; - - case MAIL: - if (value == null) { - unsetMail(); - } else { - setMail((String)value); - } - break; - - case TEL: - if (value == null) { - unsetTel(); - } else { - setTel((String)value); - } - break; - - case FAK: - if (value == null) { - unsetFak(); - } else { - setFak((String)value); - } - break; - - case LICENSE: - if (value == null) { - unsetLicense(); - } else { - setLicense((Boolean)value); - } - break; - - case INTERNET: - if (value == null) { - unsetInternet(); - } else { - setInternet((Boolean)value); - } - break; - - case RAM: - if (value == null) { - unsetRam(); - } else { - setRam((Long)value); - } - break; - - case CPU: - if (value == null) { - unsetCpu(); - } else { - setCpu((Long)value); - } - break; - - case IMAGE_PATH: - if (value == null) { - unsetImagePath(); - } else { - setImagePath((String)value); - } - break; - - case IS_TEMPLATE: - if (value == null) { - unsetIsTemplate(); - } else { - setIsTemplate((Boolean)value); - } - break; - - case FILESIZE: - if (value == null) { - unsetFilesize(); - } else { - setFilesize((Long)value); - } - break; - - case SHARE_MODE: - if (value == null) { - unsetShareMode(); - } else { - setShareMode((Long)value); - } - break; - - case OS: - if (value == null) { - unsetOs(); - } else { - setOs((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case IMAGENAME: - return getImagename(); - - case DESC: - return getDesc(); - - case LOGIN: - return getLogin(); - - case FIRSTNAME: - return getFirstname(); - - case LASTNAME: - return getLastname(); - - case UNIVERSITY: - return getUniversity(); - - case MAIL: - return getMail(); - - case TEL: - return getTel(); - - case FAK: - return getFak(); - - case LICENSE: - return Boolean.valueOf(isLicense()); - - case INTERNET: - return Boolean.valueOf(isInternet()); - - case RAM: - return Long.valueOf(getRam()); - - case CPU: - return Long.valueOf(getCpu()); - - case IMAGE_PATH: - return getImagePath(); - - case IS_TEMPLATE: - return Boolean.valueOf(isIsTemplate()); - - case FILESIZE: - return Long.valueOf(getFilesize()); - - case SHARE_MODE: - return Long.valueOf(getShareMode()); - - case OS: - return getOs(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case IMAGENAME: - return isSetImagename(); - case DESC: - return isSetDesc(); - case LOGIN: - return isSetLogin(); - case FIRSTNAME: - return isSetFirstname(); - case LASTNAME: - return isSetLastname(); - case UNIVERSITY: - return isSetUniversity(); - case MAIL: - return isSetMail(); - case TEL: - return isSetTel(); - case FAK: - return isSetFak(); - case LICENSE: - return isSetLicense(); - case INTERNET: - return isSetInternet(); - case RAM: - return isSetRam(); - case CPU: - return isSetCpu(); - case IMAGE_PATH: - return isSetImagePath(); - case IS_TEMPLATE: - return isSetIsTemplate(); - case FILESIZE: - return isSetFilesize(); - case SHARE_MODE: - return isSetShareMode(); - case OS: - return isSetOs(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof writeVLdata_args) - return this.equals((writeVLdata_args)that); - return false; - } - - public boolean equals(writeVLdata_args that) { - if (that == null) - return false; - - boolean this_present_imagename = true && this.isSetImagename(); - boolean that_present_imagename = true && that.isSetImagename(); - if (this_present_imagename || that_present_imagename) { - if (!(this_present_imagename && that_present_imagename)) - return false; - if (!this.imagename.equals(that.imagename)) - return false; - } - - boolean this_present_desc = true && this.isSetDesc(); - boolean that_present_desc = true && that.isSetDesc(); - if (this_present_desc || that_present_desc) { - if (!(this_present_desc && that_present_desc)) - return false; - if (!this.desc.equals(that.desc)) - return false; - } - - boolean this_present_login = true && this.isSetLogin(); - boolean that_present_login = true && that.isSetLogin(); - if (this_present_login || that_present_login) { - if (!(this_present_login && that_present_login)) - return false; - if (!this.login.equals(that.login)) - return false; - } - - boolean this_present_firstname = true && this.isSetFirstname(); - boolean that_present_firstname = true && that.isSetFirstname(); - if (this_present_firstname || that_present_firstname) { - if (!(this_present_firstname && that_present_firstname)) - return false; - if (!this.firstname.equals(that.firstname)) - return false; - } - - boolean this_present_lastname = true && this.isSetLastname(); - boolean that_present_lastname = true && that.isSetLastname(); - if (this_present_lastname || that_present_lastname) { - if (!(this_present_lastname && that_present_lastname)) - return false; - if (!this.lastname.equals(that.lastname)) - return false; - } - - boolean this_present_university = true && this.isSetUniversity(); - boolean that_present_university = true && that.isSetUniversity(); - if (this_present_university || that_present_university) { - if (!(this_present_university && that_present_university)) - return false; - if (!this.university.equals(that.university)) - return false; - } - - boolean this_present_Mail = true && this.isSetMail(); - boolean that_present_Mail = true && that.isSetMail(); - if (this_present_Mail || that_present_Mail) { - if (!(this_present_Mail && that_present_Mail)) - return false; - if (!this.Mail.equals(that.Mail)) - return false; - } - - boolean this_present_Tel = true && this.isSetTel(); - boolean that_present_Tel = true && that.isSetTel(); - if (this_present_Tel || that_present_Tel) { - if (!(this_present_Tel && that_present_Tel)) - return false; - if (!this.Tel.equals(that.Tel)) - return false; - } - - boolean this_present_Fak = true && this.isSetFak(); - boolean that_present_Fak = true && that.isSetFak(); - if (this_present_Fak || that_present_Fak) { - if (!(this_present_Fak && that_present_Fak)) - return false; - if (!this.Fak.equals(that.Fak)) - return false; - } - - boolean this_present_license = true; - boolean that_present_license = true; - if (this_present_license || that_present_license) { - if (!(this_present_license && that_present_license)) - return false; - if (this.license != that.license) - return false; - } - - boolean this_present_internet = true; - boolean that_present_internet = true; - if (this_present_internet || that_present_internet) { - if (!(this_present_internet && that_present_internet)) - return false; - if (this.internet != that.internet) - return false; - } - - boolean this_present_ram = true; - boolean that_present_ram = true; - if (this_present_ram || that_present_ram) { - if (!(this_present_ram && that_present_ram)) - return false; - if (this.ram != that.ram) - return false; - } - - boolean this_present_cpu = true; - boolean that_present_cpu = true; - if (this_present_cpu || that_present_cpu) { - if (!(this_present_cpu && that_present_cpu)) - return false; - if (this.cpu != that.cpu) - return false; - } - - boolean this_present_imagePath = true && this.isSetImagePath(); - boolean that_present_imagePath = true && that.isSetImagePath(); - if (this_present_imagePath || that_present_imagePath) { - if (!(this_present_imagePath && that_present_imagePath)) - return false; - if (!this.imagePath.equals(that.imagePath)) - return false; - } - - boolean this_present_isTemplate = true; - boolean that_present_isTemplate = true; - if (this_present_isTemplate || that_present_isTemplate) { - if (!(this_present_isTemplate && that_present_isTemplate)) - return false; - if (this.isTemplate != that.isTemplate) - return false; - } - - boolean this_present_filesize = true; - boolean that_present_filesize = true; - if (this_present_filesize || that_present_filesize) { - if (!(this_present_filesize && that_present_filesize)) - return false; - if (this.filesize != that.filesize) - return false; - } - - boolean this_present_shareMode = true; - boolean that_present_shareMode = true; - if (this_present_shareMode || that_present_shareMode) { - if (!(this_present_shareMode && that_present_shareMode)) - return false; - if (this.shareMode != that.shareMode) - return false; - } - - boolean this_present_os = true && this.isSetOs(); - boolean that_present_os = true && that.isSetOs(); - if (this_present_os || that_present_os) { - if (!(this_present_os && that_present_os)) - return false; - if (!this.os.equals(that.os)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(writeVLdata_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetImagename()).compareTo(other.isSetImagename()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetImagename()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagename, other.imagename); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDesc()).compareTo(other.isSetDesc()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDesc()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.desc, other.desc); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLogin()).compareTo(other.isSetLogin()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLogin()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.login, other.login); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFirstname()).compareTo(other.isSetFirstname()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFirstname()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstname, other.firstname); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLastname()).compareTo(other.isSetLastname()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLastname()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastname, other.lastname); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUniversity()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMail()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Mail, other.Mail); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTel()).compareTo(other.isSetTel()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTel()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Tel, other.Tel); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFak()).compareTo(other.isSetFak()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFak()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Fak, other.Fak); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLicense()).compareTo(other.isSetLicense()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLicense()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.license, other.license); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetInternet()).compareTo(other.isSetInternet()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetInternet()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internet, other.internet); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRam()).compareTo(other.isSetRam()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRam()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ram, other.ram); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetCpu()).compareTo(other.isSetCpu()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCpu()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cpu, other.cpu); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetImagePath()).compareTo(other.isSetImagePath()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetImagePath()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagePath, other.imagePath); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIsTemplate()).compareTo(other.isSetIsTemplate()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIsTemplate()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isTemplate, other.isTemplate); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFilesize()).compareTo(other.isSetFilesize()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFilesize()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filesize, other.filesize); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetShareMode()).compareTo(other.isSetShareMode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetShareMode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shareMode, other.shareMode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOs()).compareTo(other.isSetOs()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.os, other.os); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("writeVLdata_args("); - boolean first = true; - - sb.append("imagename:"); - if (this.imagename == null) { - sb.append("null"); - } else { - sb.append(this.imagename); - } - first = false; - if (!first) sb.append(", "); - sb.append("desc:"); - if (this.desc == null) { - sb.append("null"); - } else { - sb.append(this.desc); - } - first = false; - if (!first) sb.append(", "); - sb.append("login:"); - if (this.login == null) { - sb.append("null"); - } else { - sb.append(this.login); - } - first = false; - if (!first) sb.append(", "); - sb.append("firstname:"); - if (this.firstname == null) { - sb.append("null"); - } else { - sb.append(this.firstname); - } - first = false; - if (!first) sb.append(", "); - sb.append("lastname:"); - if (this.lastname == null) { - sb.append("null"); - } else { - sb.append(this.lastname); - } - first = false; - if (!first) sb.append(", "); - sb.append("university:"); - if (this.university == null) { - sb.append("null"); - } else { - sb.append(this.university); - } - first = false; - if (!first) sb.append(", "); - sb.append("Mail:"); - if (this.Mail == null) { - sb.append("null"); - } else { - sb.append(this.Mail); - } - first = false; - if (!first) sb.append(", "); - sb.append("Tel:"); - if (this.Tel == null) { - sb.append("null"); - } else { - sb.append(this.Tel); - } - first = false; - if (!first) sb.append(", "); - sb.append("Fak:"); - if (this.Fak == null) { - sb.append("null"); - } else { - sb.append(this.Fak); - } - first = false; - if (!first) sb.append(", "); - sb.append("license:"); - sb.append(this.license); - first = false; - if (!first) sb.append(", "); - sb.append("internet:"); - sb.append(this.internet); - first = false; - if (!first) sb.append(", "); - sb.append("ram:"); - sb.append(this.ram); - first = false; - if (!first) sb.append(", "); - sb.append("cpu:"); - sb.append(this.cpu); - first = false; - if (!first) sb.append(", "); - sb.append("imagePath:"); - if (this.imagePath == null) { - sb.append("null"); - } else { - sb.append(this.imagePath); - } - first = false; - if (!first) sb.append(", "); - sb.append("isTemplate:"); - sb.append(this.isTemplate); - first = false; - if (!first) sb.append(", "); - sb.append("filesize:"); - sb.append(this.filesize); - first = false; - if (!first) sb.append(", "); - sb.append("shareMode:"); - sb.append(this.shareMode); - first = false; - if (!first) sb.append(", "); - sb.append("os:"); - if (this.os == null) { - sb.append("null"); - } else { - sb.append(this.os); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class writeVLdata_argsStandardSchemeFactory implements SchemeFactory { - public writeVLdata_argsStandardScheme getScheme() { - return new writeVLdata_argsStandardScheme(); - } - } - - private static class writeVLdata_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, writeVLdata_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // IMAGENAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.imagename = iprot.readString(); - struct.setImagenameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // DESC - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.desc = iprot.readString(); - struct.setDescIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -3: // LOGIN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.login = iprot.readString(); - struct.setLoginIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -4: // FIRSTNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.firstname = iprot.readString(); - struct.setFirstnameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -5: // LASTNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.lastname = iprot.readString(); - struct.setLastnameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -6: // UNIVERSITY - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.university = iprot.readString(); - struct.setUniversityIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -7: // MAIL - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.Mail = iprot.readString(); - struct.setMailIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -8: // TEL - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.Tel = iprot.readString(); - struct.setTelIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -9: // FAK - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.Fak = iprot.readString(); - struct.setFakIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -10: // LICENSE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.license = iprot.readBool(); - struct.setLicenseIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -11: // INTERNET - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.internet = iprot.readBool(); - struct.setInternetIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -12: // RAM - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.ram = iprot.readI64(); - struct.setRamIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -13: // CPU - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.cpu = iprot.readI64(); - struct.setCpuIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -14: // IMAGE_PATH - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.imagePath = iprot.readString(); - struct.setImagePathIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -15: // IS_TEMPLATE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.isTemplate = iprot.readBool(); - struct.setIsTemplateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -16: // FILESIZE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.filesize = iprot.readI64(); - struct.setFilesizeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -17: // SHARE_MODE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.shareMode = iprot.readI64(); - struct.setShareModeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -18: // OS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.os = iprot.readString(); - struct.setOsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, writeVLdata_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.os != null) { - oprot.writeFieldBegin(OS_FIELD_DESC); - oprot.writeString(struct.os); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(SHARE_MODE_FIELD_DESC); - oprot.writeI64(struct.shareMode); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(FILESIZE_FIELD_DESC); - oprot.writeI64(struct.filesize); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(IS_TEMPLATE_FIELD_DESC); - oprot.writeBool(struct.isTemplate); - oprot.writeFieldEnd(); - if (struct.imagePath != null) { - oprot.writeFieldBegin(IMAGE_PATH_FIELD_DESC); - oprot.writeString(struct.imagePath); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(CPU_FIELD_DESC); - oprot.writeI64(struct.cpu); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(RAM_FIELD_DESC); - oprot.writeI64(struct.ram); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(INTERNET_FIELD_DESC); - oprot.writeBool(struct.internet); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(LICENSE_FIELD_DESC); - oprot.writeBool(struct.license); - oprot.writeFieldEnd(); - if (struct.Fak != null) { - oprot.writeFieldBegin(FAK_FIELD_DESC); - oprot.writeString(struct.Fak); - oprot.writeFieldEnd(); - } - if (struct.Tel != null) { - oprot.writeFieldBegin(TEL_FIELD_DESC); - oprot.writeString(struct.Tel); - oprot.writeFieldEnd(); - } - if (struct.Mail != null) { - oprot.writeFieldBegin(MAIL_FIELD_DESC); - oprot.writeString(struct.Mail); - oprot.writeFieldEnd(); - } - if (struct.university != null) { - oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC); - oprot.writeString(struct.university); - oprot.writeFieldEnd(); - } - if (struct.lastname != null) { - oprot.writeFieldBegin(LASTNAME_FIELD_DESC); - oprot.writeString(struct.lastname); - oprot.writeFieldEnd(); - } - if (struct.firstname != null) { - oprot.writeFieldBegin(FIRSTNAME_FIELD_DESC); - oprot.writeString(struct.firstname); - oprot.writeFieldEnd(); - } - if (struct.login != null) { - oprot.writeFieldBegin(LOGIN_FIELD_DESC); - oprot.writeString(struct.login); - oprot.writeFieldEnd(); - } - if (struct.desc != null) { - oprot.writeFieldBegin(DESC_FIELD_DESC); - oprot.writeString(struct.desc); - oprot.writeFieldEnd(); - } - if (struct.imagename != null) { - oprot.writeFieldBegin(IMAGENAME_FIELD_DESC); - oprot.writeString(struct.imagename); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class writeVLdata_argsTupleSchemeFactory implements SchemeFactory { - public writeVLdata_argsTupleScheme getScheme() { - return new writeVLdata_argsTupleScheme(); - } - } - - private static class writeVLdata_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, writeVLdata_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetImagename()) { - optionals.set(0); - } - if (struct.isSetDesc()) { - optionals.set(1); - } - if (struct.isSetLogin()) { - optionals.set(2); - } - if (struct.isSetFirstname()) { - optionals.set(3); - } - if (struct.isSetLastname()) { - optionals.set(4); - } - if (struct.isSetUniversity()) { - optionals.set(5); - } - if (struct.isSetMail()) { - optionals.set(6); - } - if (struct.isSetTel()) { - optionals.set(7); - } - if (struct.isSetFak()) { - optionals.set(8); - } - if (struct.isSetLicense()) { - optionals.set(9); - } - if (struct.isSetInternet()) { - optionals.set(10); - } - if (struct.isSetRam()) { - optionals.set(11); - } - if (struct.isSetCpu()) { - optionals.set(12); - } - if (struct.isSetImagePath()) { - optionals.set(13); - } - if (struct.isSetIsTemplate()) { - optionals.set(14); - } - if (struct.isSetFilesize()) { - optionals.set(15); - } - if (struct.isSetShareMode()) { - optionals.set(16); - } - if (struct.isSetOs()) { - optionals.set(17); - } - oprot.writeBitSet(optionals, 18); - if (struct.isSetImagename()) { - oprot.writeString(struct.imagename); - } - if (struct.isSetDesc()) { - oprot.writeString(struct.desc); - } - if (struct.isSetLogin()) { - oprot.writeString(struct.login); - } - if (struct.isSetFirstname()) { - oprot.writeString(struct.firstname); - } - if (struct.isSetLastname()) { - oprot.writeString(struct.lastname); - } - if (struct.isSetUniversity()) { - oprot.writeString(struct.university); - } - if (struct.isSetMail()) { - oprot.writeString(struct.Mail); - } - if (struct.isSetTel()) { - oprot.writeString(struct.Tel); - } - if (struct.isSetFak()) { - oprot.writeString(struct.Fak); - } - if (struct.isSetLicense()) { - oprot.writeBool(struct.license); - } - if (struct.isSetInternet()) { - oprot.writeBool(struct.internet); - } - if (struct.isSetRam()) { - oprot.writeI64(struct.ram); - } - if (struct.isSetCpu()) { - oprot.writeI64(struct.cpu); - } - if (struct.isSetImagePath()) { - oprot.writeString(struct.imagePath); - } - if (struct.isSetIsTemplate()) { - oprot.writeBool(struct.isTemplate); - } - if (struct.isSetFilesize()) { - oprot.writeI64(struct.filesize); - } - if (struct.isSetShareMode()) { - oprot.writeI64(struct.shareMode); - } - if (struct.isSetOs()) { - oprot.writeString(struct.os); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, writeVLdata_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(18); - if (incoming.get(0)) { - struct.imagename = iprot.readString(); - struct.setImagenameIsSet(true); - } - if (incoming.get(1)) { - struct.desc = iprot.readString(); - struct.setDescIsSet(true); - } - if (incoming.get(2)) { - struct.login = iprot.readString(); - struct.setLoginIsSet(true); - } - if (incoming.get(3)) { - struct.firstname = iprot.readString(); - struct.setFirstnameIsSet(true); - } - if (incoming.get(4)) { - struct.lastname = iprot.readString(); - struct.setLastnameIsSet(true); - } - if (incoming.get(5)) { - struct.university = iprot.readString(); - struct.setUniversityIsSet(true); - } - if (incoming.get(6)) { - struct.Mail = iprot.readString(); - struct.setMailIsSet(true); - } - if (incoming.get(7)) { - struct.Tel = iprot.readString(); - struct.setTelIsSet(true); - } - if (incoming.get(8)) { - struct.Fak = iprot.readString(); - struct.setFakIsSet(true); - } - if (incoming.get(9)) { - struct.license = iprot.readBool(); - struct.setLicenseIsSet(true); - } - if (incoming.get(10)) { - struct.internet = iprot.readBool(); - struct.setInternetIsSet(true); - } - if (incoming.get(11)) { - struct.ram = iprot.readI64(); - struct.setRamIsSet(true); - } - if (incoming.get(12)) { - struct.cpu = iprot.readI64(); - struct.setCpuIsSet(true); - } - if (incoming.get(13)) { - struct.imagePath = iprot.readString(); - struct.setImagePathIsSet(true); - } - if (incoming.get(14)) { - struct.isTemplate = iprot.readBool(); - struct.setIsTemplateIsSet(true); - } - if (incoming.get(15)) { - struct.filesize = iprot.readI64(); - struct.setFilesizeIsSet(true); - } - if (incoming.get(16)) { - struct.shareMode = iprot.readI64(); - struct.setShareModeIsSet(true); - } - if (incoming.get(17)) { - struct.os = iprot.readString(); - struct.setOsIsSet(true); - } - } - } - - } - - public static class writeVLdata_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeVLdata_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new writeVLdata_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new writeVLdata_resultTupleSchemeFactory()); - } - - public boolean success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeVLdata_result.class, metaDataMap); - } - - public writeVLdata_result() { - } - - public writeVLdata_result( - boolean success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public writeVLdata_result(writeVLdata_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; - } - - public writeVLdata_result deepCopy() { - return new writeVLdata_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = false; - } - - public boolean isSuccess() { - return this.success; - } - - public writeVLdata_result setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Boolean.valueOf(isSuccess()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof writeVLdata_result) - return this.equals((writeVLdata_result)that); - return false; - } - - public boolean equals(writeVLdata_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(writeVLdata_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("writeVLdata_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class writeVLdata_resultStandardSchemeFactory implements SchemeFactory { - public writeVLdata_resultStandardScheme getScheme() { - return new writeVLdata_resultStandardScheme(); - } - } - - private static class writeVLdata_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, writeVLdata_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, writeVLdata_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class writeVLdata_resultTupleSchemeFactory implements SchemeFactory { - public writeVLdata_resultTupleScheme getScheme() { - return new writeVLdata_resultTupleScheme(); - } - } - - private static class writeVLdata_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, writeVLdata_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, writeVLdata_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class getImageList_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getImageList_args"); - - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getImageList_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getImageList_argsTupleSchemeFactory()); - } - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -; - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getImageList_args.class, metaDataMap); - } - - public getImageList_args() { - } - - /** - * Performs a deep copy on other. - */ - public getImageList_args(getImageList_args other) { - } - - public getImageList_args deepCopy() { - return new getImageList_args(this); - } - - @Override - public void clear() { - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getImageList_args) - return this.equals((getImageList_args)that); - return false; - } - - public boolean equals(getImageList_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getImageList_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getImageList_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getImageList_argsStandardSchemeFactory implements SchemeFactory { - public getImageList_argsStandardScheme getScheme() { - return new getImageList_argsStandardScheme(); - } - } - - private static class getImageList_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getImageList_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getImageList_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getImageList_argsTupleSchemeFactory implements SchemeFactory { - public getImageList_argsTupleScheme getScheme() { - return new getImageList_argsTupleScheme(); - } - } - - private static class getImageList_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getImageList_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getImageList_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - } - } - - } - - public static class getImageList_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getImageList_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getImageList_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getImageList_resultTupleSchemeFactory()); - } - - public List success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Image.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getImageList_result.class, metaDataMap); - } - - public getImageList_result() { - } - - public getImageList_result( - List success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getImageList_result(getImageList_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(other.success.size()); - for (Image other_element : other.success) { - __this__success.add(new Image(other_element)); - } - this.success = __this__success; - } - } - - public getImageList_result deepCopy() { - return new getImageList_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(Image elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); - } - - public List getSuccess() { - return this.success; - } - - public getImageList_result setSuccess(List success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getImageList_result) - return this.equals((getImageList_result)that); - return false; - } - - public boolean equals(getImageList_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getImageList_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getImageList_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getImageList_resultStandardSchemeFactory implements SchemeFactory { - public getImageList_resultStandardScheme getScheme() { - return new getImageList_resultStandardScheme(); - } - } - - private static class getImageList_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getImageList_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); - struct.success = new ArrayList(_list0.size); - for (int _i1 = 0; _i1 < _list0.size; ++_i1) - { - Image _elem2; - _elem2 = new Image(); - _elem2.read(iprot); - struct.success.add(_elem2); - } - iprot.readListEnd(); - } - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getImageList_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (Image _iter3 : struct.success) - { - _iter3.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getImageList_resultTupleSchemeFactory implements SchemeFactory { - public getImageList_resultTupleScheme getScheme() { - return new getImageList_resultTupleScheme(); - } - } - - private static class getImageList_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getImageList_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (Image _iter4 : struct.success) - { - _iter4.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getImageList_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list5.size); - for (int _i6 = 0; _i6 < _list5.size; ++_i6) - { - Image _elem7; - _elem7 = new Image(); - _elem7.read(iprot); - struct.success.add(_elem7); - } - } - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class getLectureList_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureList_args"); - - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getLectureList_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getLectureList_argsTupleSchemeFactory()); - } - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -; - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLectureList_args.class, metaDataMap); - } - - public getLectureList_args() { - } - - /** - * Performs a deep copy on other. - */ - public getLectureList_args(getLectureList_args other) { - } - - public getLectureList_args deepCopy() { - return new getLectureList_args(this); - } - - @Override - public void clear() { - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getLectureList_args) - return this.equals((getLectureList_args)that); - return false; - } - - public boolean equals(getLectureList_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getLectureList_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getLectureList_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getLectureList_argsStandardSchemeFactory implements SchemeFactory { - public getLectureList_argsStandardScheme getScheme() { - return new getLectureList_argsStandardScheme(); - } - } - - private static class getLectureList_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureList_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getLectureList_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getLectureList_argsTupleSchemeFactory implements SchemeFactory { - public getLectureList_argsTupleScheme getScheme() { - return new getLectureList_argsTupleScheme(); - } - } - - private static class getLectureList_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getLectureList_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getLectureList_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - } - } - - } - - public static class getLectureList_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureList_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getLectureList_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getLectureList_resultTupleSchemeFactory()); - } - - public List success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Lecture.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLectureList_result.class, metaDataMap); - } - - public getLectureList_result() { - } - - public getLectureList_result( - List success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getLectureList_result(getLectureList_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(other.success.size()); - for (Lecture other_element : other.success) { - __this__success.add(new Lecture(other_element)); - } - this.success = __this__success; - } - } - - public getLectureList_result deepCopy() { - return new getLectureList_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(Lecture elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); - } - - public List getSuccess() { - return this.success; - } - - public getLectureList_result setSuccess(List success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getLectureList_result) - return this.equals((getLectureList_result)that); - return false; - } - - public boolean equals(getLectureList_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getLectureList_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getLectureList_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getLectureList_resultStandardSchemeFactory implements SchemeFactory { - public getLectureList_resultStandardScheme getScheme() { - return new getLectureList_resultStandardScheme(); - } - } - - private static class getLectureList_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureList_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); - struct.success = new ArrayList(_list8.size); - for (int _i9 = 0; _i9 < _list8.size; ++_i9) - { - Lecture _elem10; - _elem10 = new Lecture(); - _elem10.read(iprot); - struct.success.add(_elem10); - } - iprot.readListEnd(); - } - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getLectureList_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (Lecture _iter11 : struct.success) - { - _iter11.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getLectureList_resultTupleSchemeFactory implements SchemeFactory { - public getLectureList_resultTupleScheme getScheme() { - return new getLectureList_resultTupleScheme(); - } - } - - private static class getLectureList_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getLectureList_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (Lecture _iter12 : struct.success) - { - _iter12.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getLectureList_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list13.size); - for (int _i14 = 0; _i14 < _list13.size; ++_i14) - { - Lecture _elem15; - _elem15 = new Lecture(); - _elem15.read(iprot); - struct.success.add(_elem15); - } - } - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class getAllOS_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllOS_args"); - - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getAllOS_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getAllOS_argsTupleSchemeFactory()); - } - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -; - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllOS_args.class, metaDataMap); - } - - public getAllOS_args() { - } - - /** - * Performs a deep copy on other. - */ - public getAllOS_args(getAllOS_args other) { - } - - public getAllOS_args deepCopy() { - return new getAllOS_args(this); - } - - @Override - public void clear() { - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getAllOS_args) - return this.equals((getAllOS_args)that); - return false; - } - - public boolean equals(getAllOS_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getAllOS_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getAllOS_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getAllOS_argsStandardSchemeFactory implements SchemeFactory { - public getAllOS_argsStandardScheme getScheme() { - return new getAllOS_argsStandardScheme(); - } - } - - private static class getAllOS_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getAllOS_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getAllOS_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getAllOS_argsTupleSchemeFactory implements SchemeFactory { - public getAllOS_argsTupleScheme getScheme() { - return new getAllOS_argsTupleScheme(); - } - } - - private static class getAllOS_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getAllOS_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getAllOS_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - } - } - - } - - public static class getAllOS_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllOS_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getAllOS_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getAllOS_resultTupleSchemeFactory()); - } - - public List success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllOS_result.class, metaDataMap); - } - - public getAllOS_result() { - } - - public getAllOS_result( - List success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getAllOS_result(getAllOS_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(other.success); - this.success = __this__success; - } - } - - public getAllOS_result deepCopy() { - return new getAllOS_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(String elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); - } - - public List getSuccess() { - return this.success; - } - - public getAllOS_result setSuccess(List success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getAllOS_result) - return this.equals((getAllOS_result)that); - return false; - } - - public boolean equals(getAllOS_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getAllOS_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getAllOS_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getAllOS_resultStandardSchemeFactory implements SchemeFactory { - public getAllOS_resultStandardScheme getScheme() { - return new getAllOS_resultStandardScheme(); - } - } - - private static class getAllOS_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getAllOS_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list16 = iprot.readListBegin(); - struct.success = new ArrayList(_list16.size); - for (int _i17 = 0; _i17 < _list16.size; ++_i17) - { - String _elem18; - _elem18 = iprot.readString(); - struct.success.add(_elem18); - } - iprot.readListEnd(); - } - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getAllOS_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); - for (String _iter19 : struct.success) - { - oprot.writeString(_iter19); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getAllOS_resultTupleSchemeFactory implements SchemeFactory { - public getAllOS_resultTupleScheme getScheme() { - return new getAllOS_resultTupleScheme(); - } - } - - private static class getAllOS_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getAllOS_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (String _iter20 : struct.success) - { - oprot.writeString(_iter20); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getAllOS_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.success = new ArrayList(_list21.size); - for (int _i22 = 0; _i22 < _list21.size; ++_i22) - { - String _elem23; - _elem23 = iprot.readString(); - struct.success.add(_elem23); - } - } - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class getAllUniversities_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllUniversities_args"); - - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getAllUniversities_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getAllUniversities_argsTupleSchemeFactory()); - } - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -; - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllUniversities_args.class, metaDataMap); - } - - public getAllUniversities_args() { - } - - /** - * Performs a deep copy on other. - */ - public getAllUniversities_args(getAllUniversities_args other) { - } - - public getAllUniversities_args deepCopy() { - return new getAllUniversities_args(this); - } - - @Override - public void clear() { - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getAllUniversities_args) - return this.equals((getAllUniversities_args)that); - return false; - } - - public boolean equals(getAllUniversities_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getAllUniversities_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getAllUniversities_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getAllUniversities_argsStandardSchemeFactory implements SchemeFactory { - public getAllUniversities_argsStandardScheme getScheme() { - return new getAllUniversities_argsStandardScheme(); - } - } - - private static class getAllUniversities_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getAllUniversities_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getAllUniversities_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getAllUniversities_argsTupleSchemeFactory implements SchemeFactory { - public getAllUniversities_argsTupleScheme getScheme() { - return new getAllUniversities_argsTupleScheme(); - } - } - - private static class getAllUniversities_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getAllUniversities_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getAllUniversities_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - } - } - - } - - public static class getAllUniversities_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllUniversities_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getAllUniversities_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getAllUniversities_resultTupleSchemeFactory()); - } - - public List success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllUniversities_result.class, metaDataMap); - } - - public getAllUniversities_result() { - } - - public getAllUniversities_result( - List success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getAllUniversities_result(getAllUniversities_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(other.success); - this.success = __this__success; - } - } - - public getAllUniversities_result deepCopy() { - return new getAllUniversities_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(String elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); - } - - public List getSuccess() { - return this.success; - } - - public getAllUniversities_result setSuccess(List success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getAllUniversities_result) - return this.equals((getAllUniversities_result)that); - return false; - } - - public boolean equals(getAllUniversities_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getAllUniversities_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getAllUniversities_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getAllUniversities_resultStandardSchemeFactory implements SchemeFactory { - public getAllUniversities_resultStandardScheme getScheme() { - return new getAllUniversities_resultStandardScheme(); - } - } - - private static class getAllUniversities_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getAllUniversities_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); - struct.success = new ArrayList(_list24.size); - for (int _i25 = 0; _i25 < _list24.size; ++_i25) - { - String _elem26; - _elem26 = iprot.readString(); - struct.success.add(_elem26); - } - iprot.readListEnd(); - } - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getAllUniversities_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); - for (String _iter27 : struct.success) - { - oprot.writeString(_iter27); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getAllUniversities_resultTupleSchemeFactory implements SchemeFactory { - public getAllUniversities_resultTupleScheme getScheme() { - return new getAllUniversities_resultTupleScheme(); - } - } - - private static class getAllUniversities_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getAllUniversities_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (String _iter28 : struct.success) - { - oprot.writeString(_iter28); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getAllUniversities_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.success = new ArrayList(_list29.size); - for (int _i30 = 0; _i30 < _list29.size; ++_i30) - { - String _elem31; - _elem31 = iprot.readString(); - struct.success.add(_elem31); - } - } - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class getPersonData_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPersonData_args"); - - private static final org.apache.thrift.protocol.TField VORNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("Vorname", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField NACHNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("Nachname", org.apache.thrift.protocol.TType.STRING, (short)-2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getPersonData_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getPersonData_argsTupleSchemeFactory()); - } - - public String Vorname; // required - public String Nachname; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VORNAME((short)-1, "Vorname"), - NACHNAME((short)-2, "Nachname"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // VORNAME - return VORNAME; - case -2: // NACHNAME - return NACHNAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VORNAME, new org.apache.thrift.meta_data.FieldMetaData("Vorname", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.NACHNAME, new org.apache.thrift.meta_data.FieldMetaData("Nachname", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPersonData_args.class, metaDataMap); - } - - public getPersonData_args() { - } - - public getPersonData_args( - String Vorname, - String Nachname) - { - this(); - this.Vorname = Vorname; - this.Nachname = Nachname; - } - - /** - * Performs a deep copy on other. - */ - public getPersonData_args(getPersonData_args other) { - if (other.isSetVorname()) { - this.Vorname = other.Vorname; - } - if (other.isSetNachname()) { - this.Nachname = other.Nachname; - } - } - - public getPersonData_args deepCopy() { - return new getPersonData_args(this); - } - - @Override - public void clear() { - this.Vorname = null; - this.Nachname = null; - } - - public String getVorname() { - return this.Vorname; - } - - public getPersonData_args setVorname(String Vorname) { - this.Vorname = Vorname; - return this; - } - - public void unsetVorname() { - this.Vorname = null; - } - - /** Returns true if field Vorname is set (has been assigned a value) and false otherwise */ - public boolean isSetVorname() { - return this.Vorname != null; - } - - public void setVornameIsSet(boolean value) { - if (!value) { - this.Vorname = null; - } - } - - public String getNachname() { - return this.Nachname; - } - - public getPersonData_args setNachname(String Nachname) { - this.Nachname = Nachname; - return this; - } - - public void unsetNachname() { - this.Nachname = null; - } - - /** Returns true if field Nachname is set (has been assigned a value) and false otherwise */ - public boolean isSetNachname() { - return this.Nachname != null; - } - - public void setNachnameIsSet(boolean value) { - if (!value) { - this.Nachname = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VORNAME: - if (value == null) { - unsetVorname(); - } else { - setVorname((String)value); - } - break; - - case NACHNAME: - if (value == null) { - unsetNachname(); - } else { - setNachname((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VORNAME: - return getVorname(); - - case NACHNAME: - return getNachname(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VORNAME: - return isSetVorname(); - case NACHNAME: - return isSetNachname(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getPersonData_args) - return this.equals((getPersonData_args)that); - return false; - } - - public boolean equals(getPersonData_args that) { - if (that == null) - return false; - - boolean this_present_Vorname = true && this.isSetVorname(); - boolean that_present_Vorname = true && that.isSetVorname(); - if (this_present_Vorname || that_present_Vorname) { - if (!(this_present_Vorname && that_present_Vorname)) - return false; - if (!this.Vorname.equals(that.Vorname)) - return false; - } - - boolean this_present_Nachname = true && this.isSetNachname(); - boolean that_present_Nachname = true && that.isSetNachname(); - if (this_present_Nachname || that_present_Nachname) { - if (!(this_present_Nachname && that_present_Nachname)) - return false; - if (!this.Nachname.equals(that.Nachname)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getPersonData_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetVorname()).compareTo(other.isSetVorname()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetVorname()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Vorname, other.Vorname); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNachname()).compareTo(other.isSetNachname()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNachname()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Nachname, other.Nachname); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getPersonData_args("); - boolean first = true; - - sb.append("Vorname:"); - if (this.Vorname == null) { - sb.append("null"); - } else { - sb.append(this.Vorname); - } - first = false; - if (!first) sb.append(", "); - sb.append("Nachname:"); - if (this.Nachname == null) { - sb.append("null"); - } else { - sb.append(this.Nachname); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getPersonData_argsStandardSchemeFactory implements SchemeFactory { - public getPersonData_argsStandardScheme getScheme() { - return new getPersonData_argsStandardScheme(); - } - } - - private static class getPersonData_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getPersonData_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // VORNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.Vorname = iprot.readString(); - struct.setVornameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // NACHNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.Nachname = iprot.readString(); - struct.setNachnameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getPersonData_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.Nachname != null) { - oprot.writeFieldBegin(NACHNAME_FIELD_DESC); - oprot.writeString(struct.Nachname); - oprot.writeFieldEnd(); - } - if (struct.Vorname != null) { - oprot.writeFieldBegin(VORNAME_FIELD_DESC); - oprot.writeString(struct.Vorname); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getPersonData_argsTupleSchemeFactory implements SchemeFactory { - public getPersonData_argsTupleScheme getScheme() { - return new getPersonData_argsTupleScheme(); - } - } - - private static class getPersonData_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getPersonData_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetVorname()) { - optionals.set(0); - } - if (struct.isSetNachname()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetVorname()) { - oprot.writeString(struct.Vorname); - } - if (struct.isSetNachname()) { - oprot.writeString(struct.Nachname); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getPersonData_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.Vorname = iprot.readString(); - struct.setVornameIsSet(true); - } - if (incoming.get(1)) { - struct.Nachname = iprot.readString(); - struct.setNachnameIsSet(true); - } - } - } - - } - - public static class getPersonData_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPersonData_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getPersonData_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getPersonData_resultTupleSchemeFactory()); - } - - public Map success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPersonData_result.class, metaDataMap); - } - - public getPersonData_result() { - } - - public getPersonData_result( - Map success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getPersonData_result(getPersonData_result other) { - if (other.isSetSuccess()) { - Map __this__success = new HashMap(other.success); - this.success = __this__success; - } - } - - public getPersonData_result deepCopy() { - return new getPersonData_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public void putToSuccess(String key, String val) { - if (this.success == null) { - this.success = new HashMap(); - } - this.success.put(key, val); - } - - public Map getSuccess() { - return this.success; - } - - public getPersonData_result setSuccess(Map success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getPersonData_result) - return this.equals((getPersonData_result)that); - return false; - } - - public boolean equals(getPersonData_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getPersonData_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getPersonData_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getPersonData_resultStandardSchemeFactory implements SchemeFactory { - public getPersonData_resultStandardScheme getScheme() { - return new getPersonData_resultStandardScheme(); - } - } - - private static class getPersonData_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getPersonData_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map32 = iprot.readMapBegin(); - struct.success = new HashMap(2*_map32.size); - for (int _i33 = 0; _i33 < _map32.size; ++_i33) - { - String _key34; - String _val35; - _key34 = iprot.readString(); - _val35 = iprot.readString(); - struct.success.put(_key34, _val35); - } - iprot.readMapEnd(); - } - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getPersonData_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size())); - for (Map.Entry _iter36 : struct.success.entrySet()) - { - oprot.writeString(_iter36.getKey()); - oprot.writeString(_iter36.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getPersonData_resultTupleSchemeFactory implements SchemeFactory { - public getPersonData_resultTupleScheme getScheme() { - return new getPersonData_resultTupleScheme(); - } - } - - private static class getPersonData_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getPersonData_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (Map.Entry _iter37 : struct.success.entrySet()) - { - oprot.writeString(_iter37.getKey()); - oprot.writeString(_iter37.getValue()); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getPersonData_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TMap _map38 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.success = new HashMap(2*_map38.size); - for (int _i39 = 0; _i39 < _map38.size; ++_i39) - { - String _key40; - String _val41; - _key40 = iprot.readString(); - _val41 = iprot.readString(); - struct.success.put(_key40, _val41); - } - } - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class writeLecturedata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeLecturedata_args"); - - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField SHORTDESC_FIELD_DESC = new org.apache.thrift.protocol.TField("shortdesc", org.apache.thrift.protocol.TType.STRING, (short)-2); - private static final org.apache.thrift.protocol.TField DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("desc", org.apache.thrift.protocol.TType.STRING, (short)-3); - private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.STRING, (short)-4); - private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.STRING, (short)-5); - private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.BOOL, (short)-6); - private static final org.apache.thrift.protocol.TField IMAGENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imagename", org.apache.thrift.protocol.TType.STRING, (short)-7); - private static final org.apache.thrift.protocol.TField LOGIN_FIELD_DESC = new org.apache.thrift.protocol.TField("login", org.apache.thrift.protocol.TType.STRING, (short)-8); - private static final org.apache.thrift.protocol.TField FIRSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstname", org.apache.thrift.protocol.TType.STRING, (short)-9); - private static final org.apache.thrift.protocol.TField LASTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastname", org.apache.thrift.protocol.TType.STRING, (short)-10); - private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-11); - private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("Mail", org.apache.thrift.protocol.TType.STRING, (short)-12); - private static final org.apache.thrift.protocol.TField TEL_FIELD_DESC = new org.apache.thrift.protocol.TField("Tel", org.apache.thrift.protocol.TType.STRING, (short)-13); - private static final org.apache.thrift.protocol.TField FAK_FIELD_DESC = new org.apache.thrift.protocol.TField("Fak", org.apache.thrift.protocol.TType.STRING, (short)-14); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new writeLecturedata_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new writeLecturedata_argsTupleSchemeFactory()); - } - - public String name; // required - public String shortdesc; // required - public String desc; // required - public String startDate; // required - public String endDate; // required - public boolean isActive; // required - public String imagename; // required - public String login; // required - public String firstname; // required - public String lastname; // required - public String university; // required - public String Mail; // required - public String Tel; // required - public String Fak; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NAME((short)-1, "name"), - SHORTDESC((short)-2, "shortdesc"), - DESC((short)-3, "desc"), - START_DATE((short)-4, "startDate"), - END_DATE((short)-5, "endDate"), - IS_ACTIVE((short)-6, "isActive"), - IMAGENAME((short)-7, "imagename"), - LOGIN((short)-8, "login"), - FIRSTNAME((short)-9, "firstname"), - LASTNAME((short)-10, "lastname"), - UNIVERSITY((short)-11, "university"), - MAIL((short)-12, "Mail"), - TEL((short)-13, "Tel"), - FAK((short)-14, "Fak"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // NAME - return NAME; - case -2: // SHORTDESC - return SHORTDESC; - case -3: // DESC - return DESC; - case -4: // START_DATE - return START_DATE; - case -5: // END_DATE - return END_DATE; - case -6: // IS_ACTIVE - return IS_ACTIVE; - case -7: // IMAGENAME - return IMAGENAME; - case -8: // LOGIN - return LOGIN; - case -9: // FIRSTNAME - return FIRSTNAME; - case -10: // LASTNAME - return LASTNAME; - case -11: // UNIVERSITY - return UNIVERSITY; - case -12: // MAIL - return MAIL; - case -13: // TEL - return TEL; - case -14: // FAK - return FAK; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ISACTIVE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.SHORTDESC, new org.apache.thrift.meta_data.FieldMetaData("shortdesc", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.DESC, new org.apache.thrift.meta_data.FieldMetaData("desc", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.IMAGENAME, new org.apache.thrift.meta_data.FieldMetaData("imagename", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.LOGIN, new org.apache.thrift.meta_data.FieldMetaData("login", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.FIRSTNAME, new org.apache.thrift.meta_data.FieldMetaData("firstname", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.LASTNAME, new org.apache.thrift.meta_data.FieldMetaData("lastname", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("Mail", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.TEL, new org.apache.thrift.meta_data.FieldMetaData("Tel", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.FAK, new org.apache.thrift.meta_data.FieldMetaData("Fak", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeLecturedata_args.class, metaDataMap); - } - - public writeLecturedata_args() { - } - - public writeLecturedata_args( - String name, - String shortdesc, - String desc, - String startDate, - String endDate, - boolean isActive, - String imagename, - String login, - String firstname, - String lastname, - String university, - String Mail, - String Tel, - String Fak) - { - this(); - this.name = name; - this.shortdesc = shortdesc; - this.desc = desc; - this.startDate = startDate; - this.endDate = endDate; - this.isActive = isActive; - setIsActiveIsSet(true); - this.imagename = imagename; - this.login = login; - this.firstname = firstname; - this.lastname = lastname; - this.university = university; - this.Mail = Mail; - this.Tel = Tel; - this.Fak = Fak; - } - - /** - * Performs a deep copy on other. - */ - public writeLecturedata_args(writeLecturedata_args other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetName()) { - this.name = other.name; - } - if (other.isSetShortdesc()) { - this.shortdesc = other.shortdesc; - } - if (other.isSetDesc()) { - this.desc = other.desc; - } - if (other.isSetStartDate()) { - this.startDate = other.startDate; - } - if (other.isSetEndDate()) { - this.endDate = other.endDate; - } - this.isActive = other.isActive; - if (other.isSetImagename()) { - this.imagename = other.imagename; - } - if (other.isSetLogin()) { - this.login = other.login; - } - if (other.isSetFirstname()) { - this.firstname = other.firstname; - } - if (other.isSetLastname()) { - this.lastname = other.lastname; - } - if (other.isSetUniversity()) { - this.university = other.university; - } - if (other.isSetMail()) { - this.Mail = other.Mail; - } - if (other.isSetTel()) { - this.Tel = other.Tel; - } - if (other.isSetFak()) { - this.Fak = other.Fak; - } - } - - public writeLecturedata_args deepCopy() { - return new writeLecturedata_args(this); - } - - @Override - public void clear() { - this.name = null; - this.shortdesc = null; - this.desc = null; - this.startDate = null; - this.endDate = null; - setIsActiveIsSet(false); - this.isActive = false; - this.imagename = null; - this.login = null; - this.firstname = null; - this.lastname = null; - this.university = null; - this.Mail = null; - this.Tel = null; - this.Fak = null; - } - - public String getName() { - return this.name; - } - - public writeLecturedata_args setName(String name) { - this.name = name; - return this; - } - - public void unsetName() { - this.name = null; - } - - /** Returns true if field name is set (has been assigned a value) and false otherwise */ - public boolean isSetName() { - return this.name != null; - } - - public void setNameIsSet(boolean value) { - if (!value) { - this.name = null; - } - } - - public String getShortdesc() { - return this.shortdesc; - } - - public writeLecturedata_args setShortdesc(String shortdesc) { - this.shortdesc = shortdesc; - return this; - } - - public void unsetShortdesc() { - this.shortdesc = null; - } - - /** Returns true if field shortdesc is set (has been assigned a value) and false otherwise */ - public boolean isSetShortdesc() { - return this.shortdesc != null; - } - - public void setShortdescIsSet(boolean value) { - if (!value) { - this.shortdesc = null; - } - } - - public String getDesc() { - return this.desc; - } - - public writeLecturedata_args setDesc(String desc) { - this.desc = desc; - return this; - } - - public void unsetDesc() { - this.desc = null; - } - - /** Returns true if field desc is set (has been assigned a value) and false otherwise */ - public boolean isSetDesc() { - return this.desc != null; - } - - public void setDescIsSet(boolean value) { - if (!value) { - this.desc = null; - } - } - - public String getStartDate() { - return this.startDate; - } - - public writeLecturedata_args setStartDate(String startDate) { - this.startDate = startDate; - return this; - } - - public void unsetStartDate() { - this.startDate = null; - } - - /** Returns true if field startDate is set (has been assigned a value) and false otherwise */ - public boolean isSetStartDate() { - return this.startDate != null; - } - - public void setStartDateIsSet(boolean value) { - if (!value) { - this.startDate = null; - } - } - - public String getEndDate() { - return this.endDate; - } - - public writeLecturedata_args setEndDate(String endDate) { - this.endDate = endDate; - return this; - } - - public void unsetEndDate() { - this.endDate = null; - } - - /** Returns true if field endDate is set (has been assigned a value) and false otherwise */ - public boolean isSetEndDate() { - return this.endDate != null; - } - - public void setEndDateIsSet(boolean value) { - if (!value) { - this.endDate = null; - } - } - - public boolean isIsActive() { - return this.isActive; - } - - public writeLecturedata_args setIsActive(boolean isActive) { - this.isActive = isActive; - setIsActiveIsSet(true); - return this; - } - - public void unsetIsActive() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISACTIVE_ISSET_ID); - } - - /** Returns true if field isActive is set (has been assigned a value) and false otherwise */ - public boolean isSetIsActive() { - return EncodingUtils.testBit(__isset_bitfield, __ISACTIVE_ISSET_ID); - } - - public void setIsActiveIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISACTIVE_ISSET_ID, value); - } - - public String getImagename() { - return this.imagename; - } - - public writeLecturedata_args setImagename(String imagename) { - this.imagename = imagename; - return this; - } - - public void unsetImagename() { - this.imagename = null; - } - - /** Returns true if field imagename is set (has been assigned a value) and false otherwise */ - public boolean isSetImagename() { - return this.imagename != null; - } - - public void setImagenameIsSet(boolean value) { - if (!value) { - this.imagename = null; - } - } - - public String getLogin() { - return this.login; - } - - public writeLecturedata_args setLogin(String login) { - this.login = login; - return this; - } - - public void unsetLogin() { - this.login = null; - } - - /** Returns true if field login is set (has been assigned a value) and false otherwise */ - public boolean isSetLogin() { - return this.login != null; - } - - public void setLoginIsSet(boolean value) { - if (!value) { - this.login = null; - } - } - - public String getFirstname() { - return this.firstname; - } - - public writeLecturedata_args setFirstname(String firstname) { - this.firstname = firstname; - return this; - } - - public void unsetFirstname() { - this.firstname = null; - } - - /** Returns true if field firstname is set (has been assigned a value) and false otherwise */ - public boolean isSetFirstname() { - return this.firstname != null; - } - - public void setFirstnameIsSet(boolean value) { - if (!value) { - this.firstname = null; - } - } - - public String getLastname() { - return this.lastname; - } - - public writeLecturedata_args setLastname(String lastname) { - this.lastname = lastname; - return this; - } - - public void unsetLastname() { - this.lastname = null; - } - - /** Returns true if field lastname is set (has been assigned a value) and false otherwise */ - public boolean isSetLastname() { - return this.lastname != null; - } - - public void setLastnameIsSet(boolean value) { - if (!value) { - this.lastname = null; - } - } - - public String getUniversity() { - return this.university; - } - - public writeLecturedata_args setUniversity(String university) { - this.university = university; - return this; - } - - public void unsetUniversity() { - this.university = null; - } - - /** Returns true if field university is set (has been assigned a value) and false otherwise */ - public boolean isSetUniversity() { - return this.university != null; - } - - public void setUniversityIsSet(boolean value) { - if (!value) { - this.university = null; - } - } - - public String getMail() { - return this.Mail; - } - - public writeLecturedata_args setMail(String Mail) { - this.Mail = Mail; - return this; - } - - public void unsetMail() { - this.Mail = null; - } - - /** Returns true if field Mail is set (has been assigned a value) and false otherwise */ - public boolean isSetMail() { - return this.Mail != null; - } - - public void setMailIsSet(boolean value) { - if (!value) { - this.Mail = null; - } - } - - public String getTel() { - return this.Tel; - } - - public writeLecturedata_args setTel(String Tel) { - this.Tel = Tel; - return this; - } - - public void unsetTel() { - this.Tel = null; - } - - /** Returns true if field Tel is set (has been assigned a value) and false otherwise */ - public boolean isSetTel() { - return this.Tel != null; - } - - public void setTelIsSet(boolean value) { - if (!value) { - this.Tel = null; - } - } - - public String getFak() { - return this.Fak; - } - - public writeLecturedata_args setFak(String Fak) { - this.Fak = Fak; - return this; - } - - public void unsetFak() { - this.Fak = null; - } - - /** Returns true if field Fak is set (has been assigned a value) and false otherwise */ - public boolean isSetFak() { - return this.Fak != null; - } - - public void setFakIsSet(boolean value) { - if (!value) { - this.Fak = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NAME: - if (value == null) { - unsetName(); - } else { - setName((String)value); - } - break; - - case SHORTDESC: - if (value == null) { - unsetShortdesc(); - } else { - setShortdesc((String)value); - } - break; - - case DESC: - if (value == null) { - unsetDesc(); - } else { - setDesc((String)value); - } - break; - - case START_DATE: - if (value == null) { - unsetStartDate(); - } else { - setStartDate((String)value); - } - break; - - case END_DATE: - if (value == null) { - unsetEndDate(); - } else { - setEndDate((String)value); - } - break; - - case IS_ACTIVE: - if (value == null) { - unsetIsActive(); - } else { - setIsActive((Boolean)value); - } - break; - - case IMAGENAME: - if (value == null) { - unsetImagename(); - } else { - setImagename((String)value); - } - break; - - case LOGIN: - if (value == null) { - unsetLogin(); - } else { - setLogin((String)value); - } - break; - - case FIRSTNAME: - if (value == null) { - unsetFirstname(); - } else { - setFirstname((String)value); - } - break; - - case LASTNAME: - if (value == null) { - unsetLastname(); - } else { - setLastname((String)value); - } - break; - - case UNIVERSITY: - if (value == null) { - unsetUniversity(); - } else { - setUniversity((String)value); - } - break; - - case MAIL: - if (value == null) { - unsetMail(); - } else { - setMail((String)value); - } - break; - - case TEL: - if (value == null) { - unsetTel(); - } else { - setTel((String)value); - } - break; - - case FAK: - if (value == null) { - unsetFak(); - } else { - setFak((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NAME: - return getName(); - - case SHORTDESC: - return getShortdesc(); - - case DESC: - return getDesc(); - - case START_DATE: - return getStartDate(); - - case END_DATE: - return getEndDate(); - - case IS_ACTIVE: - return Boolean.valueOf(isIsActive()); - - case IMAGENAME: - return getImagename(); - - case LOGIN: - return getLogin(); - - case FIRSTNAME: - return getFirstname(); - - case LASTNAME: - return getLastname(); - - case UNIVERSITY: - return getUniversity(); - - case MAIL: - return getMail(); - - case TEL: - return getTel(); - - case FAK: - return getFak(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case NAME: - return isSetName(); - case SHORTDESC: - return isSetShortdesc(); - case DESC: - return isSetDesc(); - case START_DATE: - return isSetStartDate(); - case END_DATE: - return isSetEndDate(); - case IS_ACTIVE: - return isSetIsActive(); - case IMAGENAME: - return isSetImagename(); - case LOGIN: - return isSetLogin(); - case FIRSTNAME: - return isSetFirstname(); - case LASTNAME: - return isSetLastname(); - case UNIVERSITY: - return isSetUniversity(); - case MAIL: - return isSetMail(); - case TEL: - return isSetTel(); - case FAK: - return isSetFak(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof writeLecturedata_args) - return this.equals((writeLecturedata_args)that); - return false; - } - - public boolean equals(writeLecturedata_args that) { - if (that == null) - return false; - - boolean this_present_name = true && this.isSetName(); - boolean that_present_name = true && that.isSetName(); - if (this_present_name || that_present_name) { - if (!(this_present_name && that_present_name)) - return false; - if (!this.name.equals(that.name)) - return false; - } - - boolean this_present_shortdesc = true && this.isSetShortdesc(); - boolean that_present_shortdesc = true && that.isSetShortdesc(); - if (this_present_shortdesc || that_present_shortdesc) { - if (!(this_present_shortdesc && that_present_shortdesc)) - return false; - if (!this.shortdesc.equals(that.shortdesc)) - return false; - } - - boolean this_present_desc = true && this.isSetDesc(); - boolean that_present_desc = true && that.isSetDesc(); - if (this_present_desc || that_present_desc) { - if (!(this_present_desc && that_present_desc)) - return false; - if (!this.desc.equals(that.desc)) - return false; - } - - boolean this_present_startDate = true && this.isSetStartDate(); - boolean that_present_startDate = true && that.isSetStartDate(); - if (this_present_startDate || that_present_startDate) { - if (!(this_present_startDate && that_present_startDate)) - return false; - if (!this.startDate.equals(that.startDate)) - return false; - } - - boolean this_present_endDate = true && this.isSetEndDate(); - boolean that_present_endDate = true && that.isSetEndDate(); - if (this_present_endDate || that_present_endDate) { - if (!(this_present_endDate && that_present_endDate)) - return false; - if (!this.endDate.equals(that.endDate)) - return false; - } - - boolean this_present_isActive = true; - boolean that_present_isActive = true; - if (this_present_isActive || that_present_isActive) { - if (!(this_present_isActive && that_present_isActive)) - return false; - if (this.isActive != that.isActive) - return false; - } - - boolean this_present_imagename = true && this.isSetImagename(); - boolean that_present_imagename = true && that.isSetImagename(); - if (this_present_imagename || that_present_imagename) { - if (!(this_present_imagename && that_present_imagename)) - return false; - if (!this.imagename.equals(that.imagename)) - return false; - } - - boolean this_present_login = true && this.isSetLogin(); - boolean that_present_login = true && that.isSetLogin(); - if (this_present_login || that_present_login) { - if (!(this_present_login && that_present_login)) - return false; - if (!this.login.equals(that.login)) - return false; - } - - boolean this_present_firstname = true && this.isSetFirstname(); - boolean that_present_firstname = true && that.isSetFirstname(); - if (this_present_firstname || that_present_firstname) { - if (!(this_present_firstname && that_present_firstname)) - return false; - if (!this.firstname.equals(that.firstname)) - return false; - } - - boolean this_present_lastname = true && this.isSetLastname(); - boolean that_present_lastname = true && that.isSetLastname(); - if (this_present_lastname || that_present_lastname) { - if (!(this_present_lastname && that_present_lastname)) - return false; - if (!this.lastname.equals(that.lastname)) - return false; - } - - boolean this_present_university = true && this.isSetUniversity(); - boolean that_present_university = true && that.isSetUniversity(); - if (this_present_university || that_present_university) { - if (!(this_present_university && that_present_university)) - return false; - if (!this.university.equals(that.university)) - return false; - } - - boolean this_present_Mail = true && this.isSetMail(); - boolean that_present_Mail = true && that.isSetMail(); - if (this_present_Mail || that_present_Mail) { - if (!(this_present_Mail && that_present_Mail)) - return false; - if (!this.Mail.equals(that.Mail)) - return false; - } - - boolean this_present_Tel = true && this.isSetTel(); - boolean that_present_Tel = true && that.isSetTel(); - if (this_present_Tel || that_present_Tel) { - if (!(this_present_Tel && that_present_Tel)) - return false; - if (!this.Tel.equals(that.Tel)) - return false; - } - - boolean this_present_Fak = true && this.isSetFak(); - boolean that_present_Fak = true && that.isSetFak(); - if (this_present_Fak || that_present_Fak) { - if (!(this_present_Fak && that_present_Fak)) - return false; - if (!this.Fak.equals(that.Fak)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(writeLecturedata_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetShortdesc()).compareTo(other.isSetShortdesc()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetShortdesc()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shortdesc, other.shortdesc); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDesc()).compareTo(other.isSetDesc()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDesc()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.desc, other.desc); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(other.isSetStartDate()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStartDate()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, other.startDate); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(other.isSetEndDate()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEndDate()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, other.endDate); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(other.isSetIsActive()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIsActive()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isActive, other.isActive); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetImagename()).compareTo(other.isSetImagename()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetImagename()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagename, other.imagename); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLogin()).compareTo(other.isSetLogin()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLogin()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.login, other.login); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFirstname()).compareTo(other.isSetFirstname()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFirstname()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstname, other.firstname); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLastname()).compareTo(other.isSetLastname()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLastname()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastname, other.lastname); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUniversity()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMail()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Mail, other.Mail); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTel()).compareTo(other.isSetTel()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTel()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Tel, other.Tel); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFak()).compareTo(other.isSetFak()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFak()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Fak, other.Fak); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("writeLecturedata_args("); - boolean first = true; - - sb.append("name:"); - if (this.name == null) { - sb.append("null"); - } else { - sb.append(this.name); - } - first = false; - if (!first) sb.append(", "); - sb.append("shortdesc:"); - if (this.shortdesc == null) { - sb.append("null"); - } else { - sb.append(this.shortdesc); - } - first = false; - if (!first) sb.append(", "); - sb.append("desc:"); - if (this.desc == null) { - sb.append("null"); - } else { - sb.append(this.desc); - } - first = false; - if (!first) sb.append(", "); - sb.append("startDate:"); - if (this.startDate == null) { - sb.append("null"); - } else { - sb.append(this.startDate); - } - first = false; - if (!first) sb.append(", "); - sb.append("endDate:"); - if (this.endDate == null) { - sb.append("null"); - } else { - sb.append(this.endDate); - } - first = false; - if (!first) sb.append(", "); - sb.append("isActive:"); - sb.append(this.isActive); - first = false; - if (!first) sb.append(", "); - sb.append("imagename:"); - if (this.imagename == null) { - sb.append("null"); - } else { - sb.append(this.imagename); - } - first = false; - if (!first) sb.append(", "); - sb.append("login:"); - if (this.login == null) { - sb.append("null"); - } else { - sb.append(this.login); - } - first = false; - if (!first) sb.append(", "); - sb.append("firstname:"); - if (this.firstname == null) { - sb.append("null"); - } else { - sb.append(this.firstname); - } - first = false; - if (!first) sb.append(", "); - sb.append("lastname:"); - if (this.lastname == null) { - sb.append("null"); - } else { - sb.append(this.lastname); - } - first = false; - if (!first) sb.append(", "); - sb.append("university:"); - if (this.university == null) { - sb.append("null"); - } else { - sb.append(this.university); - } - first = false; - if (!first) sb.append(", "); - sb.append("Mail:"); - if (this.Mail == null) { - sb.append("null"); - } else { - sb.append(this.Mail); - } - first = false; - if (!first) sb.append(", "); - sb.append("Tel:"); - if (this.Tel == null) { - sb.append("null"); - } else { - sb.append(this.Tel); - } - first = false; - if (!first) sb.append(", "); - sb.append("Fak:"); - if (this.Fak == null) { - sb.append("null"); - } else { - sb.append(this.Fak); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class writeLecturedata_argsStandardSchemeFactory implements SchemeFactory { - public writeLecturedata_argsStandardScheme getScheme() { - return new writeLecturedata_argsStandardScheme(); - } - } - - private static class writeLecturedata_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, writeLecturedata_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.name = iprot.readString(); - struct.setNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // SHORTDESC - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.shortdesc = iprot.readString(); - struct.setShortdescIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -3: // DESC - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.desc = iprot.readString(); - struct.setDescIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -4: // START_DATE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.startDate = iprot.readString(); - struct.setStartDateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -5: // END_DATE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.endDate = iprot.readString(); - struct.setEndDateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -6: // IS_ACTIVE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.isActive = iprot.readBool(); - struct.setIsActiveIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -7: // IMAGENAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.imagename = iprot.readString(); - struct.setImagenameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -8: // LOGIN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.login = iprot.readString(); - struct.setLoginIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -9: // FIRSTNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.firstname = iprot.readString(); - struct.setFirstnameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -10: // LASTNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.lastname = iprot.readString(); - struct.setLastnameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -11: // UNIVERSITY - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.university = iprot.readString(); - struct.setUniversityIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -12: // MAIL - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.Mail = iprot.readString(); - struct.setMailIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -13: // TEL - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.Tel = iprot.readString(); - struct.setTelIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -14: // FAK - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.Fak = iprot.readString(); - struct.setFakIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, writeLecturedata_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.Fak != null) { - oprot.writeFieldBegin(FAK_FIELD_DESC); - oprot.writeString(struct.Fak); - oprot.writeFieldEnd(); - } - if (struct.Tel != null) { - oprot.writeFieldBegin(TEL_FIELD_DESC); - oprot.writeString(struct.Tel); - oprot.writeFieldEnd(); - } - if (struct.Mail != null) { - oprot.writeFieldBegin(MAIL_FIELD_DESC); - oprot.writeString(struct.Mail); - oprot.writeFieldEnd(); - } - if (struct.university != null) { - oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC); - oprot.writeString(struct.university); - oprot.writeFieldEnd(); - } - if (struct.lastname != null) { - oprot.writeFieldBegin(LASTNAME_FIELD_DESC); - oprot.writeString(struct.lastname); - oprot.writeFieldEnd(); - } - if (struct.firstname != null) { - oprot.writeFieldBegin(FIRSTNAME_FIELD_DESC); - oprot.writeString(struct.firstname); - oprot.writeFieldEnd(); - } - if (struct.login != null) { - oprot.writeFieldBegin(LOGIN_FIELD_DESC); - oprot.writeString(struct.login); - oprot.writeFieldEnd(); - } - if (struct.imagename != null) { - oprot.writeFieldBegin(IMAGENAME_FIELD_DESC); - oprot.writeString(struct.imagename); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC); - oprot.writeBool(struct.isActive); - oprot.writeFieldEnd(); - if (struct.endDate != null) { - oprot.writeFieldBegin(END_DATE_FIELD_DESC); - oprot.writeString(struct.endDate); - oprot.writeFieldEnd(); - } - if (struct.startDate != null) { - oprot.writeFieldBegin(START_DATE_FIELD_DESC); - oprot.writeString(struct.startDate); - oprot.writeFieldEnd(); - } - if (struct.desc != null) { - oprot.writeFieldBegin(DESC_FIELD_DESC); - oprot.writeString(struct.desc); - oprot.writeFieldEnd(); - } - if (struct.shortdesc != null) { - oprot.writeFieldBegin(SHORTDESC_FIELD_DESC); - oprot.writeString(struct.shortdesc); - oprot.writeFieldEnd(); - } - if (struct.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(struct.name); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class writeLecturedata_argsTupleSchemeFactory implements SchemeFactory { - public writeLecturedata_argsTupleScheme getScheme() { - return new writeLecturedata_argsTupleScheme(); - } - } - - private static class writeLecturedata_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, writeLecturedata_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetName()) { - optionals.set(0); - } - if (struct.isSetShortdesc()) { - optionals.set(1); - } - if (struct.isSetDesc()) { - optionals.set(2); - } - if (struct.isSetStartDate()) { - optionals.set(3); - } - if (struct.isSetEndDate()) { - optionals.set(4); - } - if (struct.isSetIsActive()) { - optionals.set(5); - } - if (struct.isSetImagename()) { - optionals.set(6); - } - if (struct.isSetLogin()) { - optionals.set(7); - } - if (struct.isSetFirstname()) { - optionals.set(8); - } - if (struct.isSetLastname()) { - optionals.set(9); - } - if (struct.isSetUniversity()) { - optionals.set(10); - } - if (struct.isSetMail()) { - optionals.set(11); - } - if (struct.isSetTel()) { - optionals.set(12); - } - if (struct.isSetFak()) { - optionals.set(13); - } - oprot.writeBitSet(optionals, 14); - if (struct.isSetName()) { - oprot.writeString(struct.name); - } - if (struct.isSetShortdesc()) { - oprot.writeString(struct.shortdesc); - } - if (struct.isSetDesc()) { - oprot.writeString(struct.desc); - } - if (struct.isSetStartDate()) { - oprot.writeString(struct.startDate); - } - if (struct.isSetEndDate()) { - oprot.writeString(struct.endDate); - } - if (struct.isSetIsActive()) { - oprot.writeBool(struct.isActive); - } - if (struct.isSetImagename()) { - oprot.writeString(struct.imagename); - } - if (struct.isSetLogin()) { - oprot.writeString(struct.login); - } - if (struct.isSetFirstname()) { - oprot.writeString(struct.firstname); - } - if (struct.isSetLastname()) { - oprot.writeString(struct.lastname); - } - if (struct.isSetUniversity()) { - oprot.writeString(struct.university); - } - if (struct.isSetMail()) { - oprot.writeString(struct.Mail); - } - if (struct.isSetTel()) { - oprot.writeString(struct.Tel); - } - if (struct.isSetFak()) { - oprot.writeString(struct.Fak); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, writeLecturedata_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(14); - if (incoming.get(0)) { - struct.name = iprot.readString(); - struct.setNameIsSet(true); - } - if (incoming.get(1)) { - struct.shortdesc = iprot.readString(); - struct.setShortdescIsSet(true); - } - if (incoming.get(2)) { - struct.desc = iprot.readString(); - struct.setDescIsSet(true); - } - if (incoming.get(3)) { - struct.startDate = iprot.readString(); - struct.setStartDateIsSet(true); - } - if (incoming.get(4)) { - struct.endDate = iprot.readString(); - struct.setEndDateIsSet(true); - } - if (incoming.get(5)) { - struct.isActive = iprot.readBool(); - struct.setIsActiveIsSet(true); - } - if (incoming.get(6)) { - struct.imagename = iprot.readString(); - struct.setImagenameIsSet(true); - } - if (incoming.get(7)) { - struct.login = iprot.readString(); - struct.setLoginIsSet(true); - } - if (incoming.get(8)) { - struct.firstname = iprot.readString(); - struct.setFirstnameIsSet(true); - } - if (incoming.get(9)) { - struct.lastname = iprot.readString(); - struct.setLastnameIsSet(true); - } - if (incoming.get(10)) { - struct.university = iprot.readString(); - struct.setUniversityIsSet(true); - } - if (incoming.get(11)) { - struct.Mail = iprot.readString(); - struct.setMailIsSet(true); - } - if (incoming.get(12)) { - struct.Tel = iprot.readString(); - struct.setTelIsSet(true); - } - if (incoming.get(13)) { - struct.Fak = iprot.readString(); - struct.setFakIsSet(true); - } - } - } - - } - - public static class writeLecturedata_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeLecturedata_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new writeLecturedata_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new writeLecturedata_resultTupleSchemeFactory()); - } - - public boolean success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeLecturedata_result.class, metaDataMap); - } - - public writeLecturedata_result() { - } - - public writeLecturedata_result( - boolean success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public writeLecturedata_result(writeLecturedata_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; - } - - public writeLecturedata_result deepCopy() { - return new writeLecturedata_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = false; - } - - public boolean isSuccess() { - return this.success; - } - - public writeLecturedata_result setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Boolean.valueOf(isSuccess()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof writeLecturedata_result) - return this.equals((writeLecturedata_result)that); - return false; - } - - public boolean equals(writeLecturedata_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(writeLecturedata_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("writeLecturedata_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class writeLecturedata_resultStandardSchemeFactory implements SchemeFactory { - public writeLecturedata_resultStandardScheme getScheme() { - return new writeLecturedata_resultStandardScheme(); - } - } - - private static class writeLecturedata_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, writeLecturedata_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, writeLecturedata_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class writeLecturedata_resultTupleSchemeFactory implements SchemeFactory { - public writeLecturedata_resultTupleScheme getScheme() { - return new writeLecturedata_resultTupleScheme(); - } - } - - private static class writeLecturedata_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, writeLecturedata_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, writeLecturedata_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class startFileCopy_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startFileCopy_args"); - - private static final org.apache.thrift.protocol.TField FILE_FIELD_DESC = new org.apache.thrift.protocol.TField("file", org.apache.thrift.protocol.TType.STRING, (short)-1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new startFileCopy_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new startFileCopy_argsTupleSchemeFactory()); - } - - public String file; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - FILE((short)-1, "file"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // FILE - return FILE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.FILE, new org.apache.thrift.meta_data.FieldMetaData("file", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startFileCopy_args.class, metaDataMap); - } - - public startFileCopy_args() { - } - - public startFileCopy_args( - String file) - { - this(); - this.file = file; - } - - /** - * Performs a deep copy on other. - */ - public startFileCopy_args(startFileCopy_args other) { - if (other.isSetFile()) { - this.file = other.file; - } - } - - public startFileCopy_args deepCopy() { - return new startFileCopy_args(this); - } - - @Override - public void clear() { - this.file = null; - } - - public String getFile() { - return this.file; - } - - public startFileCopy_args setFile(String file) { - this.file = file; - return this; - } - - public void unsetFile() { - this.file = null; - } - - /** Returns true if field file is set (has been assigned a value) and false otherwise */ - public boolean isSetFile() { - return this.file != null; - } - - public void setFileIsSet(boolean value) { - if (!value) { - this.file = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case FILE: - if (value == null) { - unsetFile(); - } else { - setFile((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case FILE: - return getFile(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case FILE: - return isSetFile(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof startFileCopy_args) - return this.equals((startFileCopy_args)that); - return false; - } - - public boolean equals(startFileCopy_args that) { - if (that == null) - return false; - - boolean this_present_file = true && this.isSetFile(); - boolean that_present_file = true && that.isSetFile(); - if (this_present_file || that_present_file) { - if (!(this_present_file && that_present_file)) - return false; - if (!this.file.equals(that.file)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(startFileCopy_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetFile()).compareTo(other.isSetFile()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFile()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.file, other.file); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("startFileCopy_args("); - boolean first = true; - - sb.append("file:"); - if (this.file == null) { - sb.append("null"); - } else { - sb.append(this.file); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class startFileCopy_argsStandardSchemeFactory implements SchemeFactory { - public startFileCopy_argsStandardScheme getScheme() { - return new startFileCopy_argsStandardScheme(); - } - } - - private static class startFileCopy_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, startFileCopy_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // FILE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.file = iprot.readString(); - struct.setFileIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, startFileCopy_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.file != null) { - oprot.writeFieldBegin(FILE_FIELD_DESC); - oprot.writeString(struct.file); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class startFileCopy_argsTupleSchemeFactory implements SchemeFactory { - public startFileCopy_argsTupleScheme getScheme() { - return new startFileCopy_argsTupleScheme(); - } - } - - private static class startFileCopy_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, startFileCopy_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetFile()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetFile()) { - oprot.writeString(struct.file); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, startFileCopy_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.file = iprot.readString(); - struct.setFileIsSet(true); - } - } - } - - } - - public static class startFileCopy_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startFileCopy_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new startFileCopy_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new startFileCopy_resultTupleSchemeFactory()); - } - - public boolean success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startFileCopy_result.class, metaDataMap); - } - - public startFileCopy_result() { - } - - public startFileCopy_result( - boolean success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public startFileCopy_result(startFileCopy_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; - } - - public startFileCopy_result deepCopy() { - return new startFileCopy_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = false; - } - - public boolean isSuccess() { - return this.success; - } - - public startFileCopy_result setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Boolean.valueOf(isSuccess()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof startFileCopy_result) - return this.equals((startFileCopy_result)that); - return false; - } - - public boolean equals(startFileCopy_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(startFileCopy_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("startFileCopy_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class startFileCopy_resultStandardSchemeFactory implements SchemeFactory { - public startFileCopy_resultStandardScheme getScheme() { - return new startFileCopy_resultStandardScheme(); - } - } - - private static class startFileCopy_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, startFileCopy_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, startFileCopy_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class startFileCopy_resultTupleSchemeFactory implements SchemeFactory { - public startFileCopy_resultTupleScheme getScheme() { - return new startFileCopy_resultTupleScheme(); - } - } - - private static class startFileCopy_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, startFileCopy_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, startFileCopy_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class getImageData_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getImageData_args"); - - private static final org.apache.thrift.protocol.TField IMAGEID_FIELD_DESC = new org.apache.thrift.protocol.TField("imageid", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField IMAGEVERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("imageversion", org.apache.thrift.protocol.TType.STRING, (short)-2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getImageData_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getImageData_argsTupleSchemeFactory()); - } - - public String imageid; // required - public String imageversion; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - IMAGEID((short)-1, "imageid"), - IMAGEVERSION((short)-2, "imageversion"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // IMAGEID - return IMAGEID; - case -2: // IMAGEVERSION - return IMAGEVERSION; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.IMAGEID, new org.apache.thrift.meta_data.FieldMetaData("imageid", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IMAGEVERSION, new org.apache.thrift.meta_data.FieldMetaData("imageversion", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getImageData_args.class, metaDataMap); - } - - public getImageData_args() { - } - - public getImageData_args( - String imageid, - String imageversion) - { - this(); - this.imageid = imageid; - this.imageversion = imageversion; - } - - /** - * Performs a deep copy on other. - */ - public getImageData_args(getImageData_args other) { - if (other.isSetImageid()) { - this.imageid = other.imageid; - } - if (other.isSetImageversion()) { - this.imageversion = other.imageversion; - } - } - - public getImageData_args deepCopy() { - return new getImageData_args(this); - } - - @Override - public void clear() { - this.imageid = null; - this.imageversion = null; - } - - public String getImageid() { - return this.imageid; - } - - public getImageData_args setImageid(String imageid) { - this.imageid = imageid; - return this; - } - - public void unsetImageid() { - this.imageid = null; - } - - /** Returns true if field imageid is set (has been assigned a value) and false otherwise */ - public boolean isSetImageid() { - return this.imageid != null; - } - - public void setImageidIsSet(boolean value) { - if (!value) { - this.imageid = null; - } - } - - public String getImageversion() { - return this.imageversion; - } - - public getImageData_args setImageversion(String imageversion) { - this.imageversion = imageversion; - return this; - } - - public void unsetImageversion() { - this.imageversion = null; - } - - /** Returns true if field imageversion is set (has been assigned a value) and false otherwise */ - public boolean isSetImageversion() { - return this.imageversion != null; - } - - public void setImageversionIsSet(boolean value) { - if (!value) { - this.imageversion = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case IMAGEID: - if (value == null) { - unsetImageid(); - } else { - setImageid((String)value); - } - break; - - case IMAGEVERSION: - if (value == null) { - unsetImageversion(); - } else { - setImageversion((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case IMAGEID: - return getImageid(); - - case IMAGEVERSION: - return getImageversion(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case IMAGEID: - return isSetImageid(); - case IMAGEVERSION: - return isSetImageversion(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getImageData_args) - return this.equals((getImageData_args)that); - return false; - } - - public boolean equals(getImageData_args that) { - if (that == null) - return false; - - boolean this_present_imageid = true && this.isSetImageid(); - boolean that_present_imageid = true && that.isSetImageid(); - if (this_present_imageid || that_present_imageid) { - if (!(this_present_imageid && that_present_imageid)) - return false; - if (!this.imageid.equals(that.imageid)) - return false; - } - - boolean this_present_imageversion = true && this.isSetImageversion(); - boolean that_present_imageversion = true && that.isSetImageversion(); - if (this_present_imageversion || that_present_imageversion) { - if (!(this_present_imageversion && that_present_imageversion)) - return false; - if (!this.imageversion.equals(that.imageversion)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getImageData_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetImageid()).compareTo(other.isSetImageid()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetImageid()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageid, other.imageid); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetImageversion()).compareTo(other.isSetImageversion()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetImageversion()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageversion, other.imageversion); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getImageData_args("); - boolean first = true; - - sb.append("imageid:"); - if (this.imageid == null) { - sb.append("null"); - } else { - sb.append(this.imageid); - } - first = false; - if (!first) sb.append(", "); - sb.append("imageversion:"); - if (this.imageversion == null) { - sb.append("null"); - } else { - sb.append(this.imageversion); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getImageData_argsStandardSchemeFactory implements SchemeFactory { - public getImageData_argsStandardScheme getScheme() { - return new getImageData_argsStandardScheme(); - } - } - - private static class getImageData_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getImageData_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // IMAGEID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.imageid = iprot.readString(); - struct.setImageidIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // IMAGEVERSION - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.imageversion = iprot.readString(); - struct.setImageversionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getImageData_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.imageversion != null) { - oprot.writeFieldBegin(IMAGEVERSION_FIELD_DESC); - oprot.writeString(struct.imageversion); - oprot.writeFieldEnd(); - } - if (struct.imageid != null) { - oprot.writeFieldBegin(IMAGEID_FIELD_DESC); - oprot.writeString(struct.imageid); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getImageData_argsTupleSchemeFactory implements SchemeFactory { - public getImageData_argsTupleScheme getScheme() { - return new getImageData_argsTupleScheme(); - } - } - - private static class getImageData_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getImageData_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetImageid()) { - optionals.set(0); - } - if (struct.isSetImageversion()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetImageid()) { - oprot.writeString(struct.imageid); - } - if (struct.isSetImageversion()) { - oprot.writeString(struct.imageversion); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getImageData_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.imageid = iprot.readString(); - struct.setImageidIsSet(true); - } - if (incoming.get(1)) { - struct.imageversion = iprot.readString(); - struct.setImageversionIsSet(true); - } - } - } - - } - - public static class getImageData_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getImageData_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getImageData_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getImageData_resultTupleSchemeFactory()); - } - - public Map success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getImageData_result.class, metaDataMap); - } - - public getImageData_result() { - } - - public getImageData_result( - Map success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getImageData_result(getImageData_result other) { - if (other.isSetSuccess()) { - Map __this__success = new HashMap(other.success); - this.success = __this__success; - } - } - - public getImageData_result deepCopy() { - return new getImageData_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public void putToSuccess(String key, String val) { - if (this.success == null) { - this.success = new HashMap(); - } - this.success.put(key, val); - } - - public Map getSuccess() { - return this.success; - } - - public getImageData_result setSuccess(Map success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getImageData_result) - return this.equals((getImageData_result)that); - return false; - } - - public boolean equals(getImageData_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getImageData_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getImageData_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getImageData_resultStandardSchemeFactory implements SchemeFactory { - public getImageData_resultStandardScheme getScheme() { - return new getImageData_resultStandardScheme(); - } - } - - private static class getImageData_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getImageData_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map42 = iprot.readMapBegin(); - struct.success = new HashMap(2*_map42.size); - for (int _i43 = 0; _i43 < _map42.size; ++_i43) - { - String _key44; - String _val45; - _key44 = iprot.readString(); - _val45 = iprot.readString(); - struct.success.put(_key44, _val45); - } - iprot.readMapEnd(); - } - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getImageData_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size())); - for (Map.Entry _iter46 : struct.success.entrySet()) - { - oprot.writeString(_iter46.getKey()); - oprot.writeString(_iter46.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getImageData_resultTupleSchemeFactory implements SchemeFactory { - public getImageData_resultTupleScheme getScheme() { - return new getImageData_resultTupleScheme(); - } - } - - private static class getImageData_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getImageData_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (Map.Entry _iter47 : struct.success.entrySet()) - { - oprot.writeString(_iter47.getKey()); - oprot.writeString(_iter47.getValue()); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getImageData_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TMap _map48 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.success = new HashMap(2*_map48.size); - for (int _i49 = 0; _i49 < _map48.size; ++_i49) - { - String _key50; - String _val51; - _key50 = iprot.readString(); - _val51 = iprot.readString(); - struct.success.put(_key50, _val51); - } - } - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class getLectureData_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureData_args"); - - private static final org.apache.thrift.protocol.TField LECTUREID_FIELD_DESC = new org.apache.thrift.protocol.TField("lectureid", org.apache.thrift.protocol.TType.STRING, (short)-1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getLectureData_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getLectureData_argsTupleSchemeFactory()); - } - - public String lectureid; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - LECTUREID((short)-1, "lectureid"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // LECTUREID - return LECTUREID; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.LECTUREID, new org.apache.thrift.meta_data.FieldMetaData("lectureid", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLectureData_args.class, metaDataMap); - } - - public getLectureData_args() { - } - - public getLectureData_args( - String lectureid) - { - this(); - this.lectureid = lectureid; - } - - /** - * Performs a deep copy on other. - */ - public getLectureData_args(getLectureData_args other) { - if (other.isSetLectureid()) { - this.lectureid = other.lectureid; - } - } - - public getLectureData_args deepCopy() { - return new getLectureData_args(this); - } - - @Override - public void clear() { - this.lectureid = null; - } - - public String getLectureid() { - return this.lectureid; - } - - public getLectureData_args setLectureid(String lectureid) { - this.lectureid = lectureid; - return this; - } - - public void unsetLectureid() { - this.lectureid = null; - } - - /** Returns true if field lectureid is set (has been assigned a value) and false otherwise */ - public boolean isSetLectureid() { - return this.lectureid != null; - } - - public void setLectureidIsSet(boolean value) { - if (!value) { - this.lectureid = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case LECTUREID: - if (value == null) { - unsetLectureid(); - } else { - setLectureid((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case LECTUREID: - return getLectureid(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case LECTUREID: - return isSetLectureid(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getLectureData_args) - return this.equals((getLectureData_args)that); - return false; - } - - public boolean equals(getLectureData_args that) { - if (that == null) - return false; - - boolean this_present_lectureid = true && this.isSetLectureid(); - boolean that_present_lectureid = true && that.isSetLectureid(); - if (this_present_lectureid || that_present_lectureid) { - if (!(this_present_lectureid && that_present_lectureid)) - return false; - if (!this.lectureid.equals(that.lectureid)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getLectureData_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetLectureid()).compareTo(other.isSetLectureid()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLectureid()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lectureid, other.lectureid); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getLectureData_args("); - boolean first = true; - - sb.append("lectureid:"); - if (this.lectureid == null) { - sb.append("null"); - } else { - sb.append(this.lectureid); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getLectureData_argsStandardSchemeFactory implements SchemeFactory { - public getLectureData_argsStandardScheme getScheme() { - return new getLectureData_argsStandardScheme(); - } - } - - private static class getLectureData_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureData_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // LECTUREID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.lectureid = iprot.readString(); - struct.setLectureidIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getLectureData_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.lectureid != null) { - oprot.writeFieldBegin(LECTUREID_FIELD_DESC); - oprot.writeString(struct.lectureid); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getLectureData_argsTupleSchemeFactory implements SchemeFactory { - public getLectureData_argsTupleScheme getScheme() { - return new getLectureData_argsTupleScheme(); - } - } - - private static class getLectureData_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getLectureData_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetLectureid()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetLectureid()) { - oprot.writeString(struct.lectureid); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getLectureData_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.lectureid = iprot.readString(); - struct.setLectureidIsSet(true); - } - } - } - - } - - public static class getLectureData_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureData_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getLectureData_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getLectureData_resultTupleSchemeFactory()); - } - - public Map success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLectureData_result.class, metaDataMap); - } - - public getLectureData_result() { - } - - public getLectureData_result( - Map success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getLectureData_result(getLectureData_result other) { - if (other.isSetSuccess()) { - Map __this__success = new HashMap(other.success); - this.success = __this__success; - } - } - - public getLectureData_result deepCopy() { - return new getLectureData_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public void putToSuccess(String key, String val) { - if (this.success == null) { - this.success = new HashMap(); - } - this.success.put(key, val); - } - - public Map getSuccess() { - return this.success; - } - - public getLectureData_result setSuccess(Map success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getLectureData_result) - return this.equals((getLectureData_result)that); - return false; - } - - public boolean equals(getLectureData_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getLectureData_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getLectureData_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class getLectureData_resultStandardSchemeFactory implements SchemeFactory { - public getLectureData_resultStandardScheme getScheme() { - return new getLectureData_resultStandardScheme(); - } - } - - private static class getLectureData_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureData_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map52 = iprot.readMapBegin(); - struct.success = new HashMap(2*_map52.size); - for (int _i53 = 0; _i53 < _map52.size; ++_i53) - { - String _key54; - String _val55; - _key54 = iprot.readString(); - _val55 = iprot.readString(); - struct.success.put(_key54, _val55); - } - iprot.readMapEnd(); - } - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, getLectureData_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size())); - for (Map.Entry _iter56 : struct.success.entrySet()) - { - oprot.writeString(_iter56.getKey()); - oprot.writeString(_iter56.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getLectureData_resultTupleSchemeFactory implements SchemeFactory { - public getLectureData_resultTupleScheme getScheme() { - return new getLectureData_resultTupleScheme(); - } - } - - private static class getLectureData_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getLectureData_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (Map.Entry _iter57 : struct.success.entrySet()) - { - oprot.writeString(_iter57.getKey()); - oprot.writeString(_iter57.getValue()); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getLectureData_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TMap _map58 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.success = new HashMap(2*_map58.size); - for (int _i59 = 0; _i59 < _map58.size; ++_i59) - { - String _key60; - String _val61; - _key60 = iprot.readString(); - _val61 = iprot.readString(); - struct.success.put(_key60, _val61); - } - } - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class updateImageData_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateImageData_args"); - - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField NEW_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("newName", org.apache.thrift.protocol.TType.STRING, (short)-2); - private static final org.apache.thrift.protocol.TField DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("desc", org.apache.thrift.protocol.TType.STRING, (short)-3); - private static final org.apache.thrift.protocol.TField IMAGE_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("image_path", org.apache.thrift.protocol.TType.STRING, (short)-4); - private static final org.apache.thrift.protocol.TField LICENSE_FIELD_DESC = new org.apache.thrift.protocol.TField("license", org.apache.thrift.protocol.TType.BOOL, (short)-5); - private static final org.apache.thrift.protocol.TField INTERNET_FIELD_DESC = new org.apache.thrift.protocol.TField("internet", org.apache.thrift.protocol.TType.BOOL, (short)-6); - private static final org.apache.thrift.protocol.TField RAM_FIELD_DESC = new org.apache.thrift.protocol.TField("ram", org.apache.thrift.protocol.TType.I64, (short)-7); - private static final org.apache.thrift.protocol.TField CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("cpu", org.apache.thrift.protocol.TType.I64, (short)-8); - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-9); - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-10); - private static final org.apache.thrift.protocol.TField IS_TEMPLATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isTemplate", org.apache.thrift.protocol.TType.BOOL, (short)-11); - private static final org.apache.thrift.protocol.TField FILESIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("filesize", org.apache.thrift.protocol.TType.I64, (short)-12); - private static final org.apache.thrift.protocol.TField SHARE_MODE_FIELD_DESC = new org.apache.thrift.protocol.TField("shareMode", org.apache.thrift.protocol.TType.I64, (short)-13); - private static final org.apache.thrift.protocol.TField OS_FIELD_DESC = new org.apache.thrift.protocol.TField("os", org.apache.thrift.protocol.TType.STRING, (short)-14); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new updateImageData_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new updateImageData_argsTupleSchemeFactory()); - } - - public String name; // required - public String newName; // required - public String desc; // required - public String image_path; // required - public boolean license; // required - public boolean internet; // required - public long ram; // required - public long cpu; // required - public String id; // required - public String version; // required - public boolean isTemplate; // required - public long filesize; // required - public long shareMode; // required - public String os; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NAME((short)-1, "name"), - NEW_NAME((short)-2, "newName"), - DESC((short)-3, "desc"), - IMAGE_PATH((short)-4, "image_path"), - LICENSE((short)-5, "license"), - INTERNET((short)-6, "internet"), - RAM((short)-7, "ram"), - CPU((short)-8, "cpu"), - ID((short)-9, "id"), - VERSION((short)-10, "version"), - IS_TEMPLATE((short)-11, "isTemplate"), - FILESIZE((short)-12, "filesize"), - SHARE_MODE((short)-13, "shareMode"), - OS((short)-14, "os"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // NAME - return NAME; - case -2: // NEW_NAME - return NEW_NAME; - case -3: // DESC - return DESC; - case -4: // IMAGE_PATH - return IMAGE_PATH; - case -5: // LICENSE - return LICENSE; - case -6: // INTERNET - return INTERNET; - case -7: // RAM - return RAM; - case -8: // CPU - return CPU; - case -9: // ID - return ID; - case -10: // VERSION - return VERSION; - case -11: // IS_TEMPLATE - return IS_TEMPLATE; - case -12: // FILESIZE - return FILESIZE; - case -13: // SHARE_MODE - return SHARE_MODE; - case -14: // OS - return OS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __LICENSE_ISSET_ID = 0; - private static final int __INTERNET_ISSET_ID = 1; - private static final int __RAM_ISSET_ID = 2; - private static final int __CPU_ISSET_ID = 3; - private static final int __ISTEMPLATE_ISSET_ID = 4; - private static final int __FILESIZE_ISSET_ID = 5; - private static final int __SHAREMODE_ISSET_ID = 6; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.NEW_NAME, new org.apache.thrift.meta_data.FieldMetaData("newName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.DESC, new org.apache.thrift.meta_data.FieldMetaData("desc", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IMAGE_PATH, new org.apache.thrift.meta_data.FieldMetaData("image_path", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.LICENSE, new org.apache.thrift.meta_data.FieldMetaData("license", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.INTERNET, new org.apache.thrift.meta_data.FieldMetaData("internet", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.RAM, new org.apache.thrift.meta_data.FieldMetaData("ram", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int"))); - tmpMap.put(_Fields.CPU, new org.apache.thrift.meta_data.FieldMetaData("cpu", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int"))); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IS_TEMPLATE, new org.apache.thrift.meta_data.FieldMetaData("isTemplate", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.FILESIZE, new org.apache.thrift.meta_data.FieldMetaData("filesize", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.SHARE_MODE, new org.apache.thrift.meta_data.FieldMetaData("shareMode", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int"))); - tmpMap.put(_Fields.OS, new org.apache.thrift.meta_data.FieldMetaData("os", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateImageData_args.class, metaDataMap); - } - - public updateImageData_args() { - } - - public updateImageData_args( - String name, - String newName, - String desc, - String image_path, - boolean license, - boolean internet, - long ram, - long cpu, - String id, - String version, - boolean isTemplate, - long filesize, - long shareMode, - String os) - { - this(); - this.name = name; - this.newName = newName; - this.desc = desc; - this.image_path = image_path; - this.license = license; - setLicenseIsSet(true); - this.internet = internet; - setInternetIsSet(true); - this.ram = ram; - setRamIsSet(true); - this.cpu = cpu; - setCpuIsSet(true); - this.id = id; - this.version = version; - this.isTemplate = isTemplate; - setIsTemplateIsSet(true); - this.filesize = filesize; - setFilesizeIsSet(true); - this.shareMode = shareMode; - setShareModeIsSet(true); - this.os = os; - } - - /** - * Performs a deep copy on other. - */ - public updateImageData_args(updateImageData_args other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetName()) { - this.name = other.name; - } - if (other.isSetNewName()) { - this.newName = other.newName; - } - if (other.isSetDesc()) { - this.desc = other.desc; - } - if (other.isSetImage_path()) { - this.image_path = other.image_path; - } - this.license = other.license; - this.internet = other.internet; - this.ram = other.ram; - this.cpu = other.cpu; - if (other.isSetId()) { - this.id = other.id; - } - if (other.isSetVersion()) { - this.version = other.version; - } - this.isTemplate = other.isTemplate; - this.filesize = other.filesize; - this.shareMode = other.shareMode; - if (other.isSetOs()) { - this.os = other.os; - } - } - - public updateImageData_args deepCopy() { - return new updateImageData_args(this); - } - - @Override - public void clear() { - this.name = null; - this.newName = null; - this.desc = null; - this.image_path = null; - setLicenseIsSet(false); - this.license = false; - setInternetIsSet(false); - this.internet = false; - setRamIsSet(false); - this.ram = 0; - setCpuIsSet(false); - this.cpu = 0; - this.id = null; - this.version = null; - setIsTemplateIsSet(false); - this.isTemplate = false; - setFilesizeIsSet(false); - this.filesize = 0; - setShareModeIsSet(false); - this.shareMode = 0; - this.os = null; - } - - public String getName() { - return this.name; - } - - public updateImageData_args setName(String name) { - this.name = name; - return this; - } - - public void unsetName() { - this.name = null; - } - - /** Returns true if field name is set (has been assigned a value) and false otherwise */ - public boolean isSetName() { - return this.name != null; - } - - public void setNameIsSet(boolean value) { - if (!value) { - this.name = null; - } - } - - public String getNewName() { - return this.newName; - } - - public updateImageData_args setNewName(String newName) { - this.newName = newName; - return this; - } - - public void unsetNewName() { - this.newName = null; - } - - /** Returns true if field newName is set (has been assigned a value) and false otherwise */ - public boolean isSetNewName() { - return this.newName != null; - } - - public void setNewNameIsSet(boolean value) { - if (!value) { - this.newName = null; - } - } - - public String getDesc() { - return this.desc; - } - - public updateImageData_args setDesc(String desc) { - this.desc = desc; - return this; - } - - public void unsetDesc() { - this.desc = null; - } - - /** Returns true if field desc is set (has been assigned a value) and false otherwise */ - public boolean isSetDesc() { - return this.desc != null; - } - - public void setDescIsSet(boolean value) { - if (!value) { - this.desc = null; - } - } - - public String getImage_path() { - return this.image_path; - } - - public updateImageData_args setImage_path(String image_path) { - this.image_path = image_path; - return this; - } - - public void unsetImage_path() { - this.image_path = null; - } - - /** Returns true if field image_path is set (has been assigned a value) and false otherwise */ - public boolean isSetImage_path() { - return this.image_path != null; - } - - public void setImage_pathIsSet(boolean value) { - if (!value) { - this.image_path = null; - } - } - - public boolean isLicense() { - return this.license; - } - - public updateImageData_args setLicense(boolean license) { - this.license = license; - setLicenseIsSet(true); - return this; - } - - public void unsetLicense() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LICENSE_ISSET_ID); - } - - /** Returns true if field license is set (has been assigned a value) and false otherwise */ - public boolean isSetLicense() { - return EncodingUtils.testBit(__isset_bitfield, __LICENSE_ISSET_ID); - } - - public void setLicenseIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LICENSE_ISSET_ID, value); - } - - public boolean isInternet() { - return this.internet; - } - - public updateImageData_args setInternet(boolean internet) { - this.internet = internet; - setInternetIsSet(true); - return this; - } - - public void unsetInternet() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INTERNET_ISSET_ID); - } - - /** Returns true if field internet is set (has been assigned a value) and false otherwise */ - public boolean isSetInternet() { - return EncodingUtils.testBit(__isset_bitfield, __INTERNET_ISSET_ID); - } - - public void setInternetIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INTERNET_ISSET_ID, value); - } - - public long getRam() { - return this.ram; - } - - public updateImageData_args setRam(long ram) { - this.ram = ram; - setRamIsSet(true); - return this; - } - - public void unsetRam() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RAM_ISSET_ID); - } - - /** Returns true if field ram is set (has been assigned a value) and false otherwise */ - public boolean isSetRam() { - return EncodingUtils.testBit(__isset_bitfield, __RAM_ISSET_ID); - } - - public void setRamIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RAM_ISSET_ID, value); - } - - public long getCpu() { - return this.cpu; - } - - public updateImageData_args setCpu(long cpu) { - this.cpu = cpu; - setCpuIsSet(true); - return this; - } - - public void unsetCpu() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CPU_ISSET_ID); - } - - /** Returns true if field cpu is set (has been assigned a value) and false otherwise */ - public boolean isSetCpu() { - return EncodingUtils.testBit(__isset_bitfield, __CPU_ISSET_ID); - } - - public void setCpuIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CPU_ISSET_ID, value); - } - - public String getId() { - return this.id; - } - - public updateImageData_args setId(String id) { - this.id = id; - return this; - } - - public void unsetId() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean isSetId() { - return this.id != null; - } - - public void setIdIsSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public String getVersion() { - return this.version; - } - - public updateImageData_args setVersion(String version) { - this.version = version; - return this; - } - - public void unsetVersion() { - this.version = null; - } - - /** Returns true if field version is set (has been assigned a value) and false otherwise */ - public boolean isSetVersion() { - return this.version != null; - } - - public void setVersionIsSet(boolean value) { - if (!value) { - this.version = null; - } - } - - public boolean isIsTemplate() { - return this.isTemplate; - } - - public updateImageData_args setIsTemplate(boolean isTemplate) { - this.isTemplate = isTemplate; - setIsTemplateIsSet(true); - return this; - } - - public void unsetIsTemplate() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID); - } - - /** Returns true if field isTemplate is set (has been assigned a value) and false otherwise */ - public boolean isSetIsTemplate() { - return EncodingUtils.testBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID); - } - - public void setIsTemplateIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID, value); - } - - public long getFilesize() { - return this.filesize; - } - - public updateImageData_args setFilesize(long filesize) { - this.filesize = filesize; - setFilesizeIsSet(true); - return this; - } - - public void unsetFilesize() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILESIZE_ISSET_ID); - } - - /** Returns true if field filesize is set (has been assigned a value) and false otherwise */ - public boolean isSetFilesize() { - return EncodingUtils.testBit(__isset_bitfield, __FILESIZE_ISSET_ID); - } - - public void setFilesizeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILESIZE_ISSET_ID, value); - } - - public long getShareMode() { - return this.shareMode; - } - - public updateImageData_args setShareMode(long shareMode) { - this.shareMode = shareMode; - setShareModeIsSet(true); - return this; - } - - public void unsetShareMode() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SHAREMODE_ISSET_ID); - } - - /** Returns true if field shareMode is set (has been assigned a value) and false otherwise */ - public boolean isSetShareMode() { - return EncodingUtils.testBit(__isset_bitfield, __SHAREMODE_ISSET_ID); - } - - public void setShareModeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SHAREMODE_ISSET_ID, value); - } - - public String getOs() { - return this.os; - } - - public updateImageData_args setOs(String os) { - this.os = os; - return this; - } - - public void unsetOs() { - this.os = null; - } - - /** Returns true if field os is set (has been assigned a value) and false otherwise */ - public boolean isSetOs() { - return this.os != null; - } - - public void setOsIsSet(boolean value) { - if (!value) { - this.os = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NAME: - if (value == null) { - unsetName(); - } else { - setName((String)value); - } - break; - - case NEW_NAME: - if (value == null) { - unsetNewName(); - } else { - setNewName((String)value); - } - break; - - case DESC: - if (value == null) { - unsetDesc(); - } else { - setDesc((String)value); - } - break; - - case IMAGE_PATH: - if (value == null) { - unsetImage_path(); - } else { - setImage_path((String)value); - } - break; - - case LICENSE: - if (value == null) { - unsetLicense(); - } else { - setLicense((Boolean)value); - } - break; - - case INTERNET: - if (value == null) { - unsetInternet(); - } else { - setInternet((Boolean)value); - } - break; - - case RAM: - if (value == null) { - unsetRam(); - } else { - setRam((Long)value); - } - break; - - case CPU: - if (value == null) { - unsetCpu(); - } else { - setCpu((Long)value); - } - break; - - case ID: - if (value == null) { - unsetId(); - } else { - setId((String)value); - } - break; - - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((String)value); - } - break; - - case IS_TEMPLATE: - if (value == null) { - unsetIsTemplate(); - } else { - setIsTemplate((Boolean)value); - } - break; - - case FILESIZE: - if (value == null) { - unsetFilesize(); - } else { - setFilesize((Long)value); - } - break; - - case SHARE_MODE: - if (value == null) { - unsetShareMode(); - } else { - setShareMode((Long)value); - } - break; - - case OS: - if (value == null) { - unsetOs(); - } else { - setOs((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NAME: - return getName(); - - case NEW_NAME: - return getNewName(); - - case DESC: - return getDesc(); - - case IMAGE_PATH: - return getImage_path(); - - case LICENSE: - return Boolean.valueOf(isLicense()); - - case INTERNET: - return Boolean.valueOf(isInternet()); - - case RAM: - return Long.valueOf(getRam()); - - case CPU: - return Long.valueOf(getCpu()); - - case ID: - return getId(); - - case VERSION: - return getVersion(); - - case IS_TEMPLATE: - return Boolean.valueOf(isIsTemplate()); - - case FILESIZE: - return Long.valueOf(getFilesize()); - - case SHARE_MODE: - return Long.valueOf(getShareMode()); - - case OS: - return getOs(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case NAME: - return isSetName(); - case NEW_NAME: - return isSetNewName(); - case DESC: - return isSetDesc(); - case IMAGE_PATH: - return isSetImage_path(); - case LICENSE: - return isSetLicense(); - case INTERNET: - return isSetInternet(); - case RAM: - return isSetRam(); - case CPU: - return isSetCpu(); - case ID: - return isSetId(); - case VERSION: - return isSetVersion(); - case IS_TEMPLATE: - return isSetIsTemplate(); - case FILESIZE: - return isSetFilesize(); - case SHARE_MODE: - return isSetShareMode(); - case OS: - return isSetOs(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof updateImageData_args) - return this.equals((updateImageData_args)that); - return false; - } - - public boolean equals(updateImageData_args that) { - if (that == null) - return false; - - boolean this_present_name = true && this.isSetName(); - boolean that_present_name = true && that.isSetName(); - if (this_present_name || that_present_name) { - if (!(this_present_name && that_present_name)) - return false; - if (!this.name.equals(that.name)) - return false; - } - - boolean this_present_newName = true && this.isSetNewName(); - boolean that_present_newName = true && that.isSetNewName(); - if (this_present_newName || that_present_newName) { - if (!(this_present_newName && that_present_newName)) - return false; - if (!this.newName.equals(that.newName)) - return false; - } - - boolean this_present_desc = true && this.isSetDesc(); - boolean that_present_desc = true && that.isSetDesc(); - if (this_present_desc || that_present_desc) { - if (!(this_present_desc && that_present_desc)) - return false; - if (!this.desc.equals(that.desc)) - return false; - } - - boolean this_present_image_path = true && this.isSetImage_path(); - boolean that_present_image_path = true && that.isSetImage_path(); - if (this_present_image_path || that_present_image_path) { - if (!(this_present_image_path && that_present_image_path)) - return false; - if (!this.image_path.equals(that.image_path)) - return false; - } - - boolean this_present_license = true; - boolean that_present_license = true; - if (this_present_license || that_present_license) { - if (!(this_present_license && that_present_license)) - return false; - if (this.license != that.license) - return false; - } - - boolean this_present_internet = true; - boolean that_present_internet = true; - if (this_present_internet || that_present_internet) { - if (!(this_present_internet && that_present_internet)) - return false; - if (this.internet != that.internet) - return false; - } - - boolean this_present_ram = true; - boolean that_present_ram = true; - if (this_present_ram || that_present_ram) { - if (!(this_present_ram && that_present_ram)) - return false; - if (this.ram != that.ram) - return false; - } - - boolean this_present_cpu = true; - boolean that_present_cpu = true; - if (this_present_cpu || that_present_cpu) { - if (!(this_present_cpu && that_present_cpu)) - return false; - if (this.cpu != that.cpu) - return false; - } - - boolean this_present_id = true && this.isSetId(); - boolean that_present_id = true && that.isSetId(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - boolean this_present_version = true && this.isSetVersion(); - boolean that_present_version = true && that.isSetVersion(); - if (this_present_version || that_present_version) { - if (!(this_present_version && that_present_version)) - return false; - if (!this.version.equals(that.version)) - return false; - } - - boolean this_present_isTemplate = true; - boolean that_present_isTemplate = true; - if (this_present_isTemplate || that_present_isTemplate) { - if (!(this_present_isTemplate && that_present_isTemplate)) - return false; - if (this.isTemplate != that.isTemplate) - return false; - } - - boolean this_present_filesize = true; - boolean that_present_filesize = true; - if (this_present_filesize || that_present_filesize) { - if (!(this_present_filesize && that_present_filesize)) - return false; - if (this.filesize != that.filesize) - return false; - } - - boolean this_present_shareMode = true; - boolean that_present_shareMode = true; - if (this_present_shareMode || that_present_shareMode) { - if (!(this_present_shareMode && that_present_shareMode)) - return false; - if (this.shareMode != that.shareMode) - return false; - } - - boolean this_present_os = true && this.isSetOs(); - boolean that_present_os = true && that.isSetOs(); - if (this_present_os || that_present_os) { - if (!(this_present_os && that_present_os)) - return false; - if (!this.os.equals(that.os)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(updateImageData_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNewName()).compareTo(other.isSetNewName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNewName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.newName, other.newName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDesc()).compareTo(other.isSetDesc()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDesc()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.desc, other.desc); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetImage_path()).compareTo(other.isSetImage_path()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetImage_path()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.image_path, other.image_path); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLicense()).compareTo(other.isSetLicense()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLicense()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.license, other.license); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetInternet()).compareTo(other.isSetInternet()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetInternet()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internet, other.internet); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRam()).compareTo(other.isSetRam()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRam()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ram, other.ram); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetCpu()).compareTo(other.isSetCpu()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCpu()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cpu, other.cpu); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetVersion()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIsTemplate()).compareTo(other.isSetIsTemplate()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIsTemplate()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isTemplate, other.isTemplate); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFilesize()).compareTo(other.isSetFilesize()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFilesize()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filesize, other.filesize); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetShareMode()).compareTo(other.isSetShareMode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetShareMode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shareMode, other.shareMode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOs()).compareTo(other.isSetOs()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.os, other.os); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("updateImageData_args("); - boolean first = true; - - sb.append("name:"); - if (this.name == null) { - sb.append("null"); - } else { - sb.append(this.name); - } - first = false; - if (!first) sb.append(", "); - sb.append("newName:"); - if (this.newName == null) { - sb.append("null"); - } else { - sb.append(this.newName); - } - first = false; - if (!first) sb.append(", "); - sb.append("desc:"); - if (this.desc == null) { - sb.append("null"); - } else { - sb.append(this.desc); - } - first = false; - if (!first) sb.append(", "); - sb.append("image_path:"); - if (this.image_path == null) { - sb.append("null"); - } else { - sb.append(this.image_path); - } - first = false; - if (!first) sb.append(", "); - sb.append("license:"); - sb.append(this.license); - first = false; - if (!first) sb.append(", "); - sb.append("internet:"); - sb.append(this.internet); - first = false; - if (!first) sb.append(", "); - sb.append("ram:"); - sb.append(this.ram); - first = false; - if (!first) sb.append(", "); - sb.append("cpu:"); - sb.append(this.cpu); - first = false; - if (!first) sb.append(", "); - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - if (!first) sb.append(", "); - sb.append("version:"); - if (this.version == null) { - sb.append("null"); - } else { - sb.append(this.version); - } - first = false; - if (!first) sb.append(", "); - sb.append("isTemplate:"); - sb.append(this.isTemplate); - first = false; - if (!first) sb.append(", "); - sb.append("filesize:"); - sb.append(this.filesize); - first = false; - if (!first) sb.append(", "); - sb.append("shareMode:"); - sb.append(this.shareMode); - first = false; - if (!first) sb.append(", "); - sb.append("os:"); - if (this.os == null) { - sb.append("null"); - } else { - sb.append(this.os); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class updateImageData_argsStandardSchemeFactory implements SchemeFactory { - public updateImageData_argsStandardScheme getScheme() { - return new updateImageData_argsStandardScheme(); - } - } - - private static class updateImageData_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, updateImageData_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.name = iprot.readString(); - struct.setNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // NEW_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.newName = iprot.readString(); - struct.setNewNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -3: // DESC - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.desc = iprot.readString(); - struct.setDescIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -4: // IMAGE_PATH - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.image_path = iprot.readString(); - struct.setImage_pathIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -5: // LICENSE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.license = iprot.readBool(); - struct.setLicenseIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -6: // INTERNET - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.internet = iprot.readBool(); - struct.setInternetIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -7: // RAM - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.ram = iprot.readI64(); - struct.setRamIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -8: // CPU - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.cpu = iprot.readI64(); - struct.setCpuIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -9: // ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -10: // VERSION - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.version = iprot.readString(); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -11: // IS_TEMPLATE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.isTemplate = iprot.readBool(); - struct.setIsTemplateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -12: // FILESIZE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.filesize = iprot.readI64(); - struct.setFilesizeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -13: // SHARE_MODE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.shareMode = iprot.readI64(); - struct.setShareModeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -14: // OS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.os = iprot.readString(); - struct.setOsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, updateImageData_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.os != null) { - oprot.writeFieldBegin(OS_FIELD_DESC); - oprot.writeString(struct.os); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(SHARE_MODE_FIELD_DESC); - oprot.writeI64(struct.shareMode); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(FILESIZE_FIELD_DESC); - oprot.writeI64(struct.filesize); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(IS_TEMPLATE_FIELD_DESC); - oprot.writeBool(struct.isTemplate); - oprot.writeFieldEnd(); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeString(struct.version); - oprot.writeFieldEnd(); - } - if (struct.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(struct.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(CPU_FIELD_DESC); - oprot.writeI64(struct.cpu); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(RAM_FIELD_DESC); - oprot.writeI64(struct.ram); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(INTERNET_FIELD_DESC); - oprot.writeBool(struct.internet); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(LICENSE_FIELD_DESC); - oprot.writeBool(struct.license); - oprot.writeFieldEnd(); - if (struct.image_path != null) { - oprot.writeFieldBegin(IMAGE_PATH_FIELD_DESC); - oprot.writeString(struct.image_path); - oprot.writeFieldEnd(); - } - if (struct.desc != null) { - oprot.writeFieldBegin(DESC_FIELD_DESC); - oprot.writeString(struct.desc); - oprot.writeFieldEnd(); - } - if (struct.newName != null) { - oprot.writeFieldBegin(NEW_NAME_FIELD_DESC); - oprot.writeString(struct.newName); - oprot.writeFieldEnd(); - } - if (struct.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(struct.name); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class updateImageData_argsTupleSchemeFactory implements SchemeFactory { - public updateImageData_argsTupleScheme getScheme() { - return new updateImageData_argsTupleScheme(); - } - } - - private static class updateImageData_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, updateImageData_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetName()) { - optionals.set(0); - } - if (struct.isSetNewName()) { - optionals.set(1); - } - if (struct.isSetDesc()) { - optionals.set(2); - } - if (struct.isSetImage_path()) { - optionals.set(3); - } - if (struct.isSetLicense()) { - optionals.set(4); - } - if (struct.isSetInternet()) { - optionals.set(5); - } - if (struct.isSetRam()) { - optionals.set(6); - } - if (struct.isSetCpu()) { - optionals.set(7); - } - if (struct.isSetId()) { - optionals.set(8); - } - if (struct.isSetVersion()) { - optionals.set(9); - } - if (struct.isSetIsTemplate()) { - optionals.set(10); - } - if (struct.isSetFilesize()) { - optionals.set(11); - } - if (struct.isSetShareMode()) { - optionals.set(12); - } - if (struct.isSetOs()) { - optionals.set(13); - } - oprot.writeBitSet(optionals, 14); - if (struct.isSetName()) { - oprot.writeString(struct.name); - } - if (struct.isSetNewName()) { - oprot.writeString(struct.newName); - } - if (struct.isSetDesc()) { - oprot.writeString(struct.desc); - } - if (struct.isSetImage_path()) { - oprot.writeString(struct.image_path); - } - if (struct.isSetLicense()) { - oprot.writeBool(struct.license); - } - if (struct.isSetInternet()) { - oprot.writeBool(struct.internet); - } - if (struct.isSetRam()) { - oprot.writeI64(struct.ram); - } - if (struct.isSetCpu()) { - oprot.writeI64(struct.cpu); - } - if (struct.isSetId()) { - oprot.writeString(struct.id); - } - if (struct.isSetVersion()) { - oprot.writeString(struct.version); - } - if (struct.isSetIsTemplate()) { - oprot.writeBool(struct.isTemplate); - } - if (struct.isSetFilesize()) { - oprot.writeI64(struct.filesize); - } - if (struct.isSetShareMode()) { - oprot.writeI64(struct.shareMode); - } - if (struct.isSetOs()) { - oprot.writeString(struct.os); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, updateImageData_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(14); - if (incoming.get(0)) { - struct.name = iprot.readString(); - struct.setNameIsSet(true); - } - if (incoming.get(1)) { - struct.newName = iprot.readString(); - struct.setNewNameIsSet(true); - } - if (incoming.get(2)) { - struct.desc = iprot.readString(); - struct.setDescIsSet(true); - } - if (incoming.get(3)) { - struct.image_path = iprot.readString(); - struct.setImage_pathIsSet(true); - } - if (incoming.get(4)) { - struct.license = iprot.readBool(); - struct.setLicenseIsSet(true); - } - if (incoming.get(5)) { - struct.internet = iprot.readBool(); - struct.setInternetIsSet(true); - } - if (incoming.get(6)) { - struct.ram = iprot.readI64(); - struct.setRamIsSet(true); - } - if (incoming.get(7)) { - struct.cpu = iprot.readI64(); - struct.setCpuIsSet(true); - } - if (incoming.get(8)) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } - if (incoming.get(9)) { - struct.version = iprot.readString(); - struct.setVersionIsSet(true); - } - if (incoming.get(10)) { - struct.isTemplate = iprot.readBool(); - struct.setIsTemplateIsSet(true); - } - if (incoming.get(11)) { - struct.filesize = iprot.readI64(); - struct.setFilesizeIsSet(true); - } - if (incoming.get(12)) { - struct.shareMode = iprot.readI64(); - struct.setShareModeIsSet(true); - } - if (incoming.get(13)) { - struct.os = iprot.readString(); - struct.setOsIsSet(true); - } - } - } - - } - - public static class updateImageData_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateImageData_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new updateImageData_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new updateImageData_resultTupleSchemeFactory()); - } - - public boolean success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateImageData_result.class, metaDataMap); - } - - public updateImageData_result() { - } - - public updateImageData_result( - boolean success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public updateImageData_result(updateImageData_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; - } - - public updateImageData_result deepCopy() { - return new updateImageData_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = false; - } - - public boolean isSuccess() { - return this.success; - } - - public updateImageData_result setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Boolean.valueOf(isSuccess()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof updateImageData_result) - return this.equals((updateImageData_result)that); - return false; - } - - public boolean equals(updateImageData_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(updateImageData_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("updateImageData_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class updateImageData_resultStandardSchemeFactory implements SchemeFactory { - public updateImageData_resultStandardScheme getScheme() { - return new updateImageData_resultStandardScheme(); - } - } - - private static class updateImageData_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, updateImageData_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, updateImageData_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class updateImageData_resultTupleSchemeFactory implements SchemeFactory { - public updateImageData_resultTupleScheme getScheme() { - return new updateImageData_resultTupleScheme(); - } - } - - private static class updateImageData_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, updateImageData_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, updateImageData_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class deleteImageData_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageData_args"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new deleteImageData_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new deleteImageData_argsTupleSchemeFactory()); - } - - public String id; // required - public String version; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - ID((short)-1, "id"), - VERSION((short)-2, "version"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // ID - return ID; - case -2: // VERSION - return VERSION; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteImageData_args.class, metaDataMap); - } - - public deleteImageData_args() { - } - - public deleteImageData_args( - String id, - String version) - { - this(); - this.id = id; - this.version = version; - } - - /** - * Performs a deep copy on other. - */ - public deleteImageData_args(deleteImageData_args other) { - if (other.isSetId()) { - this.id = other.id; - } - if (other.isSetVersion()) { - this.version = other.version; - } - } - - public deleteImageData_args deepCopy() { - return new deleteImageData_args(this); - } - - @Override - public void clear() { - this.id = null; - this.version = null; - } - - public String getId() { - return this.id; - } - - public deleteImageData_args setId(String id) { - this.id = id; - return this; - } - - public void unsetId() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean isSetId() { - return this.id != null; - } - - public void setIdIsSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public String getVersion() { - return this.version; - } - - public deleteImageData_args setVersion(String version) { - this.version = version; - return this; - } - - public void unsetVersion() { - this.version = null; - } - - /** Returns true if field version is set (has been assigned a value) and false otherwise */ - public boolean isSetVersion() { - return this.version != null; - } - - public void setVersionIsSet(boolean value) { - if (!value) { - this.version = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unsetId(); - } else { - setId((String)value); - } - break; - - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return getId(); - - case VERSION: - return getVersion(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case ID: - return isSetId(); - case VERSION: - return isSetVersion(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof deleteImageData_args) - return this.equals((deleteImageData_args)that); - return false; - } - - public boolean equals(deleteImageData_args that) { - if (that == null) - return false; - - boolean this_present_id = true && this.isSetId(); - boolean that_present_id = true && that.isSetId(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - boolean this_present_version = true && this.isSetVersion(); - boolean that_present_version = true && that.isSetVersion(); - if (this_present_version || that_present_version) { - if (!(this_present_version && that_present_version)) - return false; - if (!this.version.equals(that.version)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(deleteImageData_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetVersion()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("deleteImageData_args("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - if (!first) sb.append(", "); - sb.append("version:"); - if (this.version == null) { - sb.append("null"); - } else { - sb.append(this.version); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class deleteImageData_argsStandardSchemeFactory implements SchemeFactory { - public deleteImageData_argsStandardScheme getScheme() { - return new deleteImageData_argsStandardScheme(); - } - } - - private static class deleteImageData_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageData_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // VERSION - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.version = iprot.readString(); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, deleteImageData_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeString(struct.version); - oprot.writeFieldEnd(); - } - if (struct.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(struct.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class deleteImageData_argsTupleSchemeFactory implements SchemeFactory { - public deleteImageData_argsTupleScheme getScheme() { - return new deleteImageData_argsTupleScheme(); - } - } - - private static class deleteImageData_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageData_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetId()) { - optionals.set(0); - } - if (struct.isSetVersion()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetId()) { - oprot.writeString(struct.id); - } - if (struct.isSetVersion()) { - oprot.writeString(struct.version); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageData_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } - if (incoming.get(1)) { - struct.version = iprot.readString(); - struct.setVersionIsSet(true); - } - } - } - - } - - public static class deleteImageData_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageData_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new deleteImageData_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new deleteImageData_resultTupleSchemeFactory()); - } - - public boolean success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteImageData_result.class, metaDataMap); - } - - public deleteImageData_result() { - } - - public deleteImageData_result( - boolean success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public deleteImageData_result(deleteImageData_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; - } - - public deleteImageData_result deepCopy() { - return new deleteImageData_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = false; - } - - public boolean isSuccess() { - return this.success; - } - - public deleteImageData_result setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Boolean.valueOf(isSuccess()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof deleteImageData_result) - return this.equals((deleteImageData_result)that); - return false; - } - - public boolean equals(deleteImageData_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(deleteImageData_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("deleteImageData_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class deleteImageData_resultStandardSchemeFactory implements SchemeFactory { - public deleteImageData_resultStandardScheme getScheme() { - return new deleteImageData_resultStandardScheme(); - } - } - - private static class deleteImageData_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageData_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, deleteImageData_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class deleteImageData_resultTupleSchemeFactory implements SchemeFactory { - public deleteImageData_resultTupleScheme getScheme() { - return new deleteImageData_resultTupleScheme(); - } - } - - private static class deleteImageData_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageData_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageData_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class updateLecturedata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateLecturedata_args"); - - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField NEW_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("newName", org.apache.thrift.protocol.TType.STRING, (short)-2); - private static final org.apache.thrift.protocol.TField SHORTDESC_FIELD_DESC = new org.apache.thrift.protocol.TField("shortdesc", org.apache.thrift.protocol.TType.STRING, (short)-3); - private static final org.apache.thrift.protocol.TField DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("desc", org.apache.thrift.protocol.TType.STRING, (short)-4); - private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.STRING, (short)-5); - private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.STRING, (short)-6); - private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.BOOL, (short)-7); - private static final org.apache.thrift.protocol.TField IMAGEID_FIELD_DESC = new org.apache.thrift.protocol.TField("imageid", org.apache.thrift.protocol.TType.STRING, (short)-8); - private static final org.apache.thrift.protocol.TField IMAGEVERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("imageversion", org.apache.thrift.protocol.TType.STRING, (short)-9); - private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRING, (short)-10); - private static final org.apache.thrift.protocol.TField FIRSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstname", org.apache.thrift.protocol.TType.STRING, (short)-11); - private static final org.apache.thrift.protocol.TField LASTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastname", org.apache.thrift.protocol.TType.STRING, (short)-12); - private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-13); - private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("Mail", org.apache.thrift.protocol.TType.STRING, (short)-14); - private static final org.apache.thrift.protocol.TField TEL_FIELD_DESC = new org.apache.thrift.protocol.TField("Tel", org.apache.thrift.protocol.TType.STRING, (short)-15); - private static final org.apache.thrift.protocol.TField FAK_FIELD_DESC = new org.apache.thrift.protocol.TField("Fak", org.apache.thrift.protocol.TType.STRING, (short)-16); - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-17); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new updateLecturedata_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new updateLecturedata_argsTupleSchemeFactory()); - } - - public String name; // required - public String newName; // required - public String shortdesc; // required - public String desc; // required - public String startDate; // required - public String endDate; // required - public boolean isActive; // required - public String imageid; // required - public String imageversion; // required - public String user; // required - public String firstname; // required - public String lastname; // required - public String university; // required - public String Mail; // required - public String Tel; // required - public String Fak; // required - public String id; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NAME((short)-1, "name"), - NEW_NAME((short)-2, "newName"), - SHORTDESC((short)-3, "shortdesc"), - DESC((short)-4, "desc"), - START_DATE((short)-5, "startDate"), - END_DATE((short)-6, "endDate"), - IS_ACTIVE((short)-7, "isActive"), - IMAGEID((short)-8, "imageid"), - IMAGEVERSION((short)-9, "imageversion"), - USER((short)-10, "user"), - FIRSTNAME((short)-11, "firstname"), - LASTNAME((short)-12, "lastname"), - UNIVERSITY((short)-13, "university"), - MAIL((short)-14, "Mail"), - TEL((short)-15, "Tel"), - FAK((short)-16, "Fak"), - ID((short)-17, "id"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // NAME - return NAME; - case -2: // NEW_NAME - return NEW_NAME; - case -3: // SHORTDESC - return SHORTDESC; - case -4: // DESC - return DESC; - case -5: // START_DATE - return START_DATE; - case -6: // END_DATE - return END_DATE; - case -7: // IS_ACTIVE - return IS_ACTIVE; - case -8: // IMAGEID - return IMAGEID; - case -9: // IMAGEVERSION - return IMAGEVERSION; - case -10: // USER - return USER; - case -11: // FIRSTNAME - return FIRSTNAME; - case -12: // LASTNAME - return LASTNAME; - case -13: // UNIVERSITY - return UNIVERSITY; - case -14: // MAIL - return MAIL; - case -15: // TEL - return TEL; - case -16: // FAK - return FAK; - case -17: // ID - return ID; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ISACTIVE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.NEW_NAME, new org.apache.thrift.meta_data.FieldMetaData("newName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.SHORTDESC, new org.apache.thrift.meta_data.FieldMetaData("shortdesc", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.DESC, new org.apache.thrift.meta_data.FieldMetaData("desc", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.IMAGEID, new org.apache.thrift.meta_data.FieldMetaData("imageid", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IMAGEVERSION, new org.apache.thrift.meta_data.FieldMetaData("imageversion", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.FIRSTNAME, new org.apache.thrift.meta_data.FieldMetaData("firstname", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.LASTNAME, new org.apache.thrift.meta_data.FieldMetaData("lastname", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("Mail", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.TEL, new org.apache.thrift.meta_data.FieldMetaData("Tel", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.FAK, new org.apache.thrift.meta_data.FieldMetaData("Fak", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateLecturedata_args.class, metaDataMap); - } - - public updateLecturedata_args() { - } - - public updateLecturedata_args( - String name, - String newName, - String shortdesc, - String desc, - String startDate, - String endDate, - boolean isActive, - String imageid, - String imageversion, - String user, - String firstname, - String lastname, - String university, - String Mail, - String Tel, - String Fak, - String id) - { - this(); - this.name = name; - this.newName = newName; - this.shortdesc = shortdesc; - this.desc = desc; - this.startDate = startDate; - this.endDate = endDate; - this.isActive = isActive; - setIsActiveIsSet(true); - this.imageid = imageid; - this.imageversion = imageversion; - this.user = user; - this.firstname = firstname; - this.lastname = lastname; - this.university = university; - this.Mail = Mail; - this.Tel = Tel; - this.Fak = Fak; - this.id = id; - } - - /** - * Performs a deep copy on other. - */ - public updateLecturedata_args(updateLecturedata_args other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetName()) { - this.name = other.name; - } - if (other.isSetNewName()) { - this.newName = other.newName; - } - if (other.isSetShortdesc()) { - this.shortdesc = other.shortdesc; - } - if (other.isSetDesc()) { - this.desc = other.desc; - } - if (other.isSetStartDate()) { - this.startDate = other.startDate; - } - if (other.isSetEndDate()) { - this.endDate = other.endDate; - } - this.isActive = other.isActive; - if (other.isSetImageid()) { - this.imageid = other.imageid; - } - if (other.isSetImageversion()) { - this.imageversion = other.imageversion; - } - if (other.isSetUser()) { - this.user = other.user; - } - if (other.isSetFirstname()) { - this.firstname = other.firstname; - } - if (other.isSetLastname()) { - this.lastname = other.lastname; - } - if (other.isSetUniversity()) { - this.university = other.university; - } - if (other.isSetMail()) { - this.Mail = other.Mail; - } - if (other.isSetTel()) { - this.Tel = other.Tel; - } - if (other.isSetFak()) { - this.Fak = other.Fak; - } - if (other.isSetId()) { - this.id = other.id; - } - } - - public updateLecturedata_args deepCopy() { - return new updateLecturedata_args(this); - } - - @Override - public void clear() { - this.name = null; - this.newName = null; - this.shortdesc = null; - this.desc = null; - this.startDate = null; - this.endDate = null; - setIsActiveIsSet(false); - this.isActive = false; - this.imageid = null; - this.imageversion = null; - this.user = null; - this.firstname = null; - this.lastname = null; - this.university = null; - this.Mail = null; - this.Tel = null; - this.Fak = null; - this.id = null; - } - - public String getName() { - return this.name; - } - - public updateLecturedata_args setName(String name) { - this.name = name; - return this; - } - - public void unsetName() { - this.name = null; - } - - /** Returns true if field name is set (has been assigned a value) and false otherwise */ - public boolean isSetName() { - return this.name != null; - } - - public void setNameIsSet(boolean value) { - if (!value) { - this.name = null; - } - } - - public String getNewName() { - return this.newName; - } - - public updateLecturedata_args setNewName(String newName) { - this.newName = newName; - return this; - } - - public void unsetNewName() { - this.newName = null; - } - - /** Returns true if field newName is set (has been assigned a value) and false otherwise */ - public boolean isSetNewName() { - return this.newName != null; - } - - public void setNewNameIsSet(boolean value) { - if (!value) { - this.newName = null; - } - } - - public String getShortdesc() { - return this.shortdesc; - } - - public updateLecturedata_args setShortdesc(String shortdesc) { - this.shortdesc = shortdesc; - return this; - } - - public void unsetShortdesc() { - this.shortdesc = null; - } - - /** Returns true if field shortdesc is set (has been assigned a value) and false otherwise */ - public boolean isSetShortdesc() { - return this.shortdesc != null; - } - - public void setShortdescIsSet(boolean value) { - if (!value) { - this.shortdesc = null; - } - } - - public String getDesc() { - return this.desc; - } - - public updateLecturedata_args setDesc(String desc) { - this.desc = desc; - return this; - } - - public void unsetDesc() { - this.desc = null; - } - - /** Returns true if field desc is set (has been assigned a value) and false otherwise */ - public boolean isSetDesc() { - return this.desc != null; - } - - public void setDescIsSet(boolean value) { - if (!value) { - this.desc = null; - } - } - - public String getStartDate() { - return this.startDate; - } - - public updateLecturedata_args setStartDate(String startDate) { - this.startDate = startDate; - return this; - } - - public void unsetStartDate() { - this.startDate = null; - } - - /** Returns true if field startDate is set (has been assigned a value) and false otherwise */ - public boolean isSetStartDate() { - return this.startDate != null; - } - - public void setStartDateIsSet(boolean value) { - if (!value) { - this.startDate = null; - } - } - - public String getEndDate() { - return this.endDate; - } - - public updateLecturedata_args setEndDate(String endDate) { - this.endDate = endDate; - return this; - } - - public void unsetEndDate() { - this.endDate = null; - } - - /** Returns true if field endDate is set (has been assigned a value) and false otherwise */ - public boolean isSetEndDate() { - return this.endDate != null; - } - - public void setEndDateIsSet(boolean value) { - if (!value) { - this.endDate = null; - } - } - - public boolean isIsActive() { - return this.isActive; - } - - public updateLecturedata_args setIsActive(boolean isActive) { - this.isActive = isActive; - setIsActiveIsSet(true); - return this; - } - - public void unsetIsActive() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISACTIVE_ISSET_ID); - } - - /** Returns true if field isActive is set (has been assigned a value) and false otherwise */ - public boolean isSetIsActive() { - return EncodingUtils.testBit(__isset_bitfield, __ISACTIVE_ISSET_ID); - } - - public void setIsActiveIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISACTIVE_ISSET_ID, value); - } - - public String getImageid() { - return this.imageid; - } - - public updateLecturedata_args setImageid(String imageid) { - this.imageid = imageid; - return this; - } - - public void unsetImageid() { - this.imageid = null; - } - - /** Returns true if field imageid is set (has been assigned a value) and false otherwise */ - public boolean isSetImageid() { - return this.imageid != null; - } - - public void setImageidIsSet(boolean value) { - if (!value) { - this.imageid = null; - } - } - - public String getImageversion() { - return this.imageversion; - } - - public updateLecturedata_args setImageversion(String imageversion) { - this.imageversion = imageversion; - return this; - } - - public void unsetImageversion() { - this.imageversion = null; - } - - /** Returns true if field imageversion is set (has been assigned a value) and false otherwise */ - public boolean isSetImageversion() { - return this.imageversion != null; - } - - public void setImageversionIsSet(boolean value) { - if (!value) { - this.imageversion = null; - } - } - - public String getUser() { - return this.user; - } - - public updateLecturedata_args setUser(String user) { - this.user = user; - return this; - } - - public void unsetUser() { - this.user = null; - } - - /** Returns true if field user is set (has been assigned a value) and false otherwise */ - public boolean isSetUser() { - return this.user != null; - } - - public void setUserIsSet(boolean value) { - if (!value) { - this.user = null; - } - } - - public String getFirstname() { - return this.firstname; - } - - public updateLecturedata_args setFirstname(String firstname) { - this.firstname = firstname; - return this; - } - - public void unsetFirstname() { - this.firstname = null; - } - - /** Returns true if field firstname is set (has been assigned a value) and false otherwise */ - public boolean isSetFirstname() { - return this.firstname != null; - } - - public void setFirstnameIsSet(boolean value) { - if (!value) { - this.firstname = null; - } - } - - public String getLastname() { - return this.lastname; - } - - public updateLecturedata_args setLastname(String lastname) { - this.lastname = lastname; - return this; - } - - public void unsetLastname() { - this.lastname = null; - } - - /** Returns true if field lastname is set (has been assigned a value) and false otherwise */ - public boolean isSetLastname() { - return this.lastname != null; - } - - public void setLastnameIsSet(boolean value) { - if (!value) { - this.lastname = null; - } - } - - public String getUniversity() { - return this.university; - } - - public updateLecturedata_args setUniversity(String university) { - this.university = university; - return this; - } - - public void unsetUniversity() { - this.university = null; - } - - /** Returns true if field university is set (has been assigned a value) and false otherwise */ - public boolean isSetUniversity() { - return this.university != null; - } - - public void setUniversityIsSet(boolean value) { - if (!value) { - this.university = null; - } - } - - public String getMail() { - return this.Mail; - } - - public updateLecturedata_args setMail(String Mail) { - this.Mail = Mail; - return this; - } - - public void unsetMail() { - this.Mail = null; - } - - /** Returns true if field Mail is set (has been assigned a value) and false otherwise */ - public boolean isSetMail() { - return this.Mail != null; - } - - public void setMailIsSet(boolean value) { - if (!value) { - this.Mail = null; - } - } - - public String getTel() { - return this.Tel; - } - - public updateLecturedata_args setTel(String Tel) { - this.Tel = Tel; - return this; - } - - public void unsetTel() { - this.Tel = null; - } - - /** Returns true if field Tel is set (has been assigned a value) and false otherwise */ - public boolean isSetTel() { - return this.Tel != null; - } - - public void setTelIsSet(boolean value) { - if (!value) { - this.Tel = null; - } - } - - public String getFak() { - return this.Fak; - } - - public updateLecturedata_args setFak(String Fak) { - this.Fak = Fak; - return this; - } - - public void unsetFak() { - this.Fak = null; - } - - /** Returns true if field Fak is set (has been assigned a value) and false otherwise */ - public boolean isSetFak() { - return this.Fak != null; - } - - public void setFakIsSet(boolean value) { - if (!value) { - this.Fak = null; - } - } - - public String getId() { - return this.id; - } - - public updateLecturedata_args setId(String id) { - this.id = id; - return this; - } - - public void unsetId() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean isSetId() { - return this.id != null; - } - - public void setIdIsSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NAME: - if (value == null) { - unsetName(); - } else { - setName((String)value); - } - break; - - case NEW_NAME: - if (value == null) { - unsetNewName(); - } else { - setNewName((String)value); - } - break; - - case SHORTDESC: - if (value == null) { - unsetShortdesc(); - } else { - setShortdesc((String)value); - } - break; - - case DESC: - if (value == null) { - unsetDesc(); - } else { - setDesc((String)value); - } - break; - - case START_DATE: - if (value == null) { - unsetStartDate(); - } else { - setStartDate((String)value); - } - break; - - case END_DATE: - if (value == null) { - unsetEndDate(); - } else { - setEndDate((String)value); - } - break; - - case IS_ACTIVE: - if (value == null) { - unsetIsActive(); - } else { - setIsActive((Boolean)value); - } - break; - - case IMAGEID: - if (value == null) { - unsetImageid(); - } else { - setImageid((String)value); - } - break; - - case IMAGEVERSION: - if (value == null) { - unsetImageversion(); - } else { - setImageversion((String)value); - } - break; - - case USER: - if (value == null) { - unsetUser(); - } else { - setUser((String)value); - } - break; - - case FIRSTNAME: - if (value == null) { - unsetFirstname(); - } else { - setFirstname((String)value); - } - break; - - case LASTNAME: - if (value == null) { - unsetLastname(); - } else { - setLastname((String)value); - } - break; - - case UNIVERSITY: - if (value == null) { - unsetUniversity(); - } else { - setUniversity((String)value); - } - break; - - case MAIL: - if (value == null) { - unsetMail(); - } else { - setMail((String)value); - } - break; - - case TEL: - if (value == null) { - unsetTel(); - } else { - setTel((String)value); - } - break; - - case FAK: - if (value == null) { - unsetFak(); - } else { - setFak((String)value); - } - break; - - case ID: - if (value == null) { - unsetId(); - } else { - setId((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NAME: - return getName(); - - case NEW_NAME: - return getNewName(); - - case SHORTDESC: - return getShortdesc(); - - case DESC: - return getDesc(); - - case START_DATE: - return getStartDate(); - - case END_DATE: - return getEndDate(); - - case IS_ACTIVE: - return Boolean.valueOf(isIsActive()); - - case IMAGEID: - return getImageid(); - - case IMAGEVERSION: - return getImageversion(); - - case USER: - return getUser(); - - case FIRSTNAME: - return getFirstname(); - - case LASTNAME: - return getLastname(); - - case UNIVERSITY: - return getUniversity(); - - case MAIL: - return getMail(); - - case TEL: - return getTel(); - - case FAK: - return getFak(); - - case ID: - return getId(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case NAME: - return isSetName(); - case NEW_NAME: - return isSetNewName(); - case SHORTDESC: - return isSetShortdesc(); - case DESC: - return isSetDesc(); - case START_DATE: - return isSetStartDate(); - case END_DATE: - return isSetEndDate(); - case IS_ACTIVE: - return isSetIsActive(); - case IMAGEID: - return isSetImageid(); - case IMAGEVERSION: - return isSetImageversion(); - case USER: - return isSetUser(); - case FIRSTNAME: - return isSetFirstname(); - case LASTNAME: - return isSetLastname(); - case UNIVERSITY: - return isSetUniversity(); - case MAIL: - return isSetMail(); - case TEL: - return isSetTel(); - case FAK: - return isSetFak(); - case ID: - return isSetId(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof updateLecturedata_args) - return this.equals((updateLecturedata_args)that); - return false; - } - - public boolean equals(updateLecturedata_args that) { - if (that == null) - return false; - - boolean this_present_name = true && this.isSetName(); - boolean that_present_name = true && that.isSetName(); - if (this_present_name || that_present_name) { - if (!(this_present_name && that_present_name)) - return false; - if (!this.name.equals(that.name)) - return false; - } - - boolean this_present_newName = true && this.isSetNewName(); - boolean that_present_newName = true && that.isSetNewName(); - if (this_present_newName || that_present_newName) { - if (!(this_present_newName && that_present_newName)) - return false; - if (!this.newName.equals(that.newName)) - return false; - } - - boolean this_present_shortdesc = true && this.isSetShortdesc(); - boolean that_present_shortdesc = true && that.isSetShortdesc(); - if (this_present_shortdesc || that_present_shortdesc) { - if (!(this_present_shortdesc && that_present_shortdesc)) - return false; - if (!this.shortdesc.equals(that.shortdesc)) - return false; - } - - boolean this_present_desc = true && this.isSetDesc(); - boolean that_present_desc = true && that.isSetDesc(); - if (this_present_desc || that_present_desc) { - if (!(this_present_desc && that_present_desc)) - return false; - if (!this.desc.equals(that.desc)) - return false; - } - - boolean this_present_startDate = true && this.isSetStartDate(); - boolean that_present_startDate = true && that.isSetStartDate(); - if (this_present_startDate || that_present_startDate) { - if (!(this_present_startDate && that_present_startDate)) - return false; - if (!this.startDate.equals(that.startDate)) - return false; - } - - boolean this_present_endDate = true && this.isSetEndDate(); - boolean that_present_endDate = true && that.isSetEndDate(); - if (this_present_endDate || that_present_endDate) { - if (!(this_present_endDate && that_present_endDate)) - return false; - if (!this.endDate.equals(that.endDate)) - return false; - } - - boolean this_present_isActive = true; - boolean that_present_isActive = true; - if (this_present_isActive || that_present_isActive) { - if (!(this_present_isActive && that_present_isActive)) - return false; - if (this.isActive != that.isActive) - return false; - } - - boolean this_present_imageid = true && this.isSetImageid(); - boolean that_present_imageid = true && that.isSetImageid(); - if (this_present_imageid || that_present_imageid) { - if (!(this_present_imageid && that_present_imageid)) - return false; - if (!this.imageid.equals(that.imageid)) - return false; - } - - boolean this_present_imageversion = true && this.isSetImageversion(); - boolean that_present_imageversion = true && that.isSetImageversion(); - if (this_present_imageversion || that_present_imageversion) { - if (!(this_present_imageversion && that_present_imageversion)) - return false; - if (!this.imageversion.equals(that.imageversion)) - return false; - } - - boolean this_present_user = true && this.isSetUser(); - boolean that_present_user = true && that.isSetUser(); - if (this_present_user || that_present_user) { - if (!(this_present_user && that_present_user)) - return false; - if (!this.user.equals(that.user)) - return false; - } - - boolean this_present_firstname = true && this.isSetFirstname(); - boolean that_present_firstname = true && that.isSetFirstname(); - if (this_present_firstname || that_present_firstname) { - if (!(this_present_firstname && that_present_firstname)) - return false; - if (!this.firstname.equals(that.firstname)) - return false; - } - - boolean this_present_lastname = true && this.isSetLastname(); - boolean that_present_lastname = true && that.isSetLastname(); - if (this_present_lastname || that_present_lastname) { - if (!(this_present_lastname && that_present_lastname)) - return false; - if (!this.lastname.equals(that.lastname)) - return false; - } - - boolean this_present_university = true && this.isSetUniversity(); - boolean that_present_university = true && that.isSetUniversity(); - if (this_present_university || that_present_university) { - if (!(this_present_university && that_present_university)) - return false; - if (!this.university.equals(that.university)) - return false; - } - - boolean this_present_Mail = true && this.isSetMail(); - boolean that_present_Mail = true && that.isSetMail(); - if (this_present_Mail || that_present_Mail) { - if (!(this_present_Mail && that_present_Mail)) - return false; - if (!this.Mail.equals(that.Mail)) - return false; - } - - boolean this_present_Tel = true && this.isSetTel(); - boolean that_present_Tel = true && that.isSetTel(); - if (this_present_Tel || that_present_Tel) { - if (!(this_present_Tel && that_present_Tel)) - return false; - if (!this.Tel.equals(that.Tel)) - return false; - } - - boolean this_present_Fak = true && this.isSetFak(); - boolean that_present_Fak = true && that.isSetFak(); - if (this_present_Fak || that_present_Fak) { - if (!(this_present_Fak && that_present_Fak)) - return false; - if (!this.Fak.equals(that.Fak)) - return false; - } - - boolean this_present_id = true && this.isSetId(); - boolean that_present_id = true && that.isSetId(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(updateLecturedata_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNewName()).compareTo(other.isSetNewName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNewName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.newName, other.newName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetShortdesc()).compareTo(other.isSetShortdesc()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetShortdesc()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shortdesc, other.shortdesc); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDesc()).compareTo(other.isSetDesc()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDesc()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.desc, other.desc); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(other.isSetStartDate()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStartDate()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, other.startDate); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(other.isSetEndDate()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEndDate()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, other.endDate); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(other.isSetIsActive()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIsActive()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isActive, other.isActive); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetImageid()).compareTo(other.isSetImageid()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetImageid()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageid, other.imageid); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetImageversion()).compareTo(other.isSetImageversion()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetImageversion()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageversion, other.imageversion); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUser()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFirstname()).compareTo(other.isSetFirstname()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFirstname()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstname, other.firstname); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLastname()).compareTo(other.isSetLastname()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLastname()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastname, other.lastname); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUniversity()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMail()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Mail, other.Mail); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTel()).compareTo(other.isSetTel()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTel()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Tel, other.Tel); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFak()).compareTo(other.isSetFak()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFak()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Fak, other.Fak); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("updateLecturedata_args("); - boolean first = true; - - sb.append("name:"); - if (this.name == null) { - sb.append("null"); - } else { - sb.append(this.name); - } - first = false; - if (!first) sb.append(", "); - sb.append("newName:"); - if (this.newName == null) { - sb.append("null"); - } else { - sb.append(this.newName); - } - first = false; - if (!first) sb.append(", "); - sb.append("shortdesc:"); - if (this.shortdesc == null) { - sb.append("null"); - } else { - sb.append(this.shortdesc); - } - first = false; - if (!first) sb.append(", "); - sb.append("desc:"); - if (this.desc == null) { - sb.append("null"); - } else { - sb.append(this.desc); - } - first = false; - if (!first) sb.append(", "); - sb.append("startDate:"); - if (this.startDate == null) { - sb.append("null"); - } else { - sb.append(this.startDate); - } - first = false; - if (!first) sb.append(", "); - sb.append("endDate:"); - if (this.endDate == null) { - sb.append("null"); - } else { - sb.append(this.endDate); - } - first = false; - if (!first) sb.append(", "); - sb.append("isActive:"); - sb.append(this.isActive); - first = false; - if (!first) sb.append(", "); - sb.append("imageid:"); - if (this.imageid == null) { - sb.append("null"); - } else { - sb.append(this.imageid); - } - first = false; - if (!first) sb.append(", "); - sb.append("imageversion:"); - if (this.imageversion == null) { - sb.append("null"); - } else { - sb.append(this.imageversion); - } - first = false; - if (!first) sb.append(", "); - sb.append("user:"); - if (this.user == null) { - sb.append("null"); - } else { - sb.append(this.user); - } - first = false; - if (!first) sb.append(", "); - sb.append("firstname:"); - if (this.firstname == null) { - sb.append("null"); - } else { - sb.append(this.firstname); - } - first = false; - if (!first) sb.append(", "); - sb.append("lastname:"); - if (this.lastname == null) { - sb.append("null"); - } else { - sb.append(this.lastname); - } - first = false; - if (!first) sb.append(", "); - sb.append("university:"); - if (this.university == null) { - sb.append("null"); - } else { - sb.append(this.university); - } - first = false; - if (!first) sb.append(", "); - sb.append("Mail:"); - if (this.Mail == null) { - sb.append("null"); - } else { - sb.append(this.Mail); - } - first = false; - if (!first) sb.append(", "); - sb.append("Tel:"); - if (this.Tel == null) { - sb.append("null"); - } else { - sb.append(this.Tel); - } - first = false; - if (!first) sb.append(", "); - sb.append("Fak:"); - if (this.Fak == null) { - sb.append("null"); - } else { - sb.append(this.Fak); - } - first = false; - if (!first) sb.append(", "); - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class updateLecturedata_argsStandardSchemeFactory implements SchemeFactory { - public updateLecturedata_argsStandardScheme getScheme() { - return new updateLecturedata_argsStandardScheme(); - } - } - - private static class updateLecturedata_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, updateLecturedata_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.name = iprot.readString(); - struct.setNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // NEW_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.newName = iprot.readString(); - struct.setNewNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -3: // SHORTDESC - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.shortdesc = iprot.readString(); - struct.setShortdescIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -4: // DESC - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.desc = iprot.readString(); - struct.setDescIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -5: // START_DATE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.startDate = iprot.readString(); - struct.setStartDateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -6: // END_DATE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.endDate = iprot.readString(); - struct.setEndDateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -7: // IS_ACTIVE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.isActive = iprot.readBool(); - struct.setIsActiveIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -8: // IMAGEID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.imageid = iprot.readString(); - struct.setImageidIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -9: // IMAGEVERSION - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.imageversion = iprot.readString(); - struct.setImageversionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -10: // USER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.user = iprot.readString(); - struct.setUserIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -11: // FIRSTNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.firstname = iprot.readString(); - struct.setFirstnameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -12: // LASTNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.lastname = iprot.readString(); - struct.setLastnameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -13: // UNIVERSITY - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.university = iprot.readString(); - struct.setUniversityIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -14: // MAIL - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.Mail = iprot.readString(); - struct.setMailIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -15: // TEL - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.Tel = iprot.readString(); - struct.setTelIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -16: // FAK - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.Fak = iprot.readString(); - struct.setFakIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -17: // ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, updateLecturedata_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(struct.id); - oprot.writeFieldEnd(); - } - if (struct.Fak != null) { - oprot.writeFieldBegin(FAK_FIELD_DESC); - oprot.writeString(struct.Fak); - oprot.writeFieldEnd(); - } - if (struct.Tel != null) { - oprot.writeFieldBegin(TEL_FIELD_DESC); - oprot.writeString(struct.Tel); - oprot.writeFieldEnd(); - } - if (struct.Mail != null) { - oprot.writeFieldBegin(MAIL_FIELD_DESC); - oprot.writeString(struct.Mail); - oprot.writeFieldEnd(); - } - if (struct.university != null) { - oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC); - oprot.writeString(struct.university); - oprot.writeFieldEnd(); - } - if (struct.lastname != null) { - oprot.writeFieldBegin(LASTNAME_FIELD_DESC); - oprot.writeString(struct.lastname); - oprot.writeFieldEnd(); - } - if (struct.firstname != null) { - oprot.writeFieldBegin(FIRSTNAME_FIELD_DESC); - oprot.writeString(struct.firstname); - oprot.writeFieldEnd(); - } - if (struct.user != null) { - oprot.writeFieldBegin(USER_FIELD_DESC); - oprot.writeString(struct.user); - oprot.writeFieldEnd(); - } - if (struct.imageversion != null) { - oprot.writeFieldBegin(IMAGEVERSION_FIELD_DESC); - oprot.writeString(struct.imageversion); - oprot.writeFieldEnd(); - } - if (struct.imageid != null) { - oprot.writeFieldBegin(IMAGEID_FIELD_DESC); - oprot.writeString(struct.imageid); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC); - oprot.writeBool(struct.isActive); - oprot.writeFieldEnd(); - if (struct.endDate != null) { - oprot.writeFieldBegin(END_DATE_FIELD_DESC); - oprot.writeString(struct.endDate); - oprot.writeFieldEnd(); - } - if (struct.startDate != null) { - oprot.writeFieldBegin(START_DATE_FIELD_DESC); - oprot.writeString(struct.startDate); - oprot.writeFieldEnd(); - } - if (struct.desc != null) { - oprot.writeFieldBegin(DESC_FIELD_DESC); - oprot.writeString(struct.desc); - oprot.writeFieldEnd(); - } - if (struct.shortdesc != null) { - oprot.writeFieldBegin(SHORTDESC_FIELD_DESC); - oprot.writeString(struct.shortdesc); - oprot.writeFieldEnd(); - } - if (struct.newName != null) { - oprot.writeFieldBegin(NEW_NAME_FIELD_DESC); - oprot.writeString(struct.newName); - oprot.writeFieldEnd(); - } - if (struct.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(struct.name); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class updateLecturedata_argsTupleSchemeFactory implements SchemeFactory { - public updateLecturedata_argsTupleScheme getScheme() { - return new updateLecturedata_argsTupleScheme(); - } - } - - private static class updateLecturedata_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetName()) { - optionals.set(0); - } - if (struct.isSetNewName()) { - optionals.set(1); - } - if (struct.isSetShortdesc()) { - optionals.set(2); - } - if (struct.isSetDesc()) { - optionals.set(3); - } - if (struct.isSetStartDate()) { - optionals.set(4); - } - if (struct.isSetEndDate()) { - optionals.set(5); - } - if (struct.isSetIsActive()) { - optionals.set(6); - } - if (struct.isSetImageid()) { - optionals.set(7); - } - if (struct.isSetImageversion()) { - optionals.set(8); - } - if (struct.isSetUser()) { - optionals.set(9); - } - if (struct.isSetFirstname()) { - optionals.set(10); - } - if (struct.isSetLastname()) { - optionals.set(11); - } - if (struct.isSetUniversity()) { - optionals.set(12); - } - if (struct.isSetMail()) { - optionals.set(13); - } - if (struct.isSetTel()) { - optionals.set(14); - } - if (struct.isSetFak()) { - optionals.set(15); - } - if (struct.isSetId()) { - optionals.set(16); - } - oprot.writeBitSet(optionals, 17); - if (struct.isSetName()) { - oprot.writeString(struct.name); - } - if (struct.isSetNewName()) { - oprot.writeString(struct.newName); - } - if (struct.isSetShortdesc()) { - oprot.writeString(struct.shortdesc); - } - if (struct.isSetDesc()) { - oprot.writeString(struct.desc); - } - if (struct.isSetStartDate()) { - oprot.writeString(struct.startDate); - } - if (struct.isSetEndDate()) { - oprot.writeString(struct.endDate); - } - if (struct.isSetIsActive()) { - oprot.writeBool(struct.isActive); - } - if (struct.isSetImageid()) { - oprot.writeString(struct.imageid); - } - if (struct.isSetImageversion()) { - oprot.writeString(struct.imageversion); - } - if (struct.isSetUser()) { - oprot.writeString(struct.user); - } - if (struct.isSetFirstname()) { - oprot.writeString(struct.firstname); - } - if (struct.isSetLastname()) { - oprot.writeString(struct.lastname); - } - if (struct.isSetUniversity()) { - oprot.writeString(struct.university); - } - if (struct.isSetMail()) { - oprot.writeString(struct.Mail); - } - if (struct.isSetTel()) { - oprot.writeString(struct.Tel); - } - if (struct.isSetFak()) { - oprot.writeString(struct.Fak); - } - if (struct.isSetId()) { - oprot.writeString(struct.id); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(17); - if (incoming.get(0)) { - struct.name = iprot.readString(); - struct.setNameIsSet(true); - } - if (incoming.get(1)) { - struct.newName = iprot.readString(); - struct.setNewNameIsSet(true); - } - if (incoming.get(2)) { - struct.shortdesc = iprot.readString(); - struct.setShortdescIsSet(true); - } - if (incoming.get(3)) { - struct.desc = iprot.readString(); - struct.setDescIsSet(true); - } - if (incoming.get(4)) { - struct.startDate = iprot.readString(); - struct.setStartDateIsSet(true); - } - if (incoming.get(5)) { - struct.endDate = iprot.readString(); - struct.setEndDateIsSet(true); - } - if (incoming.get(6)) { - struct.isActive = iprot.readBool(); - struct.setIsActiveIsSet(true); - } - if (incoming.get(7)) { - struct.imageid = iprot.readString(); - struct.setImageidIsSet(true); - } - if (incoming.get(8)) { - struct.imageversion = iprot.readString(); - struct.setImageversionIsSet(true); - } - if (incoming.get(9)) { - struct.user = iprot.readString(); - struct.setUserIsSet(true); - } - if (incoming.get(10)) { - struct.firstname = iprot.readString(); - struct.setFirstnameIsSet(true); - } - if (incoming.get(11)) { - struct.lastname = iprot.readString(); - struct.setLastnameIsSet(true); - } - if (incoming.get(12)) { - struct.university = iprot.readString(); - struct.setUniversityIsSet(true); - } - if (incoming.get(13)) { - struct.Mail = iprot.readString(); - struct.setMailIsSet(true); - } - if (incoming.get(14)) { - struct.Tel = iprot.readString(); - struct.setTelIsSet(true); - } - if (incoming.get(15)) { - struct.Fak = iprot.readString(); - struct.setFakIsSet(true); - } - if (incoming.get(16)) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } - } - } - - } - - public static class updateLecturedata_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateLecturedata_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new updateLecturedata_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new updateLecturedata_resultTupleSchemeFactory()); - } - - public boolean success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateLecturedata_result.class, metaDataMap); - } - - public updateLecturedata_result() { - } - - public updateLecturedata_result( - boolean success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public updateLecturedata_result(updateLecturedata_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; - } - - public updateLecturedata_result deepCopy() { - return new updateLecturedata_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = false; - } - - public boolean isSuccess() { - return this.success; - } - - public updateLecturedata_result setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Boolean.valueOf(isSuccess()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof updateLecturedata_result) - return this.equals((updateLecturedata_result)that); - return false; - } - - public boolean equals(updateLecturedata_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(updateLecturedata_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("updateLecturedata_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class updateLecturedata_resultStandardSchemeFactory implements SchemeFactory { - public updateLecturedata_resultStandardScheme getScheme() { - return new updateLecturedata_resultStandardScheme(); - } - } - - private static class updateLecturedata_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, updateLecturedata_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, updateLecturedata_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class updateLecturedata_resultTupleSchemeFactory implements SchemeFactory { - public updateLecturedata_resultTupleScheme getScheme() { - return new updateLecturedata_resultTupleScheme(); - } - } - - private static class updateLecturedata_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class deleteImageServer_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageServer_args"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new deleteImageServer_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new deleteImageServer_argsTupleSchemeFactory()); - } - - public String id; // required - public String version; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - ID((short)-1, "id"), - VERSION((short)-2, "version"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // ID - return ID; - case -2: // VERSION - return VERSION; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteImageServer_args.class, metaDataMap); - } - - public deleteImageServer_args() { - } - - public deleteImageServer_args( - String id, - String version) - { - this(); - this.id = id; - this.version = version; - } - - /** - * Performs a deep copy on other. - */ - public deleteImageServer_args(deleteImageServer_args other) { - if (other.isSetId()) { - this.id = other.id; - } - if (other.isSetVersion()) { - this.version = other.version; - } - } - - public deleteImageServer_args deepCopy() { - return new deleteImageServer_args(this); - } - - @Override - public void clear() { - this.id = null; - this.version = null; - } - - public String getId() { - return this.id; - } - - public deleteImageServer_args setId(String id) { - this.id = id; - return this; - } - - public void unsetId() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean isSetId() { - return this.id != null; - } - - public void setIdIsSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public String getVersion() { - return this.version; - } - - public deleteImageServer_args setVersion(String version) { - this.version = version; - return this; - } - - public void unsetVersion() { - this.version = null; - } - - /** Returns true if field version is set (has been assigned a value) and false otherwise */ - public boolean isSetVersion() { - return this.version != null; - } - - public void setVersionIsSet(boolean value) { - if (!value) { - this.version = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unsetId(); - } else { - setId((String)value); - } - break; - - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return getId(); - - case VERSION: - return getVersion(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case ID: - return isSetId(); - case VERSION: - return isSetVersion(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof deleteImageServer_args) - return this.equals((deleteImageServer_args)that); - return false; - } - - public boolean equals(deleteImageServer_args that) { - if (that == null) - return false; - - boolean this_present_id = true && this.isSetId(); - boolean that_present_id = true && that.isSetId(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - boolean this_present_version = true && this.isSetVersion(); - boolean that_present_version = true && that.isSetVersion(); - if (this_present_version || that_present_version) { - if (!(this_present_version && that_present_version)) - return false; - if (!this.version.equals(that.version)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(deleteImageServer_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetVersion()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("deleteImageServer_args("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - if (!first) sb.append(", "); - sb.append("version:"); - if (this.version == null) { - sb.append("null"); - } else { - sb.append(this.version); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class deleteImageServer_argsStandardSchemeFactory implements SchemeFactory { - public deleteImageServer_argsStandardScheme getScheme() { - return new deleteImageServer_argsStandardScheme(); - } - } - - private static class deleteImageServer_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageServer_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // VERSION - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.version = iprot.readString(); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, deleteImageServer_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeString(struct.version); - oprot.writeFieldEnd(); - } - if (struct.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(struct.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class deleteImageServer_argsTupleSchemeFactory implements SchemeFactory { - public deleteImageServer_argsTupleScheme getScheme() { - return new deleteImageServer_argsTupleScheme(); - } - } - - private static class deleteImageServer_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetId()) { - optionals.set(0); - } - if (struct.isSetVersion()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetId()) { - oprot.writeString(struct.id); - } - if (struct.isSetVersion()) { - oprot.writeString(struct.version); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } - if (incoming.get(1)) { - struct.version = iprot.readString(); - struct.setVersionIsSet(true); - } - } - } - - } - - public static class deleteImageServer_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageServer_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new deleteImageServer_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new deleteImageServer_resultTupleSchemeFactory()); - } - - public boolean success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteImageServer_result.class, metaDataMap); - } - - public deleteImageServer_result() { - } - - public deleteImageServer_result( - boolean success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public deleteImageServer_result(deleteImageServer_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; - } - - public deleteImageServer_result deepCopy() { - return new deleteImageServer_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = false; - } - - public boolean isSuccess() { - return this.success; - } - - public deleteImageServer_result setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Boolean.valueOf(isSuccess()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof deleteImageServer_result) - return this.equals((deleteImageServer_result)that); - return false; - } - - public boolean equals(deleteImageServer_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(deleteImageServer_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("deleteImageServer_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class deleteImageServer_resultStandardSchemeFactory implements SchemeFactory { - public deleteImageServer_resultStandardScheme getScheme() { - return new deleteImageServer_resultStandardScheme(); - } - } - - private static class deleteImageServer_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageServer_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, deleteImageServer_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class deleteImageServer_resultTupleSchemeFactory implements SchemeFactory { - public deleteImageServer_resultTupleScheme getScheme() { - return new deleteImageServer_resultTupleScheme(); - } - } - - private static class deleteImageServer_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class connectedToLecture_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("connectedToLecture_args"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new connectedToLecture_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new connectedToLecture_argsTupleSchemeFactory()); - } - - public String id; // required - public String version; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - ID((short)-1, "id"), - VERSION((short)-2, "version"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // ID - return ID; - case -2: // VERSION - return VERSION; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(connectedToLecture_args.class, metaDataMap); - } - - public connectedToLecture_args() { - } - - public connectedToLecture_args( - String id, - String version) - { - this(); - this.id = id; - this.version = version; - } - - /** - * Performs a deep copy on other. - */ - public connectedToLecture_args(connectedToLecture_args other) { - if (other.isSetId()) { - this.id = other.id; - } - if (other.isSetVersion()) { - this.version = other.version; - } - } - - public connectedToLecture_args deepCopy() { - return new connectedToLecture_args(this); - } - - @Override - public void clear() { - this.id = null; - this.version = null; - } - - public String getId() { - return this.id; - } - - public connectedToLecture_args setId(String id) { - this.id = id; - return this; - } - - public void unsetId() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean isSetId() { - return this.id != null; - } - - public void setIdIsSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public String getVersion() { - return this.version; - } - - public connectedToLecture_args setVersion(String version) { - this.version = version; - return this; - } - - public void unsetVersion() { - this.version = null; - } - - /** Returns true if field version is set (has been assigned a value) and false otherwise */ - public boolean isSetVersion() { - return this.version != null; - } - - public void setVersionIsSet(boolean value) { - if (!value) { - this.version = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unsetId(); - } else { - setId((String)value); - } - break; - - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return getId(); - - case VERSION: - return getVersion(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case ID: - return isSetId(); - case VERSION: - return isSetVersion(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof connectedToLecture_args) - return this.equals((connectedToLecture_args)that); - return false; - } - - public boolean equals(connectedToLecture_args that) { - if (that == null) - return false; - - boolean this_present_id = true && this.isSetId(); - boolean that_present_id = true && that.isSetId(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - boolean this_present_version = true && this.isSetVersion(); - boolean that_present_version = true && that.isSetVersion(); - if (this_present_version || that_present_version) { - if (!(this_present_version && that_present_version)) - return false; - if (!this.version.equals(that.version)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(connectedToLecture_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetVersion()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("connectedToLecture_args("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - if (!first) sb.append(", "); - sb.append("version:"); - if (this.version == null) { - sb.append("null"); - } else { - sb.append(this.version); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class connectedToLecture_argsStandardSchemeFactory implements SchemeFactory { - public connectedToLecture_argsStandardScheme getScheme() { - return new connectedToLecture_argsStandardScheme(); - } - } - - private static class connectedToLecture_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, connectedToLecture_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // VERSION - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.version = iprot.readString(); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, connectedToLecture_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeString(struct.version); - oprot.writeFieldEnd(); - } - if (struct.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(struct.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class connectedToLecture_argsTupleSchemeFactory implements SchemeFactory { - public connectedToLecture_argsTupleScheme getScheme() { - return new connectedToLecture_argsTupleScheme(); - } - } - - private static class connectedToLecture_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, connectedToLecture_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetId()) { - optionals.set(0); - } - if (struct.isSetVersion()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetId()) { - oprot.writeString(struct.id); - } - if (struct.isSetVersion()) { - oprot.writeString(struct.version); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, connectedToLecture_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } - if (incoming.get(1)) { - struct.version = iprot.readString(); - struct.setVersionIsSet(true); - } - } - } - - } - - public static class connectedToLecture_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("connectedToLecture_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new connectedToLecture_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new connectedToLecture_resultTupleSchemeFactory()); - } - - public boolean success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(connectedToLecture_result.class, metaDataMap); - } - - public connectedToLecture_result() { - } - - public connectedToLecture_result( - boolean success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public connectedToLecture_result(connectedToLecture_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; - } - - public connectedToLecture_result deepCopy() { - return new connectedToLecture_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = false; - } - - public boolean isSuccess() { - return this.success; - } - - public connectedToLecture_result setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Boolean.valueOf(isSuccess()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof connectedToLecture_result) - return this.equals((connectedToLecture_result)that); - return false; - } - - public boolean equals(connectedToLecture_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(connectedToLecture_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("connectedToLecture_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class connectedToLecture_resultStandardSchemeFactory implements SchemeFactory { - public connectedToLecture_resultStandardScheme getScheme() { - return new connectedToLecture_resultStandardScheme(); - } - } - - private static class connectedToLecture_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, connectedToLecture_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, connectedToLecture_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class connectedToLecture_resultTupleSchemeFactory implements SchemeFactory { - public connectedToLecture_resultTupleScheme getScheme() { - return new connectedToLecture_resultTupleScheme(); - } - } - - private static class connectedToLecture_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, connectedToLecture_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, connectedToLecture_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class deleteLecture_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteLecture_args"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField HS_FIELD_DESC = new org.apache.thrift.protocol.TField("hs", org.apache.thrift.protocol.TType.STRING, (short)-2); - private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRING, (short)-3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new deleteLecture_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new deleteLecture_argsTupleSchemeFactory()); - } - - public String id; // required - public String hs; // required - public String user; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - ID((short)-1, "id"), - HS((short)-2, "hs"), - USER((short)-3, "user"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // ID - return ID; - case -2: // HS - return HS; - case -3: // USER - return USER; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.HS, new org.apache.thrift.meta_data.FieldMetaData("hs", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteLecture_args.class, metaDataMap); - } - - public deleteLecture_args() { - } - - public deleteLecture_args( - String id, - String hs, - String user) - { - this(); - this.id = id; - this.hs = hs; - this.user = user; - } - - /** - * Performs a deep copy on other. - */ - public deleteLecture_args(deleteLecture_args other) { - if (other.isSetId()) { - this.id = other.id; - } - if (other.isSetHs()) { - this.hs = other.hs; - } - if (other.isSetUser()) { - this.user = other.user; - } - } - - public deleteLecture_args deepCopy() { - return new deleteLecture_args(this); - } - - @Override - public void clear() { - this.id = null; - this.hs = null; - this.user = null; - } - - public String getId() { - return this.id; - } - - public deleteLecture_args setId(String id) { - this.id = id; - return this; - } - - public void unsetId() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean isSetId() { - return this.id != null; - } - - public void setIdIsSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public String getHs() { - return this.hs; - } - - public deleteLecture_args setHs(String hs) { - this.hs = hs; - return this; - } - - public void unsetHs() { - this.hs = null; - } - - /** Returns true if field hs is set (has been assigned a value) and false otherwise */ - public boolean isSetHs() { - return this.hs != null; - } - - public void setHsIsSet(boolean value) { - if (!value) { - this.hs = null; - } - } - - public String getUser() { - return this.user; - } - - public deleteLecture_args setUser(String user) { - this.user = user; - return this; - } - - public void unsetUser() { - this.user = null; - } - - /** Returns true if field user is set (has been assigned a value) and false otherwise */ - public boolean isSetUser() { - return this.user != null; - } - - public void setUserIsSet(boolean value) { - if (!value) { - this.user = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unsetId(); - } else { - setId((String)value); - } - break; - - case HS: - if (value == null) { - unsetHs(); - } else { - setHs((String)value); - } - break; - - case USER: - if (value == null) { - unsetUser(); - } else { - setUser((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return getId(); - - case HS: - return getHs(); - - case USER: - return getUser(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case ID: - return isSetId(); - case HS: - return isSetHs(); - case USER: - return isSetUser(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof deleteLecture_args) - return this.equals((deleteLecture_args)that); - return false; - } - - public boolean equals(deleteLecture_args that) { - if (that == null) - return false; - - boolean this_present_id = true && this.isSetId(); - boolean that_present_id = true && that.isSetId(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - boolean this_present_hs = true && this.isSetHs(); - boolean that_present_hs = true && that.isSetHs(); - if (this_present_hs || that_present_hs) { - if (!(this_present_hs && that_present_hs)) - return false; - if (!this.hs.equals(that.hs)) - return false; - } - - boolean this_present_user = true && this.isSetUser(); - boolean that_present_user = true && that.isSetUser(); - if (this_present_user || that_present_user) { - if (!(this_present_user && that_present_user)) - return false; - if (!this.user.equals(that.user)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(deleteLecture_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetHs()).compareTo(other.isSetHs()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hs, other.hs); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUser()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("deleteLecture_args("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - if (!first) sb.append(", "); - sb.append("hs:"); - if (this.hs == null) { - sb.append("null"); - } else { - sb.append(this.hs); - } - first = false; - if (!first) sb.append(", "); - sb.append("user:"); - if (this.user == null) { - sb.append("null"); - } else { - sb.append(this.user); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class deleteLecture_argsStandardSchemeFactory implements SchemeFactory { - public deleteLecture_argsStandardScheme getScheme() { - return new deleteLecture_argsStandardScheme(); - } - } - - private static class deleteLecture_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, deleteLecture_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // HS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.hs = iprot.readString(); - struct.setHsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -3: // USER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.user = iprot.readString(); - struct.setUserIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, deleteLecture_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.user != null) { - oprot.writeFieldBegin(USER_FIELD_DESC); - oprot.writeString(struct.user); - oprot.writeFieldEnd(); - } - if (struct.hs != null) { - oprot.writeFieldBegin(HS_FIELD_DESC); - oprot.writeString(struct.hs); - oprot.writeFieldEnd(); - } - if (struct.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(struct.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class deleteLecture_argsTupleSchemeFactory implements SchemeFactory { - public deleteLecture_argsTupleScheme getScheme() { - return new deleteLecture_argsTupleScheme(); - } - } - - private static class deleteLecture_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, deleteLecture_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetId()) { - optionals.set(0); - } - if (struct.isSetHs()) { - optionals.set(1); - } - if (struct.isSetUser()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetId()) { - oprot.writeString(struct.id); - } - if (struct.isSetHs()) { - oprot.writeString(struct.hs); - } - if (struct.isSetUser()) { - oprot.writeString(struct.user); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, deleteLecture_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } - if (incoming.get(1)) { - struct.hs = iprot.readString(); - struct.setHsIsSet(true); - } - if (incoming.get(2)) { - struct.user = iprot.readString(); - struct.setUserIsSet(true); - } - } - } - - } - - public static class deleteLecture_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteLecture_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new deleteLecture_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new deleteLecture_resultTupleSchemeFactory()); - } - - public boolean success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteLecture_result.class, metaDataMap); - } - - public deleteLecture_result() { - } - - public deleteLecture_result( - boolean success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public deleteLecture_result(deleteLecture_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; - } - - public deleteLecture_result deepCopy() { - return new deleteLecture_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = false; - } - - public boolean isSuccess() { - return this.success; - } - - public deleteLecture_result setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Boolean.valueOf(isSuccess()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof deleteLecture_result) - return this.equals((deleteLecture_result)that); - return false; - } - - public boolean equals(deleteLecture_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(deleteLecture_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("deleteLecture_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class deleteLecture_resultStandardSchemeFactory implements SchemeFactory { - public deleteLecture_resultStandardScheme getScheme() { - return new deleteLecture_resultStandardScheme(); - } - } - - private static class deleteLecture_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, deleteLecture_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, deleteLecture_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class deleteLecture_resultTupleSchemeFactory implements SchemeFactory { - public deleteLecture_resultTupleScheme getScheme() { - return new deleteLecture_resultTupleScheme(); - } - } - - private static class deleteLecture_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, deleteLecture_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, deleteLecture_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class checkUser_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkUser_args"); - - private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)-1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new checkUser_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new checkUser_argsTupleSchemeFactory()); - } - - public String username; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - USERNAME((short)-1, "username"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // USERNAME - return USERNAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkUser_args.class, metaDataMap); - } - - public checkUser_args() { - } - - public checkUser_args( - String username) - { - this(); - this.username = username; - } - - /** - * Performs a deep copy on other. - */ - public checkUser_args(checkUser_args other) { - if (other.isSetUsername()) { - this.username = other.username; - } - } - - public checkUser_args deepCopy() { - return new checkUser_args(this); - } - - @Override - public void clear() { - this.username = null; - } - - public String getUsername() { - return this.username; - } - - public checkUser_args setUsername(String username) { - this.username = username; - return this; - } - - public void unsetUsername() { - this.username = null; - } - - /** Returns true if field username is set (has been assigned a value) and false otherwise */ - public boolean isSetUsername() { - return this.username != null; - } - - public void setUsernameIsSet(boolean value) { - if (!value) { - this.username = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case USERNAME: - if (value == null) { - unsetUsername(); - } else { - setUsername((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case USERNAME: - return getUsername(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case USERNAME: - return isSetUsername(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof checkUser_args) - return this.equals((checkUser_args)that); - return false; - } - - public boolean equals(checkUser_args that) { - if (that == null) - return false; - - boolean this_present_username = true && this.isSetUsername(); - boolean that_present_username = true && that.isSetUsername(); - if (this_present_username || that_present_username) { - if (!(this_present_username && that_present_username)) - return false; - if (!this.username.equals(that.username)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(checkUser_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUsername()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("checkUser_args("); - boolean first = true; - - sb.append("username:"); - if (this.username == null) { - sb.append("null"); - } else { - sb.append(this.username); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class checkUser_argsStandardSchemeFactory implements SchemeFactory { - public checkUser_argsStandardScheme getScheme() { - return new checkUser_argsStandardScheme(); - } - } - - private static class checkUser_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, checkUser_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // USERNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, checkUser_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.username != null) { - oprot.writeFieldBegin(USERNAME_FIELD_DESC); - oprot.writeString(struct.username); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class checkUser_argsTupleSchemeFactory implements SchemeFactory { - public checkUser_argsTupleScheme getScheme() { - return new checkUser_argsTupleScheme(); - } - } - - private static class checkUser_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, checkUser_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetUsername()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetUsername()) { - oprot.writeString(struct.username); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, checkUser_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - } - } - } - - } - - public static class checkUser_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkUser_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new checkUser_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new checkUser_resultTupleSchemeFactory()); - } - - public boolean success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkUser_result.class, metaDataMap); - } - - public checkUser_result() { - } - - public checkUser_result( - boolean success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public checkUser_result(checkUser_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; - } - - public checkUser_result deepCopy() { - return new checkUser_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = false; - } - - public boolean isSuccess() { - return this.success; - } - - public checkUser_result setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Boolean.valueOf(isSuccess()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof checkUser_result) - return this.equals((checkUser_result)that); - return false; - } - - public boolean equals(checkUser_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(checkUser_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("checkUser_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class checkUser_resultStandardSchemeFactory implements SchemeFactory { - public checkUser_resultStandardScheme getScheme() { - return new checkUser_resultStandardScheme(); - } - } - - private static class checkUser_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, checkUser_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, checkUser_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class checkUser_resultTupleSchemeFactory implements SchemeFactory { - public checkUser_resultTupleScheme getScheme() { - return new checkUser_resultTupleScheme(); - } - } - - private static class checkUser_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, checkUser_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, checkUser_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class createUser_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createUser_args"); - - private static final org.apache.thrift.protocol.TField LOGIN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("loginName", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField LAST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastName", org.apache.thrift.protocol.TType.STRING, (short)-2); - private static final org.apache.thrift.protocol.TField FIRST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstName", org.apache.thrift.protocol.TType.STRING, (short)-3); - private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("mail", org.apache.thrift.protocol.TType.STRING, (short)-4); - private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new createUser_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new createUser_argsTupleSchemeFactory()); - } - - public String loginName; // required - public String lastName; // required - public String firstName; // required - public String mail; // required - public String university; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - LOGIN_NAME((short)-1, "loginName"), - LAST_NAME((short)-2, "lastName"), - FIRST_NAME((short)-3, "firstName"), - MAIL((short)-4, "mail"), - UNIVERSITY((short)-5, "university"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // LOGIN_NAME - return LOGIN_NAME; - case -2: // LAST_NAME - return LAST_NAME; - case -3: // FIRST_NAME - return FIRST_NAME; - case -4: // MAIL - return MAIL; - case -5: // UNIVERSITY - return UNIVERSITY; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.LOGIN_NAME, new org.apache.thrift.meta_data.FieldMetaData("loginName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.LAST_NAME, new org.apache.thrift.meta_data.FieldMetaData("lastName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.FIRST_NAME, new org.apache.thrift.meta_data.FieldMetaData("firstName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("mail", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createUser_args.class, metaDataMap); - } - - public createUser_args() { - } - - public createUser_args( - String loginName, - String lastName, - String firstName, - String mail, - String university) - { - this(); - this.loginName = loginName; - this.lastName = lastName; - this.firstName = firstName; - this.mail = mail; - this.university = university; - } - - /** - * Performs a deep copy on other. - */ - public createUser_args(createUser_args other) { - if (other.isSetLoginName()) { - this.loginName = other.loginName; - } - if (other.isSetLastName()) { - this.lastName = other.lastName; - } - if (other.isSetFirstName()) { - this.firstName = other.firstName; - } - if (other.isSetMail()) { - this.mail = other.mail; - } - if (other.isSetUniversity()) { - this.university = other.university; - } - } - - public createUser_args deepCopy() { - return new createUser_args(this); - } - - @Override - public void clear() { - this.loginName = null; - this.lastName = null; - this.firstName = null; - this.mail = null; - this.university = null; - } - - public String getLoginName() { - return this.loginName; - } - - public createUser_args setLoginName(String loginName) { - this.loginName = loginName; - return this; - } - - public void unsetLoginName() { - this.loginName = null; - } - - /** Returns true if field loginName is set (has been assigned a value) and false otherwise */ - public boolean isSetLoginName() { - return this.loginName != null; - } - - public void setLoginNameIsSet(boolean value) { - if (!value) { - this.loginName = null; - } - } - - public String getLastName() { - return this.lastName; - } - - public createUser_args setLastName(String lastName) { - this.lastName = lastName; - return this; - } - - public void unsetLastName() { - this.lastName = null; - } - - /** Returns true if field lastName is set (has been assigned a value) and false otherwise */ - public boolean isSetLastName() { - return this.lastName != null; - } - - public void setLastNameIsSet(boolean value) { - if (!value) { - this.lastName = null; - } - } - - public String getFirstName() { - return this.firstName; - } - - public createUser_args setFirstName(String firstName) { - this.firstName = firstName; - return this; - } - - public void unsetFirstName() { - this.firstName = null; - } - - /** Returns true if field firstName is set (has been assigned a value) and false otherwise */ - public boolean isSetFirstName() { - return this.firstName != null; - } - - public void setFirstNameIsSet(boolean value) { - if (!value) { - this.firstName = null; - } - } - - public String getMail() { - return this.mail; - } - - public createUser_args setMail(String mail) { - this.mail = mail; - return this; - } - - public void unsetMail() { - this.mail = null; - } - - /** Returns true if field mail is set (has been assigned a value) and false otherwise */ - public boolean isSetMail() { - return this.mail != null; - } - - public void setMailIsSet(boolean value) { - if (!value) { - this.mail = null; - } - } - - public String getUniversity() { - return this.university; - } - - public createUser_args setUniversity(String university) { - this.university = university; - return this; - } - - public void unsetUniversity() { - this.university = null; - } - - /** Returns true if field university is set (has been assigned a value) and false otherwise */ - public boolean isSetUniversity() { - return this.university != null; - } - - public void setUniversityIsSet(boolean value) { - if (!value) { - this.university = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case LOGIN_NAME: - if (value == null) { - unsetLoginName(); - } else { - setLoginName((String)value); - } - break; - - case LAST_NAME: - if (value == null) { - unsetLastName(); - } else { - setLastName((String)value); - } - break; - - case FIRST_NAME: - if (value == null) { - unsetFirstName(); - } else { - setFirstName((String)value); - } - break; - - case MAIL: - if (value == null) { - unsetMail(); - } else { - setMail((String)value); - } - break; - - case UNIVERSITY: - if (value == null) { - unsetUniversity(); - } else { - setUniversity((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case LOGIN_NAME: - return getLoginName(); - - case LAST_NAME: - return getLastName(); - - case FIRST_NAME: - return getFirstName(); - - case MAIL: - return getMail(); - - case UNIVERSITY: - return getUniversity(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case LOGIN_NAME: - return isSetLoginName(); - case LAST_NAME: - return isSetLastName(); - case FIRST_NAME: - return isSetFirstName(); - case MAIL: - return isSetMail(); - case UNIVERSITY: - return isSetUniversity(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof createUser_args) - return this.equals((createUser_args)that); - return false; - } - - public boolean equals(createUser_args that) { - if (that == null) - return false; - - boolean this_present_loginName = true && this.isSetLoginName(); - boolean that_present_loginName = true && that.isSetLoginName(); - if (this_present_loginName || that_present_loginName) { - if (!(this_present_loginName && that_present_loginName)) - return false; - if (!this.loginName.equals(that.loginName)) - return false; - } - - boolean this_present_lastName = true && this.isSetLastName(); - boolean that_present_lastName = true && that.isSetLastName(); - if (this_present_lastName || that_present_lastName) { - if (!(this_present_lastName && that_present_lastName)) - return false; - if (!this.lastName.equals(that.lastName)) - return false; - } - - boolean this_present_firstName = true && this.isSetFirstName(); - boolean that_present_firstName = true && that.isSetFirstName(); - if (this_present_firstName || that_present_firstName) { - if (!(this_present_firstName && that_present_firstName)) - return false; - if (!this.firstName.equals(that.firstName)) - return false; - } - - boolean this_present_mail = true && this.isSetMail(); - boolean that_present_mail = true && that.isSetMail(); - if (this_present_mail || that_present_mail) { - if (!(this_present_mail && that_present_mail)) - return false; - if (!this.mail.equals(that.mail)) - return false; - } - - boolean this_present_university = true && this.isSetUniversity(); - boolean that_present_university = true && that.isSetUniversity(); - if (this_present_university || that_present_university) { - if (!(this_present_university && that_present_university)) - return false; - if (!this.university.equals(that.university)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(createUser_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetLoginName()).compareTo(other.isSetLoginName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLoginName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.loginName, other.loginName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLastName()).compareTo(other.isSetLastName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLastName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastName, other.lastName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFirstName()).compareTo(other.isSetFirstName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFirstName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstName, other.firstName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMail()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mail, other.mail); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUniversity()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("createUser_args("); - boolean first = true; - - sb.append("loginName:"); - if (this.loginName == null) { - sb.append("null"); - } else { - sb.append(this.loginName); - } - first = false; - if (!first) sb.append(", "); - sb.append("lastName:"); - if (this.lastName == null) { - sb.append("null"); - } else { - sb.append(this.lastName); - } - first = false; - if (!first) sb.append(", "); - sb.append("firstName:"); - if (this.firstName == null) { - sb.append("null"); - } else { - sb.append(this.firstName); - } - first = false; - if (!first) sb.append(", "); - sb.append("mail:"); - if (this.mail == null) { - sb.append("null"); - } else { - sb.append(this.mail); - } - first = false; - if (!first) sb.append(", "); - sb.append("university:"); - if (this.university == null) { - sb.append("null"); - } else { - sb.append(this.university); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class createUser_argsStandardSchemeFactory implements SchemeFactory { - public createUser_argsStandardScheme getScheme() { - return new createUser_argsStandardScheme(); - } - } - - private static class createUser_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, createUser_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // LOGIN_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.loginName = iprot.readString(); - struct.setLoginNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // LAST_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.lastName = iprot.readString(); - struct.setLastNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -3: // FIRST_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.firstName = iprot.readString(); - struct.setFirstNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -4: // MAIL - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.mail = iprot.readString(); - struct.setMailIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -5: // UNIVERSITY - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.university = iprot.readString(); - struct.setUniversityIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, createUser_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.university != null) { - oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC); - oprot.writeString(struct.university); - oprot.writeFieldEnd(); - } - if (struct.mail != null) { - oprot.writeFieldBegin(MAIL_FIELD_DESC); - oprot.writeString(struct.mail); - oprot.writeFieldEnd(); - } - if (struct.firstName != null) { - oprot.writeFieldBegin(FIRST_NAME_FIELD_DESC); - oprot.writeString(struct.firstName); - oprot.writeFieldEnd(); - } - if (struct.lastName != null) { - oprot.writeFieldBegin(LAST_NAME_FIELD_DESC); - oprot.writeString(struct.lastName); - oprot.writeFieldEnd(); - } - if (struct.loginName != null) { - oprot.writeFieldBegin(LOGIN_NAME_FIELD_DESC); - oprot.writeString(struct.loginName); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class createUser_argsTupleSchemeFactory implements SchemeFactory { - public createUser_argsTupleScheme getScheme() { - return new createUser_argsTupleScheme(); - } - } - - private static class createUser_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, createUser_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetLoginName()) { - optionals.set(0); - } - if (struct.isSetLastName()) { - optionals.set(1); - } - if (struct.isSetFirstName()) { - optionals.set(2); - } - if (struct.isSetMail()) { - optionals.set(3); - } - if (struct.isSetUniversity()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetLoginName()) { - oprot.writeString(struct.loginName); - } - if (struct.isSetLastName()) { - oprot.writeString(struct.lastName); - } - if (struct.isSetFirstName()) { - oprot.writeString(struct.firstName); - } - if (struct.isSetMail()) { - oprot.writeString(struct.mail); - } - if (struct.isSetUniversity()) { - oprot.writeString(struct.university); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, createUser_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(5); - if (incoming.get(0)) { - struct.loginName = iprot.readString(); - struct.setLoginNameIsSet(true); - } - if (incoming.get(1)) { - struct.lastName = iprot.readString(); - struct.setLastNameIsSet(true); - } - if (incoming.get(2)) { - struct.firstName = iprot.readString(); - struct.setFirstNameIsSet(true); - } - if (incoming.get(3)) { - struct.mail = iprot.readString(); - struct.setMailIsSet(true); - } - if (incoming.get(4)) { - struct.university = iprot.readString(); - struct.setUniversityIsSet(true); - } - } - } - - } - - public static class createUser_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createUser_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new createUser_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new createUser_resultTupleSchemeFactory()); - } - - public boolean success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createUser_result.class, metaDataMap); - } - - public createUser_result() { - } - - public createUser_result( - boolean success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public createUser_result(createUser_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; - } - - public createUser_result deepCopy() { - return new createUser_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = false; - } - - public boolean isSuccess() { - return this.success; - } - - public createUser_result setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Boolean.valueOf(isSuccess()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof createUser_result) - return this.equals((createUser_result)that); - return false; - } - - public boolean equals(createUser_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(createUser_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("createUser_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class createUser_resultStandardSchemeFactory implements SchemeFactory { - public createUser_resultStandardScheme getScheme() { - return new createUser_resultStandardScheme(); - } - } - - private static class createUser_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, createUser_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, createUser_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class createUser_resultTupleSchemeFactory implements SchemeFactory { - public createUser_resultTupleScheme getScheme() { - return new createUser_resultTupleScheme(); - } - } - - private static class createUser_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, createUser_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, createUser_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class writeImageRights_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeImageRights_args"); - - private static final org.apache.thrift.protocol.TField IMAGENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imagename", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)-2); - private static final org.apache.thrift.protocol.TField LAST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastName", org.apache.thrift.protocol.TType.STRING, (short)-3); - private static final org.apache.thrift.protocol.TField FIRST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstName", org.apache.thrift.protocol.TType.STRING, (short)-4); - private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("mail", org.apache.thrift.protocol.TType.STRING, (short)-5); - private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-6); - private static final org.apache.thrift.protocol.TField ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.STRING, (short)-7); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new writeImageRights_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new writeImageRights_argsTupleSchemeFactory()); - } - - public String imagename; // required - public String username; // required - public String lastName; // required - public String firstName; // required - public String mail; // required - public String university; // required - public String role; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - IMAGENAME((short)-1, "imagename"), - USERNAME((short)-2, "username"), - LAST_NAME((short)-3, "lastName"), - FIRST_NAME((short)-4, "firstName"), - MAIL((short)-5, "mail"), - UNIVERSITY((short)-6, "university"), - ROLE((short)-7, "role"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // IMAGENAME - return IMAGENAME; - case -2: // USERNAME - return USERNAME; - case -3: // LAST_NAME - return LAST_NAME; - case -4: // FIRST_NAME - return FIRST_NAME; - case -5: // MAIL - return MAIL; - case -6: // UNIVERSITY - return UNIVERSITY; - case -7: // ROLE - return ROLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.IMAGENAME, new org.apache.thrift.meta_data.FieldMetaData("imagename", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.LAST_NAME, new org.apache.thrift.meta_data.FieldMetaData("lastName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.FIRST_NAME, new org.apache.thrift.meta_data.FieldMetaData("firstName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("mail", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeImageRights_args.class, metaDataMap); - } - - public writeImageRights_args() { - } - - public writeImageRights_args( - String imagename, - String username, - String lastName, - String firstName, - String mail, - String university, - String role) - { - this(); - this.imagename = imagename; - this.username = username; - this.lastName = lastName; - this.firstName = firstName; - this.mail = mail; - this.university = university; - this.role = role; - } - - /** - * Performs a deep copy on other. - */ - public writeImageRights_args(writeImageRights_args other) { - if (other.isSetImagename()) { - this.imagename = other.imagename; - } - if (other.isSetUsername()) { - this.username = other.username; - } - if (other.isSetLastName()) { - this.lastName = other.lastName; - } - if (other.isSetFirstName()) { - this.firstName = other.firstName; - } - if (other.isSetMail()) { - this.mail = other.mail; - } - if (other.isSetUniversity()) { - this.university = other.university; - } - if (other.isSetRole()) { - this.role = other.role; - } - } - - public writeImageRights_args deepCopy() { - return new writeImageRights_args(this); - } - - @Override - public void clear() { - this.imagename = null; - this.username = null; - this.lastName = null; - this.firstName = null; - this.mail = null; - this.university = null; - this.role = null; - } - - public String getImagename() { - return this.imagename; - } - - public writeImageRights_args setImagename(String imagename) { - this.imagename = imagename; - return this; - } - - public void unsetImagename() { - this.imagename = null; - } - - /** Returns true if field imagename is set (has been assigned a value) and false otherwise */ - public boolean isSetImagename() { - return this.imagename != null; - } - - public void setImagenameIsSet(boolean value) { - if (!value) { - this.imagename = null; - } - } - - public String getUsername() { - return this.username; - } - - public writeImageRights_args setUsername(String username) { - this.username = username; - return this; - } - - public void unsetUsername() { - this.username = null; - } - - /** Returns true if field username is set (has been assigned a value) and false otherwise */ - public boolean isSetUsername() { - return this.username != null; - } - - public void setUsernameIsSet(boolean value) { - if (!value) { - this.username = null; - } - } - - public String getLastName() { - return this.lastName; - } - - public writeImageRights_args setLastName(String lastName) { - this.lastName = lastName; - return this; - } - - public void unsetLastName() { - this.lastName = null; - } - - /** Returns true if field lastName is set (has been assigned a value) and false otherwise */ - public boolean isSetLastName() { - return this.lastName != null; - } - - public void setLastNameIsSet(boolean value) { - if (!value) { - this.lastName = null; - } - } - - public String getFirstName() { - return this.firstName; - } - - public writeImageRights_args setFirstName(String firstName) { - this.firstName = firstName; - return this; - } - - public void unsetFirstName() { - this.firstName = null; - } - - /** Returns true if field firstName is set (has been assigned a value) and false otherwise */ - public boolean isSetFirstName() { - return this.firstName != null; - } - - public void setFirstNameIsSet(boolean value) { - if (!value) { - this.firstName = null; - } - } - - public String getMail() { - return this.mail; - } - - public writeImageRights_args setMail(String mail) { - this.mail = mail; - return this; - } - - public void unsetMail() { - this.mail = null; - } - - /** Returns true if field mail is set (has been assigned a value) and false otherwise */ - public boolean isSetMail() { - return this.mail != null; - } - - public void setMailIsSet(boolean value) { - if (!value) { - this.mail = null; - } - } - - public String getUniversity() { - return this.university; - } - - public writeImageRights_args setUniversity(String university) { - this.university = university; - return this; - } - - public void unsetUniversity() { - this.university = null; - } - - /** Returns true if field university is set (has been assigned a value) and false otherwise */ - public boolean isSetUniversity() { - return this.university != null; - } - - public void setUniversityIsSet(boolean value) { - if (!value) { - this.university = null; - } - } - - public String getRole() { - return this.role; - } - - public writeImageRights_args setRole(String role) { - this.role = role; - return this; - } - - public void unsetRole() { - this.role = null; - } - - /** Returns true if field role is set (has been assigned a value) and false otherwise */ - public boolean isSetRole() { - return this.role != null; - } - - public void setRoleIsSet(boolean value) { - if (!value) { - this.role = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case IMAGENAME: - if (value == null) { - unsetImagename(); - } else { - setImagename((String)value); - } - break; - - case USERNAME: - if (value == null) { - unsetUsername(); - } else { - setUsername((String)value); - } - break; - - case LAST_NAME: - if (value == null) { - unsetLastName(); - } else { - setLastName((String)value); - } - break; - - case FIRST_NAME: - if (value == null) { - unsetFirstName(); - } else { - setFirstName((String)value); - } - break; - - case MAIL: - if (value == null) { - unsetMail(); - } else { - setMail((String)value); - } - break; - - case UNIVERSITY: - if (value == null) { - unsetUniversity(); - } else { - setUniversity((String)value); - } - break; - - case ROLE: - if (value == null) { - unsetRole(); - } else { - setRole((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case IMAGENAME: - return getImagename(); - - case USERNAME: - return getUsername(); - - case LAST_NAME: - return getLastName(); - - case FIRST_NAME: - return getFirstName(); - - case MAIL: - return getMail(); - - case UNIVERSITY: - return getUniversity(); - - case ROLE: - return getRole(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case IMAGENAME: - return isSetImagename(); - case USERNAME: - return isSetUsername(); - case LAST_NAME: - return isSetLastName(); - case FIRST_NAME: - return isSetFirstName(); - case MAIL: - return isSetMail(); - case UNIVERSITY: - return isSetUniversity(); - case ROLE: - return isSetRole(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof writeImageRights_args) - return this.equals((writeImageRights_args)that); - return false; - } - - public boolean equals(writeImageRights_args that) { - if (that == null) - return false; - - boolean this_present_imagename = true && this.isSetImagename(); - boolean that_present_imagename = true && that.isSetImagename(); - if (this_present_imagename || that_present_imagename) { - if (!(this_present_imagename && that_present_imagename)) - return false; - if (!this.imagename.equals(that.imagename)) - return false; - } - - boolean this_present_username = true && this.isSetUsername(); - boolean that_present_username = true && that.isSetUsername(); - if (this_present_username || that_present_username) { - if (!(this_present_username && that_present_username)) - return false; - if (!this.username.equals(that.username)) - return false; - } - - boolean this_present_lastName = true && this.isSetLastName(); - boolean that_present_lastName = true && that.isSetLastName(); - if (this_present_lastName || that_present_lastName) { - if (!(this_present_lastName && that_present_lastName)) - return false; - if (!this.lastName.equals(that.lastName)) - return false; - } - - boolean this_present_firstName = true && this.isSetFirstName(); - boolean that_present_firstName = true && that.isSetFirstName(); - if (this_present_firstName || that_present_firstName) { - if (!(this_present_firstName && that_present_firstName)) - return false; - if (!this.firstName.equals(that.firstName)) - return false; - } - - boolean this_present_mail = true && this.isSetMail(); - boolean that_present_mail = true && that.isSetMail(); - if (this_present_mail || that_present_mail) { - if (!(this_present_mail && that_present_mail)) - return false; - if (!this.mail.equals(that.mail)) - return false; - } - - boolean this_present_university = true && this.isSetUniversity(); - boolean that_present_university = true && that.isSetUniversity(); - if (this_present_university || that_present_university) { - if (!(this_present_university && that_present_university)) - return false; - if (!this.university.equals(that.university)) - return false; - } - - boolean this_present_role = true && this.isSetRole(); - boolean that_present_role = true && that.isSetRole(); - if (this_present_role || that_present_role) { - if (!(this_present_role && that_present_role)) - return false; - if (!this.role.equals(that.role)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(writeImageRights_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetImagename()).compareTo(other.isSetImagename()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetImagename()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagename, other.imagename); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUsername()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLastName()).compareTo(other.isSetLastName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLastName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastName, other.lastName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFirstName()).compareTo(other.isSetFirstName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFirstName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstName, other.firstName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMail()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mail, other.mail); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUniversity()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRole()).compareTo(other.isSetRole()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRole()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, other.role); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("writeImageRights_args("); - boolean first = true; - - sb.append("imagename:"); - if (this.imagename == null) { - sb.append("null"); - } else { - sb.append(this.imagename); - } - first = false; - if (!first) sb.append(", "); - sb.append("username:"); - if (this.username == null) { - sb.append("null"); - } else { - sb.append(this.username); - } - first = false; - if (!first) sb.append(", "); - sb.append("lastName:"); - if (this.lastName == null) { - sb.append("null"); - } else { - sb.append(this.lastName); - } - first = false; - if (!first) sb.append(", "); - sb.append("firstName:"); - if (this.firstName == null) { - sb.append("null"); - } else { - sb.append(this.firstName); - } - first = false; - if (!first) sb.append(", "); - sb.append("mail:"); - if (this.mail == null) { - sb.append("null"); - } else { - sb.append(this.mail); - } - first = false; - if (!first) sb.append(", "); - sb.append("university:"); - if (this.university == null) { - sb.append("null"); - } else { - sb.append(this.university); - } - first = false; - if (!first) sb.append(", "); - sb.append("role:"); - if (this.role == null) { - sb.append("null"); - } else { - sb.append(this.role); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class writeImageRights_argsStandardSchemeFactory implements SchemeFactory { - public writeImageRights_argsStandardScheme getScheme() { - return new writeImageRights_argsStandardScheme(); - } - } - - private static class writeImageRights_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, writeImageRights_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // IMAGENAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.imagename = iprot.readString(); - struct.setImagenameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // USERNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -3: // LAST_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.lastName = iprot.readString(); - struct.setLastNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -4: // FIRST_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.firstName = iprot.readString(); - struct.setFirstNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -5: // MAIL - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.mail = iprot.readString(); - struct.setMailIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -6: // UNIVERSITY - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.university = iprot.readString(); - struct.setUniversityIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -7: // ROLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.role = iprot.readString(); - struct.setRoleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, writeImageRights_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.role != null) { - oprot.writeFieldBegin(ROLE_FIELD_DESC); - oprot.writeString(struct.role); - oprot.writeFieldEnd(); - } - if (struct.university != null) { - oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC); - oprot.writeString(struct.university); - oprot.writeFieldEnd(); - } - if (struct.mail != null) { - oprot.writeFieldBegin(MAIL_FIELD_DESC); - oprot.writeString(struct.mail); - oprot.writeFieldEnd(); - } - if (struct.firstName != null) { - oprot.writeFieldBegin(FIRST_NAME_FIELD_DESC); - oprot.writeString(struct.firstName); - oprot.writeFieldEnd(); - } - if (struct.lastName != null) { - oprot.writeFieldBegin(LAST_NAME_FIELD_DESC); - oprot.writeString(struct.lastName); - oprot.writeFieldEnd(); - } - if (struct.username != null) { - oprot.writeFieldBegin(USERNAME_FIELD_DESC); - oprot.writeString(struct.username); - oprot.writeFieldEnd(); - } - if (struct.imagename != null) { - oprot.writeFieldBegin(IMAGENAME_FIELD_DESC); - oprot.writeString(struct.imagename); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class writeImageRights_argsTupleSchemeFactory implements SchemeFactory { - public writeImageRights_argsTupleScheme getScheme() { - return new writeImageRights_argsTupleScheme(); - } - } - - private static class writeImageRights_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, writeImageRights_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetImagename()) { - optionals.set(0); - } - if (struct.isSetUsername()) { - optionals.set(1); - } - if (struct.isSetLastName()) { - optionals.set(2); - } - if (struct.isSetFirstName()) { - optionals.set(3); - } - if (struct.isSetMail()) { - optionals.set(4); - } - if (struct.isSetUniversity()) { - optionals.set(5); - } - if (struct.isSetRole()) { - optionals.set(6); - } - oprot.writeBitSet(optionals, 7); - if (struct.isSetImagename()) { - oprot.writeString(struct.imagename); - } - if (struct.isSetUsername()) { - oprot.writeString(struct.username); - } - if (struct.isSetLastName()) { - oprot.writeString(struct.lastName); - } - if (struct.isSetFirstName()) { - oprot.writeString(struct.firstName); - } - if (struct.isSetMail()) { - oprot.writeString(struct.mail); - } - if (struct.isSetUniversity()) { - oprot.writeString(struct.university); - } - if (struct.isSetRole()) { - oprot.writeString(struct.role); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, writeImageRights_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(7); - if (incoming.get(0)) { - struct.imagename = iprot.readString(); - struct.setImagenameIsSet(true); - } - if (incoming.get(1)) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - } - if (incoming.get(2)) { - struct.lastName = iprot.readString(); - struct.setLastNameIsSet(true); - } - if (incoming.get(3)) { - struct.firstName = iprot.readString(); - struct.setFirstNameIsSet(true); - } - if (incoming.get(4)) { - struct.mail = iprot.readString(); - struct.setMailIsSet(true); - } - if (incoming.get(5)) { - struct.university = iprot.readString(); - struct.setUniversityIsSet(true); - } - if (incoming.get(6)) { - struct.role = iprot.readString(); - struct.setRoleIsSet(true); - } - } - } - - } - - public static class writeImageRights_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeImageRights_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new writeImageRights_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new writeImageRights_resultTupleSchemeFactory()); - } - - public boolean success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeImageRights_result.class, metaDataMap); - } - - public writeImageRights_result() { - } - - public writeImageRights_result( - boolean success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public writeImageRights_result(writeImageRights_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; - } - - public writeImageRights_result deepCopy() { - return new writeImageRights_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = false; - } - - public boolean isSuccess() { - return this.success; - } - - public writeImageRights_result setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Boolean.valueOf(isSuccess()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof writeImageRights_result) - return this.equals((writeImageRights_result)that); - return false; - } - - public boolean equals(writeImageRights_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(writeImageRights_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("writeImageRights_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class writeImageRights_resultStandardSchemeFactory implements SchemeFactory { - public writeImageRights_resultStandardScheme getScheme() { - return new writeImageRights_resultStandardScheme(); - } - } - - private static class writeImageRights_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, writeImageRights_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, writeImageRights_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class writeImageRights_resultTupleSchemeFactory implements SchemeFactory { - public writeImageRights_resultTupleScheme getScheme() { - return new writeImageRights_resultTupleScheme(); - } - } - - private static class writeImageRights_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, writeImageRights_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, writeImageRights_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class writeLectureRights_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeLectureRights_args"); - - private static final org.apache.thrift.protocol.TField LECTURENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lecturename", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)-2); - private static final org.apache.thrift.protocol.TField LAST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastName", org.apache.thrift.protocol.TType.STRING, (short)-3); - private static final org.apache.thrift.protocol.TField FIRST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstName", org.apache.thrift.protocol.TType.STRING, (short)-4); - private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("mail", org.apache.thrift.protocol.TType.STRING, (short)-5); - private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-6); - private static final org.apache.thrift.protocol.TField ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.STRING, (short)-7); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new writeLectureRights_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new writeLectureRights_argsTupleSchemeFactory()); - } - - public String lecturename; // required - public String username; // required - public String lastName; // required - public String firstName; // required - public String mail; // required - public String university; // required - public String role; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - LECTURENAME((short)-1, "lecturename"), - USERNAME((short)-2, "username"), - LAST_NAME((short)-3, "lastName"), - FIRST_NAME((short)-4, "firstName"), - MAIL((short)-5, "mail"), - UNIVERSITY((short)-6, "university"), - ROLE((short)-7, "role"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // LECTURENAME - return LECTURENAME; - case -2: // USERNAME - return USERNAME; - case -3: // LAST_NAME - return LAST_NAME; - case -4: // FIRST_NAME - return FIRST_NAME; - case -5: // MAIL - return MAIL; - case -6: // UNIVERSITY - return UNIVERSITY; - case -7: // ROLE - return ROLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.LECTURENAME, new org.apache.thrift.meta_data.FieldMetaData("lecturename", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.LAST_NAME, new org.apache.thrift.meta_data.FieldMetaData("lastName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.FIRST_NAME, new org.apache.thrift.meta_data.FieldMetaData("firstName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("mail", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeLectureRights_args.class, metaDataMap); - } - - public writeLectureRights_args() { - } - - public writeLectureRights_args( - String lecturename, - String username, - String lastName, - String firstName, - String mail, - String university, - String role) - { - this(); - this.lecturename = lecturename; - this.username = username; - this.lastName = lastName; - this.firstName = firstName; - this.mail = mail; - this.university = university; - this.role = role; - } - - /** - * Performs a deep copy on other. - */ - public writeLectureRights_args(writeLectureRights_args other) { - if (other.isSetLecturename()) { - this.lecturename = other.lecturename; - } - if (other.isSetUsername()) { - this.username = other.username; - } - if (other.isSetLastName()) { - this.lastName = other.lastName; - } - if (other.isSetFirstName()) { - this.firstName = other.firstName; - } - if (other.isSetMail()) { - this.mail = other.mail; - } - if (other.isSetUniversity()) { - this.university = other.university; - } - if (other.isSetRole()) { - this.role = other.role; - } - } - - public writeLectureRights_args deepCopy() { - return new writeLectureRights_args(this); - } - - @Override - public void clear() { - this.lecturename = null; - this.username = null; - this.lastName = null; - this.firstName = null; - this.mail = null; - this.university = null; - this.role = null; - } - - public String getLecturename() { - return this.lecturename; - } - - public writeLectureRights_args setLecturename(String lecturename) { - this.lecturename = lecturename; - return this; - } - - public void unsetLecturename() { - this.lecturename = null; - } - - /** Returns true if field lecturename is set (has been assigned a value) and false otherwise */ - public boolean isSetLecturename() { - return this.lecturename != null; - } - - public void setLecturenameIsSet(boolean value) { - if (!value) { - this.lecturename = null; - } - } - - public String getUsername() { - return this.username; - } - - public writeLectureRights_args setUsername(String username) { - this.username = username; - return this; - } - - public void unsetUsername() { - this.username = null; - } - - /** Returns true if field username is set (has been assigned a value) and false otherwise */ - public boolean isSetUsername() { - return this.username != null; - } - - public void setUsernameIsSet(boolean value) { - if (!value) { - this.username = null; - } - } - - public String getLastName() { - return this.lastName; - } - - public writeLectureRights_args setLastName(String lastName) { - this.lastName = lastName; - return this; - } - - public void unsetLastName() { - this.lastName = null; - } - - /** Returns true if field lastName is set (has been assigned a value) and false otherwise */ - public boolean isSetLastName() { - return this.lastName != null; - } - - public void setLastNameIsSet(boolean value) { - if (!value) { - this.lastName = null; - } - } - - public String getFirstName() { - return this.firstName; - } - - public writeLectureRights_args setFirstName(String firstName) { - this.firstName = firstName; - return this; - } - - public void unsetFirstName() { - this.firstName = null; - } - - /** Returns true if field firstName is set (has been assigned a value) and false otherwise */ - public boolean isSetFirstName() { - return this.firstName != null; - } - - public void setFirstNameIsSet(boolean value) { - if (!value) { - this.firstName = null; - } - } - - public String getMail() { - return this.mail; - } - - public writeLectureRights_args setMail(String mail) { - this.mail = mail; - return this; - } - - public void unsetMail() { - this.mail = null; - } - - /** Returns true if field mail is set (has been assigned a value) and false otherwise */ - public boolean isSetMail() { - return this.mail != null; - } - - public void setMailIsSet(boolean value) { - if (!value) { - this.mail = null; - } - } - - public String getUniversity() { - return this.university; - } - - public writeLectureRights_args setUniversity(String university) { - this.university = university; - return this; - } - - public void unsetUniversity() { - this.university = null; - } - - /** Returns true if field university is set (has been assigned a value) and false otherwise */ - public boolean isSetUniversity() { - return this.university != null; - } - - public void setUniversityIsSet(boolean value) { - if (!value) { - this.university = null; - } - } - - public String getRole() { - return this.role; - } - - public writeLectureRights_args setRole(String role) { - this.role = role; - return this; - } - - public void unsetRole() { - this.role = null; - } - - /** Returns true if field role is set (has been assigned a value) and false otherwise */ - public boolean isSetRole() { - return this.role != null; - } - - public void setRoleIsSet(boolean value) { - if (!value) { - this.role = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case LECTURENAME: - if (value == null) { - unsetLecturename(); - } else { - setLecturename((String)value); - } - break; - - case USERNAME: - if (value == null) { - unsetUsername(); - } else { - setUsername((String)value); - } - break; - - case LAST_NAME: - if (value == null) { - unsetLastName(); - } else { - setLastName((String)value); - } - break; - - case FIRST_NAME: - if (value == null) { - unsetFirstName(); - } else { - setFirstName((String)value); - } - break; - - case MAIL: - if (value == null) { - unsetMail(); - } else { - setMail((String)value); - } - break; - - case UNIVERSITY: - if (value == null) { - unsetUniversity(); - } else { - setUniversity((String)value); - } - break; - - case ROLE: - if (value == null) { - unsetRole(); - } else { - setRole((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case LECTURENAME: - return getLecturename(); - - case USERNAME: - return getUsername(); - - case LAST_NAME: - return getLastName(); - - case FIRST_NAME: - return getFirstName(); - - case MAIL: - return getMail(); - - case UNIVERSITY: - return getUniversity(); - - case ROLE: - return getRole(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case LECTURENAME: - return isSetLecturename(); - case USERNAME: - return isSetUsername(); - case LAST_NAME: - return isSetLastName(); - case FIRST_NAME: - return isSetFirstName(); - case MAIL: - return isSetMail(); - case UNIVERSITY: - return isSetUniversity(); - case ROLE: - return isSetRole(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof writeLectureRights_args) - return this.equals((writeLectureRights_args)that); - return false; - } - - public boolean equals(writeLectureRights_args that) { - if (that == null) - return false; - - boolean this_present_lecturename = true && this.isSetLecturename(); - boolean that_present_lecturename = true && that.isSetLecturename(); - if (this_present_lecturename || that_present_lecturename) { - if (!(this_present_lecturename && that_present_lecturename)) - return false; - if (!this.lecturename.equals(that.lecturename)) - return false; - } - - boolean this_present_username = true && this.isSetUsername(); - boolean that_present_username = true && that.isSetUsername(); - if (this_present_username || that_present_username) { - if (!(this_present_username && that_present_username)) - return false; - if (!this.username.equals(that.username)) - return false; - } - - boolean this_present_lastName = true && this.isSetLastName(); - boolean that_present_lastName = true && that.isSetLastName(); - if (this_present_lastName || that_present_lastName) { - if (!(this_present_lastName && that_present_lastName)) - return false; - if (!this.lastName.equals(that.lastName)) - return false; - } - - boolean this_present_firstName = true && this.isSetFirstName(); - boolean that_present_firstName = true && that.isSetFirstName(); - if (this_present_firstName || that_present_firstName) { - if (!(this_present_firstName && that_present_firstName)) - return false; - if (!this.firstName.equals(that.firstName)) - return false; - } - - boolean this_present_mail = true && this.isSetMail(); - boolean that_present_mail = true && that.isSetMail(); - if (this_present_mail || that_present_mail) { - if (!(this_present_mail && that_present_mail)) - return false; - if (!this.mail.equals(that.mail)) - return false; - } - - boolean this_present_university = true && this.isSetUniversity(); - boolean that_present_university = true && that.isSetUniversity(); - if (this_present_university || that_present_university) { - if (!(this_present_university && that_present_university)) - return false; - if (!this.university.equals(that.university)) - return false; - } - - boolean this_present_role = true && this.isSetRole(); - boolean that_present_role = true && that.isSetRole(); - if (this_present_role || that_present_role) { - if (!(this_present_role && that_present_role)) - return false; - if (!this.role.equals(that.role)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(writeLectureRights_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetLecturename()).compareTo(other.isSetLecturename()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLecturename()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lecturename, other.lecturename); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUsername()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLastName()).compareTo(other.isSetLastName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLastName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastName, other.lastName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFirstName()).compareTo(other.isSetFirstName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFirstName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstName, other.firstName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMail()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mail, other.mail); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUniversity()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRole()).compareTo(other.isSetRole()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRole()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, other.role); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("writeLectureRights_args("); - boolean first = true; - - sb.append("lecturename:"); - if (this.lecturename == null) { - sb.append("null"); - } else { - sb.append(this.lecturename); - } - first = false; - if (!first) sb.append(", "); - sb.append("username:"); - if (this.username == null) { - sb.append("null"); - } else { - sb.append(this.username); - } - first = false; - if (!first) sb.append(", "); - sb.append("lastName:"); - if (this.lastName == null) { - sb.append("null"); - } else { - sb.append(this.lastName); - } - first = false; - if (!first) sb.append(", "); - sb.append("firstName:"); - if (this.firstName == null) { - sb.append("null"); - } else { - sb.append(this.firstName); - } - first = false; - if (!first) sb.append(", "); - sb.append("mail:"); - if (this.mail == null) { - sb.append("null"); - } else { - sb.append(this.mail); - } - first = false; - if (!first) sb.append(", "); - sb.append("university:"); - if (this.university == null) { - sb.append("null"); - } else { - sb.append(this.university); - } - first = false; - if (!first) sb.append(", "); - sb.append("role:"); - if (this.role == null) { - sb.append("null"); - } else { - sb.append(this.role); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class writeLectureRights_argsStandardSchemeFactory implements SchemeFactory { - public writeLectureRights_argsStandardScheme getScheme() { - return new writeLectureRights_argsStandardScheme(); - } - } - - private static class writeLectureRights_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, writeLectureRights_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // LECTURENAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.lecturename = iprot.readString(); - struct.setLecturenameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // USERNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -3: // LAST_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.lastName = iprot.readString(); - struct.setLastNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -4: // FIRST_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.firstName = iprot.readString(); - struct.setFirstNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -5: // MAIL - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.mail = iprot.readString(); - struct.setMailIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -6: // UNIVERSITY - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.university = iprot.readString(); - struct.setUniversityIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -7: // ROLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.role = iprot.readString(); - struct.setRoleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, writeLectureRights_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.role != null) { - oprot.writeFieldBegin(ROLE_FIELD_DESC); - oprot.writeString(struct.role); - oprot.writeFieldEnd(); - } - if (struct.university != null) { - oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC); - oprot.writeString(struct.university); - oprot.writeFieldEnd(); - } - if (struct.mail != null) { - oprot.writeFieldBegin(MAIL_FIELD_DESC); - oprot.writeString(struct.mail); - oprot.writeFieldEnd(); - } - if (struct.firstName != null) { - oprot.writeFieldBegin(FIRST_NAME_FIELD_DESC); - oprot.writeString(struct.firstName); - oprot.writeFieldEnd(); - } - if (struct.lastName != null) { - oprot.writeFieldBegin(LAST_NAME_FIELD_DESC); - oprot.writeString(struct.lastName); - oprot.writeFieldEnd(); - } - if (struct.username != null) { - oprot.writeFieldBegin(USERNAME_FIELD_DESC); - oprot.writeString(struct.username); - oprot.writeFieldEnd(); - } - if (struct.lecturename != null) { - oprot.writeFieldBegin(LECTURENAME_FIELD_DESC); - oprot.writeString(struct.lecturename); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class writeLectureRights_argsTupleSchemeFactory implements SchemeFactory { - public writeLectureRights_argsTupleScheme getScheme() { - return new writeLectureRights_argsTupleScheme(); - } - } - - private static class writeLectureRights_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, writeLectureRights_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetLecturename()) { - optionals.set(0); - } - if (struct.isSetUsername()) { - optionals.set(1); - } - if (struct.isSetLastName()) { - optionals.set(2); - } - if (struct.isSetFirstName()) { - optionals.set(3); - } - if (struct.isSetMail()) { - optionals.set(4); - } - if (struct.isSetUniversity()) { - optionals.set(5); - } - if (struct.isSetRole()) { - optionals.set(6); - } - oprot.writeBitSet(optionals, 7); - if (struct.isSetLecturename()) { - oprot.writeString(struct.lecturename); - } - if (struct.isSetUsername()) { - oprot.writeString(struct.username); - } - if (struct.isSetLastName()) { - oprot.writeString(struct.lastName); - } - if (struct.isSetFirstName()) { - oprot.writeString(struct.firstName); - } - if (struct.isSetMail()) { - oprot.writeString(struct.mail); - } - if (struct.isSetUniversity()) { - oprot.writeString(struct.university); - } - if (struct.isSetRole()) { - oprot.writeString(struct.role); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, writeLectureRights_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(7); - if (incoming.get(0)) { - struct.lecturename = iprot.readString(); - struct.setLecturenameIsSet(true); - } - if (incoming.get(1)) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - } - if (incoming.get(2)) { - struct.lastName = iprot.readString(); - struct.setLastNameIsSet(true); - } - if (incoming.get(3)) { - struct.firstName = iprot.readString(); - struct.setFirstNameIsSet(true); - } - if (incoming.get(4)) { - struct.mail = iprot.readString(); - struct.setMailIsSet(true); - } - if (incoming.get(5)) { - struct.university = iprot.readString(); - struct.setUniversityIsSet(true); - } - if (incoming.get(6)) { - struct.role = iprot.readString(); - struct.setRoleIsSet(true); - } - } - } - - } - - public static class writeLectureRights_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeLectureRights_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new writeLectureRights_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new writeLectureRights_resultTupleSchemeFactory()); - } - - public boolean success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeLectureRights_result.class, metaDataMap); - } - - public writeLectureRights_result() { - } - - public writeLectureRights_result( - boolean success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public writeLectureRights_result(writeLectureRights_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; - } - - public writeLectureRights_result deepCopy() { - return new writeLectureRights_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = false; - } - - public boolean isSuccess() { - return this.success; - } - - public writeLectureRights_result setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Boolean.valueOf(isSuccess()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof writeLectureRights_result) - return this.equals((writeLectureRights_result)that); - return false; - } - - public boolean equals(writeLectureRights_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(writeLectureRights_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("writeLectureRights_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class writeLectureRights_resultStandardSchemeFactory implements SchemeFactory { - public writeLectureRights_resultStandardScheme getScheme() { - return new writeLectureRights_resultStandardScheme(); - } - } - - private static class writeLectureRights_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, writeLectureRights_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, writeLectureRights_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class writeLectureRights_resultTupleSchemeFactory implements SchemeFactory { - public writeLectureRights_resultTupleScheme getScheme() { - return new writeLectureRights_resultTupleScheme(); - } - } - - private static class writeLectureRights_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, writeLectureRights_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, writeLectureRights_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readBool(); - struct.setSuccessIsSet(true); - } - } - } - - } - -} diff --git a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/ServerHandler.java b/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/ServerHandler.java deleted file mode 100644 index 35b9579a..00000000 --- a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/ServerHandler.java +++ /dev/null @@ -1,547 +0,0 @@ -package server; - -import java.io.File; -import java.io.IOException; -import java.math.BigInteger; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.sql.SQLException; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; -import models.Configuration; -import org.apache.commons.io.FileUtils; -import org.apache.log4j.Logger; -import org.apache.thrift.TException; - -import com.mysql.jdbc.StringUtils; - -import sql.SQL; -import util.XMLCreator; - - - -public class ServerHandler implements Server.Iface { - static SQL sql = new SQL(); - - private static Logger log = Logger.getLogger(ServerHandler.class); - - @Override - public User getFtpUser() throws TException { - log.info(new Date() + " - returning FTPUser..."); - User user = new User(); - user.setUserName(UUID.randomUUID().toString().substring(0, 8)); - user.setPassword(getEncodedSha1Sum(UUID.randomUUID().toString() - .substring(0, 8))); - if (Configuration.config.getAbsolute_path().endsWith("/")) { - user.setPath(Configuration.config.getAbsolute_path()); - } else { - user.setPath(Configuration.config.getAbsolute_path() + "/"); - } - - // check if folder temp and folder prod exist - if (folderTempExists() == true && folderProdExists() == true) { - sql.writeFTPUser(user.getUserName(), user.getPassword()); - return user; - } else { - log.info(new Date() + " - returning null user"); - return null; - } - } - - public boolean folderTempExists() { - // check if folder temp exists, otherwise create it - Path path = null; - if (Configuration.config.getAbsolute_path().endsWith("/")) { - path = Paths.get(Configuration.config.getAbsolute_path() + "temp"); - } else { - path = Paths.get(Configuration.config.getAbsolute_path() + "/temp"); - } - - if (Files.exists(path) == true) { - log.info(new Date() + " - folder '" + path - + "' exists, no further action"); - return true; - } else { - // create directory and set permissions - boolean success = (new File(path + "")).mkdirs(); - - if (!success) { - log.info(new Date() + " - failed to create folder '" + path - + "'"); - return false; - } else { - // set permissions - try { - Runtime.getRuntime().exec("chmod 777 " + path); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - log.info(new Date() + " - folder '" + path - + "' successfully created"); - return true; - } - } - - }// end folderTempExists() - - public boolean folderProdExists() { - // check if folder temp exists, otherwise create it - Path path = null; - if (Configuration.config.getAbsolute_path().endsWith("/")) { - path = Paths.get(Configuration.config.getAbsolute_path() + "prod"); - } else { - path = Paths.get(Configuration.config.getAbsolute_path() + "/prod"); - } - - if (Files.exists(path) == true) { - log.info(new Date() + " - folder '" + path - + "' exists, no further action"); - return true; - } else { - // create directory and set permissions - boolean success = (new File(path + "")).mkdirs(); - - if (!success) { - log.info(new Date() + " - failed to create folder '" + path - + "'"); - return false; - } else { - // set permissions - try { - Runtime.getRuntime().exec("chmod 777 " + path); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - log.info(new Date() + " - folder '" + path - + "' successfully created"); - return true; - } - } - - }// end folderProdExists() - - - - public String getEncodedSha1Sum(String key) { - try { - MessageDigest md = MessageDigest.getInstance("SHA1"); - md.update(key.getBytes()); - log.info(new Date() + " - successfully returned EncodedSha1Sum"); - return new BigInteger(1, md.digest()).toString(16); - } catch (NoSuchAlgorithmException e) { - // handle error case to taste - } - return null; - } - - @Override - public long DeleteFtpUser(String user) throws TException { - return sql.DeleteUser(user); - } - - @Override - public String getPathOfImage(String image_id, String version) - throws TException { - log.info(new Date() + " - successfully returned PathOfImage: " - + sql.getPathOfImage(image_id, version)); - return sql.getPathOfImage(image_id, version); - - } - - @Override - public boolean writeVLdata(String imagename, String desc ,String login, - String firstname, String lastname, String university, String Mail, - String Tel, String Fak, boolean license, boolean internet, - long ram, long cpu, String imagePath, boolean isTemplate, - long filesize, long shareMode, String os) throws TException { - - String mode=null; - - if(shareMode==0) - { - mode="only_local"; - } - else{ - mode="to_be_published"; - } - - String pk_institution = sql.setInstitution(university); - - String pk_person = sql.setPerson(login, lastname, firstname, Mail, - new Date(), pk_institution); - - //OS impl Select and write - //ACHTUNG: Anzahl der Leerzeichen muss eingehalten werden: 'Windows 7 32 bit" - String pk_os=sql.getOSpk(os.substring(0, nthIndexOf(os, " ", 2)),os.substring(nthIndexOf(os," ", 2), os.lastIndexOf(" ")).replace(" ", "")); - - sql.setImageData(pk_person, license, internet, cpu, ram, imagename,desc, - imagePath, isTemplate, filesize,mode,pk_os); - - log.info(new Date() + " - written VLdata"); - // TODO Auto-generated method stub - return true; - } - - @Override - public List getImageList() throws TException { - return sql.getImageList(); - - } - - @Override - public List getAllOS() throws TException { - return sql.getAllOS(); - - } - - @Override - public Map getPersonData(String Vorname, String Nachname) - throws TException { - return sql.getPersonData(Vorname, Nachname); - - } - - @Override - public boolean writeLecturedata(String name, String shortdesc, String desc, - String startDate, String endDate, boolean isActive, - String imagename, String login, String firstname, String lastname, - String university, String Mail, String Tel, String Fak) - throws TException { - String pk_image = null; - Map map = new HashMap(); - int imageversion = 0; - String pk_institution = sql.setInstitution(university); - String pk_person = sql.setPerson(login, lastname, firstname, Mail, - new Date(), pk_institution); - - map = sql.getImageIDandVersion(imagename); - - pk_image = map.get("GUID"); - imageversion = Integer.parseInt(map.get("version")); - sql.setLectureData(pk_person, pk_image, imageversion, name, desc, - shortdesc, startDate, endDate, isActive); - XMLCreator xml = new XMLCreator(sql.getConnection(), name); - try { - xml.create(name); - log.info(new Date() + " - XML created."); - } catch (SQLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (TransformerException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return false; - } - - @Override - public boolean startFileCopy(String filename) throws TException { - //copy file from folder temp to folder prod - String file = Configuration.config.getAbsolute_path() + "temp/" - + filename; - File tmpFile = new File(file); - - log.info(new Date() - + " - Trying to move file to '/srv/openslx/nfs/prod/" - + tmpFile.getName() + "'"); - try { - FileUtils.moveFile(tmpFile, - new File(Configuration.config.getAbsolute_path() + "prod/" - + filename)); - // int ret = sql.UpdateImagePath(filename); - if (sql.UpdateImagePath(filename) == 0) { - log.info(new Date() + " - file moved and database updated."); - } - - } catch (IOException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to move file."); - e.printStackTrace(); - } - return true; - } - - @Override - public Map getImageData(String imageid, String imageversion) - throws TException { - log.info(new Date() + " - returning ImageData: " - + sql.getImageData(imageid, imageversion).size() + "items."); - return sql.getImageData(imageid, imageversion); - } - - @Override - public boolean updateImageData(String name, String newName,String desc, - String image_path, boolean license, boolean internet, long ram, - long cpu, String id, String version, boolean isTemplate, - long filesize, long shareMode, String os) throws TException { - String mode=null; - - if(shareMode==0) - { - mode="only_local"; - } - else{ - mode="to_be_published"; - } - String pk_os=sql.getOSpk(os.substring(0, nthIndexOf(os, " ", 2)),os.substring(nthIndexOf(os," ", 2), os.lastIndexOf(" ")).replace(" ", "")); - sql.UpdateImageData(name, newName,desc ,image_path, license, internet, cpu, - ram, id, version, isTemplate, filesize,mode,pk_os); - return false; - } - - - - - @Override - public List getLectureList() throws TException { - - - log.info(new Date().toString() + " - returning LectureList: " - + sql.getLectureList().size() + " items."); - return sql.getLectureList(); - - - } - - @Override - public boolean updateLecturedata(String name, String newName, - String shortdesc, String desc, String startDate, String endDate, - boolean isActive, String imageid,String imageversion,String user ,String firstname, - String lastname, String university, String Mail, String Tel, - String Fak, String id) throws TException { - Map map = new HashMap(); - map = sql.getDeleteXMLData(id); - sql.updateLectureData(imageid, imageversion, lastname, newName, desc, - shortdesc, startDate, endDate, isActive, id); - - String path = Configuration.config.getAbsolute_path() - + "prod/" - + map.get("date") - .substring(0, map.get("date").length() - 2) + "_" - + university + "_" + user + "_" + map.get("name") + ".xml"; - File tmpFile=new File(path); - try { - FileUtils.forceDelete(tmpFile); - } catch (IOException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - XMLCreator xml = new XMLCreator(sql.getConnection(), newName); - try { - xml.create(newName); - } catch (SQLException | ParserConfigurationException - | TransformerException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - return false; - } - - @Override - public boolean deleteImageServer(String imageid, String imageversion) - throws TException { - - String stringFile = sql.getFile(imageid, imageversion); - log.info(new Date() + " - File to Delete: " + stringFile); - - File tmpFile = new File(Configuration.config.getAbsolute_path() - + stringFile); - - try { - // File wird von Server gel�scht - FileUtils.forceDelete(tmpFile); - return true; - - } catch (IOException e) { - log.info(new Date() + " - Failed to execute deleteImageServer."); - e.printStackTrace(); - - } - - return false; - } - - @Override - public boolean deleteImageData(String id, String version) throws TException { - - return sql.deleteImage(id, version); - } - - @Override - public boolean connectedToLecture(String id, String version) - throws TException { - // TODO Auto-generated method stub - return sql.connectedToLecture(id, version); - } - - public boolean deleteLecture(String id, String hs, String user) { - Map map = new HashMap(); - map = sql.getDeleteXMLData(id); - try { - - String path = Configuration.config.getAbsolute_path() - + "prod/" - + map.get("date") - .substring(0, map.get("date").length() - 2) + "_" - + hs + "_" + user + "_" + map.get("name") + ".xml"; - File xmlFile = new File(path); - FileUtils.forceDelete(xmlFile); - } catch (IOException e) { - log.info(new Date() + " - Failed to execute deleteLecture"); - e.printStackTrace(); - } - return sql.deleteLecture(id); - - } - - @Override - public List getAllUniversities() throws TException { - return sql.getAllUniversities(); - - } - - @Override - public Map getLectureData(String lectureid) - throws TException { - log.info(new Date() + " - returning LectureData: " - + sql.getLectureData(lectureid).size() + "items."); - return sql.getLectureData(lectureid); - } - - - - - public static int nthIndexOf(final String string, final String token, - final int index) - { - int j = 0; - - for (int i = 0; i < index; i++) - { - j = string.indexOf(token, j + 1); - if (j == -1) break; - } - - return j; - } - - @Override - public boolean checkUser(String username) throws TException { - return sql.checkUser(username); - - } - - @Override - public boolean createUser(String loginName, String lastName, - String firstName, String mail, String university) throws TException { - String pk_institution = sql.setInstitution(university); - String pk_person = sql.setPerson(loginName, lastName, firstName, mail, - new Date(), pk_institution); - return true; - } - - @Override - public boolean writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role) - throws TException { - String pk_image = null; - Map map = new HashMap(); - int imageversion = 0; - String pk_institution = sql.setInstitution(university); - String pk_person = sql.setPerson(username, lastName, firstName, mail, - new Date(), pk_institution); - map = sql.getImageIDandVersion(imagename); - pk_image = map.get("GUID"); - imageversion = Integer.parseInt(map.get("version")); - - if(role.equals("Dozent")) { - int read=1; - int write=1; - int changePermission=0; - int admin=0; - int linkallowed=1; - int roleID=sql.getRoleID(role); - - sql.setImageRights(pk_person, pk_image, roleID, read, write, changePermission, admin, linkallowed); - - }else if(role.equals("Admin")){ - int read=1; - int write=1; - int changePermission=1; - int admin=1; - int linkallowed=1; - int roleID=sql.getRoleID(role); - - sql.setImageRights(pk_person, pk_image, roleID, read, write, changePermission, admin, linkallowed); - } - else{ - int read=1; - int write=0; - int changePermission=0; - int admin=0; - int linkallowed=0; - int roleID=sql.getRoleID(role); - - sql.setImageRights(pk_person, pk_image, roleID, read, write, changePermission, admin, linkallowed); - } - - return true; - } - - @Override - public boolean writeLectureRights(String lecturename, String username, - String lastName, String firstName, String mail, String university, - String role) throws TException { - String pk_lecture = null; - - String pk_institution = sql.setInstitution(university); - String pk_person = sql.setPerson(username, lastName, firstName, mail, - new Date(), pk_institution); - pk_lecture=sql.getLectureID(lecturename); - - if(role.equals("Dozent")) { - int read=1; - int write=1; - int changePermission=0; - int admin=0; - int roleID=sql.getRoleID(role); - - sql.setLectureRights(pk_person, pk_lecture, roleID, read, write, changePermission, admin); - - }else if(role.equals("Admin")){ - int read=1; - int write=1; - int changePermission=1; - int admin=1; - int roleID=sql.getRoleID(role); - - sql.setLectureRights(pk_person, pk_lecture, roleID, read, write, changePermission, admin); - } - else{ - int read=0; - int write=0; - int changePermission=0; - int admin=0; - int roleID=sql.getRoleID(role); - - sql.setLectureRights(pk_person, pk_lecture, roleID, read, write, changePermission, admin); - } - - return true; - } - - -} diff --git a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/StartServer.java b/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/StartServer.java deleted file mode 100644 index 7280ee99..00000000 --- a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/StartServer.java +++ /dev/null @@ -1,75 +0,0 @@ -package server; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import models.Configuration; -import org.apache.log4j.BasicConfigurator; -import org.apache.log4j.Logger; -import org.ini4j.InvalidFileFormatException; -import org.ini4j.Wini; -import server.BinaryListener; - - -public class StartServer { - - /** - * @param args - */ - - private static Logger log = Logger.getLogger(StartServer.class); - - private static List servers = new ArrayList<>(); - - public static void main(String[] args) { - - String version = "Version: 1.03"; - String buildDate = "Build Date: 09.09.2014"; - - //get going and show basic information in logfile - BasicConfigurator.configure(); - log.info("***** " + new Date() + " - starting Application *****"); - log.info(new Date() + " - "+version+" , "+buildDate); - - - - // get Configuration - try { - log.info(new Date() + " - Getting config from .ini-file"); - Wini ini = new Wini(new File("Server_Config.ini")); - Configuration.config.setAbsolute_path(ini.get("ftp", - "path_absolute")); - Configuration.config - .setSql_connection(ini.get("sql", "connection")); - Configuration.config.setSql_pass(ini.get("sql", "pass")); - Configuration.config.setSql_user(ini.get("sql", "user")); - } catch (InvalidFileFormatException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (IOException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - // Start Server - Thread t; - t = new Thread(new BinaryListener()); - servers.add(t); - t.start(); - for (Thread wait : servers) { - boolean success = false; - while (!success) { - try { - wait.join(); - success = true; - } catch (InterruptedException e) { - // Do nothing... - } - } - } - log.info(new Date() + " - all Servers shut down, exiting...\n"); - - } - -} diff --git a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/TBinaryProtocolSafe.java b/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/TBinaryProtocolSafe.java deleted file mode 100644 index 843b58b1..00000000 --- a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/TBinaryProtocolSafe.java +++ /dev/null @@ -1,123 +0,0 @@ -package server; - -import java.io.UnsupportedEncodingException; -import java.nio.ByteBuffer; - -import org.apache.thrift.TException; -import org.apache.thrift.protocol.TBinaryProtocol; -import org.apache.thrift.protocol.TMessage; -import org.apache.thrift.protocol.TProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.protocol.TProtocolFactory; -import org.apache.thrift.transport.TTransport; - -/** - * Binary protocol implementation for thrift. - * Will not read messages bigger than 12MiB. - * - */ -public class TBinaryProtocolSafe extends TBinaryProtocol -{ - /** - * Factory - */ - @SuppressWarnings( "serial" ) - public static class Factory implements TProtocolFactory - { - - protected boolean strictRead_ = false; - protected boolean strictWrite_ = true; - - public Factory() - { - this( false, true ); - } - - public Factory(boolean strictRead, boolean strictWrite) - { - strictRead_ = strictRead; - strictWrite_ = strictWrite; - } - - public TProtocol getProtocol( TTransport trans ) - { - return new TBinaryProtocolSafe( trans, strictRead_, strictWrite_ ); - } - } - - private static final int maxLen = 12 * 1024 * 1024; // 12 MiB - - /** - * Constructor - */ - public TBinaryProtocolSafe(TTransport trans) - { - this( trans, false, true ); - } - - public TBinaryProtocolSafe(TTransport trans, boolean strictRead, boolean strictWrite) - { - super( trans ); - strictRead_ = strictRead; - strictWrite_ = strictWrite; - } - - /** - * Reading methods. - */ - - public TMessage readMessageBegin() throws TException - { - int size = readI32(); - if ( size > maxLen ) - throw new TProtocolException( TProtocolException.SIZE_LIMIT, "Payload too big." ); - if ( size < 0 ) { - int version = size & VERSION_MASK; - if ( version != VERSION_1 ) { - throw new TProtocolException( TProtocolException.BAD_VERSION, "Bad version in readMessageBegin" ); - } - return new TMessage( readString(), (byte) ( size & 0x000000ff ), readI32() ); - } else { - if ( strictRead_ ) { - throw new TProtocolException( TProtocolException.BAD_VERSION, "Missing version in readMessageBegin, old client?" ); - } - return new TMessage( readStringBody( size ), readByte(), readI32() ); - } - } - - public String readString() throws TException - { - int size = readI32(); - if ( size > maxLen ) - throw new TProtocolException( TProtocolException.SIZE_LIMIT, "Payload too big." ); - if ( trans_.getBytesRemainingInBuffer() >= size ) { - try { - String s = new String( trans_.getBuffer(), trans_.getBufferPosition(), size, "UTF-8" ); - trans_.consumeBuffer( size ); - return s; - } catch ( UnsupportedEncodingException e ) { - throw new TException( "JVM DOES NOT SUPPORT UTF-8" ); - } - } - - return readStringBody( size ); - } - - public ByteBuffer readBinary() throws TException - { - int size = readI32(); - if ( size > maxLen ) - throw new TProtocolException( TProtocolException.SIZE_LIMIT, "Payload too big." ); - if ( trans_.getBytesRemainingInBuffer() >= size ) { - ByteBuffer bb = ByteBuffer.wrap( trans_.getBuffer(), trans_.getBufferPosition(), size ); - trans_.consumeBuffer( size ); - return bb; - } - - byte[] buf = new byte[ size ]; - trans_.readAll( buf, 0, size ); - return ByteBuffer.wrap( buf ); - } - -} - diff --git a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/User.java b/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/User.java deleted file mode 100644 index 7bf98cc4..00000000 --- a/dozentenmodulserver/Dozentenmodulserver/src/main/java/server/User.java +++ /dev/null @@ -1,588 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.1) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package server; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class User implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("User"); - - private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)-1); - private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)-2); - private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)-3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new UserStandardSchemeFactory()); - schemes.put(TupleScheme.class, new UserTupleSchemeFactory()); - } - - public String userName; // required - public String password; // required - public String path; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - USER_NAME((short)-1, "userName"), - PASSWORD((short)-2, "password"), - PATH((short)-3, "path"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // USER_NAME - return USER_NAME; - case -2: // PASSWORD - return PASSWORD; - case -3: // PATH - return PATH; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(User.class, metaDataMap); - } - - public User() { - } - - public User( - String userName, - String password, - String path) - { - this(); - this.userName = userName; - this.password = password; - this.path = path; - } - - /** - * Performs a deep copy on other. - */ - public User(User other) { - if (other.isSetUserName()) { - this.userName = other.userName; - } - if (other.isSetPassword()) { - this.password = other.password; - } - if (other.isSetPath()) { - this.path = other.path; - } - } - - public User deepCopy() { - return new User(this); - } - - @Override - public void clear() { - this.userName = null; - this.password = null; - this.path = null; - } - - public String getUserName() { - return this.userName; - } - - public User setUserName(String userName) { - this.userName = userName; - return this; - } - - public void unsetUserName() { - this.userName = null; - } - - /** Returns true if field userName is set (has been assigned a value) and false otherwise */ - public boolean isSetUserName() { - return this.userName != null; - } - - public void setUserNameIsSet(boolean value) { - if (!value) { - this.userName = null; - } - } - - public String getPassword() { - return this.password; - } - - public User setPassword(String password) { - this.password = password; - return this; - } - - public void unsetPassword() { - this.password = null; - } - - /** Returns true if field password is set (has been assigned a value) and false otherwise */ - public boolean isSetPassword() { - return this.password != null; - } - - public void setPasswordIsSet(boolean value) { - if (!value) { - this.password = null; - } - } - - public String getPath() { - return this.path; - } - - public User setPath(String path) { - this.path = path; - return this; - } - - public void unsetPath() { - this.path = null; - } - - /** Returns true if field path is set (has been assigned a value) and false otherwise */ - public boolean isSetPath() { - return this.path != null; - } - - public void setPathIsSet(boolean value) { - if (!value) { - this.path = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case USER_NAME: - if (value == null) { - unsetUserName(); - } else { - setUserName((String)value); - } - break; - - case PASSWORD: - if (value == null) { - unsetPassword(); - } else { - setPassword((String)value); - } - break; - - case PATH: - if (value == null) { - unsetPath(); - } else { - setPath((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case USER_NAME: - return getUserName(); - - case PASSWORD: - return getPassword(); - - case PATH: - return getPath(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case USER_NAME: - return isSetUserName(); - case PASSWORD: - return isSetPassword(); - case PATH: - return isSetPath(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof User) - return this.equals((User)that); - return false; - } - - public boolean equals(User that) { - if (that == null) - return false; - - boolean this_present_userName = true && this.isSetUserName(); - boolean that_present_userName = true && that.isSetUserName(); - if (this_present_userName || that_present_userName) { - if (!(this_present_userName && that_present_userName)) - return false; - if (!this.userName.equals(that.userName)) - return false; - } - - boolean this_present_password = true && this.isSetPassword(); - boolean that_present_password = true && that.isSetPassword(); - if (this_present_password || that_present_password) { - if (!(this_present_password && that_present_password)) - return false; - if (!this.password.equals(that.password)) - return false; - } - - boolean this_present_path = true && this.isSetPath(); - boolean that_present_path = true && that.isSetPath(); - if (this_present_path || that_present_path) { - if (!(this_present_path && that_present_path)) - return false; - if (!this.path.equals(that.path)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(User other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUserName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPassword()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPath()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("User("); - boolean first = true; - - sb.append("userName:"); - if (this.userName == null) { - sb.append("null"); - } else { - sb.append(this.userName); - } - first = false; - if (!first) sb.append(", "); - sb.append("password:"); - if (this.password == null) { - sb.append("null"); - } else { - sb.append(this.password); - } - first = false; - if (!first) sb.append(", "); - sb.append("path:"); - if (this.path == null) { - sb.append("null"); - } else { - sb.append(this.path); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class UserStandardSchemeFactory implements SchemeFactory { - public UserStandardScheme getScheme() { - return new UserStandardScheme(); - } - } - - private static class UserStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, User struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // USER_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.userName = iprot.readString(); - struct.setUserNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -2: // PASSWORD - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.password = iprot.readString(); - struct.setPasswordIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case -3: // PATH - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.path = iprot.readString(); - struct.setPathIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, User struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(struct.path); - oprot.writeFieldEnd(); - } - if (struct.password != null) { - oprot.writeFieldBegin(PASSWORD_FIELD_DESC); - oprot.writeString(struct.password); - oprot.writeFieldEnd(); - } - if (struct.userName != null) { - oprot.writeFieldBegin(USER_NAME_FIELD_DESC); - oprot.writeString(struct.userName); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class UserTupleSchemeFactory implements SchemeFactory { - public UserTupleScheme getScheme() { - return new UserTupleScheme(); - } - } - - private static class UserTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, User struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetUserName()) { - optionals.set(0); - } - if (struct.isSetPassword()) { - optionals.set(1); - } - if (struct.isSetPath()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetUserName()) { - oprot.writeString(struct.userName); - } - if (struct.isSetPassword()) { - oprot.writeString(struct.password); - } - if (struct.isSetPath()) { - oprot.writeString(struct.path); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, User struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.userName = iprot.readString(); - struct.setUserNameIsSet(true); - } - if (incoming.get(1)) { - struct.password = iprot.readString(); - struct.setPasswordIsSet(true); - } - if (incoming.get(2)) { - struct.path = iprot.readString(); - struct.setPathIsSet(true); - } - } - } - -} - diff --git a/dozentenmodulserver/Dozentenmodulserver/src/main/java/sql/SQL.java b/dozentenmodulserver/Dozentenmodulserver/src/main/java/sql/SQL.java deleted file mode 100644 index 9a115f09..00000000 --- a/dozentenmodulserver/Dozentenmodulserver/src/main/java/sql/SQL.java +++ /dev/null @@ -1,1013 +0,0 @@ -package sql; - -import java.sql.*; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.UUID; - -import models.Configuration; - -import org.apache.log4j.Logger; -import server.BinaryListener; -import server.Image; -import server.Lecture; - -public class SQL { - - private static Logger log = Logger.getLogger(BinaryListener.class); - - public Connection getConnection() { - try { - Class.forName("com.mysql.jdbc.Driver").newInstance(); - } catch (InstantiationException | IllegalAccessException - | ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - try { - Connection con = DriverManager - .getConnection("jdbc:mysql://"+Configuration.config.getSql_connection()+"?user="+Configuration.config.getSql_user()+"&password="+Configuration.config.getSql_pass()+""); - con.setAutoCommit(false); - - return con; - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to return connection to Client."); - e.printStackTrace(); - } - return null; - } - - public int writeFTPUser(String user, String pass) { - Statement stm; - try { - Connection con=getConnection(); - stm = con.createStatement(); - - int ret = stm - .executeUpdate("INSERT INTO `bwLehrpool`.`FtpUsers`(`User`,`Password`,`Uid`,`Gid`,`Dir`)VALUES('" - + user - + "',SHA1('" - + pass - + "'),'10001','12345','"+Configuration.config.getAbsolute_path()+"temp/');"); - con.commit(); - con.close(); - log.info(new Date() + " - created FTPUser " + user + " : " + pass - + "."); - return ret; - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to writeFTPUser."); - e.printStackTrace(); - } - return -1; - } - - public int DeleteUser(String user) { - Statement stm; - try { - Connection con=getConnection(); - stm = con.createStatement(); - - int ret = stm - .executeUpdate("DELETE FROM `bwLehrpool`.`FtpUsers` where User like '" - + user + "';"); - con.commit(); - con.close(); - log.info(new Date() + " - FTPUser " + user + " deleted."); - return ret; - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to DeleteUser."); - e.printStackTrace(); - } - return -1; - } - - public ResultSet getImage() { - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - ResultSet rs=stm - .executeQuery("SELECT image_name FROM bwLehrpool.m_VLData_imageInfo;"); - con.close(); - return rs; - - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getImage."); - e.printStackTrace(); - } - - return null; - } - - public String getPathOfImage(String image_id, - String version) { - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - ResultSet rs=stm - .executeQuery("SELECT image_path FROM bwLehrpool.m_VLData_imageInfo where GUID_imageID='" - + image_id - + "' and imageVersion='" - + version - + "';"); - rs.first(); - String path=rs.getString("image_path"); - con.close(); - return path; - - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getPathOfImage."); - e.printStackTrace(); - } - - return null; - } - - public String setInstitution(String university) { - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - - ResultSet ret = stm - .executeQuery("SELECT * FROM bwLehrpool.m_institution where name like'" - + university + "';"); - - if (ret.next() == false) { - - String id = UUID.randomUUID().toString(); - stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_institution`(`institutionID`,`name`)VALUES('" - + id + "','" + university + "');"); - con.commit(); - ResultSet rs = stm - .executeQuery("SELECT institutionID FROM bwLehrpool.m_institution WHERE name like '" - + university + "';"); - rs.next(); - String institution=rs.getString("institutionID"); - con.close(); - - return institution; - } else { - String institution=ret.getString("institutionID"); - con.close(); - return institution; - } - - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to setInstitution."); - e.printStackTrace(); - } - return "-1"; - } - - public String setPerson(String login, String lastname, - String firstname, String mail, Date lastlogin, String Institution) { - DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - - ResultSet ret = stm - .executeQuery("SELECT userID FROM bwLehrpool.m_user where Nachname like '" - + lastname - + "' and Vorname like '" - + firstname - + "';"); - - if (ret.next() == false) { - - String id = UUID.randomUUID().toString(); - stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_user`(`userID`,`loginName`,`nachname`,`vorname`,`mail`,`lastLogin`,`institution`)VALUES('" - + id - + "','" - + login - + "','" - + lastname - + "','" - + firstname - + "','" - + mail - + "','" - + formatter.format(new Date()) - + "','" - + Institution - + "');"); - con.commit(); - ResultSet rs = stm - .executeQuery("SELECT userID FROM bwLehrpool.m_user where Nachname like '" - + lastname - + "' and Vorname like '" - + firstname - + "';"); - rs.next(); - String userid=rs.getString("userID"); - con.close(); - return userid; - } else { - ret.first(); - String userid=ret.getString("userID"); - con.close(); - return userid; - } - - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to setPerson."); - e.printStackTrace(); - } - return "-1"; - } - - public boolean setImageData(String pk_person, boolean license, - boolean internet, long cpu, long ram, String imagename,String desc, - String imagePath, boolean isTemplate, long filesize, String shareMode, String pk_os) { - - DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - - int internet_bol = 0; - int license_bol = 0; - if (internet == true) { - internet_bol = 1; - } - if (license == true) { - license_bol = 1; - } - - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - - String uid = UUID.randomUUID().toString(); - stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_VLData_imageInfo`(`GUID_imageID`,`imageVersion`,`image_name`,`image_description`,`image_path`,`image_lastCall`,`image_create_time`,`image_update_time`,`image_owner`,`image_change_by`,`rec_create_time`,`rec_change_time`,`rec_owner`,`rec_change_by`,`content_operatingSystem`,`status_isCompressed`,`status_isSecure`,`status_isOptimzed`,`status_isValid`,`status_isReady`,`status_isDeleted`,`status_isLastOfficialVersion`,`cond_hasLicenseRestriction`,`cond_hasInternetRestriction`,`cond_minRAM`,`cond_minCPUs`,`image_isTemplate`,`image_filesize`,`image_syncMode`)VALUES('" - + uid // GUID_imageID - + "',1,'" // imageVersion - + imagename // image_name - + "','" +desc //image_description - + "','" + imagePath // image_path - + "','" + formatter.format(new Date()) // image_lastCall - + "','" + formatter.format(new Date()) // image_create_time - + "','" + formatter.format(new Date()) // image_update_time - + "','" + pk_person // image_owner - + "','" + pk_person // image_change_by - + "','" + formatter.format(new Date()) // rec_create_time - + "','" + formatter.format(new Date()) // rec_change_time - + "','" + pk_person // rec_owner - + "','" + pk_person // rec_change_by - + "','" + pk_os // content_operatingSystem - + "',1" // status_isCompressed - + ",1" // status_isSecure - + ",1" // status_isOptimzed - + ",1" // status_isValid - + ",1" // status_isReady - + ",0" // status_isDeleted - + ",0,'" // status_isLastOfficialVersion - + license_bol // cond_hasLicenseRestriction - + "','" + internet_bol // cond_hasInternetRestriction - + "','" + ram // cond_minRAM - + "','" + cpu // cond_minCPUs - + "','" + isTemplate //image_isTemplate - + "','" + filesize //image_filesize - + "','" + shareMode //shareMode - + "');"); - con.commit(); - con.close(); - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to setImageData."); - e.printStackTrace(); - } - return true; - - } - - public List getImageList() { - - Connection con=getConnection(); - Statement stm; - List list = new ArrayList(); - try { - - stm = con.createStatement(); - ResultSet res=stm - .executeQuery("SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name,os.architecture, '' as lecture,vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user, vl.image_isTemplate FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and vl.image_owner=u.userID and vl.image_name not in (SELECT vl.image_name FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID) union SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name,os.architecture, lect.name as lecture, vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user, vl.image_isTemplate FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID;"); - - - - while (res.next()) { - - - list.add(new Image(res.getString("GUID_imageID"), res - .getString("imageVersion"), - res.getString("image_name"), res - .getString("cond_hasLicenseRestriction"), res - .getString("name")+" "+res.getString("architecture")+" bit", res.getString("lecture"), - res.getString("image_update_time"), res - .getString("user"), res.getString("image_isTemplate"))); - - } - - con.close(); - } catch (SQLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - - return list; - - } - - public List getLectureList() { - List list = new ArrayList(); - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - ResultSet res=stm - .executeQuery("SELECT l.lectureID, l.name, l.isActive,l.startTime,l.endTime,l.lastUsed,l.description, i.image_name, concat(u.Nachname,' ',u.Vorname) as user FROM bwLehrpool.m_VLData_lecture l, bwLehrpool.m_VLData_imageInfo i, bwLehrpool.m_user u where i.GUID_imageID=l.imageID and l.admin_owner=u.userID;"); - while (res.next()) { - - list.add(new Lecture(res.getString("lectureID"), res - .getString("name"), res.getString("isActive"), res - .getString("startTime"), res.getString("endTime"), res - .getString("lastUsed"), res.getString("description"), - res.getString("image_name"), res.getString("user"))); - - } - con.close(); - return list; - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getLectureList."); - e.printStackTrace(); - } - return null; - } - - public List getAllOS() { - List list = new ArrayList<>(); - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - ResultSet rs=stm - .executeQuery("SELECT name, architecture FROM bwLehrpool.m_operatingSystem;"); - while (rs.next()) { - list.add(rs.getString("name")+" "+rs.getString("architecture")+" bit"); - } - return list; - - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getAllOS."); - e.printStackTrace(); - } - - return null; - - } - - public Map getPersonData(String Vorname, - String Nachname) { - Map map = new HashMap(); - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - ResultSet rs= stm - .executeQuery("SELECT u.Nachname, u.Vorname, u.mail, i.name FROM bwLehrpool.m_user u, bwLehrpool.m_institution i where u.Nachname like '" - + Nachname - + "' and u.Vorname like '" - + Vorname - + "' and u.institution=i.institutionID;"); - while (rs.next()) { - - map.put("mail", rs.getString("mail")); - map.put("Nachname", rs.getString("Nachname")); - map.put("Vorname", rs.getString("Vorname")); - map.put("Hochschule", rs.getString("name")); - - } - con.close(); - return map; - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getPersonData."); - e.printStackTrace(); - } - return null; - } - - public int setLectureData(String pk_person, String pk_image, - int imageversion, String name, String desc, String shortdesc, - String start, String end, boolean isactive) { - - DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - int active_bol = 0; - - if (isactive == true) { - active_bol = 1; - } - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - - String uid = UUID.randomUUID().toString(); - stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_VLData_lecture`(`lectureID`,`name`,`isActive`,`startTime`,`endTime`,`lastUsed`,`shortDescription`,`description`,`imageID`,`imageVersion`,`admin_createTime`,`admin_changeTime`,`admin_owner`,`admin_change_by`)VALUES('" - + uid - + "','" - + name - + "','" - + active_bol - + "','" - + start - + "','" - + end - + "','" - + formatter.format(new Date()) - + "','" - + shortdesc - + "','" - + desc - + "','" - + pk_image - + "','" - + imageversion - + "','" - + formatter.format(new Date()) - + "','" - + formatter.format(new Date()) - + "','" - + pk_person - + "','" - + pk_person + "');"); - con.commit(); - con.close(); - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to setLectureData."); - e.printStackTrace(); - } - return 0; - - } - - public Map getImageIDandVersion(String name) { - Map map = new HashMap(); - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - ResultSet image= stm - .executeQuery("SELECT GUID_imageID, imageVersion FROM bwLehrpool.m_VLData_imageInfo where image_name like '" - + name + "';"); - while (image.next()) { - map.put("GUID", image.getString("GUID_imageID")); - map.put("version", String.valueOf(image.getString("imageVersion"))); - - } - con.close(); - return map; - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getImageIDandVersion."); - e.printStackTrace(); - } - return null; - } - - public Map getImageData(String id, String version) { - Map map = new HashMap(); - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - ResultSet data=stm - .executeQuery("SELECT u.mail, i.GUID_imageID, i.imageVersion, i.image_name,i.image_description,i.image_update_time,i.cond_hasInternetRestriction,i.cond_hasLicenseRestriction, i.cond_minCPUs,i.cond_minRAM, i.image_syncMode,i.image_filesize,i.image_path, i.image_isTemplate,os.GuestOS, concat(u.Nachname,' ',u.Vorname) as Owner FROM bwLehrpool.m_VLData_imageInfo i,bwLehrpool.m_user u,bwLehrpool.m_operatingSystem os where i.image_owner=u.userID and i.content_operatingSystem=os.operatingSystemID and GUID_imageID = '" + id + "' and imageVersion = '" + version + "' ;"); - while (data.next()) { - map.put("name", data.getString("image_name")); - map.put("internet", - data.getString("cond_hasInternetRestriction")); - map.put("license", data.getString("cond_hasLicenseRestriction")); - map.put("cpu", data.getString("cond_minCPUs")); - map.put("ram", data.getString("cond_minRAM")); - map.put("shareMode", data.getString("image_syncMode")); - map.put("filesize", data.getString("image_filesize")); - map.put("path", data.getString("image_path")); - map.put("template", data.getString("image_isTemplate")); - map.put("os",data.getString("GuestOS")); - map.put("owner", data.getString("Owner")); - map.put("lastupdate", data.getString("image_update_time")); - map.put("desc", data.getString("image_description")); - map.put("id", data.getString("GUID_imageID")); - map.put("version", data.getString("imageVersion")); - map.put("mail", data.getString("mail")); - - } - con.close(); - return map; - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getImageData."); - e.printStackTrace(); - } - return null; - } - - public int UpdateImageData(String name, String newName,String desc,String image_path, - boolean license, boolean internet, long cpu, long ram, String id, - String version, boolean isTemplate, long filesize, String shareMode,String ospk) { - try { - Connection con=getConnection(); - DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - Statement stm = con.createStatement(); - int newVersion = Integer.parseInt(version) + 1; - - int internet_bol = 0; - int license_bol = 0; - if (internet == true) { - internet_bol = 1; - } - if (license == true) { - license_bol = 1; - } - log.info(new Date() + " - 'image_name` = '" + newName+ "\n length of name="+newName.length()); - - stm.executeUpdate("UPDATE `bwLehrpool`.`m_VLData_imageInfo` SET `imageVersion` = '" - + newVersion - + "',`image_name` = '" - + newName - + "',`image_description` = '" - + desc - + "',`image_path` = '" - + image_path - + "',`image_update_time` = '" - + formatter.format(new Date()) - + "',`rec_change_time` = '" - + formatter.format(new Date()) - + "',`cond_hasLicenseRestriction` = '" - + license_bol - + "',`cond_hasInternetRestriction` = '" - + internet_bol - + "',`cond_minRAM` = '" - + ram - + "',`cond_minCPUs` = '" - + cpu - + "',`image_isTemplate` = '" - + isTemplate - + "',`content_operatingSystem` = '" - + ospk - + "',`image_filesize` = '" - + filesize - + "',`image_syncMode` = '" - + shareMode - + "' WHERE `GUID_imageID` = '" - + id - + "' AND `imageVersion` = '" + version + "';"); - con.commit(); - con.close(); - return 0; - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to UpdateImageData."); - e.printStackTrace(); - } - return -1; - } - - public boolean deleteImage(String id, String version) { - - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - - stm.executeUpdate("DELETE FROM bwLehrpool.m_VLData_imageInfo where GUID_imageID = '" - + id + "' " + "AND imageVersion = '" + version + "';"); - - con.commit(); - con.close(); - return true; - - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to deleteImage."); - e.printStackTrace(); - } - - return false; - } - - public int updateLectureData(String pk_image, - String imageversion, String name, String newName, String desc, - String shortdesc, String start, String end, boolean isactive, - String id) { - - DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - int active_bol = 0; - - if (isactive == true) { - active_bol = 1; - } - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - stm.executeUpdate("UPDATE `bwLehrpool`.`m_VLData_lecture` SET `name` = '" - + newName - + "',`isActive` = '" - + active_bol - + "',`startTime` = '" - + start - + "',`endTime` = '" - + end - + "',`description` = '" - + desc - + "',`imageID` = '" - + pk_image - + "',`imageVersion` = '" - + imageversion - + "',`admin_changeTime` = '" - + formatter.format(new Date()) - + "'WHERE `lectureID` = '" + id + "';"); - con.commit(); - con.close(); - log.info(new Date() + " - Succeeded to updateLectureData."); - - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to updateLectureData."); - e.printStackTrace(); - } - - return 0; - - } - - public boolean connectedToLecture(String id, String version) { - - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - - ResultSet rs = stm.executeQuery("SELECT lectureID FROM " - + "bwLehrpool.m_VLData_lecture WHERE imageID = '" + id - + "' AND imageVersion = '" + version + "';"); - boolean ret=rs.first(); - con.close(); - return ret; - - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() - + " - Failed to execute method connectedToLecture."); - e.printStackTrace(); - } - - return false; - - } - - public boolean deleteLecture(String id) { - - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - stm.executeUpdate("DELETE FROM bwLehrpool.m_VLData_lecture WHERE lectureID = '" - + id + "';"); - - con.commit(); - con.close(); - return true; - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to deleteLecture."); - e.printStackTrace(); - } - - return false; - } - - public String getFile(String imageid, String imageversion) { - - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - - ResultSet rs = stm - .executeQuery("SELECT image_path FROM bwLehrpool.m_VLData_imageInfo WHERE GUID_imageID = '" - + imageid - + "' AND imageVersion = '" - + imageversion - + "';"); - rs.next(); - String path=rs.getString("image_path"); - con.close(); - return path; - - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getFile."); - e.printStackTrace(); - } - - return null; - } - - public Map getDeleteXMLData(String id) { - Map map = new HashMap(); - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - - ResultSet rs = stm - .executeQuery("SELECT name, admin_createTime FROM bwLehrpool.m_VLData_lecture where lectureID='" - + id + "';"); - rs.next(); - map.put("date", rs.getString("admin_createTime").replace(" ", "") - .replace("-", "").replace(":", "")); - map.put("name", rs.getString("name")); - - - con.close(); - return map; - - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getDeleteXMLData."); - e.printStackTrace(); - } - - return null; - } - - public int UpdateImagePath(String name) { - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - String image_path="prod/"+name; - - stm.executeUpdate("UPDATE `bwLehrpool`.`m_VLData_imageInfo` SET `image_path` = '" - + image_path - + "' WHERE `image_path` = '" - + "temp/"+name + "';"); - con.commit(); - con.close(); - return 0; - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to UpdateImagePath."); - e.printStackTrace(); - } - return -1; - } - - public List getAllUniversities() { - List list = new ArrayList<>(); - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - ResultSet rs=stm - .executeQuery("SELECT name FROM bwLehrpool.m_institution;"); - while (rs.next()) { - list.add(rs.getString("name")); - } - return list; - - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getAllUniversities."); - e.printStackTrace(); - } - - return null; - - } - - public String getOSpk(String os, - String architecture) { - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - log.info(new Date() + " - Getting PrimaryKey for OS: "+os+" architecture: "+architecture); - ResultSet rs=stm - .executeQuery("SELECT operatingSystemID FROM bwLehrpool.m_operatingSystem where name like '" - + os - + "' and architecture like '" - + architecture - + "';"); - rs.first(); - String pkos=rs.getString("operatingSystemID"); - log.info(new Date() + " - Key is "+pkos); - con.close(); - return pkos; - - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getOSpk."); - e.printStackTrace(); - } - - return null; - } - - public String getOS(String pk) { - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - //log.info(new Date() + " - OS: "+os+" architecture: "+architecture); - ResultSet rs=stm - .executeQuery("SELECT name,architecture FROM bwLehrpool.m_operatingSystem where operatingSystemID = '" - + pk - + "';"); - rs.first(); - String os=rs.getString("name")+" "+rs.getString("architecture"); - con.close(); - return os; - - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getOS."); - e.printStackTrace(); - } - - return null; - } - - public Map getLectureData(String id) { - Map map = new HashMap(); - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - ResultSet data=stm - .executeQuery("select l.name, l.isActive, l.startTime, l.endTime, l.lastUsed, l.description, i.image_path, l.imageVersion, concat(u.Nachname,' ',u.Vorname) as owner from m_VLData_lecture l, m_user u, m_VLData_imageInfo i where l.admin_owner=u.userID and l.imageID=i.GUID_imageID and lectureID= '" + id + "' ;"); - while (data.next()) { - map.put("name", data.getString("name")); - map.put("isActive", - data.getString("isActive")); - map.put("startTime", data.getString("startTime")); - map.put("endTime", data.getString("endTime")); - map.put("lastUsed", data.getString("lastUsed")); - map.put("desc", data.getString("description")); - map.put("imagepath", data.getString("image_path")); - map.put("imageversion", data.getString("imageVersion")); - map.put("owner", data.getString("Owner")); - - } - con.close(); - return map; - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getLectureData."); - e.printStackTrace(); - } - return null; - } - - public boolean checkUser(String username) { - Statement stm; - boolean ret=false; - try { - Connection con=getConnection(); - stm = con.createStatement(); - ResultSet rs=stm.executeQuery("Select * from m_user where loginName like '"+username+"'"); - if(rs.next()) - { - ret=true; - log.info(new Date() + " - User " + rs.getString("loginName") + " exist."); - } - else{ - ret=false; - log.info(new Date() + " - User " + rs.getString("loginName") + " not exist."); - } - con.close(); - - - } catch (SQLException e) { - // TODO Auto-generated catch block - - e.printStackTrace(); - } - return ret; - } - - public int setImageRights(String pk_person, String pk_image,int role ,int read, int write, int changePermission, int admin,int linkallowed) { - - - - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - - String uid = UUID.randomUUID().toString(); - stm.executeUpdate("INSERT INTO `bwLehrpool`.`pm_VLData_image`(`GUID`,`GUID_imageID`,`roleID`,`userID`,`image_read`,`image_write`,`image_admin`,`image_changePermission`,`link_allowed`)VALUES('" - + uid - + "','" - + pk_image - + "','" - + role - + "','" - + pk_person - + "','" - + read - + "','" - + write - + "','" - + admin - + "','" - + changePermission - + "','" - + linkallowed+ "');"); - con.commit(); - con.close(); - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to setImageRights."); - e.printStackTrace(); - } - return 0; - - } - public int getRoleID(String role) { - - - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - - ResultSet rs=stm - .executeQuery("SELECT roleID FROM bwLehrpool.m_role where name like '"+ role+ "';"); - rs.first(); - - return rs.getInt("roleID"); - - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to getRoleID."); - e.printStackTrace(); - } - return -1; - } - public int setLectureRights(String pk_person, String pk_lecture,int role ,int read, int write, int changePermission, int admin) { - - - - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - - String uid = UUID.randomUUID().toString(); - stm.executeUpdate("INSERT INTO `bwLehrpool`.`pm_VLData_lecture`(`GUID`,`lectureID`,`roleID`,`userID`,`rec_read`,`rec_write`,`rec_admin`,`rec_changePermission`)VALUES('" - + uid - + "','" - + pk_lecture - + "','" - + role - + "','" - + pk_person - + "','" - + read - + "','" - + write - + "','" - + admin - + "','" - + changePermission+ "');"); - con.commit(); - con.close(); - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to setLectureRights."); - e.printStackTrace(); - } - return 0; - - } - public String getLectureID(String name) { - String id=null; - try { - Connection con=getConnection(); - Statement stm = con.createStatement(); - ResultSet lecture= stm - .executeQuery("SELECT lectureID FROM bwLehrpool.m_VLData_lecture where name like '" - + name + "';"); - while (lecture.next()) { - id=lecture.getString("lectureID"); - - } - con.close(); - return id; - } catch (SQLException e) { - // TODO Auto-generated catch block - log.info(new Date() + " - Failed to LectureID."); - e.printStackTrace(); - } - return id; - } -} diff --git a/dozentenmodulserver/Dozentenmodulserver/src/main/java/util/XMLCreator.java b/dozentenmodulserver/Dozentenmodulserver/src/main/java/util/XMLCreator.java deleted file mode 100644 index 46cdef5d..00000000 --- a/dozentenmodulserver/Dozentenmodulserver/src/main/java/util/XMLCreator.java +++ /dev/null @@ -1,230 +0,0 @@ -package util; - -import java.io.File; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import models.Configuration; - -import org.apache.log4j.Logger; -import org.w3c.dom.Comment; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import server.BinaryListener; -import sql.SQL; - -public class XMLCreator { - - /* - * This class offers methods to create XML files for the (old) version of - * managing VMware *.vmdks - */ - - private Connection con = null; - private Statement st = null; - private ResultSet rs = null; - private String vmName; - private String filePath = Configuration.config.getAbsolute_path()+"prod/"; - private String imageName; - private String xmlName; - private static Logger log = Logger.getLogger( BinaryListener.class ); - - - // phone param not existing - private String query = "SELECT m_VLData_imageInfo.image_path ,vorname, nachname, mail, shortdescription, description, m_operatingSystem.guestOS as os,m_VLData_lecture.admin_createTime as createtime ,m_VLData_lecture.admin_changeTime as time, m_VLData_lecture.name as lectureName, m_user.institution as userInstitution, m_user.loginName as loginName, m_VLData_lecture.isActive, m_institution.name as institutionName " - + "FROM bwLehrpool.m_VLData_lecture, bwLehrpool.m_VLData_imageInfo, bwLehrpool.m_user, bwLehrpool.m_operatingSystem, bwLehrpool.m_institution " - + "WHERE m_user.userID = m_VLData_lecture.admin_owner " - + "AND m_VLData_imageInfo.GUID_imageID = m_VLData_lecture.imageID " - + "AND m_VLData_imageInfo.content_operatingSystem = m_operatingSystem.operatingSystemID " - + "AND m_user.institution = m_institution.institutionID " - + "AND m_VLData_lecture.name = "; - - public XMLCreator(Connection con) { - this.con = con; - } - - public XMLCreator(Connection con, String vmName) { - this.con = con; - this.vmName = vmName; - } - - public boolean create() throws SQLException, ParserConfigurationException, - TransformerException { - - // System.out.println(query); - - if (con == null || vmName == null) { - return false; - } - query += "'" + this.vmName + "';"; - - boolean success = startCreation(); - - if (success) { - return true; - } - log.info(new Date() + " - Could not create XML-File '"+vmName+"'. Error in create(String vmName)."); - return false; - - } - - // overload method for dynamic setting of param vmName instead of static - // context above - public boolean create(String vmName) throws SQLException, - ParserConfigurationException, TransformerException { - // System.out.println(query); - - if (con == null || vmName == null) { - return false; - } - query += "'" + vmName + "';"; - - boolean success = startCreation(); - - if (success) { - return true; - } - log.info(new Date() + " - Could not create XML-File '"+vmName+"'. Error in create(String vmName)."); - return false; - } - - private boolean startCreation() throws SQLException, - ParserConfigurationException, TransformerException { - // get needed data from database - st = con.createStatement(); - rs = st.executeQuery(query); - rs.next(); - - // factory - DocumentBuilderFactory docFactory = DocumentBuilderFactory - .newInstance(); - DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); - - // root elements - dynamic content - Document doc = docBuilder.newDocument(); - Element rootElement = doc.createElement("settings"); - doc.appendChild(rootElement); - - Element entry = doc.createElement("eintrag"); - rootElement.appendChild(entry); - - Element prio = doc.createElement("priority"); - entry.appendChild(prio); - prio.setAttribute("param", "0"); - - Comment fComment = doc.createComment("Diesen Abschnitt erg�nzen"); - entry.appendChild(fComment); - - Element imgName = doc.createElement("image_name"); - entry.appendChild(imgName); - imageName = rs.getString("image_path").substring( - rs.getString("image_path").lastIndexOf("/")+1); //+1 um das f�hrende "/" los zu werden - - imgName.setAttribute("param", imageName); - - Element creator = doc.createElement("creator"); - entry.appendChild(creator); - creator.setAttribute("param", - (rs.getString("vorname") + " " + rs.getString("nachname"))); - - Element email = doc.createElement("email"); - entry.appendChild(email); - email.setAttribute("param", rs.getString("mail")); - - // TODO check whether necessary - Element phone = doc.createElement("phone"); - entry.appendChild(phone); - phone.setAttribute("param", ""); - - Element shortDesc = doc.createElement("short_description"); - entry.appendChild(shortDesc); - shortDesc.setAttribute("param", rs.getString("lectureName")); - - // TODO append latest change date and time - Element longDesc = doc.createElement("long_description"); - entry.appendChild(longDesc); - longDesc.setAttribute("param", rs.getString("description") - + "; last update: " + rs.getString("time")); - - Element os = doc.createElement("os"); - entry.appendChild(os); - os.setAttribute("param", rs.getString("os")); - - Comment sComment = doc.createComment("Diesen Abschnitt erg�nzen"); - entry.appendChild(sComment); - - // static content following - second part of xml descriptor - - Element netwParam = doc.createElement("network"); - entry.appendChild(netwParam); - netwParam.setAttribute("param", "nat"); - - Element netcParam = doc.createElement("netcard"); - entry.appendChild(netcParam); - netcParam.setAttribute("param", "e1000"); - - Element vm = doc.createElement("virtualmachine"); - entry.appendChild(vm); - vm.setAttribute("param", "vmware"); - - // TODO Fallunterscheidung - Element icon = doc.createElement("icon"); - entry.appendChild(icon); - icon.setAttribute("param", "windows"); - - Element active = doc.createElement("active"); - entry.appendChild(active); - - //set activity - if(rs.getString("isActive").equals("1")){ - active.setAttribute("param", "true"); - } else if(rs.getString("isActive").equals("0")){ - active.setAttribute("param", "false"); - } - - Element pools = doc.createElement("pools"); - entry.appendChild(pools); - pools.setAttribute("param", "default"); - - Element enable3d = doc.createElement("enable3d"); - entry.appendChild(enable3d); - enable3d.setAttribute("param", "true"); - - // write virtual document to file - TransformerFactory transformerFactory = TransformerFactory - .newInstance(); - Transformer transformer = transformerFactory.newTransformer(); - DOMSource source = new DOMSource(doc); - - //Set XML-filename - xmlName=rs.getString("createtime").substring(0, rs.getString("createtime").length() - 2).replace("-", "").replace(" ", "").replace(":", "") + "_" + rs.getString("institutionName") + "_" + rs.getString("loginName") + "_" + rs.getString("lectureName") + ".xml"; - - //Write file - StreamResult result = new StreamResult(new File(filePath+ xmlName)); // see filepath at top of class - - transformer.transform(source, result); - - // cleanup - rs.close(); - st.close(); - - // return - log.info(new Date() + " - XML-File '"+xmlName+"' successfully created."); - return true; - } -} diff --git a/dozentenmodulserver/Dozentenmodulserver/src/test/java/bwlehrpool/AppTest.java b/dozentenmodulserver/Dozentenmodulserver/src/test/java/bwlehrpool/AppTest.java deleted file mode 100644 index ffcdcc2e..00000000 --- a/dozentenmodulserver/Dozentenmodulserver/src/test/java/bwlehrpool/AppTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package bwlehrpool; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Unit test for simple App. - */ -public class AppTest - extends TestCase -{ - /** - * Create the test case - * - * @param testName name of the test case - */ - public AppTest( String testName ) - { - super( testName ); - } - - /** - * @return the suite of tests being tested - */ - public static Test suite() - { - return new TestSuite( AppTest.class ); - } - - /** - * Rigourous Test :-) - */ - public void testApp() - { - assertTrue( true ); - } -} diff --git a/dozentenmodulserver/Dozentenmodulserver/thrift/server.thrift b/dozentenmodulserver/Dozentenmodulserver/thrift/server.thrift deleted file mode 100644 index 51bc1765..00000000 --- a/dozentenmodulserver/Dozentenmodulserver/thrift/server.thrift +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Define some namespace/package name for our stuff - */ -namespace java server - -typedef i64 int - -struct User{ - string userName, - string password, - string path, -} - -struct Image{ - string id, - string version, - string imageName, - string licenseRestriction, - string osName, - string lectureName, - string updateTime, - string userData, - string isTemplate, -} -struct Lecture{ - string id, - string lecturename, - string isActive, - string starttime, - string endtime, - string lastused, - string desc, - string imagename, - string username, - -} -service Server{ - User getFtpUser(), - int DeleteFtpUser(string user), - string getPathOfImage(string image_id,string version), - bool writeVLdata(string imagename, string desc ,string login ,string firstname, string lastname,string university, string Mail, string Tel, string Fak, bool license, bool internet, int ram, int cpu, string imagePath, bool isTemplate ,i64 filesize, int shareMode, string os), - list getImageList(), - list getLectureList(), - list getAllOS(), - list getAllUniversities(), - map getPersonData(string Vorname, string Nachname), - bool writeLecturedata(string name, string shortdesc, string desc,string startDate, string endDate, bool isActive, string imagename,string login,string firstname,string lastname, string university, string Mail, string Tel,string Fak), - bool startFileCopy(string file), - map getImageData(string imageid, string imageversion), - map getLectureData(string lectureid), - bool updateImageData(string name, string newName,string desc,string image_path,bool license, bool internet, int ram,int cpu, string id, string version,bool isTemplate ,i64 filesize, int shareMode, string os), - bool deleteImageData(string id, string version), - bool updateLecturedata(string name, string newName ,string shortdesc, string desc,string startDate, string endDate, bool isActive, string imageid, string imageversion,string user,string firstname,string lastname, string university, string Mail, string Tel,string Fak, string id), - bool deleteImageServer(string id, string version), - bool connectedToLecture(string id, string version), - bool deleteLecture(string id, string hs, string user), - bool checkUser(string username), - bool createUser(string loginName, string lastName, string firstName, string mail, string university), - bool writeImageRights(string imagename, string username, string lastName, string firstName, string mail, string university, string role), - bool writeLectureRights(string lecturename, string username, string lastName, string firstName, string mail, string university, string role), -} \ No newline at end of file diff --git a/dozentenmodulserver/pom.xml b/dozentenmodulserver/pom.xml new file mode 100644 index 00000000..762ccb1a --- /dev/null +++ b/dozentenmodulserver/pom.xml @@ -0,0 +1,116 @@ + + 4.0.0 + + bwlehrpool + dozmod-server + 1.0-SNAPSHOT + jar + + DozMod-Server + http://maven.apache.org + + + UTF-8 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + maven-assembly-plugin + + + package + + single + + + + + + + server.StartServer + + + + jar-with-dependencies + + + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + true + + + server.StartServer + + + + + + + + + + + + org.apache.thrift + libthrift + 0.9.1 + compile + + + mysql + mysql-connector-java + 5.1.28 + compile + + + commons-io + commons-io + 2.4 + compile + + + log4j + log4j + 1.2.17 + compile + + + org.ini4j + ini4j + 0.5.2 + + + org.slf4j + slf4j-log4j12 + 1.5.8 + compile + + + junit + junit + 3.8.1 + test + + + + diff --git a/dozentenmodulserver/src/main/java/models/Configuration.java b/dozentenmodulserver/src/main/java/models/Configuration.java new file mode 100644 index 00000000..1e616466 --- /dev/null +++ b/dozentenmodulserver/src/main/java/models/Configuration.java @@ -0,0 +1,39 @@ +package models; + +public class Configuration { + + private String absolute_path; + private String sql_connection; + private String sql_user; + private String sql_pass; + + public static Configuration config =new Configuration(); + + public String getAbsolute_path() { + return absolute_path; + } + public void setAbsolute_path(String absolute_path) { + this.absolute_path = absolute_path; + } + public String getSql_connection() { + return sql_connection; + } + public void setSql_connection(String sql_connection) { + this.sql_connection = sql_connection; + } + public String getSql_user() { + return sql_user; + } + public void setSql_user(String sql_user) { + this.sql_user = sql_user; + } + public String getSql_pass() { + return sql_pass; + } + public void setSql_pass(String sql_pass) { + this.sql_pass = sql_pass; + } + + + +} diff --git a/dozentenmodulserver/src/main/java/server/BinaryListener.java b/dozentenmodulserver/src/main/java/server/BinaryListener.java new file mode 100644 index 00000000..ffeb9bd5 --- /dev/null +++ b/dozentenmodulserver/src/main/java/server/BinaryListener.java @@ -0,0 +1,48 @@ +package server; + +import java.util.Date; + +import org.apache.log4j.Logger; +import org.apache.thrift.protocol.TProtocolFactory; +import org.apache.thrift.server.TServer; +import org.apache.thrift.server.TThreadPoolServer.Args; +import org.apache.thrift.server.TThreadPoolServer; +import org.apache.thrift.transport.TServerSocket; +import org.apache.thrift.transport.TServerTransport; +import org.apache.thrift.transport.TTransportException; + +public class BinaryListener implements Runnable { + private static Logger log = Logger.getLogger(BinaryListener.class); + + private final int MINWORKERTHREADS = 20; // keine ahnung ob das passt... + private final int MAXWORKERTHREADS = 80; // ebenso + + @Override + public void run() { + final ServerHandler handler = new ServerHandler(); + final Server.Processor processor = new Server.Processor( + handler); + final TServerTransport transport; + final TProtocolFactory protFactory = new TBinaryProtocolSafe.Factory( + true, true); + try { + transport = new TServerSocket(9090); + log.info(new Date() + " - Connected to Port 9090"); + + } catch (TTransportException e) { + log.fatal(new Date() + " - Could not listen on port 9090"); + return; + } + TServer server = new TThreadPoolServer(new Args(transport) + .protocolFactory(protFactory).processor(processor) + .minWorkerThreads(MINWORKERTHREADS) + .maxWorkerThreads(MAXWORKERTHREADS)); + + log.info(new Date() + " - Started running BinaryListener"); + log.info(new Date() + " - MINWORKERTHREADS=" + MINWORKERTHREADS + + " and MAXWORKERTHREADS=" + MAXWORKERTHREADS + "\n"); + server.serve(); + + } + +} diff --git a/dozentenmodulserver/src/main/java/server/Image.java b/dozentenmodulserver/src/main/java/server/Image.java new file mode 100644 index 00000000..16fc1ef5 --- /dev/null +++ b/dozentenmodulserver/src/main/java/server/Image.java @@ -0,0 +1,1188 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package server; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Image implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Image"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-2); + private static final org.apache.thrift.protocol.TField IMAGE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imageName", org.apache.thrift.protocol.TType.STRING, (short)-3); + private static final org.apache.thrift.protocol.TField LICENSE_RESTRICTION_FIELD_DESC = new org.apache.thrift.protocol.TField("licenseRestriction", org.apache.thrift.protocol.TType.STRING, (short)-4); + private static final org.apache.thrift.protocol.TField OS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("osName", org.apache.thrift.protocol.TType.STRING, (short)-5); + private static final org.apache.thrift.protocol.TField LECTURE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lectureName", org.apache.thrift.protocol.TType.STRING, (short)-6); + private static final org.apache.thrift.protocol.TField UPDATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("updateTime", org.apache.thrift.protocol.TType.STRING, (short)-7); + private static final org.apache.thrift.protocol.TField USER_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("userData", org.apache.thrift.protocol.TType.STRING, (short)-8); + private static final org.apache.thrift.protocol.TField IS_TEMPLATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isTemplate", org.apache.thrift.protocol.TType.STRING, (short)-9); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ImageStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ImageTupleSchemeFactory()); + } + + public String id; // required + public String version; // required + public String imageName; // required + public String licenseRestriction; // required + public String osName; // required + public String lectureName; // required + public String updateTime; // required + public String userData; // required + public String isTemplate; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + ID((short)-1, "id"), + VERSION((short)-2, "version"), + IMAGE_NAME((short)-3, "imageName"), + LICENSE_RESTRICTION((short)-4, "licenseRestriction"), + OS_NAME((short)-5, "osName"), + LECTURE_NAME((short)-6, "lectureName"), + UPDATE_TIME((short)-7, "updateTime"), + USER_DATA((short)-8, "userData"), + IS_TEMPLATE((short)-9, "isTemplate"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // ID + return ID; + case -2: // VERSION + return VERSION; + case -3: // IMAGE_NAME + return IMAGE_NAME; + case -4: // LICENSE_RESTRICTION + return LICENSE_RESTRICTION; + case -5: // OS_NAME + return OS_NAME; + case -6: // LECTURE_NAME + return LECTURE_NAME; + case -7: // UPDATE_TIME + return UPDATE_TIME; + case -8: // USER_DATA + return USER_DATA; + case -9: // IS_TEMPLATE + return IS_TEMPLATE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IMAGE_NAME, new org.apache.thrift.meta_data.FieldMetaData("imageName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LICENSE_RESTRICTION, new org.apache.thrift.meta_data.FieldMetaData("licenseRestriction", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.OS_NAME, new org.apache.thrift.meta_data.FieldMetaData("osName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LECTURE_NAME, new org.apache.thrift.meta_data.FieldMetaData("lectureName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.UPDATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("updateTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.USER_DATA, new org.apache.thrift.meta_data.FieldMetaData("userData", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IS_TEMPLATE, new org.apache.thrift.meta_data.FieldMetaData("isTemplate", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Image.class, metaDataMap); + } + + public Image() { + } + + public Image( + String id, + String version, + String imageName, + String licenseRestriction, + String osName, + String lectureName, + String updateTime, + String userData, + String isTemplate) + { + this(); + this.id = id; + this.version = version; + this.imageName = imageName; + this.licenseRestriction = licenseRestriction; + this.osName = osName; + this.lectureName = lectureName; + this.updateTime = updateTime; + this.userData = userData; + this.isTemplate = isTemplate; + } + + /** + * Performs a deep copy on other. + */ + public Image(Image other) { + if (other.isSetId()) { + this.id = other.id; + } + if (other.isSetVersion()) { + this.version = other.version; + } + if (other.isSetImageName()) { + this.imageName = other.imageName; + } + if (other.isSetLicenseRestriction()) { + this.licenseRestriction = other.licenseRestriction; + } + if (other.isSetOsName()) { + this.osName = other.osName; + } + if (other.isSetLectureName()) { + this.lectureName = other.lectureName; + } + if (other.isSetUpdateTime()) { + this.updateTime = other.updateTime; + } + if (other.isSetUserData()) { + this.userData = other.userData; + } + if (other.isSetIsTemplate()) { + this.isTemplate = other.isTemplate; + } + } + + public Image deepCopy() { + return new Image(this); + } + + @Override + public void clear() { + this.id = null; + this.version = null; + this.imageName = null; + this.licenseRestriction = null; + this.osName = null; + this.lectureName = null; + this.updateTime = null; + this.userData = null; + this.isTemplate = null; + } + + public String getId() { + return this.id; + } + + public Image setId(String id) { + this.id = id; + return this; + } + + public void unsetId() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return this.id != null; + } + + public void setIdIsSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public String getVersion() { + return this.version; + } + + public Image setVersion(String version) { + this.version = version; + return this; + } + + public void unsetVersion() { + this.version = null; + } + + /** Returns true if field version is set (has been assigned a value) and false otherwise */ + public boolean isSetVersion() { + return this.version != null; + } + + public void setVersionIsSet(boolean value) { + if (!value) { + this.version = null; + } + } + + public String getImageName() { + return this.imageName; + } + + public Image setImageName(String imageName) { + this.imageName = imageName; + return this; + } + + public void unsetImageName() { + this.imageName = null; + } + + /** Returns true if field imageName is set (has been assigned a value) and false otherwise */ + public boolean isSetImageName() { + return this.imageName != null; + } + + public void setImageNameIsSet(boolean value) { + if (!value) { + this.imageName = null; + } + } + + public String getLicenseRestriction() { + return this.licenseRestriction; + } + + public Image setLicenseRestriction(String licenseRestriction) { + this.licenseRestriction = licenseRestriction; + return this; + } + + public void unsetLicenseRestriction() { + this.licenseRestriction = null; + } + + /** Returns true if field licenseRestriction is set (has been assigned a value) and false otherwise */ + public boolean isSetLicenseRestriction() { + return this.licenseRestriction != null; + } + + public void setLicenseRestrictionIsSet(boolean value) { + if (!value) { + this.licenseRestriction = null; + } + } + + public String getOsName() { + return this.osName; + } + + public Image setOsName(String osName) { + this.osName = osName; + return this; + } + + public void unsetOsName() { + this.osName = null; + } + + /** Returns true if field osName is set (has been assigned a value) and false otherwise */ + public boolean isSetOsName() { + return this.osName != null; + } + + public void setOsNameIsSet(boolean value) { + if (!value) { + this.osName = null; + } + } + + public String getLectureName() { + return this.lectureName; + } + + public Image setLectureName(String lectureName) { + this.lectureName = lectureName; + return this; + } + + public void unsetLectureName() { + this.lectureName = null; + } + + /** Returns true if field lectureName is set (has been assigned a value) and false otherwise */ + public boolean isSetLectureName() { + return this.lectureName != null; + } + + public void setLectureNameIsSet(boolean value) { + if (!value) { + this.lectureName = null; + } + } + + public String getUpdateTime() { + return this.updateTime; + } + + public Image setUpdateTime(String updateTime) { + this.updateTime = updateTime; + return this; + } + + public void unsetUpdateTime() { + this.updateTime = null; + } + + /** Returns true if field updateTime is set (has been assigned a value) and false otherwise */ + public boolean isSetUpdateTime() { + return this.updateTime != null; + } + + public void setUpdateTimeIsSet(boolean value) { + if (!value) { + this.updateTime = null; + } + } + + public String getUserData() { + return this.userData; + } + + public Image setUserData(String userData) { + this.userData = userData; + return this; + } + + public void unsetUserData() { + this.userData = null; + } + + /** Returns true if field userData is set (has been assigned a value) and false otherwise */ + public boolean isSetUserData() { + return this.userData != null; + } + + public void setUserDataIsSet(boolean value) { + if (!value) { + this.userData = null; + } + } + + public String getIsTemplate() { + return this.isTemplate; + } + + public Image setIsTemplate(String isTemplate) { + this.isTemplate = isTemplate; + return this; + } + + public void unsetIsTemplate() { + this.isTemplate = null; + } + + /** Returns true if field isTemplate is set (has been assigned a value) and false otherwise */ + public boolean isSetIsTemplate() { + return this.isTemplate != null; + } + + public void setIsTemplateIsSet(boolean value) { + if (!value) { + this.isTemplate = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unsetId(); + } else { + setId((String)value); + } + break; + + case VERSION: + if (value == null) { + unsetVersion(); + } else { + setVersion((String)value); + } + break; + + case IMAGE_NAME: + if (value == null) { + unsetImageName(); + } else { + setImageName((String)value); + } + break; + + case LICENSE_RESTRICTION: + if (value == null) { + unsetLicenseRestriction(); + } else { + setLicenseRestriction((String)value); + } + break; + + case OS_NAME: + if (value == null) { + unsetOsName(); + } else { + setOsName((String)value); + } + break; + + case LECTURE_NAME: + if (value == null) { + unsetLectureName(); + } else { + setLectureName((String)value); + } + break; + + case UPDATE_TIME: + if (value == null) { + unsetUpdateTime(); + } else { + setUpdateTime((String)value); + } + break; + + case USER_DATA: + if (value == null) { + unsetUserData(); + } else { + setUserData((String)value); + } + break; + + case IS_TEMPLATE: + if (value == null) { + unsetIsTemplate(); + } else { + setIsTemplate((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return getId(); + + case VERSION: + return getVersion(); + + case IMAGE_NAME: + return getImageName(); + + case LICENSE_RESTRICTION: + return getLicenseRestriction(); + + case OS_NAME: + return getOsName(); + + case LECTURE_NAME: + return getLectureName(); + + case UPDATE_TIME: + return getUpdateTime(); + + case USER_DATA: + return getUserData(); + + case IS_TEMPLATE: + return getIsTemplate(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case ID: + return isSetId(); + case VERSION: + return isSetVersion(); + case IMAGE_NAME: + return isSetImageName(); + case LICENSE_RESTRICTION: + return isSetLicenseRestriction(); + case OS_NAME: + return isSetOsName(); + case LECTURE_NAME: + return isSetLectureName(); + case UPDATE_TIME: + return isSetUpdateTime(); + case USER_DATA: + return isSetUserData(); + case IS_TEMPLATE: + return isSetIsTemplate(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Image) + return this.equals((Image)that); + return false; + } + + public boolean equals(Image that) { + if (that == null) + return false; + + boolean this_present_id = true && this.isSetId(); + boolean that_present_id = true && that.isSetId(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + boolean this_present_version = true && this.isSetVersion(); + boolean that_present_version = true && that.isSetVersion(); + if (this_present_version || that_present_version) { + if (!(this_present_version && that_present_version)) + return false; + if (!this.version.equals(that.version)) + return false; + } + + boolean this_present_imageName = true && this.isSetImageName(); + boolean that_present_imageName = true && that.isSetImageName(); + if (this_present_imageName || that_present_imageName) { + if (!(this_present_imageName && that_present_imageName)) + return false; + if (!this.imageName.equals(that.imageName)) + return false; + } + + boolean this_present_licenseRestriction = true && this.isSetLicenseRestriction(); + boolean that_present_licenseRestriction = true && that.isSetLicenseRestriction(); + if (this_present_licenseRestriction || that_present_licenseRestriction) { + if (!(this_present_licenseRestriction && that_present_licenseRestriction)) + return false; + if (!this.licenseRestriction.equals(that.licenseRestriction)) + return false; + } + + boolean this_present_osName = true && this.isSetOsName(); + boolean that_present_osName = true && that.isSetOsName(); + if (this_present_osName || that_present_osName) { + if (!(this_present_osName && that_present_osName)) + return false; + if (!this.osName.equals(that.osName)) + return false; + } + + boolean this_present_lectureName = true && this.isSetLectureName(); + boolean that_present_lectureName = true && that.isSetLectureName(); + if (this_present_lectureName || that_present_lectureName) { + if (!(this_present_lectureName && that_present_lectureName)) + return false; + if (!this.lectureName.equals(that.lectureName)) + return false; + } + + boolean this_present_updateTime = true && this.isSetUpdateTime(); + boolean that_present_updateTime = true && that.isSetUpdateTime(); + if (this_present_updateTime || that_present_updateTime) { + if (!(this_present_updateTime && that_present_updateTime)) + return false; + if (!this.updateTime.equals(that.updateTime)) + return false; + } + + boolean this_present_userData = true && this.isSetUserData(); + boolean that_present_userData = true && that.isSetUserData(); + if (this_present_userData || that_present_userData) { + if (!(this_present_userData && that_present_userData)) + return false; + if (!this.userData.equals(that.userData)) + return false; + } + + boolean this_present_isTemplate = true && this.isSetIsTemplate(); + boolean that_present_isTemplate = true && that.isSetIsTemplate(); + if (this_present_isTemplate || that_present_isTemplate) { + if (!(this_present_isTemplate && that_present_isTemplate)) + return false; + if (!this.isTemplate.equals(that.isTemplate)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(Image other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetImageName()).compareTo(other.isSetImageName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImageName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageName, other.imageName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLicenseRestriction()).compareTo(other.isSetLicenseRestriction()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLicenseRestriction()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.licenseRestriction, other.licenseRestriction); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOsName()).compareTo(other.isSetOsName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOsName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.osName, other.osName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLectureName()).compareTo(other.isSetLectureName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLectureName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lectureName, other.lectureName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUpdateTime()).compareTo(other.isSetUpdateTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUpdateTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updateTime, other.updateTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUserData()).compareTo(other.isSetUserData()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUserData()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userData, other.userData); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIsTemplate()).compareTo(other.isSetIsTemplate()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIsTemplate()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isTemplate, other.isTemplate); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Image("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + if (!first) sb.append(", "); + sb.append("version:"); + if (this.version == null) { + sb.append("null"); + } else { + sb.append(this.version); + } + first = false; + if (!first) sb.append(", "); + sb.append("imageName:"); + if (this.imageName == null) { + sb.append("null"); + } else { + sb.append(this.imageName); + } + first = false; + if (!first) sb.append(", "); + sb.append("licenseRestriction:"); + if (this.licenseRestriction == null) { + sb.append("null"); + } else { + sb.append(this.licenseRestriction); + } + first = false; + if (!first) sb.append(", "); + sb.append("osName:"); + if (this.osName == null) { + sb.append("null"); + } else { + sb.append(this.osName); + } + first = false; + if (!first) sb.append(", "); + sb.append("lectureName:"); + if (this.lectureName == null) { + sb.append("null"); + } else { + sb.append(this.lectureName); + } + first = false; + if (!first) sb.append(", "); + sb.append("updateTime:"); + if (this.updateTime == null) { + sb.append("null"); + } else { + sb.append(this.updateTime); + } + first = false; + if (!first) sb.append(", "); + sb.append("userData:"); + if (this.userData == null) { + sb.append("null"); + } else { + sb.append(this.userData); + } + first = false; + if (!first) sb.append(", "); + sb.append("isTemplate:"); + if (this.isTemplate == null) { + sb.append("null"); + } else { + sb.append(this.isTemplate); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class ImageStandardSchemeFactory implements SchemeFactory { + public ImageStandardScheme getScheme() { + return new ImageStandardScheme(); + } + } + + private static class ImageStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Image struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -3: // IMAGE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imageName = iprot.readString(); + struct.setImageNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -4: // LICENSE_RESTRICTION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.licenseRestriction = iprot.readString(); + struct.setLicenseRestrictionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -5: // OS_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.osName = iprot.readString(); + struct.setOsNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -6: // LECTURE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.lectureName = iprot.readString(); + struct.setLectureNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -7: // UPDATE_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.updateTime = iprot.readString(); + struct.setUpdateTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -8: // USER_DATA + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.userData = iprot.readString(); + struct.setUserDataIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -9: // IS_TEMPLATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.isTemplate = iprot.readString(); + struct.setIsTemplateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, Image struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isTemplate != null) { + oprot.writeFieldBegin(IS_TEMPLATE_FIELD_DESC); + oprot.writeString(struct.isTemplate); + oprot.writeFieldEnd(); + } + if (struct.userData != null) { + oprot.writeFieldBegin(USER_DATA_FIELD_DESC); + oprot.writeString(struct.userData); + oprot.writeFieldEnd(); + } + if (struct.updateTime != null) { + oprot.writeFieldBegin(UPDATE_TIME_FIELD_DESC); + oprot.writeString(struct.updateTime); + oprot.writeFieldEnd(); + } + if (struct.lectureName != null) { + oprot.writeFieldBegin(LECTURE_NAME_FIELD_DESC); + oprot.writeString(struct.lectureName); + oprot.writeFieldEnd(); + } + if (struct.osName != null) { + oprot.writeFieldBegin(OS_NAME_FIELD_DESC); + oprot.writeString(struct.osName); + oprot.writeFieldEnd(); + } + if (struct.licenseRestriction != null) { + oprot.writeFieldBegin(LICENSE_RESTRICTION_FIELD_DESC); + oprot.writeString(struct.licenseRestriction); + oprot.writeFieldEnd(); + } + if (struct.imageName != null) { + oprot.writeFieldBegin(IMAGE_NAME_FIELD_DESC); + oprot.writeString(struct.imageName); + oprot.writeFieldEnd(); + } + if (struct.version != null) { + oprot.writeFieldBegin(VERSION_FIELD_DESC); + oprot.writeString(struct.version); + oprot.writeFieldEnd(); + } + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ImageTupleSchemeFactory implements SchemeFactory { + public ImageTupleScheme getScheme() { + return new ImageTupleScheme(); + } + } + + private static class ImageTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Image struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + if (struct.isSetVersion()) { + optionals.set(1); + } + if (struct.isSetImageName()) { + optionals.set(2); + } + if (struct.isSetLicenseRestriction()) { + optionals.set(3); + } + if (struct.isSetOsName()) { + optionals.set(4); + } + if (struct.isSetLectureName()) { + optionals.set(5); + } + if (struct.isSetUpdateTime()) { + optionals.set(6); + } + if (struct.isSetUserData()) { + optionals.set(7); + } + if (struct.isSetIsTemplate()) { + optionals.set(8); + } + oprot.writeBitSet(optionals, 9); + if (struct.isSetId()) { + oprot.writeString(struct.id); + } + if (struct.isSetVersion()) { + oprot.writeString(struct.version); + } + if (struct.isSetImageName()) { + oprot.writeString(struct.imageName); + } + if (struct.isSetLicenseRestriction()) { + oprot.writeString(struct.licenseRestriction); + } + if (struct.isSetOsName()) { + oprot.writeString(struct.osName); + } + if (struct.isSetLectureName()) { + oprot.writeString(struct.lectureName); + } + if (struct.isSetUpdateTime()) { + oprot.writeString(struct.updateTime); + } + if (struct.isSetUserData()) { + oprot.writeString(struct.userData); + } + if (struct.isSetIsTemplate()) { + oprot.writeString(struct.isTemplate); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Image struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(9); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } + if (incoming.get(1)) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } + if (incoming.get(2)) { + struct.imageName = iprot.readString(); + struct.setImageNameIsSet(true); + } + if (incoming.get(3)) { + struct.licenseRestriction = iprot.readString(); + struct.setLicenseRestrictionIsSet(true); + } + if (incoming.get(4)) { + struct.osName = iprot.readString(); + struct.setOsNameIsSet(true); + } + if (incoming.get(5)) { + struct.lectureName = iprot.readString(); + struct.setLectureNameIsSet(true); + } + if (incoming.get(6)) { + struct.updateTime = iprot.readString(); + struct.setUpdateTimeIsSet(true); + } + if (incoming.get(7)) { + struct.userData = iprot.readString(); + struct.setUserDataIsSet(true); + } + if (incoming.get(8)) { + struct.isTemplate = iprot.readString(); + struct.setIsTemplateIsSet(true); + } + } + } + +} + diff --git a/dozentenmodulserver/src/main/java/server/Lecture.java b/dozentenmodulserver/src/main/java/server/Lecture.java new file mode 100644 index 00000000..0c61ad84 --- /dev/null +++ b/dozentenmodulserver/src/main/java/server/Lecture.java @@ -0,0 +1,1188 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package server; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Lecture implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Lecture"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField LECTURENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lecturename", org.apache.thrift.protocol.TType.STRING, (short)-2); + private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.STRING, (short)-3); + private static final org.apache.thrift.protocol.TField STARTTIME_FIELD_DESC = new org.apache.thrift.protocol.TField("starttime", org.apache.thrift.protocol.TType.STRING, (short)-4); + private static final org.apache.thrift.protocol.TField ENDTIME_FIELD_DESC = new org.apache.thrift.protocol.TField("endtime", org.apache.thrift.protocol.TType.STRING, (short)-5); + private static final org.apache.thrift.protocol.TField LASTUSED_FIELD_DESC = new org.apache.thrift.protocol.TField("lastused", org.apache.thrift.protocol.TType.STRING, (short)-6); + private static final org.apache.thrift.protocol.TField DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("desc", org.apache.thrift.protocol.TType.STRING, (short)-7); + private static final org.apache.thrift.protocol.TField IMAGENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imagename", org.apache.thrift.protocol.TType.STRING, (short)-8); + private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)-9); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new LectureStandardSchemeFactory()); + schemes.put(TupleScheme.class, new LectureTupleSchemeFactory()); + } + + public String id; // required + public String lecturename; // required + public String isActive; // required + public String starttime; // required + public String endtime; // required + public String lastused; // required + public String desc; // required + public String imagename; // required + public String username; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + ID((short)-1, "id"), + LECTURENAME((short)-2, "lecturename"), + IS_ACTIVE((short)-3, "isActive"), + STARTTIME((short)-4, "starttime"), + ENDTIME((short)-5, "endtime"), + LASTUSED((short)-6, "lastused"), + DESC((short)-7, "desc"), + IMAGENAME((short)-8, "imagename"), + USERNAME((short)-9, "username"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // ID + return ID; + case -2: // LECTURENAME + return LECTURENAME; + case -3: // IS_ACTIVE + return IS_ACTIVE; + case -4: // STARTTIME + return STARTTIME; + case -5: // ENDTIME + return ENDTIME; + case -6: // LASTUSED + return LASTUSED; + case -7: // DESC + return DESC; + case -8: // IMAGENAME + return IMAGENAME; + case -9: // USERNAME + return USERNAME; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LECTURENAME, new org.apache.thrift.meta_data.FieldMetaData("lecturename", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.STARTTIME, new org.apache.thrift.meta_data.FieldMetaData("starttime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.ENDTIME, new org.apache.thrift.meta_data.FieldMetaData("endtime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LASTUSED, new org.apache.thrift.meta_data.FieldMetaData("lastused", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.DESC, new org.apache.thrift.meta_data.FieldMetaData("desc", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IMAGENAME, new org.apache.thrift.meta_data.FieldMetaData("imagename", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Lecture.class, metaDataMap); + } + + public Lecture() { + } + + public Lecture( + String id, + String lecturename, + String isActive, + String starttime, + String endtime, + String lastused, + String desc, + String imagename, + String username) + { + this(); + this.id = id; + this.lecturename = lecturename; + this.isActive = isActive; + this.starttime = starttime; + this.endtime = endtime; + this.lastused = lastused; + this.desc = desc; + this.imagename = imagename; + this.username = username; + } + + /** + * Performs a deep copy on other. + */ + public Lecture(Lecture other) { + if (other.isSetId()) { + this.id = other.id; + } + if (other.isSetLecturename()) { + this.lecturename = other.lecturename; + } + if (other.isSetIsActive()) { + this.isActive = other.isActive; + } + if (other.isSetStarttime()) { + this.starttime = other.starttime; + } + if (other.isSetEndtime()) { + this.endtime = other.endtime; + } + if (other.isSetLastused()) { + this.lastused = other.lastused; + } + if (other.isSetDesc()) { + this.desc = other.desc; + } + if (other.isSetImagename()) { + this.imagename = other.imagename; + } + if (other.isSetUsername()) { + this.username = other.username; + } + } + + public Lecture deepCopy() { + return new Lecture(this); + } + + @Override + public void clear() { + this.id = null; + this.lecturename = null; + this.isActive = null; + this.starttime = null; + this.endtime = null; + this.lastused = null; + this.desc = null; + this.imagename = null; + this.username = null; + } + + public String getId() { + return this.id; + } + + public Lecture setId(String id) { + this.id = id; + return this; + } + + public void unsetId() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return this.id != null; + } + + public void setIdIsSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public String getLecturename() { + return this.lecturename; + } + + public Lecture setLecturename(String lecturename) { + this.lecturename = lecturename; + return this; + } + + public void unsetLecturename() { + this.lecturename = null; + } + + /** Returns true if field lecturename is set (has been assigned a value) and false otherwise */ + public boolean isSetLecturename() { + return this.lecturename != null; + } + + public void setLecturenameIsSet(boolean value) { + if (!value) { + this.lecturename = null; + } + } + + public String getIsActive() { + return this.isActive; + } + + public Lecture setIsActive(String isActive) { + this.isActive = isActive; + return this; + } + + public void unsetIsActive() { + this.isActive = null; + } + + /** Returns true if field isActive is set (has been assigned a value) and false otherwise */ + public boolean isSetIsActive() { + return this.isActive != null; + } + + public void setIsActiveIsSet(boolean value) { + if (!value) { + this.isActive = null; + } + } + + public String getStarttime() { + return this.starttime; + } + + public Lecture setStarttime(String starttime) { + this.starttime = starttime; + return this; + } + + public void unsetStarttime() { + this.starttime = null; + } + + /** Returns true if field starttime is set (has been assigned a value) and false otherwise */ + public boolean isSetStarttime() { + return this.starttime != null; + } + + public void setStarttimeIsSet(boolean value) { + if (!value) { + this.starttime = null; + } + } + + public String getEndtime() { + return this.endtime; + } + + public Lecture setEndtime(String endtime) { + this.endtime = endtime; + return this; + } + + public void unsetEndtime() { + this.endtime = null; + } + + /** Returns true if field endtime is set (has been assigned a value) and false otherwise */ + public boolean isSetEndtime() { + return this.endtime != null; + } + + public void setEndtimeIsSet(boolean value) { + if (!value) { + this.endtime = null; + } + } + + public String getLastused() { + return this.lastused; + } + + public Lecture setLastused(String lastused) { + this.lastused = lastused; + return this; + } + + public void unsetLastused() { + this.lastused = null; + } + + /** Returns true if field lastused is set (has been assigned a value) and false otherwise */ + public boolean isSetLastused() { + return this.lastused != null; + } + + public void setLastusedIsSet(boolean value) { + if (!value) { + this.lastused = null; + } + } + + public String getDesc() { + return this.desc; + } + + public Lecture setDesc(String desc) { + this.desc = desc; + return this; + } + + public void unsetDesc() { + this.desc = null; + } + + /** Returns true if field desc is set (has been assigned a value) and false otherwise */ + public boolean isSetDesc() { + return this.desc != null; + } + + public void setDescIsSet(boolean value) { + if (!value) { + this.desc = null; + } + } + + public String getImagename() { + return this.imagename; + } + + public Lecture setImagename(String imagename) { + this.imagename = imagename; + return this; + } + + public void unsetImagename() { + this.imagename = null; + } + + /** Returns true if field imagename is set (has been assigned a value) and false otherwise */ + public boolean isSetImagename() { + return this.imagename != null; + } + + public void setImagenameIsSet(boolean value) { + if (!value) { + this.imagename = null; + } + } + + public String getUsername() { + return this.username; + } + + public Lecture setUsername(String username) { + this.username = username; + return this; + } + + public void unsetUsername() { + this.username = null; + } + + /** Returns true if field username is set (has been assigned a value) and false otherwise */ + public boolean isSetUsername() { + return this.username != null; + } + + public void setUsernameIsSet(boolean value) { + if (!value) { + this.username = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unsetId(); + } else { + setId((String)value); + } + break; + + case LECTURENAME: + if (value == null) { + unsetLecturename(); + } else { + setLecturename((String)value); + } + break; + + case IS_ACTIVE: + if (value == null) { + unsetIsActive(); + } else { + setIsActive((String)value); + } + break; + + case STARTTIME: + if (value == null) { + unsetStarttime(); + } else { + setStarttime((String)value); + } + break; + + case ENDTIME: + if (value == null) { + unsetEndtime(); + } else { + setEndtime((String)value); + } + break; + + case LASTUSED: + if (value == null) { + unsetLastused(); + } else { + setLastused((String)value); + } + break; + + case DESC: + if (value == null) { + unsetDesc(); + } else { + setDesc((String)value); + } + break; + + case IMAGENAME: + if (value == null) { + unsetImagename(); + } else { + setImagename((String)value); + } + break; + + case USERNAME: + if (value == null) { + unsetUsername(); + } else { + setUsername((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return getId(); + + case LECTURENAME: + return getLecturename(); + + case IS_ACTIVE: + return getIsActive(); + + case STARTTIME: + return getStarttime(); + + case ENDTIME: + return getEndtime(); + + case LASTUSED: + return getLastused(); + + case DESC: + return getDesc(); + + case IMAGENAME: + return getImagename(); + + case USERNAME: + return getUsername(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case ID: + return isSetId(); + case LECTURENAME: + return isSetLecturename(); + case IS_ACTIVE: + return isSetIsActive(); + case STARTTIME: + return isSetStarttime(); + case ENDTIME: + return isSetEndtime(); + case LASTUSED: + return isSetLastused(); + case DESC: + return isSetDesc(); + case IMAGENAME: + return isSetImagename(); + case USERNAME: + return isSetUsername(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Lecture) + return this.equals((Lecture)that); + return false; + } + + public boolean equals(Lecture that) { + if (that == null) + return false; + + boolean this_present_id = true && this.isSetId(); + boolean that_present_id = true && that.isSetId(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + boolean this_present_lecturename = true && this.isSetLecturename(); + boolean that_present_lecturename = true && that.isSetLecturename(); + if (this_present_lecturename || that_present_lecturename) { + if (!(this_present_lecturename && that_present_lecturename)) + return false; + if (!this.lecturename.equals(that.lecturename)) + return false; + } + + boolean this_present_isActive = true && this.isSetIsActive(); + boolean that_present_isActive = true && that.isSetIsActive(); + if (this_present_isActive || that_present_isActive) { + if (!(this_present_isActive && that_present_isActive)) + return false; + if (!this.isActive.equals(that.isActive)) + return false; + } + + boolean this_present_starttime = true && this.isSetStarttime(); + boolean that_present_starttime = true && that.isSetStarttime(); + if (this_present_starttime || that_present_starttime) { + if (!(this_present_starttime && that_present_starttime)) + return false; + if (!this.starttime.equals(that.starttime)) + return false; + } + + boolean this_present_endtime = true && this.isSetEndtime(); + boolean that_present_endtime = true && that.isSetEndtime(); + if (this_present_endtime || that_present_endtime) { + if (!(this_present_endtime && that_present_endtime)) + return false; + if (!this.endtime.equals(that.endtime)) + return false; + } + + boolean this_present_lastused = true && this.isSetLastused(); + boolean that_present_lastused = true && that.isSetLastused(); + if (this_present_lastused || that_present_lastused) { + if (!(this_present_lastused && that_present_lastused)) + return false; + if (!this.lastused.equals(that.lastused)) + return false; + } + + boolean this_present_desc = true && this.isSetDesc(); + boolean that_present_desc = true && that.isSetDesc(); + if (this_present_desc || that_present_desc) { + if (!(this_present_desc && that_present_desc)) + return false; + if (!this.desc.equals(that.desc)) + return false; + } + + boolean this_present_imagename = true && this.isSetImagename(); + boolean that_present_imagename = true && that.isSetImagename(); + if (this_present_imagename || that_present_imagename) { + if (!(this_present_imagename && that_present_imagename)) + return false; + if (!this.imagename.equals(that.imagename)) + return false; + } + + boolean this_present_username = true && this.isSetUsername(); + boolean that_present_username = true && that.isSetUsername(); + if (this_present_username || that_present_username) { + if (!(this_present_username && that_present_username)) + return false; + if (!this.username.equals(that.username)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(Lecture other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLecturename()).compareTo(other.isSetLecturename()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLecturename()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lecturename, other.lecturename); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(other.isSetIsActive()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIsActive()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isActive, other.isActive); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStarttime()).compareTo(other.isSetStarttime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStarttime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.starttime, other.starttime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEndtime()).compareTo(other.isSetEndtime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEndtime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endtime, other.endtime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLastused()).compareTo(other.isSetLastused()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLastused()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastused, other.lastused); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDesc()).compareTo(other.isSetDesc()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDesc()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.desc, other.desc); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetImagename()).compareTo(other.isSetImagename()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImagename()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagename, other.imagename); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUsername()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Lecture("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + if (!first) sb.append(", "); + sb.append("lecturename:"); + if (this.lecturename == null) { + sb.append("null"); + } else { + sb.append(this.lecturename); + } + first = false; + if (!first) sb.append(", "); + sb.append("isActive:"); + if (this.isActive == null) { + sb.append("null"); + } else { + sb.append(this.isActive); + } + first = false; + if (!first) sb.append(", "); + sb.append("starttime:"); + if (this.starttime == null) { + sb.append("null"); + } else { + sb.append(this.starttime); + } + first = false; + if (!first) sb.append(", "); + sb.append("endtime:"); + if (this.endtime == null) { + sb.append("null"); + } else { + sb.append(this.endtime); + } + first = false; + if (!first) sb.append(", "); + sb.append("lastused:"); + if (this.lastused == null) { + sb.append("null"); + } else { + sb.append(this.lastused); + } + first = false; + if (!first) sb.append(", "); + sb.append("desc:"); + if (this.desc == null) { + sb.append("null"); + } else { + sb.append(this.desc); + } + first = false; + if (!first) sb.append(", "); + sb.append("imagename:"); + if (this.imagename == null) { + sb.append("null"); + } else { + sb.append(this.imagename); + } + first = false; + if (!first) sb.append(", "); + sb.append("username:"); + if (this.username == null) { + sb.append("null"); + } else { + sb.append(this.username); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class LectureStandardSchemeFactory implements SchemeFactory { + public LectureStandardScheme getScheme() { + return new LectureStandardScheme(); + } + } + + private static class LectureStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Lecture struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // LECTURENAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.lecturename = iprot.readString(); + struct.setLecturenameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -3: // IS_ACTIVE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.isActive = iprot.readString(); + struct.setIsActiveIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -4: // STARTTIME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.starttime = iprot.readString(); + struct.setStarttimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -5: // ENDTIME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.endtime = iprot.readString(); + struct.setEndtimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -6: // LASTUSED + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.lastused = iprot.readString(); + struct.setLastusedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -7: // DESC + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.desc = iprot.readString(); + struct.setDescIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -8: // IMAGENAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imagename = iprot.readString(); + struct.setImagenameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -9: // USERNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, Lecture struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.username != null) { + oprot.writeFieldBegin(USERNAME_FIELD_DESC); + oprot.writeString(struct.username); + oprot.writeFieldEnd(); + } + if (struct.imagename != null) { + oprot.writeFieldBegin(IMAGENAME_FIELD_DESC); + oprot.writeString(struct.imagename); + oprot.writeFieldEnd(); + } + if (struct.desc != null) { + oprot.writeFieldBegin(DESC_FIELD_DESC); + oprot.writeString(struct.desc); + oprot.writeFieldEnd(); + } + if (struct.lastused != null) { + oprot.writeFieldBegin(LASTUSED_FIELD_DESC); + oprot.writeString(struct.lastused); + oprot.writeFieldEnd(); + } + if (struct.endtime != null) { + oprot.writeFieldBegin(ENDTIME_FIELD_DESC); + oprot.writeString(struct.endtime); + oprot.writeFieldEnd(); + } + if (struct.starttime != null) { + oprot.writeFieldBegin(STARTTIME_FIELD_DESC); + oprot.writeString(struct.starttime); + oprot.writeFieldEnd(); + } + if (struct.isActive != null) { + oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC); + oprot.writeString(struct.isActive); + oprot.writeFieldEnd(); + } + if (struct.lecturename != null) { + oprot.writeFieldBegin(LECTURENAME_FIELD_DESC); + oprot.writeString(struct.lecturename); + oprot.writeFieldEnd(); + } + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class LectureTupleSchemeFactory implements SchemeFactory { + public LectureTupleScheme getScheme() { + return new LectureTupleScheme(); + } + } + + private static class LectureTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Lecture struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + if (struct.isSetLecturename()) { + optionals.set(1); + } + if (struct.isSetIsActive()) { + optionals.set(2); + } + if (struct.isSetStarttime()) { + optionals.set(3); + } + if (struct.isSetEndtime()) { + optionals.set(4); + } + if (struct.isSetLastused()) { + optionals.set(5); + } + if (struct.isSetDesc()) { + optionals.set(6); + } + if (struct.isSetImagename()) { + optionals.set(7); + } + if (struct.isSetUsername()) { + optionals.set(8); + } + oprot.writeBitSet(optionals, 9); + if (struct.isSetId()) { + oprot.writeString(struct.id); + } + if (struct.isSetLecturename()) { + oprot.writeString(struct.lecturename); + } + if (struct.isSetIsActive()) { + oprot.writeString(struct.isActive); + } + if (struct.isSetStarttime()) { + oprot.writeString(struct.starttime); + } + if (struct.isSetEndtime()) { + oprot.writeString(struct.endtime); + } + if (struct.isSetLastused()) { + oprot.writeString(struct.lastused); + } + if (struct.isSetDesc()) { + oprot.writeString(struct.desc); + } + if (struct.isSetImagename()) { + oprot.writeString(struct.imagename); + } + if (struct.isSetUsername()) { + oprot.writeString(struct.username); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Lecture struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(9); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } + if (incoming.get(1)) { + struct.lecturename = iprot.readString(); + struct.setLecturenameIsSet(true); + } + if (incoming.get(2)) { + struct.isActive = iprot.readString(); + struct.setIsActiveIsSet(true); + } + if (incoming.get(3)) { + struct.starttime = iprot.readString(); + struct.setStarttimeIsSet(true); + } + if (incoming.get(4)) { + struct.endtime = iprot.readString(); + struct.setEndtimeIsSet(true); + } + if (incoming.get(5)) { + struct.lastused = iprot.readString(); + struct.setLastusedIsSet(true); + } + if (incoming.get(6)) { + struct.desc = iprot.readString(); + struct.setDescIsSet(true); + } + if (incoming.get(7)) { + struct.imagename = iprot.readString(); + struct.setImagenameIsSet(true); + } + if (incoming.get(8)) { + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } + } + } + +} + diff --git a/dozentenmodulserver/src/main/java/server/Server.java b/dozentenmodulserver/src/main/java/server/Server.java new file mode 100644 index 00000000..ab527168 --- /dev/null +++ b/dozentenmodulserver/src/main/java/server/Server.java @@ -0,0 +1,27824 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package server; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Server { + + public interface Iface { + + public User getFtpUser() throws org.apache.thrift.TException; + + public long DeleteFtpUser(String user) throws org.apache.thrift.TException; + + public String getPathOfImage(String image_id, String version) throws org.apache.thrift.TException; + + public boolean writeVLdata(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException; + + public List getImageList() throws org.apache.thrift.TException; + + public List getLectureList() throws org.apache.thrift.TException; + + public List getAllOS() throws org.apache.thrift.TException; + + public List getAllUniversities() throws org.apache.thrift.TException; + + public Map getPersonData(String Vorname, String Nachname) throws org.apache.thrift.TException; + + public boolean writeLecturedata(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak) throws org.apache.thrift.TException; + + public boolean startFileCopy(String file) throws org.apache.thrift.TException; + + public Map getImageData(String imageid, String imageversion) throws org.apache.thrift.TException; + + public Map getLectureData(String lectureid) throws org.apache.thrift.TException; + + public boolean updateImageData(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException; + + public boolean deleteImageData(String id, String version) throws org.apache.thrift.TException; + + public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException; + + public boolean deleteImageServer(String id, String version) throws org.apache.thrift.TException; + + public boolean connectedToLecture(String id, String version) throws org.apache.thrift.TException; + + public boolean deleteLecture(String id, String hs, String user) throws org.apache.thrift.TException; + + public boolean checkUser(String username) throws org.apache.thrift.TException; + + public boolean createUser(String loginName, String lastName, String firstName, String mail, String university) throws org.apache.thrift.TException; + + public boolean writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException; + + public boolean writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException; + + } + + public interface AsyncIface { + + public void getFtpUser(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void DeleteFtpUser(String user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getPathOfImage(String image_id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void writeVLdata(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getImageList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getLectureList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getAllOS(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getAllUniversities(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getPersonData(String Vorname, String Nachname, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void writeLecturedata(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void startFileCopy(String file, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getImageData(String imageid, String imageversion, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getLectureData(String lectureid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void updateImageData(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void deleteImageData(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void deleteImageServer(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void connectedToLecture(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void deleteLecture(String id, String hs, String user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void checkUser(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void createUser(String loginName, String lastName, String firstName, String mail, String university, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + } + + public static class Client extends org.apache.thrift.TServiceClient implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { + public Factory() {} + public Client getClient(org.apache.thrift.protocol.TProtocol prot) { + return new Client(prot); + } + public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + return new Client(iprot, oprot); + } + } + + public Client(org.apache.thrift.protocol.TProtocol prot) + { + super(prot, prot); + } + + public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + super(iprot, oprot); + } + + public User getFtpUser() throws org.apache.thrift.TException + { + send_getFtpUser(); + return recv_getFtpUser(); + } + + public void send_getFtpUser() throws org.apache.thrift.TException + { + getFtpUser_args args = new getFtpUser_args(); + sendBase("getFtpUser", args); + } + + public User recv_getFtpUser() throws org.apache.thrift.TException + { + getFtpUser_result result = new getFtpUser_result(); + receiveBase(result, "getFtpUser"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getFtpUser failed: unknown result"); + } + + public long DeleteFtpUser(String user) throws org.apache.thrift.TException + { + send_DeleteFtpUser(user); + return recv_DeleteFtpUser(); + } + + public void send_DeleteFtpUser(String user) throws org.apache.thrift.TException + { + DeleteFtpUser_args args = new DeleteFtpUser_args(); + args.setUser(user); + sendBase("DeleteFtpUser", args); + } + + public long recv_DeleteFtpUser() throws org.apache.thrift.TException + { + DeleteFtpUser_result result = new DeleteFtpUser_result(); + receiveBase(result, "DeleteFtpUser"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "DeleteFtpUser failed: unknown result"); + } + + public String getPathOfImage(String image_id, String version) throws org.apache.thrift.TException + { + send_getPathOfImage(image_id, version); + return recv_getPathOfImage(); + } + + public void send_getPathOfImage(String image_id, String version) throws org.apache.thrift.TException + { + getPathOfImage_args args = new getPathOfImage_args(); + args.setImage_id(image_id); + args.setVersion(version); + sendBase("getPathOfImage", args); + } + + public String recv_getPathOfImage() throws org.apache.thrift.TException + { + getPathOfImage_result result = new getPathOfImage_result(); + receiveBase(result, "getPathOfImage"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPathOfImage failed: unknown result"); + } + + public boolean writeVLdata(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException + { + send_writeVLdata(imagename, desc, login, firstname, lastname, university, Mail, Tel, Fak, license, internet, ram, cpu, imagePath, isTemplate, filesize, shareMode, os); + return recv_writeVLdata(); + } + + public void send_writeVLdata(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException + { + writeVLdata_args args = new writeVLdata_args(); + args.setImagename(imagename); + args.setDesc(desc); + args.setLogin(login); + args.setFirstname(firstname); + args.setLastname(lastname); + args.setUniversity(university); + args.setMail(Mail); + args.setTel(Tel); + args.setFak(Fak); + args.setLicense(license); + args.setInternet(internet); + args.setRam(ram); + args.setCpu(cpu); + args.setImagePath(imagePath); + args.setIsTemplate(isTemplate); + args.setFilesize(filesize); + args.setShareMode(shareMode); + args.setOs(os); + sendBase("writeVLdata", args); + } + + public boolean recv_writeVLdata() throws org.apache.thrift.TException + { + writeVLdata_result result = new writeVLdata_result(); + receiveBase(result, "writeVLdata"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "writeVLdata failed: unknown result"); + } + + public List getImageList() throws org.apache.thrift.TException + { + send_getImageList(); + return recv_getImageList(); + } + + public void send_getImageList() throws org.apache.thrift.TException + { + getImageList_args args = new getImageList_args(); + sendBase("getImageList", args); + } + + public List recv_getImageList() throws org.apache.thrift.TException + { + getImageList_result result = new getImageList_result(); + receiveBase(result, "getImageList"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getImageList failed: unknown result"); + } + + public List getLectureList() throws org.apache.thrift.TException + { + send_getLectureList(); + return recv_getLectureList(); + } + + public void send_getLectureList() throws org.apache.thrift.TException + { + getLectureList_args args = new getLectureList_args(); + sendBase("getLectureList", args); + } + + public List recv_getLectureList() throws org.apache.thrift.TException + { + getLectureList_result result = new getLectureList_result(); + receiveBase(result, "getLectureList"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLectureList failed: unknown result"); + } + + public List getAllOS() throws org.apache.thrift.TException + { + send_getAllOS(); + return recv_getAllOS(); + } + + public void send_getAllOS() throws org.apache.thrift.TException + { + getAllOS_args args = new getAllOS_args(); + sendBase("getAllOS", args); + } + + public List recv_getAllOS() throws org.apache.thrift.TException + { + getAllOS_result result = new getAllOS_result(); + receiveBase(result, "getAllOS"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllOS failed: unknown result"); + } + + public List getAllUniversities() throws org.apache.thrift.TException + { + send_getAllUniversities(); + return recv_getAllUniversities(); + } + + public void send_getAllUniversities() throws org.apache.thrift.TException + { + getAllUniversities_args args = new getAllUniversities_args(); + sendBase("getAllUniversities", args); + } + + public List recv_getAllUniversities() throws org.apache.thrift.TException + { + getAllUniversities_result result = new getAllUniversities_result(); + receiveBase(result, "getAllUniversities"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllUniversities failed: unknown result"); + } + + public Map getPersonData(String Vorname, String Nachname) throws org.apache.thrift.TException + { + send_getPersonData(Vorname, Nachname); + return recv_getPersonData(); + } + + public void send_getPersonData(String Vorname, String Nachname) throws org.apache.thrift.TException + { + getPersonData_args args = new getPersonData_args(); + args.setVorname(Vorname); + args.setNachname(Nachname); + sendBase("getPersonData", args); + } + + public Map recv_getPersonData() throws org.apache.thrift.TException + { + getPersonData_result result = new getPersonData_result(); + receiveBase(result, "getPersonData"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPersonData failed: unknown result"); + } + + public boolean writeLecturedata(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak) throws org.apache.thrift.TException + { + send_writeLecturedata(name, shortdesc, desc, startDate, endDate, isActive, imagename, login, firstname, lastname, university, Mail, Tel, Fak); + return recv_writeLecturedata(); + } + + public void send_writeLecturedata(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak) throws org.apache.thrift.TException + { + writeLecturedata_args args = new writeLecturedata_args(); + args.setName(name); + args.setShortdesc(shortdesc); + args.setDesc(desc); + args.setStartDate(startDate); + args.setEndDate(endDate); + args.setIsActive(isActive); + args.setImagename(imagename); + args.setLogin(login); + args.setFirstname(firstname); + args.setLastname(lastname); + args.setUniversity(university); + args.setMail(Mail); + args.setTel(Tel); + args.setFak(Fak); + sendBase("writeLecturedata", args); + } + + public boolean recv_writeLecturedata() throws org.apache.thrift.TException + { + writeLecturedata_result result = new writeLecturedata_result(); + receiveBase(result, "writeLecturedata"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "writeLecturedata failed: unknown result"); + } + + public boolean startFileCopy(String file) throws org.apache.thrift.TException + { + send_startFileCopy(file); + return recv_startFileCopy(); + } + + public void send_startFileCopy(String file) throws org.apache.thrift.TException + { + startFileCopy_args args = new startFileCopy_args(); + args.setFile(file); + sendBase("startFileCopy", args); + } + + public boolean recv_startFileCopy() throws org.apache.thrift.TException + { + startFileCopy_result result = new startFileCopy_result(); + receiveBase(result, "startFileCopy"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startFileCopy failed: unknown result"); + } + + public Map getImageData(String imageid, String imageversion) throws org.apache.thrift.TException + { + send_getImageData(imageid, imageversion); + return recv_getImageData(); + } + + public void send_getImageData(String imageid, String imageversion) throws org.apache.thrift.TException + { + getImageData_args args = new getImageData_args(); + args.setImageid(imageid); + args.setImageversion(imageversion); + sendBase("getImageData", args); + } + + public Map recv_getImageData() throws org.apache.thrift.TException + { + getImageData_result result = new getImageData_result(); + receiveBase(result, "getImageData"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getImageData failed: unknown result"); + } + + public Map getLectureData(String lectureid) throws org.apache.thrift.TException + { + send_getLectureData(lectureid); + return recv_getLectureData(); + } + + public void send_getLectureData(String lectureid) throws org.apache.thrift.TException + { + getLectureData_args args = new getLectureData_args(); + args.setLectureid(lectureid); + sendBase("getLectureData", args); + } + + public Map recv_getLectureData() throws org.apache.thrift.TException + { + getLectureData_result result = new getLectureData_result(); + receiveBase(result, "getLectureData"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLectureData failed: unknown result"); + } + + public boolean updateImageData(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException + { + send_updateImageData(name, newName, desc, image_path, license, internet, ram, cpu, id, version, isTemplate, filesize, shareMode, os); + return recv_updateImageData(); + } + + public void send_updateImageData(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException + { + updateImageData_args args = new updateImageData_args(); + args.setName(name); + args.setNewName(newName); + args.setDesc(desc); + args.setImage_path(image_path); + args.setLicense(license); + args.setInternet(internet); + args.setRam(ram); + args.setCpu(cpu); + args.setId(id); + args.setVersion(version); + args.setIsTemplate(isTemplate); + args.setFilesize(filesize); + args.setShareMode(shareMode); + args.setOs(os); + sendBase("updateImageData", args); + } + + public boolean recv_updateImageData() throws org.apache.thrift.TException + { + updateImageData_result result = new updateImageData_result(); + receiveBase(result, "updateImageData"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateImageData failed: unknown result"); + } + + public boolean deleteImageData(String id, String version) throws org.apache.thrift.TException + { + send_deleteImageData(id, version); + return recv_deleteImageData(); + } + + public void send_deleteImageData(String id, String version) throws org.apache.thrift.TException + { + deleteImageData_args args = new deleteImageData_args(); + args.setId(id); + args.setVersion(version); + sendBase("deleteImageData", args); + } + + public boolean recv_deleteImageData() throws org.apache.thrift.TException + { + deleteImageData_result result = new deleteImageData_result(); + receiveBase(result, "deleteImageData"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteImageData failed: unknown result"); + } + + public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException + { + send_updateLecturedata(name, newName, shortdesc, desc, startDate, endDate, isActive, imageid, imageversion, user, firstname, lastname, university, Mail, Tel, Fak, id); + return recv_updateLecturedata(); + } + + public void send_updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException + { + updateLecturedata_args args = new updateLecturedata_args(); + args.setName(name); + args.setNewName(newName); + args.setShortdesc(shortdesc); + args.setDesc(desc); + args.setStartDate(startDate); + args.setEndDate(endDate); + args.setIsActive(isActive); + args.setImageid(imageid); + args.setImageversion(imageversion); + args.setUser(user); + args.setFirstname(firstname); + args.setLastname(lastname); + args.setUniversity(university); + args.setMail(Mail); + args.setTel(Tel); + args.setFak(Fak); + args.setId(id); + sendBase("updateLecturedata", args); + } + + public boolean recv_updateLecturedata() throws org.apache.thrift.TException + { + updateLecturedata_result result = new updateLecturedata_result(); + receiveBase(result, "updateLecturedata"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateLecturedata failed: unknown result"); + } + + public boolean deleteImageServer(String id, String version) throws org.apache.thrift.TException + { + send_deleteImageServer(id, version); + return recv_deleteImageServer(); + } + + public void send_deleteImageServer(String id, String version) throws org.apache.thrift.TException + { + deleteImageServer_args args = new deleteImageServer_args(); + args.setId(id); + args.setVersion(version); + sendBase("deleteImageServer", args); + } + + public boolean recv_deleteImageServer() throws org.apache.thrift.TException + { + deleteImageServer_result result = new deleteImageServer_result(); + receiveBase(result, "deleteImageServer"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteImageServer failed: unknown result"); + } + + public boolean connectedToLecture(String id, String version) throws org.apache.thrift.TException + { + send_connectedToLecture(id, version); + return recv_connectedToLecture(); + } + + public void send_connectedToLecture(String id, String version) throws org.apache.thrift.TException + { + connectedToLecture_args args = new connectedToLecture_args(); + args.setId(id); + args.setVersion(version); + sendBase("connectedToLecture", args); + } + + public boolean recv_connectedToLecture() throws org.apache.thrift.TException + { + connectedToLecture_result result = new connectedToLecture_result(); + receiveBase(result, "connectedToLecture"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "connectedToLecture failed: unknown result"); + } + + public boolean deleteLecture(String id, String hs, String user) throws org.apache.thrift.TException + { + send_deleteLecture(id, hs, user); + return recv_deleteLecture(); + } + + public void send_deleteLecture(String id, String hs, String user) throws org.apache.thrift.TException + { + deleteLecture_args args = new deleteLecture_args(); + args.setId(id); + args.setHs(hs); + args.setUser(user); + sendBase("deleteLecture", args); + } + + public boolean recv_deleteLecture() throws org.apache.thrift.TException + { + deleteLecture_result result = new deleteLecture_result(); + receiveBase(result, "deleteLecture"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteLecture failed: unknown result"); + } + + public boolean checkUser(String username) throws org.apache.thrift.TException + { + send_checkUser(username); + return recv_checkUser(); + } + + public void send_checkUser(String username) throws org.apache.thrift.TException + { + checkUser_args args = new checkUser_args(); + args.setUsername(username); + sendBase("checkUser", args); + } + + public boolean recv_checkUser() throws org.apache.thrift.TException + { + checkUser_result result = new checkUser_result(); + receiveBase(result, "checkUser"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "checkUser failed: unknown result"); + } + + public boolean createUser(String loginName, String lastName, String firstName, String mail, String university) throws org.apache.thrift.TException + { + send_createUser(loginName, lastName, firstName, mail, university); + return recv_createUser(); + } + + public void send_createUser(String loginName, String lastName, String firstName, String mail, String university) throws org.apache.thrift.TException + { + createUser_args args = new createUser_args(); + args.setLoginName(loginName); + args.setLastName(lastName); + args.setFirstName(firstName); + args.setMail(mail); + args.setUniversity(university); + sendBase("createUser", args); + } + + public boolean recv_createUser() throws org.apache.thrift.TException + { + createUser_result result = new createUser_result(); + receiveBase(result, "createUser"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createUser failed: unknown result"); + } + + public boolean writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException + { + send_writeImageRights(imagename, username, lastName, firstName, mail, university, role); + return recv_writeImageRights(); + } + + public void send_writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException + { + writeImageRights_args args = new writeImageRights_args(); + args.setImagename(imagename); + args.setUsername(username); + args.setLastName(lastName); + args.setFirstName(firstName); + args.setMail(mail); + args.setUniversity(university); + args.setRole(role); + sendBase("writeImageRights", args); + } + + public boolean recv_writeImageRights() throws org.apache.thrift.TException + { + writeImageRights_result result = new writeImageRights_result(); + receiveBase(result, "writeImageRights"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "writeImageRights failed: unknown result"); + } + + public boolean writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException + { + send_writeLectureRights(lecturename, username, lastName, firstName, mail, university, role); + return recv_writeLectureRights(); + } + + public void send_writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException + { + writeLectureRights_args args = new writeLectureRights_args(); + args.setLecturename(lecturename); + args.setUsername(username); + args.setLastName(lastName); + args.setFirstName(firstName); + args.setMail(mail); + args.setUniversity(university); + args.setRole(role); + sendBase("writeLectureRights", args); + } + + public boolean recv_writeLectureRights() throws org.apache.thrift.TException + { + writeLectureRights_result result = new writeLectureRights_result(); + receiveBase(result, "writeLectureRights"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "writeLectureRights failed: unknown result"); + } + + } + public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + private org.apache.thrift.async.TAsyncClientManager clientManager; + private org.apache.thrift.protocol.TProtocolFactory protocolFactory; + public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } + } + + public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); + } + + public void getFtpUser(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getFtpUser_call method_call = new getFtpUser_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getFtpUser_call extends org.apache.thrift.async.TAsyncMethodCall { + public getFtpUser_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getFtpUser", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getFtpUser_args args = new getFtpUser_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public User getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getFtpUser(); + } + } + + public void DeleteFtpUser(String user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + DeleteFtpUser_call method_call = new DeleteFtpUser_call(user, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class DeleteFtpUser_call extends org.apache.thrift.async.TAsyncMethodCall { + private String user; + public DeleteFtpUser_call(String user, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.user = user; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("DeleteFtpUser", org.apache.thrift.protocol.TMessageType.CALL, 0)); + DeleteFtpUser_args args = new DeleteFtpUser_args(); + args.setUser(user); + args.write(prot); + prot.writeMessageEnd(); + } + + public long getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_DeleteFtpUser(); + } + } + + public void getPathOfImage(String image_id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getPathOfImage_call method_call = new getPathOfImage_call(image_id, version, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getPathOfImage_call extends org.apache.thrift.async.TAsyncMethodCall { + private String image_id; + private String version; + public getPathOfImage_call(String image_id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.image_id = image_id; + this.version = version; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPathOfImage", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getPathOfImage_args args = new getPathOfImage_args(); + args.setImage_id(image_id); + args.setVersion(version); + args.write(prot); + prot.writeMessageEnd(); + } + + public String getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getPathOfImage(); + } + } + + public void writeVLdata(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + writeVLdata_call method_call = new writeVLdata_call(imagename, desc, login, firstname, lastname, university, Mail, Tel, Fak, license, internet, ram, cpu, imagePath, isTemplate, filesize, shareMode, os, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class writeVLdata_call extends org.apache.thrift.async.TAsyncMethodCall { + private String imagename; + private String desc; + private String login; + private String firstname; + private String lastname; + private String university; + private String Mail; + private String Tel; + private String Fak; + private boolean license; + private boolean internet; + private long ram; + private long cpu; + private String imagePath; + private boolean isTemplate; + private long filesize; + private long shareMode; + private String os; + public writeVLdata_call(String imagename, String desc, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.imagename = imagename; + this.desc = desc; + this.login = login; + this.firstname = firstname; + this.lastname = lastname; + this.university = university; + this.Mail = Mail; + this.Tel = Tel; + this.Fak = Fak; + this.license = license; + this.internet = internet; + this.ram = ram; + this.cpu = cpu; + this.imagePath = imagePath; + this.isTemplate = isTemplate; + this.filesize = filesize; + this.shareMode = shareMode; + this.os = os; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("writeVLdata", org.apache.thrift.protocol.TMessageType.CALL, 0)); + writeVLdata_args args = new writeVLdata_args(); + args.setImagename(imagename); + args.setDesc(desc); + args.setLogin(login); + args.setFirstname(firstname); + args.setLastname(lastname); + args.setUniversity(university); + args.setMail(Mail); + args.setTel(Tel); + args.setFak(Fak); + args.setLicense(license); + args.setInternet(internet); + args.setRam(ram); + args.setCpu(cpu); + args.setImagePath(imagePath); + args.setIsTemplate(isTemplate); + args.setFilesize(filesize); + args.setShareMode(shareMode); + args.setOs(os); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_writeVLdata(); + } + } + + public void getImageList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getImageList_call method_call = new getImageList_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getImageList_call extends org.apache.thrift.async.TAsyncMethodCall { + public getImageList_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getImageList", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getImageList_args args = new getImageList_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getImageList(); + } + } + + public void getLectureList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getLectureList_call method_call = new getLectureList_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getLectureList_call extends org.apache.thrift.async.TAsyncMethodCall { + public getLectureList_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getLectureList", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getLectureList_args args = new getLectureList_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getLectureList(); + } + } + + public void getAllOS(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getAllOS_call method_call = new getAllOS_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getAllOS_call extends org.apache.thrift.async.TAsyncMethodCall { + public getAllOS_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllOS", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getAllOS_args args = new getAllOS_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getAllOS(); + } + } + + public void getAllUniversities(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getAllUniversities_call method_call = new getAllUniversities_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getAllUniversities_call extends org.apache.thrift.async.TAsyncMethodCall { + public getAllUniversities_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllUniversities", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getAllUniversities_args args = new getAllUniversities_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getAllUniversities(); + } + } + + public void getPersonData(String Vorname, String Nachname, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getPersonData_call method_call = new getPersonData_call(Vorname, Nachname, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getPersonData_call extends org.apache.thrift.async.TAsyncMethodCall { + private String Vorname; + private String Nachname; + public getPersonData_call(String Vorname, String Nachname, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.Vorname = Vorname; + this.Nachname = Nachname; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPersonData", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getPersonData_args args = new getPersonData_args(); + args.setVorname(Vorname); + args.setNachname(Nachname); + args.write(prot); + prot.writeMessageEnd(); + } + + public Map getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getPersonData(); + } + } + + public void writeLecturedata(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + writeLecturedata_call method_call = new writeLecturedata_call(name, shortdesc, desc, startDate, endDate, isActive, imagename, login, firstname, lastname, university, Mail, Tel, Fak, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class writeLecturedata_call extends org.apache.thrift.async.TAsyncMethodCall { + private String name; + private String shortdesc; + private String desc; + private String startDate; + private String endDate; + private boolean isActive; + private String imagename; + private String login; + private String firstname; + private String lastname; + private String university; + private String Mail; + private String Tel; + private String Fak; + public writeLecturedata_call(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.name = name; + this.shortdesc = shortdesc; + this.desc = desc; + this.startDate = startDate; + this.endDate = endDate; + this.isActive = isActive; + this.imagename = imagename; + this.login = login; + this.firstname = firstname; + this.lastname = lastname; + this.university = university; + this.Mail = Mail; + this.Tel = Tel; + this.Fak = Fak; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("writeLecturedata", org.apache.thrift.protocol.TMessageType.CALL, 0)); + writeLecturedata_args args = new writeLecturedata_args(); + args.setName(name); + args.setShortdesc(shortdesc); + args.setDesc(desc); + args.setStartDate(startDate); + args.setEndDate(endDate); + args.setIsActive(isActive); + args.setImagename(imagename); + args.setLogin(login); + args.setFirstname(firstname); + args.setLastname(lastname); + args.setUniversity(university); + args.setMail(Mail); + args.setTel(Tel); + args.setFak(Fak); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_writeLecturedata(); + } + } + + public void startFileCopy(String file, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + startFileCopy_call method_call = new startFileCopy_call(file, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class startFileCopy_call extends org.apache.thrift.async.TAsyncMethodCall { + private String file; + public startFileCopy_call(String file, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.file = file; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startFileCopy", org.apache.thrift.protocol.TMessageType.CALL, 0)); + startFileCopy_args args = new startFileCopy_args(); + args.setFile(file); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_startFileCopy(); + } + } + + public void getImageData(String imageid, String imageversion, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getImageData_call method_call = new getImageData_call(imageid, imageversion, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getImageData_call extends org.apache.thrift.async.TAsyncMethodCall { + private String imageid; + private String imageversion; + public getImageData_call(String imageid, String imageversion, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.imageid = imageid; + this.imageversion = imageversion; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getImageData", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getImageData_args args = new getImageData_args(); + args.setImageid(imageid); + args.setImageversion(imageversion); + args.write(prot); + prot.writeMessageEnd(); + } + + public Map getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getImageData(); + } + } + + public void getLectureData(String lectureid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getLectureData_call method_call = new getLectureData_call(lectureid, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getLectureData_call extends org.apache.thrift.async.TAsyncMethodCall { + private String lectureid; + public getLectureData_call(String lectureid, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.lectureid = lectureid; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getLectureData", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getLectureData_args args = new getLectureData_args(); + args.setLectureid(lectureid); + args.write(prot); + prot.writeMessageEnd(); + } + + public Map getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getLectureData(); + } + } + + public void updateImageData(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + updateImageData_call method_call = new updateImageData_call(name, newName, desc, image_path, license, internet, ram, cpu, id, version, isTemplate, filesize, shareMode, os, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class updateImageData_call extends org.apache.thrift.async.TAsyncMethodCall { + private String name; + private String newName; + private String desc; + private String image_path; + private boolean license; + private boolean internet; + private long ram; + private long cpu; + private String id; + private String version; + private boolean isTemplate; + private long filesize; + private long shareMode; + private String os; + public updateImageData_call(String name, String newName, String desc, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.name = name; + this.newName = newName; + this.desc = desc; + this.image_path = image_path; + this.license = license; + this.internet = internet; + this.ram = ram; + this.cpu = cpu; + this.id = id; + this.version = version; + this.isTemplate = isTemplate; + this.filesize = filesize; + this.shareMode = shareMode; + this.os = os; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateImageData", org.apache.thrift.protocol.TMessageType.CALL, 0)); + updateImageData_args args = new updateImageData_args(); + args.setName(name); + args.setNewName(newName); + args.setDesc(desc); + args.setImage_path(image_path); + args.setLicense(license); + args.setInternet(internet); + args.setRam(ram); + args.setCpu(cpu); + args.setId(id); + args.setVersion(version); + args.setIsTemplate(isTemplate); + args.setFilesize(filesize); + args.setShareMode(shareMode); + args.setOs(os); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_updateImageData(); + } + } + + public void deleteImageData(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deleteImageData_call method_call = new deleteImageData_call(id, version, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteImageData_call extends org.apache.thrift.async.TAsyncMethodCall { + private String id; + private String version; + public deleteImageData_call(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + this.version = version; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteImageData", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteImageData_args args = new deleteImageData_args(); + args.setId(id); + args.setVersion(version); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_deleteImageData(); + } + } + + public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + updateLecturedata_call method_call = new updateLecturedata_call(name, newName, shortdesc, desc, startDate, endDate, isActive, imageid, imageversion, user, firstname, lastname, university, Mail, Tel, Fak, id, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class updateLecturedata_call extends org.apache.thrift.async.TAsyncMethodCall { + private String name; + private String newName; + private String shortdesc; + private String desc; + private String startDate; + private String endDate; + private boolean isActive; + private String imageid; + private String imageversion; + private String user; + private String firstname; + private String lastname; + private String university; + private String Mail; + private String Tel; + private String Fak; + private String id; + public updateLecturedata_call(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imageid, String imageversion, String user, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.name = name; + this.newName = newName; + this.shortdesc = shortdesc; + this.desc = desc; + this.startDate = startDate; + this.endDate = endDate; + this.isActive = isActive; + this.imageid = imageid; + this.imageversion = imageversion; + this.user = user; + this.firstname = firstname; + this.lastname = lastname; + this.university = university; + this.Mail = Mail; + this.Tel = Tel; + this.Fak = Fak; + this.id = id; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateLecturedata", org.apache.thrift.protocol.TMessageType.CALL, 0)); + updateLecturedata_args args = new updateLecturedata_args(); + args.setName(name); + args.setNewName(newName); + args.setShortdesc(shortdesc); + args.setDesc(desc); + args.setStartDate(startDate); + args.setEndDate(endDate); + args.setIsActive(isActive); + args.setImageid(imageid); + args.setImageversion(imageversion); + args.setUser(user); + args.setFirstname(firstname); + args.setLastname(lastname); + args.setUniversity(university); + args.setMail(Mail); + args.setTel(Tel); + args.setFak(Fak); + args.setId(id); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_updateLecturedata(); + } + } + + public void deleteImageServer(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deleteImageServer_call method_call = new deleteImageServer_call(id, version, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteImageServer_call extends org.apache.thrift.async.TAsyncMethodCall { + private String id; + private String version; + public deleteImageServer_call(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + this.version = version; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteImageServer", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteImageServer_args args = new deleteImageServer_args(); + args.setId(id); + args.setVersion(version); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_deleteImageServer(); + } + } + + public void connectedToLecture(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + connectedToLecture_call method_call = new connectedToLecture_call(id, version, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class connectedToLecture_call extends org.apache.thrift.async.TAsyncMethodCall { + private String id; + private String version; + public connectedToLecture_call(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + this.version = version; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("connectedToLecture", org.apache.thrift.protocol.TMessageType.CALL, 0)); + connectedToLecture_args args = new connectedToLecture_args(); + args.setId(id); + args.setVersion(version); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_connectedToLecture(); + } + } + + public void deleteLecture(String id, String hs, String user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deleteLecture_call method_call = new deleteLecture_call(id, hs, user, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteLecture_call extends org.apache.thrift.async.TAsyncMethodCall { + private String id; + private String hs; + private String user; + public deleteLecture_call(String id, String hs, String user, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + this.hs = hs; + this.user = user; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteLecture", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteLecture_args args = new deleteLecture_args(); + args.setId(id); + args.setHs(hs); + args.setUser(user); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_deleteLecture(); + } + } + + public void checkUser(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + checkUser_call method_call = new checkUser_call(username, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class checkUser_call extends org.apache.thrift.async.TAsyncMethodCall { + private String username; + public checkUser_call(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.username = username; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("checkUser", org.apache.thrift.protocol.TMessageType.CALL, 0)); + checkUser_args args = new checkUser_args(); + args.setUsername(username); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_checkUser(); + } + } + + public void createUser(String loginName, String lastName, String firstName, String mail, String university, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + createUser_call method_call = new createUser_call(loginName, lastName, firstName, mail, university, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class createUser_call extends org.apache.thrift.async.TAsyncMethodCall { + private String loginName; + private String lastName; + private String firstName; + private String mail; + private String university; + public createUser_call(String loginName, String lastName, String firstName, String mail, String university, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.loginName = loginName; + this.lastName = lastName; + this.firstName = firstName; + this.mail = mail; + this.university = university; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createUser", org.apache.thrift.protocol.TMessageType.CALL, 0)); + createUser_args args = new createUser_args(); + args.setLoginName(loginName); + args.setLastName(lastName); + args.setFirstName(firstName); + args.setMail(mail); + args.setUniversity(university); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_createUser(); + } + } + + public void writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + writeImageRights_call method_call = new writeImageRights_call(imagename, username, lastName, firstName, mail, university, role, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class writeImageRights_call extends org.apache.thrift.async.TAsyncMethodCall { + private String imagename; + private String username; + private String lastName; + private String firstName; + private String mail; + private String university; + private String role; + public writeImageRights_call(String imagename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.imagename = imagename; + this.username = username; + this.lastName = lastName; + this.firstName = firstName; + this.mail = mail; + this.university = university; + this.role = role; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("writeImageRights", org.apache.thrift.protocol.TMessageType.CALL, 0)); + writeImageRights_args args = new writeImageRights_args(); + args.setImagename(imagename); + args.setUsername(username); + args.setLastName(lastName); + args.setFirstName(firstName); + args.setMail(mail); + args.setUniversity(university); + args.setRole(role); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_writeImageRights(); + } + } + + public void writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + writeLectureRights_call method_call = new writeLectureRights_call(lecturename, username, lastName, firstName, mail, university, role, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class writeLectureRights_call extends org.apache.thrift.async.TAsyncMethodCall { + private String lecturename; + private String username; + private String lastName; + private String firstName; + private String mail; + private String university; + private String role; + public writeLectureRights_call(String lecturename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.lecturename = lecturename; + this.username = username; + this.lastName = lastName; + this.firstName = firstName; + this.mail = mail; + this.university = university; + this.role = role; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("writeLectureRights", org.apache.thrift.protocol.TMessageType.CALL, 0)); + writeLectureRights_args args = new writeLectureRights_args(); + args.setLecturename(lecturename); + args.setUsername(username); + args.setLastName(lastName); + args.setFirstName(firstName); + args.setMail(mail); + args.setUniversity(university); + args.setRole(role); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_writeLectureRights(); + } + } + + } + + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected Processor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("getFtpUser", new getFtpUser()); + processMap.put("DeleteFtpUser", new DeleteFtpUser()); + processMap.put("getPathOfImage", new getPathOfImage()); + processMap.put("writeVLdata", new writeVLdata()); + processMap.put("getImageList", new getImageList()); + processMap.put("getLectureList", new getLectureList()); + processMap.put("getAllOS", new getAllOS()); + processMap.put("getAllUniversities", new getAllUniversities()); + processMap.put("getPersonData", new getPersonData()); + processMap.put("writeLecturedata", new writeLecturedata()); + processMap.put("startFileCopy", new startFileCopy()); + processMap.put("getImageData", new getImageData()); + processMap.put("getLectureData", new getLectureData()); + processMap.put("updateImageData", new updateImageData()); + processMap.put("deleteImageData", new deleteImageData()); + processMap.put("updateLecturedata", new updateLecturedata()); + processMap.put("deleteImageServer", new deleteImageServer()); + processMap.put("connectedToLecture", new connectedToLecture()); + processMap.put("deleteLecture", new deleteLecture()); + processMap.put("checkUser", new checkUser()); + processMap.put("createUser", new createUser()); + processMap.put("writeImageRights", new writeImageRights()); + processMap.put("writeLectureRights", new writeLectureRights()); + return processMap; + } + + public static class getFtpUser extends org.apache.thrift.ProcessFunction { + public getFtpUser() { + super("getFtpUser"); + } + + public getFtpUser_args getEmptyArgsInstance() { + return new getFtpUser_args(); + } + + protected boolean isOneway() { + return false; + } + + public getFtpUser_result getResult(I iface, getFtpUser_args args) throws org.apache.thrift.TException { + getFtpUser_result result = new getFtpUser_result(); + result.success = iface.getFtpUser(); + return result; + } + } + + public static class DeleteFtpUser extends org.apache.thrift.ProcessFunction { + public DeleteFtpUser() { + super("DeleteFtpUser"); + } + + public DeleteFtpUser_args getEmptyArgsInstance() { + return new DeleteFtpUser_args(); + } + + protected boolean isOneway() { + return false; + } + + public DeleteFtpUser_result getResult(I iface, DeleteFtpUser_args args) throws org.apache.thrift.TException { + DeleteFtpUser_result result = new DeleteFtpUser_result(); + result.success = iface.DeleteFtpUser(args.user); + result.setSuccessIsSet(true); + return result; + } + } + + public static class getPathOfImage extends org.apache.thrift.ProcessFunction { + public getPathOfImage() { + super("getPathOfImage"); + } + + public getPathOfImage_args getEmptyArgsInstance() { + return new getPathOfImage_args(); + } + + protected boolean isOneway() { + return false; + } + + public getPathOfImage_result getResult(I iface, getPathOfImage_args args) throws org.apache.thrift.TException { + getPathOfImage_result result = new getPathOfImage_result(); + result.success = iface.getPathOfImage(args.image_id, args.version); + return result; + } + } + + public static class writeVLdata extends org.apache.thrift.ProcessFunction { + public writeVLdata() { + super("writeVLdata"); + } + + public writeVLdata_args getEmptyArgsInstance() { + return new writeVLdata_args(); + } + + protected boolean isOneway() { + return false; + } + + public writeVLdata_result getResult(I iface, writeVLdata_args args) throws org.apache.thrift.TException { + writeVLdata_result result = new writeVLdata_result(); + result.success = iface.writeVLdata(args.imagename, args.desc, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.license, args.internet, args.ram, args.cpu, args.imagePath, args.isTemplate, args.filesize, args.shareMode, args.os); + result.setSuccessIsSet(true); + return result; + } + } + + public static class getImageList extends org.apache.thrift.ProcessFunction { + public getImageList() { + super("getImageList"); + } + + public getImageList_args getEmptyArgsInstance() { + return new getImageList_args(); + } + + protected boolean isOneway() { + return false; + } + + public getImageList_result getResult(I iface, getImageList_args args) throws org.apache.thrift.TException { + getImageList_result result = new getImageList_result(); + result.success = iface.getImageList(); + return result; + } + } + + public static class getLectureList extends org.apache.thrift.ProcessFunction { + public getLectureList() { + super("getLectureList"); + } + + public getLectureList_args getEmptyArgsInstance() { + return new getLectureList_args(); + } + + protected boolean isOneway() { + return false; + } + + public getLectureList_result getResult(I iface, getLectureList_args args) throws org.apache.thrift.TException { + getLectureList_result result = new getLectureList_result(); + result.success = iface.getLectureList(); + return result; + } + } + + public static class getAllOS extends org.apache.thrift.ProcessFunction { + public getAllOS() { + super("getAllOS"); + } + + public getAllOS_args getEmptyArgsInstance() { + return new getAllOS_args(); + } + + protected boolean isOneway() { + return false; + } + + public getAllOS_result getResult(I iface, getAllOS_args args) throws org.apache.thrift.TException { + getAllOS_result result = new getAllOS_result(); + result.success = iface.getAllOS(); + return result; + } + } + + public static class getAllUniversities extends org.apache.thrift.ProcessFunction { + public getAllUniversities() { + super("getAllUniversities"); + } + + public getAllUniversities_args getEmptyArgsInstance() { + return new getAllUniversities_args(); + } + + protected boolean isOneway() { + return false; + } + + public getAllUniversities_result getResult(I iface, getAllUniversities_args args) throws org.apache.thrift.TException { + getAllUniversities_result result = new getAllUniversities_result(); + result.success = iface.getAllUniversities(); + return result; + } + } + + public static class getPersonData extends org.apache.thrift.ProcessFunction { + public getPersonData() { + super("getPersonData"); + } + + public getPersonData_args getEmptyArgsInstance() { + return new getPersonData_args(); + } + + protected boolean isOneway() { + return false; + } + + public getPersonData_result getResult(I iface, getPersonData_args args) throws org.apache.thrift.TException { + getPersonData_result result = new getPersonData_result(); + result.success = iface.getPersonData(args.Vorname, args.Nachname); + return result; + } + } + + public static class writeLecturedata extends org.apache.thrift.ProcessFunction { + public writeLecturedata() { + super("writeLecturedata"); + } + + public writeLecturedata_args getEmptyArgsInstance() { + return new writeLecturedata_args(); + } + + protected boolean isOneway() { + return false; + } + + public writeLecturedata_result getResult(I iface, writeLecturedata_args args) throws org.apache.thrift.TException { + writeLecturedata_result result = new writeLecturedata_result(); + result.success = iface.writeLecturedata(args.name, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imagename, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak); + result.setSuccessIsSet(true); + return result; + } + } + + public static class startFileCopy extends org.apache.thrift.ProcessFunction { + public startFileCopy() { + super("startFileCopy"); + } + + public startFileCopy_args getEmptyArgsInstance() { + return new startFileCopy_args(); + } + + protected boolean isOneway() { + return false; + } + + public startFileCopy_result getResult(I iface, startFileCopy_args args) throws org.apache.thrift.TException { + startFileCopy_result result = new startFileCopy_result(); + result.success = iface.startFileCopy(args.file); + result.setSuccessIsSet(true); + return result; + } + } + + public static class getImageData extends org.apache.thrift.ProcessFunction { + public getImageData() { + super("getImageData"); + } + + public getImageData_args getEmptyArgsInstance() { + return new getImageData_args(); + } + + protected boolean isOneway() { + return false; + } + + public getImageData_result getResult(I iface, getImageData_args args) throws org.apache.thrift.TException { + getImageData_result result = new getImageData_result(); + result.success = iface.getImageData(args.imageid, args.imageversion); + return result; + } + } + + public static class getLectureData extends org.apache.thrift.ProcessFunction { + public getLectureData() { + super("getLectureData"); + } + + public getLectureData_args getEmptyArgsInstance() { + return new getLectureData_args(); + } + + protected boolean isOneway() { + return false; + } + + public getLectureData_result getResult(I iface, getLectureData_args args) throws org.apache.thrift.TException { + getLectureData_result result = new getLectureData_result(); + result.success = iface.getLectureData(args.lectureid); + return result; + } + } + + public static class updateImageData extends org.apache.thrift.ProcessFunction { + public updateImageData() { + super("updateImageData"); + } + + public updateImageData_args getEmptyArgsInstance() { + return new updateImageData_args(); + } + + protected boolean isOneway() { + return false; + } + + public updateImageData_result getResult(I iface, updateImageData_args args) throws org.apache.thrift.TException { + updateImageData_result result = new updateImageData_result(); + result.success = iface.updateImageData(args.name, args.newName, args.desc, args.image_path, args.license, args.internet, args.ram, args.cpu, args.id, args.version, args.isTemplate, args.filesize, args.shareMode, args.os); + result.setSuccessIsSet(true); + return result; + } + } + + public static class deleteImageData extends org.apache.thrift.ProcessFunction { + public deleteImageData() { + super("deleteImageData"); + } + + public deleteImageData_args getEmptyArgsInstance() { + return new deleteImageData_args(); + } + + protected boolean isOneway() { + return false; + } + + public deleteImageData_result getResult(I iface, deleteImageData_args args) throws org.apache.thrift.TException { + deleteImageData_result result = new deleteImageData_result(); + result.success = iface.deleteImageData(args.id, args.version); + result.setSuccessIsSet(true); + return result; + } + } + + public static class updateLecturedata extends org.apache.thrift.ProcessFunction { + public updateLecturedata() { + super("updateLecturedata"); + } + + public updateLecturedata_args getEmptyArgsInstance() { + return new updateLecturedata_args(); + } + + protected boolean isOneway() { + return false; + } + + public updateLecturedata_result getResult(I iface, updateLecturedata_args args) throws org.apache.thrift.TException { + updateLecturedata_result result = new updateLecturedata_result(); + result.success = iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imageid, args.imageversion, args.user, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id); + result.setSuccessIsSet(true); + return result; + } + } + + public static class deleteImageServer extends org.apache.thrift.ProcessFunction { + public deleteImageServer() { + super("deleteImageServer"); + } + + public deleteImageServer_args getEmptyArgsInstance() { + return new deleteImageServer_args(); + } + + protected boolean isOneway() { + return false; + } + + public deleteImageServer_result getResult(I iface, deleteImageServer_args args) throws org.apache.thrift.TException { + deleteImageServer_result result = new deleteImageServer_result(); + result.success = iface.deleteImageServer(args.id, args.version); + result.setSuccessIsSet(true); + return result; + } + } + + public static class connectedToLecture extends org.apache.thrift.ProcessFunction { + public connectedToLecture() { + super("connectedToLecture"); + } + + public connectedToLecture_args getEmptyArgsInstance() { + return new connectedToLecture_args(); + } + + protected boolean isOneway() { + return false; + } + + public connectedToLecture_result getResult(I iface, connectedToLecture_args args) throws org.apache.thrift.TException { + connectedToLecture_result result = new connectedToLecture_result(); + result.success = iface.connectedToLecture(args.id, args.version); + result.setSuccessIsSet(true); + return result; + } + } + + public static class deleteLecture extends org.apache.thrift.ProcessFunction { + public deleteLecture() { + super("deleteLecture"); + } + + public deleteLecture_args getEmptyArgsInstance() { + return new deleteLecture_args(); + } + + protected boolean isOneway() { + return false; + } + + public deleteLecture_result getResult(I iface, deleteLecture_args args) throws org.apache.thrift.TException { + deleteLecture_result result = new deleteLecture_result(); + result.success = iface.deleteLecture(args.id, args.hs, args.user); + result.setSuccessIsSet(true); + return result; + } + } + + public static class checkUser extends org.apache.thrift.ProcessFunction { + public checkUser() { + super("checkUser"); + } + + public checkUser_args getEmptyArgsInstance() { + return new checkUser_args(); + } + + protected boolean isOneway() { + return false; + } + + public checkUser_result getResult(I iface, checkUser_args args) throws org.apache.thrift.TException { + checkUser_result result = new checkUser_result(); + result.success = iface.checkUser(args.username); + result.setSuccessIsSet(true); + return result; + } + } + + public static class createUser extends org.apache.thrift.ProcessFunction { + public createUser() { + super("createUser"); + } + + public createUser_args getEmptyArgsInstance() { + return new createUser_args(); + } + + protected boolean isOneway() { + return false; + } + + public createUser_result getResult(I iface, createUser_args args) throws org.apache.thrift.TException { + createUser_result result = new createUser_result(); + result.success = iface.createUser(args.loginName, args.lastName, args.firstName, args.mail, args.university); + result.setSuccessIsSet(true); + return result; + } + } + + public static class writeImageRights extends org.apache.thrift.ProcessFunction { + public writeImageRights() { + super("writeImageRights"); + } + + public writeImageRights_args getEmptyArgsInstance() { + return new writeImageRights_args(); + } + + protected boolean isOneway() { + return false; + } + + public writeImageRights_result getResult(I iface, writeImageRights_args args) throws org.apache.thrift.TException { + writeImageRights_result result = new writeImageRights_result(); + result.success = iface.writeImageRights(args.imagename, args.username, args.lastName, args.firstName, args.mail, args.university, args.role); + result.setSuccessIsSet(true); + return result; + } + } + + public static class writeLectureRights extends org.apache.thrift.ProcessFunction { + public writeLectureRights() { + super("writeLectureRights"); + } + + public writeLectureRights_args getEmptyArgsInstance() { + return new writeLectureRights_args(); + } + + protected boolean isOneway() { + return false; + } + + public writeLectureRights_result getResult(I iface, writeLectureRights_args args) throws org.apache.thrift.TException { + writeLectureRights_result result = new writeLectureRights_result(); + result.success = iface.writeLectureRights(args.lecturename, args.username, args.lastName, args.firstName, args.mail, args.university, args.role); + result.setSuccessIsSet(true); + return result; + } + } + + } + + public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); + public AsyncProcessor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected AsyncProcessor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("getFtpUser", new getFtpUser()); + processMap.put("DeleteFtpUser", new DeleteFtpUser()); + processMap.put("getPathOfImage", new getPathOfImage()); + processMap.put("writeVLdata", new writeVLdata()); + processMap.put("getImageList", new getImageList()); + processMap.put("getLectureList", new getLectureList()); + processMap.put("getAllOS", new getAllOS()); + processMap.put("getAllUniversities", new getAllUniversities()); + processMap.put("getPersonData", new getPersonData()); + processMap.put("writeLecturedata", new writeLecturedata()); + processMap.put("startFileCopy", new startFileCopy()); + processMap.put("getImageData", new getImageData()); + processMap.put("getLectureData", new getLectureData()); + processMap.put("updateImageData", new updateImageData()); + processMap.put("deleteImageData", new deleteImageData()); + processMap.put("updateLecturedata", new updateLecturedata()); + processMap.put("deleteImageServer", new deleteImageServer()); + processMap.put("connectedToLecture", new connectedToLecture()); + processMap.put("deleteLecture", new deleteLecture()); + processMap.put("checkUser", new checkUser()); + processMap.put("createUser", new createUser()); + processMap.put("writeImageRights", new writeImageRights()); + processMap.put("writeLectureRights", new writeLectureRights()); + return processMap; + } + + public static class getFtpUser extends org.apache.thrift.AsyncProcessFunction { + public getFtpUser() { + super("getFtpUser"); + } + + public getFtpUser_args getEmptyArgsInstance() { + return new getFtpUser_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(User o) { + getFtpUser_result result = new getFtpUser_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getFtpUser_result result = new getFtpUser_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getFtpUser_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.getFtpUser(resultHandler); + } + } + + public static class DeleteFtpUser extends org.apache.thrift.AsyncProcessFunction { + public DeleteFtpUser() { + super("DeleteFtpUser"); + } + + public DeleteFtpUser_args getEmptyArgsInstance() { + return new DeleteFtpUser_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Long o) { + DeleteFtpUser_result result = new DeleteFtpUser_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + DeleteFtpUser_result result = new DeleteFtpUser_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, DeleteFtpUser_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.DeleteFtpUser(args.user,resultHandler); + } + } + + public static class getPathOfImage extends org.apache.thrift.AsyncProcessFunction { + public getPathOfImage() { + super("getPathOfImage"); + } + + public getPathOfImage_args getEmptyArgsInstance() { + return new getPathOfImage_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(String o) { + getPathOfImage_result result = new getPathOfImage_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getPathOfImage_result result = new getPathOfImage_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getPathOfImage_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.getPathOfImage(args.image_id, args.version,resultHandler); + } + } + + public static class writeVLdata extends org.apache.thrift.AsyncProcessFunction { + public writeVLdata() { + super("writeVLdata"); + } + + public writeVLdata_args getEmptyArgsInstance() { + return new writeVLdata_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + writeVLdata_result result = new writeVLdata_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + writeVLdata_result result = new writeVLdata_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, writeVLdata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.writeVLdata(args.imagename, args.desc, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.license, args.internet, args.ram, args.cpu, args.imagePath, args.isTemplate, args.filesize, args.shareMode, args.os,resultHandler); + } + } + + public static class getImageList extends org.apache.thrift.AsyncProcessFunction> { + public getImageList() { + super("getImageList"); + } + + public getImageList_args getEmptyArgsInstance() { + return new getImageList_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getImageList_result result = new getImageList_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getImageList_result result = new getImageList_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getImageList_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getImageList(resultHandler); + } + } + + public static class getLectureList extends org.apache.thrift.AsyncProcessFunction> { + public getLectureList() { + super("getLectureList"); + } + + public getLectureList_args getEmptyArgsInstance() { + return new getLectureList_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getLectureList_result result = new getLectureList_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getLectureList_result result = new getLectureList_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getLectureList_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getLectureList(resultHandler); + } + } + + public static class getAllOS extends org.apache.thrift.AsyncProcessFunction> { + public getAllOS() { + super("getAllOS"); + } + + public getAllOS_args getEmptyArgsInstance() { + return new getAllOS_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getAllOS_result result = new getAllOS_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getAllOS_result result = new getAllOS_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getAllOS_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getAllOS(resultHandler); + } + } + + public static class getAllUniversities extends org.apache.thrift.AsyncProcessFunction> { + public getAllUniversities() { + super("getAllUniversities"); + } + + public getAllUniversities_args getEmptyArgsInstance() { + return new getAllUniversities_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getAllUniversities_result result = new getAllUniversities_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getAllUniversities_result result = new getAllUniversities_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getAllUniversities_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getAllUniversities(resultHandler); + } + } + + public static class getPersonData extends org.apache.thrift.AsyncProcessFunction> { + public getPersonData() { + super("getPersonData"); + } + + public getPersonData_args getEmptyArgsInstance() { + return new getPersonData_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(Map o) { + getPersonData_result result = new getPersonData_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getPersonData_result result = new getPersonData_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getPersonData_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getPersonData(args.Vorname, args.Nachname,resultHandler); + } + } + + public static class writeLecturedata extends org.apache.thrift.AsyncProcessFunction { + public writeLecturedata() { + super("writeLecturedata"); + } + + public writeLecturedata_args getEmptyArgsInstance() { + return new writeLecturedata_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + writeLecturedata_result result = new writeLecturedata_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + writeLecturedata_result result = new writeLecturedata_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, writeLecturedata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.writeLecturedata(args.name, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imagename, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak,resultHandler); + } + } + + public static class startFileCopy extends org.apache.thrift.AsyncProcessFunction { + public startFileCopy() { + super("startFileCopy"); + } + + public startFileCopy_args getEmptyArgsInstance() { + return new startFileCopy_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + startFileCopy_result result = new startFileCopy_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + startFileCopy_result result = new startFileCopy_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, startFileCopy_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.startFileCopy(args.file,resultHandler); + } + } + + public static class getImageData extends org.apache.thrift.AsyncProcessFunction> { + public getImageData() { + super("getImageData"); + } + + public getImageData_args getEmptyArgsInstance() { + return new getImageData_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(Map o) { + getImageData_result result = new getImageData_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getImageData_result result = new getImageData_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getImageData_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getImageData(args.imageid, args.imageversion,resultHandler); + } + } + + public static class getLectureData extends org.apache.thrift.AsyncProcessFunction> { + public getLectureData() { + super("getLectureData"); + } + + public getLectureData_args getEmptyArgsInstance() { + return new getLectureData_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(Map o) { + getLectureData_result result = new getLectureData_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getLectureData_result result = new getLectureData_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getLectureData_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getLectureData(args.lectureid,resultHandler); + } + } + + public static class updateImageData extends org.apache.thrift.AsyncProcessFunction { + public updateImageData() { + super("updateImageData"); + } + + public updateImageData_args getEmptyArgsInstance() { + return new updateImageData_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + updateImageData_result result = new updateImageData_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + updateImageData_result result = new updateImageData_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, updateImageData_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.updateImageData(args.name, args.newName, args.desc, args.image_path, args.license, args.internet, args.ram, args.cpu, args.id, args.version, args.isTemplate, args.filesize, args.shareMode, args.os,resultHandler); + } + } + + public static class deleteImageData extends org.apache.thrift.AsyncProcessFunction { + public deleteImageData() { + super("deleteImageData"); + } + + public deleteImageData_args getEmptyArgsInstance() { + return new deleteImageData_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + deleteImageData_result result = new deleteImageData_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + deleteImageData_result result = new deleteImageData_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, deleteImageData_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.deleteImageData(args.id, args.version,resultHandler); + } + } + + public static class updateLecturedata extends org.apache.thrift.AsyncProcessFunction { + public updateLecturedata() { + super("updateLecturedata"); + } + + public updateLecturedata_args getEmptyArgsInstance() { + return new updateLecturedata_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + updateLecturedata_result result = new updateLecturedata_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + updateLecturedata_result result = new updateLecturedata_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, updateLecturedata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imageid, args.imageversion, args.user, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id,resultHandler); + } + } + + public static class deleteImageServer extends org.apache.thrift.AsyncProcessFunction { + public deleteImageServer() { + super("deleteImageServer"); + } + + public deleteImageServer_args getEmptyArgsInstance() { + return new deleteImageServer_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + deleteImageServer_result result = new deleteImageServer_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + deleteImageServer_result result = new deleteImageServer_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, deleteImageServer_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.deleteImageServer(args.id, args.version,resultHandler); + } + } + + public static class connectedToLecture extends org.apache.thrift.AsyncProcessFunction { + public connectedToLecture() { + super("connectedToLecture"); + } + + public connectedToLecture_args getEmptyArgsInstance() { + return new connectedToLecture_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + connectedToLecture_result result = new connectedToLecture_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + connectedToLecture_result result = new connectedToLecture_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, connectedToLecture_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.connectedToLecture(args.id, args.version,resultHandler); + } + } + + public static class deleteLecture extends org.apache.thrift.AsyncProcessFunction { + public deleteLecture() { + super("deleteLecture"); + } + + public deleteLecture_args getEmptyArgsInstance() { + return new deleteLecture_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + deleteLecture_result result = new deleteLecture_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + deleteLecture_result result = new deleteLecture_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, deleteLecture_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.deleteLecture(args.id, args.hs, args.user,resultHandler); + } + } + + public static class checkUser extends org.apache.thrift.AsyncProcessFunction { + public checkUser() { + super("checkUser"); + } + + public checkUser_args getEmptyArgsInstance() { + return new checkUser_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + checkUser_result result = new checkUser_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + checkUser_result result = new checkUser_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, checkUser_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.checkUser(args.username,resultHandler); + } + } + + public static class createUser extends org.apache.thrift.AsyncProcessFunction { + public createUser() { + super("createUser"); + } + + public createUser_args getEmptyArgsInstance() { + return new createUser_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + createUser_result result = new createUser_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + createUser_result result = new createUser_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, createUser_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.createUser(args.loginName, args.lastName, args.firstName, args.mail, args.university,resultHandler); + } + } + + public static class writeImageRights extends org.apache.thrift.AsyncProcessFunction { + public writeImageRights() { + super("writeImageRights"); + } + + public writeImageRights_args getEmptyArgsInstance() { + return new writeImageRights_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + writeImageRights_result result = new writeImageRights_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + writeImageRights_result result = new writeImageRights_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, writeImageRights_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.writeImageRights(args.imagename, args.username, args.lastName, args.firstName, args.mail, args.university, args.role,resultHandler); + } + } + + public static class writeLectureRights extends org.apache.thrift.AsyncProcessFunction { + public writeLectureRights() { + super("writeLectureRights"); + } + + public writeLectureRights_args getEmptyArgsInstance() { + return new writeLectureRights_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + writeLectureRights_result result = new writeLectureRights_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + writeLectureRights_result result = new writeLectureRights_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, writeLectureRights_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.writeLectureRights(args.lecturename, args.username, args.lastName, args.firstName, args.mail, args.university, args.role,resultHandler); + } + } + + } + + public static class getFtpUser_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getFtpUser_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getFtpUser_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getFtpUser_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getFtpUser_args.class, metaDataMap); + } + + public getFtpUser_args() { + } + + /** + * Performs a deep copy on other. + */ + public getFtpUser_args(getFtpUser_args other) { + } + + public getFtpUser_args deepCopy() { + return new getFtpUser_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getFtpUser_args) + return this.equals((getFtpUser_args)that); + return false; + } + + public boolean equals(getFtpUser_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getFtpUser_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getFtpUser_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getFtpUser_argsStandardSchemeFactory implements SchemeFactory { + public getFtpUser_argsStandardScheme getScheme() { + return new getFtpUser_argsStandardScheme(); + } + } + + private static class getFtpUser_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getFtpUser_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getFtpUser_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getFtpUser_argsTupleSchemeFactory implements SchemeFactory { + public getFtpUser_argsTupleScheme getScheme() { + return new getFtpUser_argsTupleScheme(); + } + } + + private static class getFtpUser_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getFtpUser_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getFtpUser_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getFtpUser_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getFtpUser_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getFtpUser_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getFtpUser_resultTupleSchemeFactory()); + } + + public User success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, User.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getFtpUser_result.class, metaDataMap); + } + + public getFtpUser_result() { + } + + public getFtpUser_result( + User success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getFtpUser_result(getFtpUser_result other) { + if (other.isSetSuccess()) { + this.success = new User(other.success); + } + } + + public getFtpUser_result deepCopy() { + return new getFtpUser_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public User getSuccess() { + return this.success; + } + + public getFtpUser_result setSuccess(User success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((User)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getFtpUser_result) + return this.equals((getFtpUser_result)that); + return false; + } + + public boolean equals(getFtpUser_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getFtpUser_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getFtpUser_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getFtpUser_resultStandardSchemeFactory implements SchemeFactory { + public getFtpUser_resultStandardScheme getScheme() { + return new getFtpUser_resultStandardScheme(); + } + } + + private static class getFtpUser_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getFtpUser_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new User(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getFtpUser_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getFtpUser_resultTupleSchemeFactory implements SchemeFactory { + public getFtpUser_resultTupleScheme getScheme() { + return new getFtpUser_resultTupleScheme(); + } + } + + private static class getFtpUser_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getFtpUser_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getFtpUser_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new User(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class DeleteFtpUser_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DeleteFtpUser_args"); + + private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRING, (short)-1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new DeleteFtpUser_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new DeleteFtpUser_argsTupleSchemeFactory()); + } + + public String user; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + USER((short)-1, "user"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // USER + return USER; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DeleteFtpUser_args.class, metaDataMap); + } + + public DeleteFtpUser_args() { + } + + public DeleteFtpUser_args( + String user) + { + this(); + this.user = user; + } + + /** + * Performs a deep copy on other. + */ + public DeleteFtpUser_args(DeleteFtpUser_args other) { + if (other.isSetUser()) { + this.user = other.user; + } + } + + public DeleteFtpUser_args deepCopy() { + return new DeleteFtpUser_args(this); + } + + @Override + public void clear() { + this.user = null; + } + + public String getUser() { + return this.user; + } + + public DeleteFtpUser_args setUser(String user) { + this.user = user; + return this; + } + + public void unsetUser() { + this.user = null; + } + + /** Returns true if field user is set (has been assigned a value) and false otherwise */ + public boolean isSetUser() { + return this.user != null; + } + + public void setUserIsSet(boolean value) { + if (!value) { + this.user = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case USER: + if (value == null) { + unsetUser(); + } else { + setUser((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case USER: + return getUser(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case USER: + return isSetUser(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof DeleteFtpUser_args) + return this.equals((DeleteFtpUser_args)that); + return false; + } + + public boolean equals(DeleteFtpUser_args that) { + if (that == null) + return false; + + boolean this_present_user = true && this.isSetUser(); + boolean that_present_user = true && that.isSetUser(); + if (this_present_user || that_present_user) { + if (!(this_present_user && that_present_user)) + return false; + if (!this.user.equals(that.user)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(DeleteFtpUser_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUser()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("DeleteFtpUser_args("); + boolean first = true; + + sb.append("user:"); + if (this.user == null) { + sb.append("null"); + } else { + sb.append(this.user); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class DeleteFtpUser_argsStandardSchemeFactory implements SchemeFactory { + public DeleteFtpUser_argsStandardScheme getScheme() { + return new DeleteFtpUser_argsStandardScheme(); + } + } + + private static class DeleteFtpUser_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, DeleteFtpUser_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // USER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.user = iprot.readString(); + struct.setUserIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, DeleteFtpUser_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.user != null) { + oprot.writeFieldBegin(USER_FIELD_DESC); + oprot.writeString(struct.user); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class DeleteFtpUser_argsTupleSchemeFactory implements SchemeFactory { + public DeleteFtpUser_argsTupleScheme getScheme() { + return new DeleteFtpUser_argsTupleScheme(); + } + } + + private static class DeleteFtpUser_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, DeleteFtpUser_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUser()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetUser()) { + oprot.writeString(struct.user); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, DeleteFtpUser_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.user = iprot.readString(); + struct.setUserIsSet(true); + } + } + } + + } + + public static class DeleteFtpUser_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DeleteFtpUser_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new DeleteFtpUser_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new DeleteFtpUser_resultTupleSchemeFactory()); + } + + public long success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DeleteFtpUser_result.class, metaDataMap); + } + + public DeleteFtpUser_result() { + } + + public DeleteFtpUser_result( + long success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public DeleteFtpUser_result(DeleteFtpUser_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public DeleteFtpUser_result deepCopy() { + return new DeleteFtpUser_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + } + + public long getSuccess() { + return this.success; + } + + public DeleteFtpUser_result setSuccess(long success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Long.valueOf(getSuccess()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof DeleteFtpUser_result) + return this.equals((DeleteFtpUser_result)that); + return false; + } + + public boolean equals(DeleteFtpUser_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(DeleteFtpUser_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("DeleteFtpUser_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class DeleteFtpUser_resultStandardSchemeFactory implements SchemeFactory { + public DeleteFtpUser_resultStandardScheme getScheme() { + return new DeleteFtpUser_resultStandardScheme(); + } + } + + private static class DeleteFtpUser_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, DeleteFtpUser_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, DeleteFtpUser_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI64(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class DeleteFtpUser_resultTupleSchemeFactory implements SchemeFactory { + public DeleteFtpUser_resultTupleScheme getScheme() { + return new DeleteFtpUser_resultTupleScheme(); + } + } + + private static class DeleteFtpUser_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, DeleteFtpUser_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeI64(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, DeleteFtpUser_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class getPathOfImage_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPathOfImage_args"); + + private static final org.apache.thrift.protocol.TField IMAGE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("image_id", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getPathOfImage_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getPathOfImage_argsTupleSchemeFactory()); + } + + public String image_id; // required + public String version; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + IMAGE_ID((short)-1, "image_id"), + VERSION((short)-2, "version"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // IMAGE_ID + return IMAGE_ID; + case -2: // VERSION + return VERSION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IMAGE_ID, new org.apache.thrift.meta_data.FieldMetaData("image_id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathOfImage_args.class, metaDataMap); + } + + public getPathOfImage_args() { + } + + public getPathOfImage_args( + String image_id, + String version) + { + this(); + this.image_id = image_id; + this.version = version; + } + + /** + * Performs a deep copy on other. + */ + public getPathOfImage_args(getPathOfImage_args other) { + if (other.isSetImage_id()) { + this.image_id = other.image_id; + } + if (other.isSetVersion()) { + this.version = other.version; + } + } + + public getPathOfImage_args deepCopy() { + return new getPathOfImage_args(this); + } + + @Override + public void clear() { + this.image_id = null; + this.version = null; + } + + public String getImage_id() { + return this.image_id; + } + + public getPathOfImage_args setImage_id(String image_id) { + this.image_id = image_id; + return this; + } + + public void unsetImage_id() { + this.image_id = null; + } + + /** Returns true if field image_id is set (has been assigned a value) and false otherwise */ + public boolean isSetImage_id() { + return this.image_id != null; + } + + public void setImage_idIsSet(boolean value) { + if (!value) { + this.image_id = null; + } + } + + public String getVersion() { + return this.version; + } + + public getPathOfImage_args setVersion(String version) { + this.version = version; + return this; + } + + public void unsetVersion() { + this.version = null; + } + + /** Returns true if field version is set (has been assigned a value) and false otherwise */ + public boolean isSetVersion() { + return this.version != null; + } + + public void setVersionIsSet(boolean value) { + if (!value) { + this.version = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IMAGE_ID: + if (value == null) { + unsetImage_id(); + } else { + setImage_id((String)value); + } + break; + + case VERSION: + if (value == null) { + unsetVersion(); + } else { + setVersion((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IMAGE_ID: + return getImage_id(); + + case VERSION: + return getVersion(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case IMAGE_ID: + return isSetImage_id(); + case VERSION: + return isSetVersion(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getPathOfImage_args) + return this.equals((getPathOfImage_args)that); + return false; + } + + public boolean equals(getPathOfImage_args that) { + if (that == null) + return false; + + boolean this_present_image_id = true && this.isSetImage_id(); + boolean that_present_image_id = true && that.isSetImage_id(); + if (this_present_image_id || that_present_image_id) { + if (!(this_present_image_id && that_present_image_id)) + return false; + if (!this.image_id.equals(that.image_id)) + return false; + } + + boolean this_present_version = true && this.isSetVersion(); + boolean that_present_version = true && that.isSetVersion(); + if (this_present_version || that_present_version) { + if (!(this_present_version && that_present_version)) + return false; + if (!this.version.equals(that.version)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getPathOfImage_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetImage_id()).compareTo(other.isSetImage_id()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImage_id()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.image_id, other.image_id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getPathOfImage_args("); + boolean first = true; + + sb.append("image_id:"); + if (this.image_id == null) { + sb.append("null"); + } else { + sb.append(this.image_id); + } + first = false; + if (!first) sb.append(", "); + sb.append("version:"); + if (this.version == null) { + sb.append("null"); + } else { + sb.append(this.version); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getPathOfImage_argsStandardSchemeFactory implements SchemeFactory { + public getPathOfImage_argsStandardScheme getScheme() { + return new getPathOfImage_argsStandardScheme(); + } + } + + private static class getPathOfImage_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getPathOfImage_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // IMAGE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.image_id = iprot.readString(); + struct.setImage_idIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getPathOfImage_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.version != null) { + oprot.writeFieldBegin(VERSION_FIELD_DESC); + oprot.writeString(struct.version); + oprot.writeFieldEnd(); + } + if (struct.image_id != null) { + oprot.writeFieldBegin(IMAGE_ID_FIELD_DESC); + oprot.writeString(struct.image_id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getPathOfImage_argsTupleSchemeFactory implements SchemeFactory { + public getPathOfImage_argsTupleScheme getScheme() { + return new getPathOfImage_argsTupleScheme(); + } + } + + private static class getPathOfImage_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getPathOfImage_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetImage_id()) { + optionals.set(0); + } + if (struct.isSetVersion()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetImage_id()) { + oprot.writeString(struct.image_id); + } + if (struct.isSetVersion()) { + oprot.writeString(struct.version); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getPathOfImage_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.image_id = iprot.readString(); + struct.setImage_idIsSet(true); + } + if (incoming.get(1)) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } + } + } + + } + + public static class getPathOfImage_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPathOfImage_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getPathOfImage_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getPathOfImage_resultTupleSchemeFactory()); + } + + public String success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathOfImage_result.class, metaDataMap); + } + + public getPathOfImage_result() { + } + + public getPathOfImage_result( + String success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getPathOfImage_result(getPathOfImage_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + } + + public getPathOfImage_result deepCopy() { + return new getPathOfImage_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public String getSuccess() { + return this.success; + } + + public getPathOfImage_result setSuccess(String success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getPathOfImage_result) + return this.equals((getPathOfImage_result)that); + return false; + } + + public boolean equals(getPathOfImage_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getPathOfImage_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getPathOfImage_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getPathOfImage_resultStandardSchemeFactory implements SchemeFactory { + public getPathOfImage_resultStandardScheme getScheme() { + return new getPathOfImage_resultStandardScheme(); + } + } + + private static class getPathOfImage_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getPathOfImage_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getPathOfImage_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getPathOfImage_resultTupleSchemeFactory implements SchemeFactory { + public getPathOfImage_resultTupleScheme getScheme() { + return new getPathOfImage_resultTupleScheme(); + } + } + + private static class getPathOfImage_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getPathOfImage_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getPathOfImage_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class writeVLdata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeVLdata_args"); + + private static final org.apache.thrift.protocol.TField IMAGENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imagename", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("desc", org.apache.thrift.protocol.TType.STRING, (short)-2); + private static final org.apache.thrift.protocol.TField LOGIN_FIELD_DESC = new org.apache.thrift.protocol.TField("login", org.apache.thrift.protocol.TType.STRING, (short)-3); + private static final org.apache.thrift.protocol.TField FIRSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstname", org.apache.thrift.protocol.TType.STRING, (short)-4); + private static final org.apache.thrift.protocol.TField LASTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastname", org.apache.thrift.protocol.TType.STRING, (short)-5); + private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-6); + private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("Mail", org.apache.thrift.protocol.TType.STRING, (short)-7); + private static final org.apache.thrift.protocol.TField TEL_FIELD_DESC = new org.apache.thrift.protocol.TField("Tel", org.apache.thrift.protocol.TType.STRING, (short)-8); + private static final org.apache.thrift.protocol.TField FAK_FIELD_DESC = new org.apache.thrift.protocol.TField("Fak", org.apache.thrift.protocol.TType.STRING, (short)-9); + private static final org.apache.thrift.protocol.TField LICENSE_FIELD_DESC = new org.apache.thrift.protocol.TField("license", org.apache.thrift.protocol.TType.BOOL, (short)-10); + private static final org.apache.thrift.protocol.TField INTERNET_FIELD_DESC = new org.apache.thrift.protocol.TField("internet", org.apache.thrift.protocol.TType.BOOL, (short)-11); + private static final org.apache.thrift.protocol.TField RAM_FIELD_DESC = new org.apache.thrift.protocol.TField("ram", org.apache.thrift.protocol.TType.I64, (short)-12); + private static final org.apache.thrift.protocol.TField CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("cpu", org.apache.thrift.protocol.TType.I64, (short)-13); + private static final org.apache.thrift.protocol.TField IMAGE_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("imagePath", org.apache.thrift.protocol.TType.STRING, (short)-14); + private static final org.apache.thrift.protocol.TField IS_TEMPLATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isTemplate", org.apache.thrift.protocol.TType.BOOL, (short)-15); + private static final org.apache.thrift.protocol.TField FILESIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("filesize", org.apache.thrift.protocol.TType.I64, (short)-16); + private static final org.apache.thrift.protocol.TField SHARE_MODE_FIELD_DESC = new org.apache.thrift.protocol.TField("shareMode", org.apache.thrift.protocol.TType.I64, (short)-17); + private static final org.apache.thrift.protocol.TField OS_FIELD_DESC = new org.apache.thrift.protocol.TField("os", org.apache.thrift.protocol.TType.STRING, (short)-18); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new writeVLdata_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new writeVLdata_argsTupleSchemeFactory()); + } + + public String imagename; // required + public String desc; // required + public String login; // required + public String firstname; // required + public String lastname; // required + public String university; // required + public String Mail; // required + public String Tel; // required + public String Fak; // required + public boolean license; // required + public boolean internet; // required + public long ram; // required + public long cpu; // required + public String imagePath; // required + public boolean isTemplate; // required + public long filesize; // required + public long shareMode; // required + public String os; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + IMAGENAME((short)-1, "imagename"), + DESC((short)-2, "desc"), + LOGIN((short)-3, "login"), + FIRSTNAME((short)-4, "firstname"), + LASTNAME((short)-5, "lastname"), + UNIVERSITY((short)-6, "university"), + MAIL((short)-7, "Mail"), + TEL((short)-8, "Tel"), + FAK((short)-9, "Fak"), + LICENSE((short)-10, "license"), + INTERNET((short)-11, "internet"), + RAM((short)-12, "ram"), + CPU((short)-13, "cpu"), + IMAGE_PATH((short)-14, "imagePath"), + IS_TEMPLATE((short)-15, "isTemplate"), + FILESIZE((short)-16, "filesize"), + SHARE_MODE((short)-17, "shareMode"), + OS((short)-18, "os"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // IMAGENAME + return IMAGENAME; + case -2: // DESC + return DESC; + case -3: // LOGIN + return LOGIN; + case -4: // FIRSTNAME + return FIRSTNAME; + case -5: // LASTNAME + return LASTNAME; + case -6: // UNIVERSITY + return UNIVERSITY; + case -7: // MAIL + return MAIL; + case -8: // TEL + return TEL; + case -9: // FAK + return FAK; + case -10: // LICENSE + return LICENSE; + case -11: // INTERNET + return INTERNET; + case -12: // RAM + return RAM; + case -13: // CPU + return CPU; + case -14: // IMAGE_PATH + return IMAGE_PATH; + case -15: // IS_TEMPLATE + return IS_TEMPLATE; + case -16: // FILESIZE + return FILESIZE; + case -17: // SHARE_MODE + return SHARE_MODE; + case -18: // OS + return OS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __LICENSE_ISSET_ID = 0; + private static final int __INTERNET_ISSET_ID = 1; + private static final int __RAM_ISSET_ID = 2; + private static final int __CPU_ISSET_ID = 3; + private static final int __ISTEMPLATE_ISSET_ID = 4; + private static final int __FILESIZE_ISSET_ID = 5; + private static final int __SHAREMODE_ISSET_ID = 6; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IMAGENAME, new org.apache.thrift.meta_data.FieldMetaData("imagename", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.DESC, new org.apache.thrift.meta_data.FieldMetaData("desc", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LOGIN, new org.apache.thrift.meta_data.FieldMetaData("login", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.FIRSTNAME, new org.apache.thrift.meta_data.FieldMetaData("firstname", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LASTNAME, new org.apache.thrift.meta_data.FieldMetaData("lastname", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("Mail", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TEL, new org.apache.thrift.meta_data.FieldMetaData("Tel", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.FAK, new org.apache.thrift.meta_data.FieldMetaData("Fak", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LICENSE, new org.apache.thrift.meta_data.FieldMetaData("license", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.INTERNET, new org.apache.thrift.meta_data.FieldMetaData("internet", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.RAM, new org.apache.thrift.meta_data.FieldMetaData("ram", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int"))); + tmpMap.put(_Fields.CPU, new org.apache.thrift.meta_data.FieldMetaData("cpu", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int"))); + tmpMap.put(_Fields.IMAGE_PATH, new org.apache.thrift.meta_data.FieldMetaData("imagePath", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IS_TEMPLATE, new org.apache.thrift.meta_data.FieldMetaData("isTemplate", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.FILESIZE, new org.apache.thrift.meta_data.FieldMetaData("filesize", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.SHARE_MODE, new org.apache.thrift.meta_data.FieldMetaData("shareMode", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int"))); + tmpMap.put(_Fields.OS, new org.apache.thrift.meta_data.FieldMetaData("os", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeVLdata_args.class, metaDataMap); + } + + public writeVLdata_args() { + } + + public writeVLdata_args( + String imagename, + String desc, + String login, + String firstname, + String lastname, + String university, + String Mail, + String Tel, + String Fak, + boolean license, + boolean internet, + long ram, + long cpu, + String imagePath, + boolean isTemplate, + long filesize, + long shareMode, + String os) + { + this(); + this.imagename = imagename; + this.desc = desc; + this.login = login; + this.firstname = firstname; + this.lastname = lastname; + this.university = university; + this.Mail = Mail; + this.Tel = Tel; + this.Fak = Fak; + this.license = license; + setLicenseIsSet(true); + this.internet = internet; + setInternetIsSet(true); + this.ram = ram; + setRamIsSet(true); + this.cpu = cpu; + setCpuIsSet(true); + this.imagePath = imagePath; + this.isTemplate = isTemplate; + setIsTemplateIsSet(true); + this.filesize = filesize; + setFilesizeIsSet(true); + this.shareMode = shareMode; + setShareModeIsSet(true); + this.os = os; + } + + /** + * Performs a deep copy on other. + */ + public writeVLdata_args(writeVLdata_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetImagename()) { + this.imagename = other.imagename; + } + if (other.isSetDesc()) { + this.desc = other.desc; + } + if (other.isSetLogin()) { + this.login = other.login; + } + if (other.isSetFirstname()) { + this.firstname = other.firstname; + } + if (other.isSetLastname()) { + this.lastname = other.lastname; + } + if (other.isSetUniversity()) { + this.university = other.university; + } + if (other.isSetMail()) { + this.Mail = other.Mail; + } + if (other.isSetTel()) { + this.Tel = other.Tel; + } + if (other.isSetFak()) { + this.Fak = other.Fak; + } + this.license = other.license; + this.internet = other.internet; + this.ram = other.ram; + this.cpu = other.cpu; + if (other.isSetImagePath()) { + this.imagePath = other.imagePath; + } + this.isTemplate = other.isTemplate; + this.filesize = other.filesize; + this.shareMode = other.shareMode; + if (other.isSetOs()) { + this.os = other.os; + } + } + + public writeVLdata_args deepCopy() { + return new writeVLdata_args(this); + } + + @Override + public void clear() { + this.imagename = null; + this.desc = null; + this.login = null; + this.firstname = null; + this.lastname = null; + this.university = null; + this.Mail = null; + this.Tel = null; + this.Fak = null; + setLicenseIsSet(false); + this.license = false; + setInternetIsSet(false); + this.internet = false; + setRamIsSet(false); + this.ram = 0; + setCpuIsSet(false); + this.cpu = 0; + this.imagePath = null; + setIsTemplateIsSet(false); + this.isTemplate = false; + setFilesizeIsSet(false); + this.filesize = 0; + setShareModeIsSet(false); + this.shareMode = 0; + this.os = null; + } + + public String getImagename() { + return this.imagename; + } + + public writeVLdata_args setImagename(String imagename) { + this.imagename = imagename; + return this; + } + + public void unsetImagename() { + this.imagename = null; + } + + /** Returns true if field imagename is set (has been assigned a value) and false otherwise */ + public boolean isSetImagename() { + return this.imagename != null; + } + + public void setImagenameIsSet(boolean value) { + if (!value) { + this.imagename = null; + } + } + + public String getDesc() { + return this.desc; + } + + public writeVLdata_args setDesc(String desc) { + this.desc = desc; + return this; + } + + public void unsetDesc() { + this.desc = null; + } + + /** Returns true if field desc is set (has been assigned a value) and false otherwise */ + public boolean isSetDesc() { + return this.desc != null; + } + + public void setDescIsSet(boolean value) { + if (!value) { + this.desc = null; + } + } + + public String getLogin() { + return this.login; + } + + public writeVLdata_args setLogin(String login) { + this.login = login; + return this; + } + + public void unsetLogin() { + this.login = null; + } + + /** Returns true if field login is set (has been assigned a value) and false otherwise */ + public boolean isSetLogin() { + return this.login != null; + } + + public void setLoginIsSet(boolean value) { + if (!value) { + this.login = null; + } + } + + public String getFirstname() { + return this.firstname; + } + + public writeVLdata_args setFirstname(String firstname) { + this.firstname = firstname; + return this; + } + + public void unsetFirstname() { + this.firstname = null; + } + + /** Returns true if field firstname is set (has been assigned a value) and false otherwise */ + public boolean isSetFirstname() { + return this.firstname != null; + } + + public void setFirstnameIsSet(boolean value) { + if (!value) { + this.firstname = null; + } + } + + public String getLastname() { + return this.lastname; + } + + public writeVLdata_args setLastname(String lastname) { + this.lastname = lastname; + return this; + } + + public void unsetLastname() { + this.lastname = null; + } + + /** Returns true if field lastname is set (has been assigned a value) and false otherwise */ + public boolean isSetLastname() { + return this.lastname != null; + } + + public void setLastnameIsSet(boolean value) { + if (!value) { + this.lastname = null; + } + } + + public String getUniversity() { + return this.university; + } + + public writeVLdata_args setUniversity(String university) { + this.university = university; + return this; + } + + public void unsetUniversity() { + this.university = null; + } + + /** Returns true if field university is set (has been assigned a value) and false otherwise */ + public boolean isSetUniversity() { + return this.university != null; + } + + public void setUniversityIsSet(boolean value) { + if (!value) { + this.university = null; + } + } + + public String getMail() { + return this.Mail; + } + + public writeVLdata_args setMail(String Mail) { + this.Mail = Mail; + return this; + } + + public void unsetMail() { + this.Mail = null; + } + + /** Returns true if field Mail is set (has been assigned a value) and false otherwise */ + public boolean isSetMail() { + return this.Mail != null; + } + + public void setMailIsSet(boolean value) { + if (!value) { + this.Mail = null; + } + } + + public String getTel() { + return this.Tel; + } + + public writeVLdata_args setTel(String Tel) { + this.Tel = Tel; + return this; + } + + public void unsetTel() { + this.Tel = null; + } + + /** Returns true if field Tel is set (has been assigned a value) and false otherwise */ + public boolean isSetTel() { + return this.Tel != null; + } + + public void setTelIsSet(boolean value) { + if (!value) { + this.Tel = null; + } + } + + public String getFak() { + return this.Fak; + } + + public writeVLdata_args setFak(String Fak) { + this.Fak = Fak; + return this; + } + + public void unsetFak() { + this.Fak = null; + } + + /** Returns true if field Fak is set (has been assigned a value) and false otherwise */ + public boolean isSetFak() { + return this.Fak != null; + } + + public void setFakIsSet(boolean value) { + if (!value) { + this.Fak = null; + } + } + + public boolean isLicense() { + return this.license; + } + + public writeVLdata_args setLicense(boolean license) { + this.license = license; + setLicenseIsSet(true); + return this; + } + + public void unsetLicense() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LICENSE_ISSET_ID); + } + + /** Returns true if field license is set (has been assigned a value) and false otherwise */ + public boolean isSetLicense() { + return EncodingUtils.testBit(__isset_bitfield, __LICENSE_ISSET_ID); + } + + public void setLicenseIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LICENSE_ISSET_ID, value); + } + + public boolean isInternet() { + return this.internet; + } + + public writeVLdata_args setInternet(boolean internet) { + this.internet = internet; + setInternetIsSet(true); + return this; + } + + public void unsetInternet() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INTERNET_ISSET_ID); + } + + /** Returns true if field internet is set (has been assigned a value) and false otherwise */ + public boolean isSetInternet() { + return EncodingUtils.testBit(__isset_bitfield, __INTERNET_ISSET_ID); + } + + public void setInternetIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INTERNET_ISSET_ID, value); + } + + public long getRam() { + return this.ram; + } + + public writeVLdata_args setRam(long ram) { + this.ram = ram; + setRamIsSet(true); + return this; + } + + public void unsetRam() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RAM_ISSET_ID); + } + + /** Returns true if field ram is set (has been assigned a value) and false otherwise */ + public boolean isSetRam() { + return EncodingUtils.testBit(__isset_bitfield, __RAM_ISSET_ID); + } + + public void setRamIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RAM_ISSET_ID, value); + } + + public long getCpu() { + return this.cpu; + } + + public writeVLdata_args setCpu(long cpu) { + this.cpu = cpu; + setCpuIsSet(true); + return this; + } + + public void unsetCpu() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CPU_ISSET_ID); + } + + /** Returns true if field cpu is set (has been assigned a value) and false otherwise */ + public boolean isSetCpu() { + return EncodingUtils.testBit(__isset_bitfield, __CPU_ISSET_ID); + } + + public void setCpuIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CPU_ISSET_ID, value); + } + + public String getImagePath() { + return this.imagePath; + } + + public writeVLdata_args setImagePath(String imagePath) { + this.imagePath = imagePath; + return this; + } + + public void unsetImagePath() { + this.imagePath = null; + } + + /** Returns true if field imagePath is set (has been assigned a value) and false otherwise */ + public boolean isSetImagePath() { + return this.imagePath != null; + } + + public void setImagePathIsSet(boolean value) { + if (!value) { + this.imagePath = null; + } + } + + public boolean isIsTemplate() { + return this.isTemplate; + } + + public writeVLdata_args setIsTemplate(boolean isTemplate) { + this.isTemplate = isTemplate; + setIsTemplateIsSet(true); + return this; + } + + public void unsetIsTemplate() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID); + } + + /** Returns true if field isTemplate is set (has been assigned a value) and false otherwise */ + public boolean isSetIsTemplate() { + return EncodingUtils.testBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID); + } + + public void setIsTemplateIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID, value); + } + + public long getFilesize() { + return this.filesize; + } + + public writeVLdata_args setFilesize(long filesize) { + this.filesize = filesize; + setFilesizeIsSet(true); + return this; + } + + public void unsetFilesize() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILESIZE_ISSET_ID); + } + + /** Returns true if field filesize is set (has been assigned a value) and false otherwise */ + public boolean isSetFilesize() { + return EncodingUtils.testBit(__isset_bitfield, __FILESIZE_ISSET_ID); + } + + public void setFilesizeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILESIZE_ISSET_ID, value); + } + + public long getShareMode() { + return this.shareMode; + } + + public writeVLdata_args setShareMode(long shareMode) { + this.shareMode = shareMode; + setShareModeIsSet(true); + return this; + } + + public void unsetShareMode() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SHAREMODE_ISSET_ID); + } + + /** Returns true if field shareMode is set (has been assigned a value) and false otherwise */ + public boolean isSetShareMode() { + return EncodingUtils.testBit(__isset_bitfield, __SHAREMODE_ISSET_ID); + } + + public void setShareModeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SHAREMODE_ISSET_ID, value); + } + + public String getOs() { + return this.os; + } + + public writeVLdata_args setOs(String os) { + this.os = os; + return this; + } + + public void unsetOs() { + this.os = null; + } + + /** Returns true if field os is set (has been assigned a value) and false otherwise */ + public boolean isSetOs() { + return this.os != null; + } + + public void setOsIsSet(boolean value) { + if (!value) { + this.os = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IMAGENAME: + if (value == null) { + unsetImagename(); + } else { + setImagename((String)value); + } + break; + + case DESC: + if (value == null) { + unsetDesc(); + } else { + setDesc((String)value); + } + break; + + case LOGIN: + if (value == null) { + unsetLogin(); + } else { + setLogin((String)value); + } + break; + + case FIRSTNAME: + if (value == null) { + unsetFirstname(); + } else { + setFirstname((String)value); + } + break; + + case LASTNAME: + if (value == null) { + unsetLastname(); + } else { + setLastname((String)value); + } + break; + + case UNIVERSITY: + if (value == null) { + unsetUniversity(); + } else { + setUniversity((String)value); + } + break; + + case MAIL: + if (value == null) { + unsetMail(); + } else { + setMail((String)value); + } + break; + + case TEL: + if (value == null) { + unsetTel(); + } else { + setTel((String)value); + } + break; + + case FAK: + if (value == null) { + unsetFak(); + } else { + setFak((String)value); + } + break; + + case LICENSE: + if (value == null) { + unsetLicense(); + } else { + setLicense((Boolean)value); + } + break; + + case INTERNET: + if (value == null) { + unsetInternet(); + } else { + setInternet((Boolean)value); + } + break; + + case RAM: + if (value == null) { + unsetRam(); + } else { + setRam((Long)value); + } + break; + + case CPU: + if (value == null) { + unsetCpu(); + } else { + setCpu((Long)value); + } + break; + + case IMAGE_PATH: + if (value == null) { + unsetImagePath(); + } else { + setImagePath((String)value); + } + break; + + case IS_TEMPLATE: + if (value == null) { + unsetIsTemplate(); + } else { + setIsTemplate((Boolean)value); + } + break; + + case FILESIZE: + if (value == null) { + unsetFilesize(); + } else { + setFilesize((Long)value); + } + break; + + case SHARE_MODE: + if (value == null) { + unsetShareMode(); + } else { + setShareMode((Long)value); + } + break; + + case OS: + if (value == null) { + unsetOs(); + } else { + setOs((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IMAGENAME: + return getImagename(); + + case DESC: + return getDesc(); + + case LOGIN: + return getLogin(); + + case FIRSTNAME: + return getFirstname(); + + case LASTNAME: + return getLastname(); + + case UNIVERSITY: + return getUniversity(); + + case MAIL: + return getMail(); + + case TEL: + return getTel(); + + case FAK: + return getFak(); + + case LICENSE: + return Boolean.valueOf(isLicense()); + + case INTERNET: + return Boolean.valueOf(isInternet()); + + case RAM: + return Long.valueOf(getRam()); + + case CPU: + return Long.valueOf(getCpu()); + + case IMAGE_PATH: + return getImagePath(); + + case IS_TEMPLATE: + return Boolean.valueOf(isIsTemplate()); + + case FILESIZE: + return Long.valueOf(getFilesize()); + + case SHARE_MODE: + return Long.valueOf(getShareMode()); + + case OS: + return getOs(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case IMAGENAME: + return isSetImagename(); + case DESC: + return isSetDesc(); + case LOGIN: + return isSetLogin(); + case FIRSTNAME: + return isSetFirstname(); + case LASTNAME: + return isSetLastname(); + case UNIVERSITY: + return isSetUniversity(); + case MAIL: + return isSetMail(); + case TEL: + return isSetTel(); + case FAK: + return isSetFak(); + case LICENSE: + return isSetLicense(); + case INTERNET: + return isSetInternet(); + case RAM: + return isSetRam(); + case CPU: + return isSetCpu(); + case IMAGE_PATH: + return isSetImagePath(); + case IS_TEMPLATE: + return isSetIsTemplate(); + case FILESIZE: + return isSetFilesize(); + case SHARE_MODE: + return isSetShareMode(); + case OS: + return isSetOs(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof writeVLdata_args) + return this.equals((writeVLdata_args)that); + return false; + } + + public boolean equals(writeVLdata_args that) { + if (that == null) + return false; + + boolean this_present_imagename = true && this.isSetImagename(); + boolean that_present_imagename = true && that.isSetImagename(); + if (this_present_imagename || that_present_imagename) { + if (!(this_present_imagename && that_present_imagename)) + return false; + if (!this.imagename.equals(that.imagename)) + return false; + } + + boolean this_present_desc = true && this.isSetDesc(); + boolean that_present_desc = true && that.isSetDesc(); + if (this_present_desc || that_present_desc) { + if (!(this_present_desc && that_present_desc)) + return false; + if (!this.desc.equals(that.desc)) + return false; + } + + boolean this_present_login = true && this.isSetLogin(); + boolean that_present_login = true && that.isSetLogin(); + if (this_present_login || that_present_login) { + if (!(this_present_login && that_present_login)) + return false; + if (!this.login.equals(that.login)) + return false; + } + + boolean this_present_firstname = true && this.isSetFirstname(); + boolean that_present_firstname = true && that.isSetFirstname(); + if (this_present_firstname || that_present_firstname) { + if (!(this_present_firstname && that_present_firstname)) + return false; + if (!this.firstname.equals(that.firstname)) + return false; + } + + boolean this_present_lastname = true && this.isSetLastname(); + boolean that_present_lastname = true && that.isSetLastname(); + if (this_present_lastname || that_present_lastname) { + if (!(this_present_lastname && that_present_lastname)) + return false; + if (!this.lastname.equals(that.lastname)) + return false; + } + + boolean this_present_university = true && this.isSetUniversity(); + boolean that_present_university = true && that.isSetUniversity(); + if (this_present_university || that_present_university) { + if (!(this_present_university && that_present_university)) + return false; + if (!this.university.equals(that.university)) + return false; + } + + boolean this_present_Mail = true && this.isSetMail(); + boolean that_present_Mail = true && that.isSetMail(); + if (this_present_Mail || that_present_Mail) { + if (!(this_present_Mail && that_present_Mail)) + return false; + if (!this.Mail.equals(that.Mail)) + return false; + } + + boolean this_present_Tel = true && this.isSetTel(); + boolean that_present_Tel = true && that.isSetTel(); + if (this_present_Tel || that_present_Tel) { + if (!(this_present_Tel && that_present_Tel)) + return false; + if (!this.Tel.equals(that.Tel)) + return false; + } + + boolean this_present_Fak = true && this.isSetFak(); + boolean that_present_Fak = true && that.isSetFak(); + if (this_present_Fak || that_present_Fak) { + if (!(this_present_Fak && that_present_Fak)) + return false; + if (!this.Fak.equals(that.Fak)) + return false; + } + + boolean this_present_license = true; + boolean that_present_license = true; + if (this_present_license || that_present_license) { + if (!(this_present_license && that_present_license)) + return false; + if (this.license != that.license) + return false; + } + + boolean this_present_internet = true; + boolean that_present_internet = true; + if (this_present_internet || that_present_internet) { + if (!(this_present_internet && that_present_internet)) + return false; + if (this.internet != that.internet) + return false; + } + + boolean this_present_ram = true; + boolean that_present_ram = true; + if (this_present_ram || that_present_ram) { + if (!(this_present_ram && that_present_ram)) + return false; + if (this.ram != that.ram) + return false; + } + + boolean this_present_cpu = true; + boolean that_present_cpu = true; + if (this_present_cpu || that_present_cpu) { + if (!(this_present_cpu && that_present_cpu)) + return false; + if (this.cpu != that.cpu) + return false; + } + + boolean this_present_imagePath = true && this.isSetImagePath(); + boolean that_present_imagePath = true && that.isSetImagePath(); + if (this_present_imagePath || that_present_imagePath) { + if (!(this_present_imagePath && that_present_imagePath)) + return false; + if (!this.imagePath.equals(that.imagePath)) + return false; + } + + boolean this_present_isTemplate = true; + boolean that_present_isTemplate = true; + if (this_present_isTemplate || that_present_isTemplate) { + if (!(this_present_isTemplate && that_present_isTemplate)) + return false; + if (this.isTemplate != that.isTemplate) + return false; + } + + boolean this_present_filesize = true; + boolean that_present_filesize = true; + if (this_present_filesize || that_present_filesize) { + if (!(this_present_filesize && that_present_filesize)) + return false; + if (this.filesize != that.filesize) + return false; + } + + boolean this_present_shareMode = true; + boolean that_present_shareMode = true; + if (this_present_shareMode || that_present_shareMode) { + if (!(this_present_shareMode && that_present_shareMode)) + return false; + if (this.shareMode != that.shareMode) + return false; + } + + boolean this_present_os = true && this.isSetOs(); + boolean that_present_os = true && that.isSetOs(); + if (this_present_os || that_present_os) { + if (!(this_present_os && that_present_os)) + return false; + if (!this.os.equals(that.os)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(writeVLdata_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetImagename()).compareTo(other.isSetImagename()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImagename()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagename, other.imagename); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDesc()).compareTo(other.isSetDesc()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDesc()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.desc, other.desc); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLogin()).compareTo(other.isSetLogin()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLogin()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.login, other.login); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFirstname()).compareTo(other.isSetFirstname()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFirstname()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstname, other.firstname); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLastname()).compareTo(other.isSetLastname()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLastname()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastname, other.lastname); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUniversity()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMail()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Mail, other.Mail); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTel()).compareTo(other.isSetTel()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTel()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Tel, other.Tel); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFak()).compareTo(other.isSetFak()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFak()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Fak, other.Fak); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLicense()).compareTo(other.isSetLicense()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLicense()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.license, other.license); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetInternet()).compareTo(other.isSetInternet()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetInternet()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internet, other.internet); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRam()).compareTo(other.isSetRam()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRam()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ram, other.ram); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetCpu()).compareTo(other.isSetCpu()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCpu()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cpu, other.cpu); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetImagePath()).compareTo(other.isSetImagePath()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImagePath()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagePath, other.imagePath); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIsTemplate()).compareTo(other.isSetIsTemplate()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIsTemplate()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isTemplate, other.isTemplate); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFilesize()).compareTo(other.isSetFilesize()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFilesize()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filesize, other.filesize); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetShareMode()).compareTo(other.isSetShareMode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetShareMode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shareMode, other.shareMode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOs()).compareTo(other.isSetOs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.os, other.os); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("writeVLdata_args("); + boolean first = true; + + sb.append("imagename:"); + if (this.imagename == null) { + sb.append("null"); + } else { + sb.append(this.imagename); + } + first = false; + if (!first) sb.append(", "); + sb.append("desc:"); + if (this.desc == null) { + sb.append("null"); + } else { + sb.append(this.desc); + } + first = false; + if (!first) sb.append(", "); + sb.append("login:"); + if (this.login == null) { + sb.append("null"); + } else { + sb.append(this.login); + } + first = false; + if (!first) sb.append(", "); + sb.append("firstname:"); + if (this.firstname == null) { + sb.append("null"); + } else { + sb.append(this.firstname); + } + first = false; + if (!first) sb.append(", "); + sb.append("lastname:"); + if (this.lastname == null) { + sb.append("null"); + } else { + sb.append(this.lastname); + } + first = false; + if (!first) sb.append(", "); + sb.append("university:"); + if (this.university == null) { + sb.append("null"); + } else { + sb.append(this.university); + } + first = false; + if (!first) sb.append(", "); + sb.append("Mail:"); + if (this.Mail == null) { + sb.append("null"); + } else { + sb.append(this.Mail); + } + first = false; + if (!first) sb.append(", "); + sb.append("Tel:"); + if (this.Tel == null) { + sb.append("null"); + } else { + sb.append(this.Tel); + } + first = false; + if (!first) sb.append(", "); + sb.append("Fak:"); + if (this.Fak == null) { + sb.append("null"); + } else { + sb.append(this.Fak); + } + first = false; + if (!first) sb.append(", "); + sb.append("license:"); + sb.append(this.license); + first = false; + if (!first) sb.append(", "); + sb.append("internet:"); + sb.append(this.internet); + first = false; + if (!first) sb.append(", "); + sb.append("ram:"); + sb.append(this.ram); + first = false; + if (!first) sb.append(", "); + sb.append("cpu:"); + sb.append(this.cpu); + first = false; + if (!first) sb.append(", "); + sb.append("imagePath:"); + if (this.imagePath == null) { + sb.append("null"); + } else { + sb.append(this.imagePath); + } + first = false; + if (!first) sb.append(", "); + sb.append("isTemplate:"); + sb.append(this.isTemplate); + first = false; + if (!first) sb.append(", "); + sb.append("filesize:"); + sb.append(this.filesize); + first = false; + if (!first) sb.append(", "); + sb.append("shareMode:"); + sb.append(this.shareMode); + first = false; + if (!first) sb.append(", "); + sb.append("os:"); + if (this.os == null) { + sb.append("null"); + } else { + sb.append(this.os); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class writeVLdata_argsStandardSchemeFactory implements SchemeFactory { + public writeVLdata_argsStandardScheme getScheme() { + return new writeVLdata_argsStandardScheme(); + } + } + + private static class writeVLdata_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, writeVLdata_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // IMAGENAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imagename = iprot.readString(); + struct.setImagenameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // DESC + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.desc = iprot.readString(); + struct.setDescIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -3: // LOGIN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.login = iprot.readString(); + struct.setLoginIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -4: // FIRSTNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.firstname = iprot.readString(); + struct.setFirstnameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -5: // LASTNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.lastname = iprot.readString(); + struct.setLastnameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -6: // UNIVERSITY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.university = iprot.readString(); + struct.setUniversityIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -7: // MAIL + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Mail = iprot.readString(); + struct.setMailIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -8: // TEL + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Tel = iprot.readString(); + struct.setTelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -9: // FAK + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Fak = iprot.readString(); + struct.setFakIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -10: // LICENSE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.license = iprot.readBool(); + struct.setLicenseIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -11: // INTERNET + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.internet = iprot.readBool(); + struct.setInternetIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -12: // RAM + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.ram = iprot.readI64(); + struct.setRamIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -13: // CPU + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.cpu = iprot.readI64(); + struct.setCpuIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -14: // IMAGE_PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imagePath = iprot.readString(); + struct.setImagePathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -15: // IS_TEMPLATE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.isTemplate = iprot.readBool(); + struct.setIsTemplateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -16: // FILESIZE + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.filesize = iprot.readI64(); + struct.setFilesizeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -17: // SHARE_MODE + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.shareMode = iprot.readI64(); + struct.setShareModeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -18: // OS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.os = iprot.readString(); + struct.setOsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, writeVLdata_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.os != null) { + oprot.writeFieldBegin(OS_FIELD_DESC); + oprot.writeString(struct.os); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(SHARE_MODE_FIELD_DESC); + oprot.writeI64(struct.shareMode); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(FILESIZE_FIELD_DESC); + oprot.writeI64(struct.filesize); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_TEMPLATE_FIELD_DESC); + oprot.writeBool(struct.isTemplate); + oprot.writeFieldEnd(); + if (struct.imagePath != null) { + oprot.writeFieldBegin(IMAGE_PATH_FIELD_DESC); + oprot.writeString(struct.imagePath); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(CPU_FIELD_DESC); + oprot.writeI64(struct.cpu); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(RAM_FIELD_DESC); + oprot.writeI64(struct.ram); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(INTERNET_FIELD_DESC); + oprot.writeBool(struct.internet); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(LICENSE_FIELD_DESC); + oprot.writeBool(struct.license); + oprot.writeFieldEnd(); + if (struct.Fak != null) { + oprot.writeFieldBegin(FAK_FIELD_DESC); + oprot.writeString(struct.Fak); + oprot.writeFieldEnd(); + } + if (struct.Tel != null) { + oprot.writeFieldBegin(TEL_FIELD_DESC); + oprot.writeString(struct.Tel); + oprot.writeFieldEnd(); + } + if (struct.Mail != null) { + oprot.writeFieldBegin(MAIL_FIELD_DESC); + oprot.writeString(struct.Mail); + oprot.writeFieldEnd(); + } + if (struct.university != null) { + oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC); + oprot.writeString(struct.university); + oprot.writeFieldEnd(); + } + if (struct.lastname != null) { + oprot.writeFieldBegin(LASTNAME_FIELD_DESC); + oprot.writeString(struct.lastname); + oprot.writeFieldEnd(); + } + if (struct.firstname != null) { + oprot.writeFieldBegin(FIRSTNAME_FIELD_DESC); + oprot.writeString(struct.firstname); + oprot.writeFieldEnd(); + } + if (struct.login != null) { + oprot.writeFieldBegin(LOGIN_FIELD_DESC); + oprot.writeString(struct.login); + oprot.writeFieldEnd(); + } + if (struct.desc != null) { + oprot.writeFieldBegin(DESC_FIELD_DESC); + oprot.writeString(struct.desc); + oprot.writeFieldEnd(); + } + if (struct.imagename != null) { + oprot.writeFieldBegin(IMAGENAME_FIELD_DESC); + oprot.writeString(struct.imagename); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class writeVLdata_argsTupleSchemeFactory implements SchemeFactory { + public writeVLdata_argsTupleScheme getScheme() { + return new writeVLdata_argsTupleScheme(); + } + } + + private static class writeVLdata_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, writeVLdata_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetImagename()) { + optionals.set(0); + } + if (struct.isSetDesc()) { + optionals.set(1); + } + if (struct.isSetLogin()) { + optionals.set(2); + } + if (struct.isSetFirstname()) { + optionals.set(3); + } + if (struct.isSetLastname()) { + optionals.set(4); + } + if (struct.isSetUniversity()) { + optionals.set(5); + } + if (struct.isSetMail()) { + optionals.set(6); + } + if (struct.isSetTel()) { + optionals.set(7); + } + if (struct.isSetFak()) { + optionals.set(8); + } + if (struct.isSetLicense()) { + optionals.set(9); + } + if (struct.isSetInternet()) { + optionals.set(10); + } + if (struct.isSetRam()) { + optionals.set(11); + } + if (struct.isSetCpu()) { + optionals.set(12); + } + if (struct.isSetImagePath()) { + optionals.set(13); + } + if (struct.isSetIsTemplate()) { + optionals.set(14); + } + if (struct.isSetFilesize()) { + optionals.set(15); + } + if (struct.isSetShareMode()) { + optionals.set(16); + } + if (struct.isSetOs()) { + optionals.set(17); + } + oprot.writeBitSet(optionals, 18); + if (struct.isSetImagename()) { + oprot.writeString(struct.imagename); + } + if (struct.isSetDesc()) { + oprot.writeString(struct.desc); + } + if (struct.isSetLogin()) { + oprot.writeString(struct.login); + } + if (struct.isSetFirstname()) { + oprot.writeString(struct.firstname); + } + if (struct.isSetLastname()) { + oprot.writeString(struct.lastname); + } + if (struct.isSetUniversity()) { + oprot.writeString(struct.university); + } + if (struct.isSetMail()) { + oprot.writeString(struct.Mail); + } + if (struct.isSetTel()) { + oprot.writeString(struct.Tel); + } + if (struct.isSetFak()) { + oprot.writeString(struct.Fak); + } + if (struct.isSetLicense()) { + oprot.writeBool(struct.license); + } + if (struct.isSetInternet()) { + oprot.writeBool(struct.internet); + } + if (struct.isSetRam()) { + oprot.writeI64(struct.ram); + } + if (struct.isSetCpu()) { + oprot.writeI64(struct.cpu); + } + if (struct.isSetImagePath()) { + oprot.writeString(struct.imagePath); + } + if (struct.isSetIsTemplate()) { + oprot.writeBool(struct.isTemplate); + } + if (struct.isSetFilesize()) { + oprot.writeI64(struct.filesize); + } + if (struct.isSetShareMode()) { + oprot.writeI64(struct.shareMode); + } + if (struct.isSetOs()) { + oprot.writeString(struct.os); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, writeVLdata_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(18); + if (incoming.get(0)) { + struct.imagename = iprot.readString(); + struct.setImagenameIsSet(true); + } + if (incoming.get(1)) { + struct.desc = iprot.readString(); + struct.setDescIsSet(true); + } + if (incoming.get(2)) { + struct.login = iprot.readString(); + struct.setLoginIsSet(true); + } + if (incoming.get(3)) { + struct.firstname = iprot.readString(); + struct.setFirstnameIsSet(true); + } + if (incoming.get(4)) { + struct.lastname = iprot.readString(); + struct.setLastnameIsSet(true); + } + if (incoming.get(5)) { + struct.university = iprot.readString(); + struct.setUniversityIsSet(true); + } + if (incoming.get(6)) { + struct.Mail = iprot.readString(); + struct.setMailIsSet(true); + } + if (incoming.get(7)) { + struct.Tel = iprot.readString(); + struct.setTelIsSet(true); + } + if (incoming.get(8)) { + struct.Fak = iprot.readString(); + struct.setFakIsSet(true); + } + if (incoming.get(9)) { + struct.license = iprot.readBool(); + struct.setLicenseIsSet(true); + } + if (incoming.get(10)) { + struct.internet = iprot.readBool(); + struct.setInternetIsSet(true); + } + if (incoming.get(11)) { + struct.ram = iprot.readI64(); + struct.setRamIsSet(true); + } + if (incoming.get(12)) { + struct.cpu = iprot.readI64(); + struct.setCpuIsSet(true); + } + if (incoming.get(13)) { + struct.imagePath = iprot.readString(); + struct.setImagePathIsSet(true); + } + if (incoming.get(14)) { + struct.isTemplate = iprot.readBool(); + struct.setIsTemplateIsSet(true); + } + if (incoming.get(15)) { + struct.filesize = iprot.readI64(); + struct.setFilesizeIsSet(true); + } + if (incoming.get(16)) { + struct.shareMode = iprot.readI64(); + struct.setShareModeIsSet(true); + } + if (incoming.get(17)) { + struct.os = iprot.readString(); + struct.setOsIsSet(true); + } + } + } + + } + + public static class writeVLdata_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeVLdata_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new writeVLdata_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new writeVLdata_resultTupleSchemeFactory()); + } + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeVLdata_result.class, metaDataMap); + } + + public writeVLdata_result() { + } + + public writeVLdata_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public writeVLdata_result(writeVLdata_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public writeVLdata_result deepCopy() { + return new writeVLdata_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public writeVLdata_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof writeVLdata_result) + return this.equals((writeVLdata_result)that); + return false; + } + + public boolean equals(writeVLdata_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(writeVLdata_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("writeVLdata_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class writeVLdata_resultStandardSchemeFactory implements SchemeFactory { + public writeVLdata_resultStandardScheme getScheme() { + return new writeVLdata_resultStandardScheme(); + } + } + + private static class writeVLdata_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, writeVLdata_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, writeVLdata_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class writeVLdata_resultTupleSchemeFactory implements SchemeFactory { + public writeVLdata_resultTupleScheme getScheme() { + return new writeVLdata_resultTupleScheme(); + } + } + + private static class writeVLdata_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, writeVLdata_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, writeVLdata_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class getImageList_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getImageList_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getImageList_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getImageList_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getImageList_args.class, metaDataMap); + } + + public getImageList_args() { + } + + /** + * Performs a deep copy on other. + */ + public getImageList_args(getImageList_args other) { + } + + public getImageList_args deepCopy() { + return new getImageList_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getImageList_args) + return this.equals((getImageList_args)that); + return false; + } + + public boolean equals(getImageList_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getImageList_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getImageList_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getImageList_argsStandardSchemeFactory implements SchemeFactory { + public getImageList_argsStandardScheme getScheme() { + return new getImageList_argsStandardScheme(); + } + } + + private static class getImageList_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getImageList_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getImageList_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getImageList_argsTupleSchemeFactory implements SchemeFactory { + public getImageList_argsTupleScheme getScheme() { + return new getImageList_argsTupleScheme(); + } + } + + private static class getImageList_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getImageList_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getImageList_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getImageList_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getImageList_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getImageList_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getImageList_resultTupleSchemeFactory()); + } + + public List success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Image.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getImageList_result.class, metaDataMap); + } + + public getImageList_result() { + } + + public getImageList_result( + List success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getImageList_result(getImageList_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (Image other_element : other.success) { + __this__success.add(new Image(other_element)); + } + this.success = __this__success; + } + } + + public getImageList_result deepCopy() { + return new getImageList_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(Image elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getImageList_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getImageList_result) + return this.equals((getImageList_result)that); + return false; + } + + public boolean equals(getImageList_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getImageList_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getImageList_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getImageList_resultStandardSchemeFactory implements SchemeFactory { + public getImageList_resultStandardScheme getScheme() { + return new getImageList_resultStandardScheme(); + } + } + + private static class getImageList_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getImageList_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); + struct.success = new ArrayList(_list0.size); + for (int _i1 = 0; _i1 < _list0.size; ++_i1) + { + Image _elem2; + _elem2 = new Image(); + _elem2.read(iprot); + struct.success.add(_elem2); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getImageList_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (Image _iter3 : struct.success) + { + _iter3.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getImageList_resultTupleSchemeFactory implements SchemeFactory { + public getImageList_resultTupleScheme getScheme() { + return new getImageList_resultTupleScheme(); + } + } + + private static class getImageList_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getImageList_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (Image _iter4 : struct.success) + { + _iter4.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getImageList_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list5.size); + for (int _i6 = 0; _i6 < _list5.size; ++_i6) + { + Image _elem7; + _elem7 = new Image(); + _elem7.read(iprot); + struct.success.add(_elem7); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class getLectureList_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureList_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getLectureList_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getLectureList_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLectureList_args.class, metaDataMap); + } + + public getLectureList_args() { + } + + /** + * Performs a deep copy on other. + */ + public getLectureList_args(getLectureList_args other) { + } + + public getLectureList_args deepCopy() { + return new getLectureList_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getLectureList_args) + return this.equals((getLectureList_args)that); + return false; + } + + public boolean equals(getLectureList_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getLectureList_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getLectureList_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getLectureList_argsStandardSchemeFactory implements SchemeFactory { + public getLectureList_argsStandardScheme getScheme() { + return new getLectureList_argsStandardScheme(); + } + } + + private static class getLectureList_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureList_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getLectureList_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getLectureList_argsTupleSchemeFactory implements SchemeFactory { + public getLectureList_argsTupleScheme getScheme() { + return new getLectureList_argsTupleScheme(); + } + } + + private static class getLectureList_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getLectureList_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getLectureList_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getLectureList_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureList_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getLectureList_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getLectureList_resultTupleSchemeFactory()); + } + + public List success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Lecture.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLectureList_result.class, metaDataMap); + } + + public getLectureList_result() { + } + + public getLectureList_result( + List success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getLectureList_result(getLectureList_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (Lecture other_element : other.success) { + __this__success.add(new Lecture(other_element)); + } + this.success = __this__success; + } + } + + public getLectureList_result deepCopy() { + return new getLectureList_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(Lecture elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getLectureList_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getLectureList_result) + return this.equals((getLectureList_result)that); + return false; + } + + public boolean equals(getLectureList_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getLectureList_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getLectureList_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getLectureList_resultStandardSchemeFactory implements SchemeFactory { + public getLectureList_resultStandardScheme getScheme() { + return new getLectureList_resultStandardScheme(); + } + } + + private static class getLectureList_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureList_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); + struct.success = new ArrayList(_list8.size); + for (int _i9 = 0; _i9 < _list8.size; ++_i9) + { + Lecture _elem10; + _elem10 = new Lecture(); + _elem10.read(iprot); + struct.success.add(_elem10); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getLectureList_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (Lecture _iter11 : struct.success) + { + _iter11.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getLectureList_resultTupleSchemeFactory implements SchemeFactory { + public getLectureList_resultTupleScheme getScheme() { + return new getLectureList_resultTupleScheme(); + } + } + + private static class getLectureList_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getLectureList_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (Lecture _iter12 : struct.success) + { + _iter12.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getLectureList_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list13.size); + for (int _i14 = 0; _i14 < _list13.size; ++_i14) + { + Lecture _elem15; + _elem15 = new Lecture(); + _elem15.read(iprot); + struct.success.add(_elem15); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class getAllOS_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllOS_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getAllOS_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getAllOS_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllOS_args.class, metaDataMap); + } + + public getAllOS_args() { + } + + /** + * Performs a deep copy on other. + */ + public getAllOS_args(getAllOS_args other) { + } + + public getAllOS_args deepCopy() { + return new getAllOS_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getAllOS_args) + return this.equals((getAllOS_args)that); + return false; + } + + public boolean equals(getAllOS_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getAllOS_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getAllOS_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getAllOS_argsStandardSchemeFactory implements SchemeFactory { + public getAllOS_argsStandardScheme getScheme() { + return new getAllOS_argsStandardScheme(); + } + } + + private static class getAllOS_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getAllOS_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getAllOS_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getAllOS_argsTupleSchemeFactory implements SchemeFactory { + public getAllOS_argsTupleScheme getScheme() { + return new getAllOS_argsTupleScheme(); + } + } + + private static class getAllOS_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getAllOS_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getAllOS_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getAllOS_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllOS_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getAllOS_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getAllOS_resultTupleSchemeFactory()); + } + + public List success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllOS_result.class, metaDataMap); + } + + public getAllOS_result() { + } + + public getAllOS_result( + List success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getAllOS_result(getAllOS_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success); + this.success = __this__success; + } + } + + public getAllOS_result deepCopy() { + return new getAllOS_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(String elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getAllOS_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getAllOS_result) + return this.equals((getAllOS_result)that); + return false; + } + + public boolean equals(getAllOS_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getAllOS_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getAllOS_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getAllOS_resultStandardSchemeFactory implements SchemeFactory { + public getAllOS_resultStandardScheme getScheme() { + return new getAllOS_resultStandardScheme(); + } + } + + private static class getAllOS_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getAllOS_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list16 = iprot.readListBegin(); + struct.success = new ArrayList(_list16.size); + for (int _i17 = 0; _i17 < _list16.size; ++_i17) + { + String _elem18; + _elem18 = iprot.readString(); + struct.success.add(_elem18); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getAllOS_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); + for (String _iter19 : struct.success) + { + oprot.writeString(_iter19); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getAllOS_resultTupleSchemeFactory implements SchemeFactory { + public getAllOS_resultTupleScheme getScheme() { + return new getAllOS_resultTupleScheme(); + } + } + + private static class getAllOS_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getAllOS_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (String _iter20 : struct.success) + { + oprot.writeString(_iter20); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getAllOS_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new ArrayList(_list21.size); + for (int _i22 = 0; _i22 < _list21.size; ++_i22) + { + String _elem23; + _elem23 = iprot.readString(); + struct.success.add(_elem23); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class getAllUniversities_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllUniversities_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getAllUniversities_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getAllUniversities_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllUniversities_args.class, metaDataMap); + } + + public getAllUniversities_args() { + } + + /** + * Performs a deep copy on other. + */ + public getAllUniversities_args(getAllUniversities_args other) { + } + + public getAllUniversities_args deepCopy() { + return new getAllUniversities_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getAllUniversities_args) + return this.equals((getAllUniversities_args)that); + return false; + } + + public boolean equals(getAllUniversities_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getAllUniversities_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getAllUniversities_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getAllUniversities_argsStandardSchemeFactory implements SchemeFactory { + public getAllUniversities_argsStandardScheme getScheme() { + return new getAllUniversities_argsStandardScheme(); + } + } + + private static class getAllUniversities_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getAllUniversities_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getAllUniversities_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getAllUniversities_argsTupleSchemeFactory implements SchemeFactory { + public getAllUniversities_argsTupleScheme getScheme() { + return new getAllUniversities_argsTupleScheme(); + } + } + + private static class getAllUniversities_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getAllUniversities_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getAllUniversities_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getAllUniversities_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllUniversities_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getAllUniversities_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getAllUniversities_resultTupleSchemeFactory()); + } + + public List success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllUniversities_result.class, metaDataMap); + } + + public getAllUniversities_result() { + } + + public getAllUniversities_result( + List success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getAllUniversities_result(getAllUniversities_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success); + this.success = __this__success; + } + } + + public getAllUniversities_result deepCopy() { + return new getAllUniversities_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(String elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getAllUniversities_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getAllUniversities_result) + return this.equals((getAllUniversities_result)that); + return false; + } + + public boolean equals(getAllUniversities_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getAllUniversities_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getAllUniversities_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getAllUniversities_resultStandardSchemeFactory implements SchemeFactory { + public getAllUniversities_resultStandardScheme getScheme() { + return new getAllUniversities_resultStandardScheme(); + } + } + + private static class getAllUniversities_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getAllUniversities_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); + struct.success = new ArrayList(_list24.size); + for (int _i25 = 0; _i25 < _list24.size; ++_i25) + { + String _elem26; + _elem26 = iprot.readString(); + struct.success.add(_elem26); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getAllUniversities_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); + for (String _iter27 : struct.success) + { + oprot.writeString(_iter27); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getAllUniversities_resultTupleSchemeFactory implements SchemeFactory { + public getAllUniversities_resultTupleScheme getScheme() { + return new getAllUniversities_resultTupleScheme(); + } + } + + private static class getAllUniversities_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getAllUniversities_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (String _iter28 : struct.success) + { + oprot.writeString(_iter28); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getAllUniversities_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new ArrayList(_list29.size); + for (int _i30 = 0; _i30 < _list29.size; ++_i30) + { + String _elem31; + _elem31 = iprot.readString(); + struct.success.add(_elem31); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class getPersonData_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPersonData_args"); + + private static final org.apache.thrift.protocol.TField VORNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("Vorname", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField NACHNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("Nachname", org.apache.thrift.protocol.TType.STRING, (short)-2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getPersonData_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getPersonData_argsTupleSchemeFactory()); + } + + public String Vorname; // required + public String Nachname; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + VORNAME((short)-1, "Vorname"), + NACHNAME((short)-2, "Nachname"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // VORNAME + return VORNAME; + case -2: // NACHNAME + return NACHNAME; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VORNAME, new org.apache.thrift.meta_data.FieldMetaData("Vorname", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NACHNAME, new org.apache.thrift.meta_data.FieldMetaData("Nachname", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPersonData_args.class, metaDataMap); + } + + public getPersonData_args() { + } + + public getPersonData_args( + String Vorname, + String Nachname) + { + this(); + this.Vorname = Vorname; + this.Nachname = Nachname; + } + + /** + * Performs a deep copy on other. + */ + public getPersonData_args(getPersonData_args other) { + if (other.isSetVorname()) { + this.Vorname = other.Vorname; + } + if (other.isSetNachname()) { + this.Nachname = other.Nachname; + } + } + + public getPersonData_args deepCopy() { + return new getPersonData_args(this); + } + + @Override + public void clear() { + this.Vorname = null; + this.Nachname = null; + } + + public String getVorname() { + return this.Vorname; + } + + public getPersonData_args setVorname(String Vorname) { + this.Vorname = Vorname; + return this; + } + + public void unsetVorname() { + this.Vorname = null; + } + + /** Returns true if field Vorname is set (has been assigned a value) and false otherwise */ + public boolean isSetVorname() { + return this.Vorname != null; + } + + public void setVornameIsSet(boolean value) { + if (!value) { + this.Vorname = null; + } + } + + public String getNachname() { + return this.Nachname; + } + + public getPersonData_args setNachname(String Nachname) { + this.Nachname = Nachname; + return this; + } + + public void unsetNachname() { + this.Nachname = null; + } + + /** Returns true if field Nachname is set (has been assigned a value) and false otherwise */ + public boolean isSetNachname() { + return this.Nachname != null; + } + + public void setNachnameIsSet(boolean value) { + if (!value) { + this.Nachname = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VORNAME: + if (value == null) { + unsetVorname(); + } else { + setVorname((String)value); + } + break; + + case NACHNAME: + if (value == null) { + unsetNachname(); + } else { + setNachname((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VORNAME: + return getVorname(); + + case NACHNAME: + return getNachname(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case VORNAME: + return isSetVorname(); + case NACHNAME: + return isSetNachname(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getPersonData_args) + return this.equals((getPersonData_args)that); + return false; + } + + public boolean equals(getPersonData_args that) { + if (that == null) + return false; + + boolean this_present_Vorname = true && this.isSetVorname(); + boolean that_present_Vorname = true && that.isSetVorname(); + if (this_present_Vorname || that_present_Vorname) { + if (!(this_present_Vorname && that_present_Vorname)) + return false; + if (!this.Vorname.equals(that.Vorname)) + return false; + } + + boolean this_present_Nachname = true && this.isSetNachname(); + boolean that_present_Nachname = true && that.isSetNachname(); + if (this_present_Nachname || that_present_Nachname) { + if (!(this_present_Nachname && that_present_Nachname)) + return false; + if (!this.Nachname.equals(that.Nachname)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getPersonData_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetVorname()).compareTo(other.isSetVorname()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetVorname()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Vorname, other.Vorname); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNachname()).compareTo(other.isSetNachname()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNachname()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Nachname, other.Nachname); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getPersonData_args("); + boolean first = true; + + sb.append("Vorname:"); + if (this.Vorname == null) { + sb.append("null"); + } else { + sb.append(this.Vorname); + } + first = false; + if (!first) sb.append(", "); + sb.append("Nachname:"); + if (this.Nachname == null) { + sb.append("null"); + } else { + sb.append(this.Nachname); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getPersonData_argsStandardSchemeFactory implements SchemeFactory { + public getPersonData_argsStandardScheme getScheme() { + return new getPersonData_argsStandardScheme(); + } + } + + private static class getPersonData_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getPersonData_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // VORNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Vorname = iprot.readString(); + struct.setVornameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // NACHNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Nachname = iprot.readString(); + struct.setNachnameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getPersonData_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.Nachname != null) { + oprot.writeFieldBegin(NACHNAME_FIELD_DESC); + oprot.writeString(struct.Nachname); + oprot.writeFieldEnd(); + } + if (struct.Vorname != null) { + oprot.writeFieldBegin(VORNAME_FIELD_DESC); + oprot.writeString(struct.Vorname); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getPersonData_argsTupleSchemeFactory implements SchemeFactory { + public getPersonData_argsTupleScheme getScheme() { + return new getPersonData_argsTupleScheme(); + } + } + + private static class getPersonData_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getPersonData_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetVorname()) { + optionals.set(0); + } + if (struct.isSetNachname()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetVorname()) { + oprot.writeString(struct.Vorname); + } + if (struct.isSetNachname()) { + oprot.writeString(struct.Nachname); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getPersonData_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.Vorname = iprot.readString(); + struct.setVornameIsSet(true); + } + if (incoming.get(1)) { + struct.Nachname = iprot.readString(); + struct.setNachnameIsSet(true); + } + } + } + + } + + public static class getPersonData_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPersonData_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getPersonData_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getPersonData_resultTupleSchemeFactory()); + } + + public Map success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPersonData_result.class, metaDataMap); + } + + public getPersonData_result() { + } + + public getPersonData_result( + Map success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getPersonData_result(getPersonData_result other) { + if (other.isSetSuccess()) { + Map __this__success = new HashMap(other.success); + this.success = __this__success; + } + } + + public getPersonData_result deepCopy() { + return new getPersonData_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public void putToSuccess(String key, String val) { + if (this.success == null) { + this.success = new HashMap(); + } + this.success.put(key, val); + } + + public Map getSuccess() { + return this.success; + } + + public getPersonData_result setSuccess(Map success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getPersonData_result) + return this.equals((getPersonData_result)that); + return false; + } + + public boolean equals(getPersonData_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getPersonData_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getPersonData_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getPersonData_resultStandardSchemeFactory implements SchemeFactory { + public getPersonData_resultStandardScheme getScheme() { + return new getPersonData_resultStandardScheme(); + } + } + + private static class getPersonData_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getPersonData_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map32 = iprot.readMapBegin(); + struct.success = new HashMap(2*_map32.size); + for (int _i33 = 0; _i33 < _map32.size; ++_i33) + { + String _key34; + String _val35; + _key34 = iprot.readString(); + _val35 = iprot.readString(); + struct.success.put(_key34, _val35); + } + iprot.readMapEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getPersonData_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size())); + for (Map.Entry _iter36 : struct.success.entrySet()) + { + oprot.writeString(_iter36.getKey()); + oprot.writeString(_iter36.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getPersonData_resultTupleSchemeFactory implements SchemeFactory { + public getPersonData_resultTupleScheme getScheme() { + return new getPersonData_resultTupleScheme(); + } + } + + private static class getPersonData_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getPersonData_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (Map.Entry _iter37 : struct.success.entrySet()) + { + oprot.writeString(_iter37.getKey()); + oprot.writeString(_iter37.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getPersonData_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map38 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new HashMap(2*_map38.size); + for (int _i39 = 0; _i39 < _map38.size; ++_i39) + { + String _key40; + String _val41; + _key40 = iprot.readString(); + _val41 = iprot.readString(); + struct.success.put(_key40, _val41); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class writeLecturedata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeLecturedata_args"); + + private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField SHORTDESC_FIELD_DESC = new org.apache.thrift.protocol.TField("shortdesc", org.apache.thrift.protocol.TType.STRING, (short)-2); + private static final org.apache.thrift.protocol.TField DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("desc", org.apache.thrift.protocol.TType.STRING, (short)-3); + private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.STRING, (short)-4); + private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.STRING, (short)-5); + private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.BOOL, (short)-6); + private static final org.apache.thrift.protocol.TField IMAGENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imagename", org.apache.thrift.protocol.TType.STRING, (short)-7); + private static final org.apache.thrift.protocol.TField LOGIN_FIELD_DESC = new org.apache.thrift.protocol.TField("login", org.apache.thrift.protocol.TType.STRING, (short)-8); + private static final org.apache.thrift.protocol.TField FIRSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstname", org.apache.thrift.protocol.TType.STRING, (short)-9); + private static final org.apache.thrift.protocol.TField LASTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastname", org.apache.thrift.protocol.TType.STRING, (short)-10); + private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-11); + private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("Mail", org.apache.thrift.protocol.TType.STRING, (short)-12); + private static final org.apache.thrift.protocol.TField TEL_FIELD_DESC = new org.apache.thrift.protocol.TField("Tel", org.apache.thrift.protocol.TType.STRING, (short)-13); + private static final org.apache.thrift.protocol.TField FAK_FIELD_DESC = new org.apache.thrift.protocol.TField("Fak", org.apache.thrift.protocol.TType.STRING, (short)-14); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new writeLecturedata_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new writeLecturedata_argsTupleSchemeFactory()); + } + + public String name; // required + public String shortdesc; // required + public String desc; // required + public String startDate; // required + public String endDate; // required + public boolean isActive; // required + public String imagename; // required + public String login; // required + public String firstname; // required + public String lastname; // required + public String university; // required + public String Mail; // required + public String Tel; // required + public String Fak; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + NAME((short)-1, "name"), + SHORTDESC((short)-2, "shortdesc"), + DESC((short)-3, "desc"), + START_DATE((short)-4, "startDate"), + END_DATE((short)-5, "endDate"), + IS_ACTIVE((short)-6, "isActive"), + IMAGENAME((short)-7, "imagename"), + LOGIN((short)-8, "login"), + FIRSTNAME((short)-9, "firstname"), + LASTNAME((short)-10, "lastname"), + UNIVERSITY((short)-11, "university"), + MAIL((short)-12, "Mail"), + TEL((short)-13, "Tel"), + FAK((short)-14, "Fak"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // NAME + return NAME; + case -2: // SHORTDESC + return SHORTDESC; + case -3: // DESC + return DESC; + case -4: // START_DATE + return START_DATE; + case -5: // END_DATE + return END_DATE; + case -6: // IS_ACTIVE + return IS_ACTIVE; + case -7: // IMAGENAME + return IMAGENAME; + case -8: // LOGIN + return LOGIN; + case -9: // FIRSTNAME + return FIRSTNAME; + case -10: // LASTNAME + return LASTNAME; + case -11: // UNIVERSITY + return UNIVERSITY; + case -12: // MAIL + return MAIL; + case -13: // TEL + return TEL; + case -14: // FAK + return FAK; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __ISACTIVE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SHORTDESC, new org.apache.thrift.meta_data.FieldMetaData("shortdesc", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.DESC, new org.apache.thrift.meta_data.FieldMetaData("desc", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.IMAGENAME, new org.apache.thrift.meta_data.FieldMetaData("imagename", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LOGIN, new org.apache.thrift.meta_data.FieldMetaData("login", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.FIRSTNAME, new org.apache.thrift.meta_data.FieldMetaData("firstname", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LASTNAME, new org.apache.thrift.meta_data.FieldMetaData("lastname", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("Mail", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TEL, new org.apache.thrift.meta_data.FieldMetaData("Tel", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.FAK, new org.apache.thrift.meta_data.FieldMetaData("Fak", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeLecturedata_args.class, metaDataMap); + } + + public writeLecturedata_args() { + } + + public writeLecturedata_args( + String name, + String shortdesc, + String desc, + String startDate, + String endDate, + boolean isActive, + String imagename, + String login, + String firstname, + String lastname, + String university, + String Mail, + String Tel, + String Fak) + { + this(); + this.name = name; + this.shortdesc = shortdesc; + this.desc = desc; + this.startDate = startDate; + this.endDate = endDate; + this.isActive = isActive; + setIsActiveIsSet(true); + this.imagename = imagename; + this.login = login; + this.firstname = firstname; + this.lastname = lastname; + this.university = university; + this.Mail = Mail; + this.Tel = Tel; + this.Fak = Fak; + } + + /** + * Performs a deep copy on other. + */ + public writeLecturedata_args(writeLecturedata_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetName()) { + this.name = other.name; + } + if (other.isSetShortdesc()) { + this.shortdesc = other.shortdesc; + } + if (other.isSetDesc()) { + this.desc = other.desc; + } + if (other.isSetStartDate()) { + this.startDate = other.startDate; + } + if (other.isSetEndDate()) { + this.endDate = other.endDate; + } + this.isActive = other.isActive; + if (other.isSetImagename()) { + this.imagename = other.imagename; + } + if (other.isSetLogin()) { + this.login = other.login; + } + if (other.isSetFirstname()) { + this.firstname = other.firstname; + } + if (other.isSetLastname()) { + this.lastname = other.lastname; + } + if (other.isSetUniversity()) { + this.university = other.university; + } + if (other.isSetMail()) { + this.Mail = other.Mail; + } + if (other.isSetTel()) { + this.Tel = other.Tel; + } + if (other.isSetFak()) { + this.Fak = other.Fak; + } + } + + public writeLecturedata_args deepCopy() { + return new writeLecturedata_args(this); + } + + @Override + public void clear() { + this.name = null; + this.shortdesc = null; + this.desc = null; + this.startDate = null; + this.endDate = null; + setIsActiveIsSet(false); + this.isActive = false; + this.imagename = null; + this.login = null; + this.firstname = null; + this.lastname = null; + this.university = null; + this.Mail = null; + this.Tel = null; + this.Fak = null; + } + + public String getName() { + return this.name; + } + + public writeLecturedata_args setName(String name) { + this.name = name; + return this; + } + + public void unsetName() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean isSetName() { + return this.name != null; + } + + public void setNameIsSet(boolean value) { + if (!value) { + this.name = null; + } + } + + public String getShortdesc() { + return this.shortdesc; + } + + public writeLecturedata_args setShortdesc(String shortdesc) { + this.shortdesc = shortdesc; + return this; + } + + public void unsetShortdesc() { + this.shortdesc = null; + } + + /** Returns true if field shortdesc is set (has been assigned a value) and false otherwise */ + public boolean isSetShortdesc() { + return this.shortdesc != null; + } + + public void setShortdescIsSet(boolean value) { + if (!value) { + this.shortdesc = null; + } + } + + public String getDesc() { + return this.desc; + } + + public writeLecturedata_args setDesc(String desc) { + this.desc = desc; + return this; + } + + public void unsetDesc() { + this.desc = null; + } + + /** Returns true if field desc is set (has been assigned a value) and false otherwise */ + public boolean isSetDesc() { + return this.desc != null; + } + + public void setDescIsSet(boolean value) { + if (!value) { + this.desc = null; + } + } + + public String getStartDate() { + return this.startDate; + } + + public writeLecturedata_args setStartDate(String startDate) { + this.startDate = startDate; + return this; + } + + public void unsetStartDate() { + this.startDate = null; + } + + /** Returns true if field startDate is set (has been assigned a value) and false otherwise */ + public boolean isSetStartDate() { + return this.startDate != null; + } + + public void setStartDateIsSet(boolean value) { + if (!value) { + this.startDate = null; + } + } + + public String getEndDate() { + return this.endDate; + } + + public writeLecturedata_args setEndDate(String endDate) { + this.endDate = endDate; + return this; + } + + public void unsetEndDate() { + this.endDate = null; + } + + /** Returns true if field endDate is set (has been assigned a value) and false otherwise */ + public boolean isSetEndDate() { + return this.endDate != null; + } + + public void setEndDateIsSet(boolean value) { + if (!value) { + this.endDate = null; + } + } + + public boolean isIsActive() { + return this.isActive; + } + + public writeLecturedata_args setIsActive(boolean isActive) { + this.isActive = isActive; + setIsActiveIsSet(true); + return this; + } + + public void unsetIsActive() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISACTIVE_ISSET_ID); + } + + /** Returns true if field isActive is set (has been assigned a value) and false otherwise */ + public boolean isSetIsActive() { + return EncodingUtils.testBit(__isset_bitfield, __ISACTIVE_ISSET_ID); + } + + public void setIsActiveIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISACTIVE_ISSET_ID, value); + } + + public String getImagename() { + return this.imagename; + } + + public writeLecturedata_args setImagename(String imagename) { + this.imagename = imagename; + return this; + } + + public void unsetImagename() { + this.imagename = null; + } + + /** Returns true if field imagename is set (has been assigned a value) and false otherwise */ + public boolean isSetImagename() { + return this.imagename != null; + } + + public void setImagenameIsSet(boolean value) { + if (!value) { + this.imagename = null; + } + } + + public String getLogin() { + return this.login; + } + + public writeLecturedata_args setLogin(String login) { + this.login = login; + return this; + } + + public void unsetLogin() { + this.login = null; + } + + /** Returns true if field login is set (has been assigned a value) and false otherwise */ + public boolean isSetLogin() { + return this.login != null; + } + + public void setLoginIsSet(boolean value) { + if (!value) { + this.login = null; + } + } + + public String getFirstname() { + return this.firstname; + } + + public writeLecturedata_args setFirstname(String firstname) { + this.firstname = firstname; + return this; + } + + public void unsetFirstname() { + this.firstname = null; + } + + /** Returns true if field firstname is set (has been assigned a value) and false otherwise */ + public boolean isSetFirstname() { + return this.firstname != null; + } + + public void setFirstnameIsSet(boolean value) { + if (!value) { + this.firstname = null; + } + } + + public String getLastname() { + return this.lastname; + } + + public writeLecturedata_args setLastname(String lastname) { + this.lastname = lastname; + return this; + } + + public void unsetLastname() { + this.lastname = null; + } + + /** Returns true if field lastname is set (has been assigned a value) and false otherwise */ + public boolean isSetLastname() { + return this.lastname != null; + } + + public void setLastnameIsSet(boolean value) { + if (!value) { + this.lastname = null; + } + } + + public String getUniversity() { + return this.university; + } + + public writeLecturedata_args setUniversity(String university) { + this.university = university; + return this; + } + + public void unsetUniversity() { + this.university = null; + } + + /** Returns true if field university is set (has been assigned a value) and false otherwise */ + public boolean isSetUniversity() { + return this.university != null; + } + + public void setUniversityIsSet(boolean value) { + if (!value) { + this.university = null; + } + } + + public String getMail() { + return this.Mail; + } + + public writeLecturedata_args setMail(String Mail) { + this.Mail = Mail; + return this; + } + + public void unsetMail() { + this.Mail = null; + } + + /** Returns true if field Mail is set (has been assigned a value) and false otherwise */ + public boolean isSetMail() { + return this.Mail != null; + } + + public void setMailIsSet(boolean value) { + if (!value) { + this.Mail = null; + } + } + + public String getTel() { + return this.Tel; + } + + public writeLecturedata_args setTel(String Tel) { + this.Tel = Tel; + return this; + } + + public void unsetTel() { + this.Tel = null; + } + + /** Returns true if field Tel is set (has been assigned a value) and false otherwise */ + public boolean isSetTel() { + return this.Tel != null; + } + + public void setTelIsSet(boolean value) { + if (!value) { + this.Tel = null; + } + } + + public String getFak() { + return this.Fak; + } + + public writeLecturedata_args setFak(String Fak) { + this.Fak = Fak; + return this; + } + + public void unsetFak() { + this.Fak = null; + } + + /** Returns true if field Fak is set (has been assigned a value) and false otherwise */ + public boolean isSetFak() { + return this.Fak != null; + } + + public void setFakIsSet(boolean value) { + if (!value) { + this.Fak = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NAME: + if (value == null) { + unsetName(); + } else { + setName((String)value); + } + break; + + case SHORTDESC: + if (value == null) { + unsetShortdesc(); + } else { + setShortdesc((String)value); + } + break; + + case DESC: + if (value == null) { + unsetDesc(); + } else { + setDesc((String)value); + } + break; + + case START_DATE: + if (value == null) { + unsetStartDate(); + } else { + setStartDate((String)value); + } + break; + + case END_DATE: + if (value == null) { + unsetEndDate(); + } else { + setEndDate((String)value); + } + break; + + case IS_ACTIVE: + if (value == null) { + unsetIsActive(); + } else { + setIsActive((Boolean)value); + } + break; + + case IMAGENAME: + if (value == null) { + unsetImagename(); + } else { + setImagename((String)value); + } + break; + + case LOGIN: + if (value == null) { + unsetLogin(); + } else { + setLogin((String)value); + } + break; + + case FIRSTNAME: + if (value == null) { + unsetFirstname(); + } else { + setFirstname((String)value); + } + break; + + case LASTNAME: + if (value == null) { + unsetLastname(); + } else { + setLastname((String)value); + } + break; + + case UNIVERSITY: + if (value == null) { + unsetUniversity(); + } else { + setUniversity((String)value); + } + break; + + case MAIL: + if (value == null) { + unsetMail(); + } else { + setMail((String)value); + } + break; + + case TEL: + if (value == null) { + unsetTel(); + } else { + setTel((String)value); + } + break; + + case FAK: + if (value == null) { + unsetFak(); + } else { + setFak((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return getName(); + + case SHORTDESC: + return getShortdesc(); + + case DESC: + return getDesc(); + + case START_DATE: + return getStartDate(); + + case END_DATE: + return getEndDate(); + + case IS_ACTIVE: + return Boolean.valueOf(isIsActive()); + + case IMAGENAME: + return getImagename(); + + case LOGIN: + return getLogin(); + + case FIRSTNAME: + return getFirstname(); + + case LASTNAME: + return getLastname(); + + case UNIVERSITY: + return getUniversity(); + + case MAIL: + return getMail(); + + case TEL: + return getTel(); + + case FAK: + return getFak(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case NAME: + return isSetName(); + case SHORTDESC: + return isSetShortdesc(); + case DESC: + return isSetDesc(); + case START_DATE: + return isSetStartDate(); + case END_DATE: + return isSetEndDate(); + case IS_ACTIVE: + return isSetIsActive(); + case IMAGENAME: + return isSetImagename(); + case LOGIN: + return isSetLogin(); + case FIRSTNAME: + return isSetFirstname(); + case LASTNAME: + return isSetLastname(); + case UNIVERSITY: + return isSetUniversity(); + case MAIL: + return isSetMail(); + case TEL: + return isSetTel(); + case FAK: + return isSetFak(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof writeLecturedata_args) + return this.equals((writeLecturedata_args)that); + return false; + } + + public boolean equals(writeLecturedata_args that) { + if (that == null) + return false; + + boolean this_present_name = true && this.isSetName(); + boolean that_present_name = true && that.isSetName(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + boolean this_present_shortdesc = true && this.isSetShortdesc(); + boolean that_present_shortdesc = true && that.isSetShortdesc(); + if (this_present_shortdesc || that_present_shortdesc) { + if (!(this_present_shortdesc && that_present_shortdesc)) + return false; + if (!this.shortdesc.equals(that.shortdesc)) + return false; + } + + boolean this_present_desc = true && this.isSetDesc(); + boolean that_present_desc = true && that.isSetDesc(); + if (this_present_desc || that_present_desc) { + if (!(this_present_desc && that_present_desc)) + return false; + if (!this.desc.equals(that.desc)) + return false; + } + + boolean this_present_startDate = true && this.isSetStartDate(); + boolean that_present_startDate = true && that.isSetStartDate(); + if (this_present_startDate || that_present_startDate) { + if (!(this_present_startDate && that_present_startDate)) + return false; + if (!this.startDate.equals(that.startDate)) + return false; + } + + boolean this_present_endDate = true && this.isSetEndDate(); + boolean that_present_endDate = true && that.isSetEndDate(); + if (this_present_endDate || that_present_endDate) { + if (!(this_present_endDate && that_present_endDate)) + return false; + if (!this.endDate.equals(that.endDate)) + return false; + } + + boolean this_present_isActive = true; + boolean that_present_isActive = true; + if (this_present_isActive || that_present_isActive) { + if (!(this_present_isActive && that_present_isActive)) + return false; + if (this.isActive != that.isActive) + return false; + } + + boolean this_present_imagename = true && this.isSetImagename(); + boolean that_present_imagename = true && that.isSetImagename(); + if (this_present_imagename || that_present_imagename) { + if (!(this_present_imagename && that_present_imagename)) + return false; + if (!this.imagename.equals(that.imagename)) + return false; + } + + boolean this_present_login = true && this.isSetLogin(); + boolean that_present_login = true && that.isSetLogin(); + if (this_present_login || that_present_login) { + if (!(this_present_login && that_present_login)) + return false; + if (!this.login.equals(that.login)) + return false; + } + + boolean this_present_firstname = true && this.isSetFirstname(); + boolean that_present_firstname = true && that.isSetFirstname(); + if (this_present_firstname || that_present_firstname) { + if (!(this_present_firstname && that_present_firstname)) + return false; + if (!this.firstname.equals(that.firstname)) + return false; + } + + boolean this_present_lastname = true && this.isSetLastname(); + boolean that_present_lastname = true && that.isSetLastname(); + if (this_present_lastname || that_present_lastname) { + if (!(this_present_lastname && that_present_lastname)) + return false; + if (!this.lastname.equals(that.lastname)) + return false; + } + + boolean this_present_university = true && this.isSetUniversity(); + boolean that_present_university = true && that.isSetUniversity(); + if (this_present_university || that_present_university) { + if (!(this_present_university && that_present_university)) + return false; + if (!this.university.equals(that.university)) + return false; + } + + boolean this_present_Mail = true && this.isSetMail(); + boolean that_present_Mail = true && that.isSetMail(); + if (this_present_Mail || that_present_Mail) { + if (!(this_present_Mail && that_present_Mail)) + return false; + if (!this.Mail.equals(that.Mail)) + return false; + } + + boolean this_present_Tel = true && this.isSetTel(); + boolean that_present_Tel = true && that.isSetTel(); + if (this_present_Tel || that_present_Tel) { + if (!(this_present_Tel && that_present_Tel)) + return false; + if (!this.Tel.equals(that.Tel)) + return false; + } + + boolean this_present_Fak = true && this.isSetFak(); + boolean that_present_Fak = true && that.isSetFak(); + if (this_present_Fak || that_present_Fak) { + if (!(this_present_Fak && that_present_Fak)) + return false; + if (!this.Fak.equals(that.Fak)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(writeLecturedata_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetShortdesc()).compareTo(other.isSetShortdesc()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetShortdesc()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shortdesc, other.shortdesc); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDesc()).compareTo(other.isSetDesc()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDesc()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.desc, other.desc); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(other.isSetStartDate()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartDate()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, other.startDate); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(other.isSetEndDate()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEndDate()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, other.endDate); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(other.isSetIsActive()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIsActive()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isActive, other.isActive); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetImagename()).compareTo(other.isSetImagename()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImagename()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagename, other.imagename); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLogin()).compareTo(other.isSetLogin()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLogin()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.login, other.login); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFirstname()).compareTo(other.isSetFirstname()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFirstname()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstname, other.firstname); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLastname()).compareTo(other.isSetLastname()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLastname()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastname, other.lastname); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUniversity()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMail()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Mail, other.Mail); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTel()).compareTo(other.isSetTel()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTel()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Tel, other.Tel); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFak()).compareTo(other.isSetFak()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFak()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Fak, other.Fak); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("writeLecturedata_args("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + if (!first) sb.append(", "); + sb.append("shortdesc:"); + if (this.shortdesc == null) { + sb.append("null"); + } else { + sb.append(this.shortdesc); + } + first = false; + if (!first) sb.append(", "); + sb.append("desc:"); + if (this.desc == null) { + sb.append("null"); + } else { + sb.append(this.desc); + } + first = false; + if (!first) sb.append(", "); + sb.append("startDate:"); + if (this.startDate == null) { + sb.append("null"); + } else { + sb.append(this.startDate); + } + first = false; + if (!first) sb.append(", "); + sb.append("endDate:"); + if (this.endDate == null) { + sb.append("null"); + } else { + sb.append(this.endDate); + } + first = false; + if (!first) sb.append(", "); + sb.append("isActive:"); + sb.append(this.isActive); + first = false; + if (!first) sb.append(", "); + sb.append("imagename:"); + if (this.imagename == null) { + sb.append("null"); + } else { + sb.append(this.imagename); + } + first = false; + if (!first) sb.append(", "); + sb.append("login:"); + if (this.login == null) { + sb.append("null"); + } else { + sb.append(this.login); + } + first = false; + if (!first) sb.append(", "); + sb.append("firstname:"); + if (this.firstname == null) { + sb.append("null"); + } else { + sb.append(this.firstname); + } + first = false; + if (!first) sb.append(", "); + sb.append("lastname:"); + if (this.lastname == null) { + sb.append("null"); + } else { + sb.append(this.lastname); + } + first = false; + if (!first) sb.append(", "); + sb.append("university:"); + if (this.university == null) { + sb.append("null"); + } else { + sb.append(this.university); + } + first = false; + if (!first) sb.append(", "); + sb.append("Mail:"); + if (this.Mail == null) { + sb.append("null"); + } else { + sb.append(this.Mail); + } + first = false; + if (!first) sb.append(", "); + sb.append("Tel:"); + if (this.Tel == null) { + sb.append("null"); + } else { + sb.append(this.Tel); + } + first = false; + if (!first) sb.append(", "); + sb.append("Fak:"); + if (this.Fak == null) { + sb.append("null"); + } else { + sb.append(this.Fak); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class writeLecturedata_argsStandardSchemeFactory implements SchemeFactory { + public writeLecturedata_argsStandardScheme getScheme() { + return new writeLecturedata_argsStandardScheme(); + } + } + + private static class writeLecturedata_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, writeLecturedata_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // SHORTDESC + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.shortdesc = iprot.readString(); + struct.setShortdescIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -3: // DESC + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.desc = iprot.readString(); + struct.setDescIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -4: // START_DATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.startDate = iprot.readString(); + struct.setStartDateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -5: // END_DATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.endDate = iprot.readString(); + struct.setEndDateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -6: // IS_ACTIVE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.isActive = iprot.readBool(); + struct.setIsActiveIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -7: // IMAGENAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imagename = iprot.readString(); + struct.setImagenameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -8: // LOGIN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.login = iprot.readString(); + struct.setLoginIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -9: // FIRSTNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.firstname = iprot.readString(); + struct.setFirstnameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -10: // LASTNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.lastname = iprot.readString(); + struct.setLastnameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -11: // UNIVERSITY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.university = iprot.readString(); + struct.setUniversityIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -12: // MAIL + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Mail = iprot.readString(); + struct.setMailIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -13: // TEL + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Tel = iprot.readString(); + struct.setTelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -14: // FAK + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Fak = iprot.readString(); + struct.setFakIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, writeLecturedata_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.Fak != null) { + oprot.writeFieldBegin(FAK_FIELD_DESC); + oprot.writeString(struct.Fak); + oprot.writeFieldEnd(); + } + if (struct.Tel != null) { + oprot.writeFieldBegin(TEL_FIELD_DESC); + oprot.writeString(struct.Tel); + oprot.writeFieldEnd(); + } + if (struct.Mail != null) { + oprot.writeFieldBegin(MAIL_FIELD_DESC); + oprot.writeString(struct.Mail); + oprot.writeFieldEnd(); + } + if (struct.university != null) { + oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC); + oprot.writeString(struct.university); + oprot.writeFieldEnd(); + } + if (struct.lastname != null) { + oprot.writeFieldBegin(LASTNAME_FIELD_DESC); + oprot.writeString(struct.lastname); + oprot.writeFieldEnd(); + } + if (struct.firstname != null) { + oprot.writeFieldBegin(FIRSTNAME_FIELD_DESC); + oprot.writeString(struct.firstname); + oprot.writeFieldEnd(); + } + if (struct.login != null) { + oprot.writeFieldBegin(LOGIN_FIELD_DESC); + oprot.writeString(struct.login); + oprot.writeFieldEnd(); + } + if (struct.imagename != null) { + oprot.writeFieldBegin(IMAGENAME_FIELD_DESC); + oprot.writeString(struct.imagename); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC); + oprot.writeBool(struct.isActive); + oprot.writeFieldEnd(); + if (struct.endDate != null) { + oprot.writeFieldBegin(END_DATE_FIELD_DESC); + oprot.writeString(struct.endDate); + oprot.writeFieldEnd(); + } + if (struct.startDate != null) { + oprot.writeFieldBegin(START_DATE_FIELD_DESC); + oprot.writeString(struct.startDate); + oprot.writeFieldEnd(); + } + if (struct.desc != null) { + oprot.writeFieldBegin(DESC_FIELD_DESC); + oprot.writeString(struct.desc); + oprot.writeFieldEnd(); + } + if (struct.shortdesc != null) { + oprot.writeFieldBegin(SHORTDESC_FIELD_DESC); + oprot.writeString(struct.shortdesc); + oprot.writeFieldEnd(); + } + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class writeLecturedata_argsTupleSchemeFactory implements SchemeFactory { + public writeLecturedata_argsTupleScheme getScheme() { + return new writeLecturedata_argsTupleScheme(); + } + } + + private static class writeLecturedata_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, writeLecturedata_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetName()) { + optionals.set(0); + } + if (struct.isSetShortdesc()) { + optionals.set(1); + } + if (struct.isSetDesc()) { + optionals.set(2); + } + if (struct.isSetStartDate()) { + optionals.set(3); + } + if (struct.isSetEndDate()) { + optionals.set(4); + } + if (struct.isSetIsActive()) { + optionals.set(5); + } + if (struct.isSetImagename()) { + optionals.set(6); + } + if (struct.isSetLogin()) { + optionals.set(7); + } + if (struct.isSetFirstname()) { + optionals.set(8); + } + if (struct.isSetLastname()) { + optionals.set(9); + } + if (struct.isSetUniversity()) { + optionals.set(10); + } + if (struct.isSetMail()) { + optionals.set(11); + } + if (struct.isSetTel()) { + optionals.set(12); + } + if (struct.isSetFak()) { + optionals.set(13); + } + oprot.writeBitSet(optionals, 14); + if (struct.isSetName()) { + oprot.writeString(struct.name); + } + if (struct.isSetShortdesc()) { + oprot.writeString(struct.shortdesc); + } + if (struct.isSetDesc()) { + oprot.writeString(struct.desc); + } + if (struct.isSetStartDate()) { + oprot.writeString(struct.startDate); + } + if (struct.isSetEndDate()) { + oprot.writeString(struct.endDate); + } + if (struct.isSetIsActive()) { + oprot.writeBool(struct.isActive); + } + if (struct.isSetImagename()) { + oprot.writeString(struct.imagename); + } + if (struct.isSetLogin()) { + oprot.writeString(struct.login); + } + if (struct.isSetFirstname()) { + oprot.writeString(struct.firstname); + } + if (struct.isSetLastname()) { + oprot.writeString(struct.lastname); + } + if (struct.isSetUniversity()) { + oprot.writeString(struct.university); + } + if (struct.isSetMail()) { + oprot.writeString(struct.Mail); + } + if (struct.isSetTel()) { + oprot.writeString(struct.Tel); + } + if (struct.isSetFak()) { + oprot.writeString(struct.Fak); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, writeLecturedata_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(14); + if (incoming.get(0)) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } + if (incoming.get(1)) { + struct.shortdesc = iprot.readString(); + struct.setShortdescIsSet(true); + } + if (incoming.get(2)) { + struct.desc = iprot.readString(); + struct.setDescIsSet(true); + } + if (incoming.get(3)) { + struct.startDate = iprot.readString(); + struct.setStartDateIsSet(true); + } + if (incoming.get(4)) { + struct.endDate = iprot.readString(); + struct.setEndDateIsSet(true); + } + if (incoming.get(5)) { + struct.isActive = iprot.readBool(); + struct.setIsActiveIsSet(true); + } + if (incoming.get(6)) { + struct.imagename = iprot.readString(); + struct.setImagenameIsSet(true); + } + if (incoming.get(7)) { + struct.login = iprot.readString(); + struct.setLoginIsSet(true); + } + if (incoming.get(8)) { + struct.firstname = iprot.readString(); + struct.setFirstnameIsSet(true); + } + if (incoming.get(9)) { + struct.lastname = iprot.readString(); + struct.setLastnameIsSet(true); + } + if (incoming.get(10)) { + struct.university = iprot.readString(); + struct.setUniversityIsSet(true); + } + if (incoming.get(11)) { + struct.Mail = iprot.readString(); + struct.setMailIsSet(true); + } + if (incoming.get(12)) { + struct.Tel = iprot.readString(); + struct.setTelIsSet(true); + } + if (incoming.get(13)) { + struct.Fak = iprot.readString(); + struct.setFakIsSet(true); + } + } + } + + } + + public static class writeLecturedata_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeLecturedata_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new writeLecturedata_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new writeLecturedata_resultTupleSchemeFactory()); + } + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeLecturedata_result.class, metaDataMap); + } + + public writeLecturedata_result() { + } + + public writeLecturedata_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public writeLecturedata_result(writeLecturedata_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public writeLecturedata_result deepCopy() { + return new writeLecturedata_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public writeLecturedata_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof writeLecturedata_result) + return this.equals((writeLecturedata_result)that); + return false; + } + + public boolean equals(writeLecturedata_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(writeLecturedata_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("writeLecturedata_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class writeLecturedata_resultStandardSchemeFactory implements SchemeFactory { + public writeLecturedata_resultStandardScheme getScheme() { + return new writeLecturedata_resultStandardScheme(); + } + } + + private static class writeLecturedata_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, writeLecturedata_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, writeLecturedata_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class writeLecturedata_resultTupleSchemeFactory implements SchemeFactory { + public writeLecturedata_resultTupleScheme getScheme() { + return new writeLecturedata_resultTupleScheme(); + } + } + + private static class writeLecturedata_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, writeLecturedata_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, writeLecturedata_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class startFileCopy_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startFileCopy_args"); + + private static final org.apache.thrift.protocol.TField FILE_FIELD_DESC = new org.apache.thrift.protocol.TField("file", org.apache.thrift.protocol.TType.STRING, (short)-1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new startFileCopy_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new startFileCopy_argsTupleSchemeFactory()); + } + + public String file; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + FILE((short)-1, "file"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // FILE + return FILE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.FILE, new org.apache.thrift.meta_data.FieldMetaData("file", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startFileCopy_args.class, metaDataMap); + } + + public startFileCopy_args() { + } + + public startFileCopy_args( + String file) + { + this(); + this.file = file; + } + + /** + * Performs a deep copy on other. + */ + public startFileCopy_args(startFileCopy_args other) { + if (other.isSetFile()) { + this.file = other.file; + } + } + + public startFileCopy_args deepCopy() { + return new startFileCopy_args(this); + } + + @Override + public void clear() { + this.file = null; + } + + public String getFile() { + return this.file; + } + + public startFileCopy_args setFile(String file) { + this.file = file; + return this; + } + + public void unsetFile() { + this.file = null; + } + + /** Returns true if field file is set (has been assigned a value) and false otherwise */ + public boolean isSetFile() { + return this.file != null; + } + + public void setFileIsSet(boolean value) { + if (!value) { + this.file = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case FILE: + if (value == null) { + unsetFile(); + } else { + setFile((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case FILE: + return getFile(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case FILE: + return isSetFile(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof startFileCopy_args) + return this.equals((startFileCopy_args)that); + return false; + } + + public boolean equals(startFileCopy_args that) { + if (that == null) + return false; + + boolean this_present_file = true && this.isSetFile(); + boolean that_present_file = true && that.isSetFile(); + if (this_present_file || that_present_file) { + if (!(this_present_file && that_present_file)) + return false; + if (!this.file.equals(that.file)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(startFileCopy_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetFile()).compareTo(other.isSetFile()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFile()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.file, other.file); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("startFileCopy_args("); + boolean first = true; + + sb.append("file:"); + if (this.file == null) { + sb.append("null"); + } else { + sb.append(this.file); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class startFileCopy_argsStandardSchemeFactory implements SchemeFactory { + public startFileCopy_argsStandardScheme getScheme() { + return new startFileCopy_argsStandardScheme(); + } + } + + private static class startFileCopy_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, startFileCopy_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // FILE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.file = iprot.readString(); + struct.setFileIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, startFileCopy_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.file != null) { + oprot.writeFieldBegin(FILE_FIELD_DESC); + oprot.writeString(struct.file); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class startFileCopy_argsTupleSchemeFactory implements SchemeFactory { + public startFileCopy_argsTupleScheme getScheme() { + return new startFileCopy_argsTupleScheme(); + } + } + + private static class startFileCopy_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, startFileCopy_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetFile()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetFile()) { + oprot.writeString(struct.file); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, startFileCopy_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.file = iprot.readString(); + struct.setFileIsSet(true); + } + } + } + + } + + public static class startFileCopy_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startFileCopy_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new startFileCopy_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new startFileCopy_resultTupleSchemeFactory()); + } + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startFileCopy_result.class, metaDataMap); + } + + public startFileCopy_result() { + } + + public startFileCopy_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public startFileCopy_result(startFileCopy_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public startFileCopy_result deepCopy() { + return new startFileCopy_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public startFileCopy_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof startFileCopy_result) + return this.equals((startFileCopy_result)that); + return false; + } + + public boolean equals(startFileCopy_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(startFileCopy_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("startFileCopy_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class startFileCopy_resultStandardSchemeFactory implements SchemeFactory { + public startFileCopy_resultStandardScheme getScheme() { + return new startFileCopy_resultStandardScheme(); + } + } + + private static class startFileCopy_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, startFileCopy_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, startFileCopy_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class startFileCopy_resultTupleSchemeFactory implements SchemeFactory { + public startFileCopy_resultTupleScheme getScheme() { + return new startFileCopy_resultTupleScheme(); + } + } + + private static class startFileCopy_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, startFileCopy_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, startFileCopy_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class getImageData_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getImageData_args"); + + private static final org.apache.thrift.protocol.TField IMAGEID_FIELD_DESC = new org.apache.thrift.protocol.TField("imageid", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField IMAGEVERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("imageversion", org.apache.thrift.protocol.TType.STRING, (short)-2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getImageData_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getImageData_argsTupleSchemeFactory()); + } + + public String imageid; // required + public String imageversion; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + IMAGEID((short)-1, "imageid"), + IMAGEVERSION((short)-2, "imageversion"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // IMAGEID + return IMAGEID; + case -2: // IMAGEVERSION + return IMAGEVERSION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IMAGEID, new org.apache.thrift.meta_data.FieldMetaData("imageid", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IMAGEVERSION, new org.apache.thrift.meta_data.FieldMetaData("imageversion", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getImageData_args.class, metaDataMap); + } + + public getImageData_args() { + } + + public getImageData_args( + String imageid, + String imageversion) + { + this(); + this.imageid = imageid; + this.imageversion = imageversion; + } + + /** + * Performs a deep copy on other. + */ + public getImageData_args(getImageData_args other) { + if (other.isSetImageid()) { + this.imageid = other.imageid; + } + if (other.isSetImageversion()) { + this.imageversion = other.imageversion; + } + } + + public getImageData_args deepCopy() { + return new getImageData_args(this); + } + + @Override + public void clear() { + this.imageid = null; + this.imageversion = null; + } + + public String getImageid() { + return this.imageid; + } + + public getImageData_args setImageid(String imageid) { + this.imageid = imageid; + return this; + } + + public void unsetImageid() { + this.imageid = null; + } + + /** Returns true if field imageid is set (has been assigned a value) and false otherwise */ + public boolean isSetImageid() { + return this.imageid != null; + } + + public void setImageidIsSet(boolean value) { + if (!value) { + this.imageid = null; + } + } + + public String getImageversion() { + return this.imageversion; + } + + public getImageData_args setImageversion(String imageversion) { + this.imageversion = imageversion; + return this; + } + + public void unsetImageversion() { + this.imageversion = null; + } + + /** Returns true if field imageversion is set (has been assigned a value) and false otherwise */ + public boolean isSetImageversion() { + return this.imageversion != null; + } + + public void setImageversionIsSet(boolean value) { + if (!value) { + this.imageversion = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IMAGEID: + if (value == null) { + unsetImageid(); + } else { + setImageid((String)value); + } + break; + + case IMAGEVERSION: + if (value == null) { + unsetImageversion(); + } else { + setImageversion((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IMAGEID: + return getImageid(); + + case IMAGEVERSION: + return getImageversion(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case IMAGEID: + return isSetImageid(); + case IMAGEVERSION: + return isSetImageversion(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getImageData_args) + return this.equals((getImageData_args)that); + return false; + } + + public boolean equals(getImageData_args that) { + if (that == null) + return false; + + boolean this_present_imageid = true && this.isSetImageid(); + boolean that_present_imageid = true && that.isSetImageid(); + if (this_present_imageid || that_present_imageid) { + if (!(this_present_imageid && that_present_imageid)) + return false; + if (!this.imageid.equals(that.imageid)) + return false; + } + + boolean this_present_imageversion = true && this.isSetImageversion(); + boolean that_present_imageversion = true && that.isSetImageversion(); + if (this_present_imageversion || that_present_imageversion) { + if (!(this_present_imageversion && that_present_imageversion)) + return false; + if (!this.imageversion.equals(that.imageversion)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getImageData_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetImageid()).compareTo(other.isSetImageid()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImageid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageid, other.imageid); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetImageversion()).compareTo(other.isSetImageversion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImageversion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageversion, other.imageversion); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getImageData_args("); + boolean first = true; + + sb.append("imageid:"); + if (this.imageid == null) { + sb.append("null"); + } else { + sb.append(this.imageid); + } + first = false; + if (!first) sb.append(", "); + sb.append("imageversion:"); + if (this.imageversion == null) { + sb.append("null"); + } else { + sb.append(this.imageversion); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getImageData_argsStandardSchemeFactory implements SchemeFactory { + public getImageData_argsStandardScheme getScheme() { + return new getImageData_argsStandardScheme(); + } + } + + private static class getImageData_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getImageData_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // IMAGEID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imageid = iprot.readString(); + struct.setImageidIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // IMAGEVERSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imageversion = iprot.readString(); + struct.setImageversionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getImageData_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.imageversion != null) { + oprot.writeFieldBegin(IMAGEVERSION_FIELD_DESC); + oprot.writeString(struct.imageversion); + oprot.writeFieldEnd(); + } + if (struct.imageid != null) { + oprot.writeFieldBegin(IMAGEID_FIELD_DESC); + oprot.writeString(struct.imageid); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getImageData_argsTupleSchemeFactory implements SchemeFactory { + public getImageData_argsTupleScheme getScheme() { + return new getImageData_argsTupleScheme(); + } + } + + private static class getImageData_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getImageData_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetImageid()) { + optionals.set(0); + } + if (struct.isSetImageversion()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetImageid()) { + oprot.writeString(struct.imageid); + } + if (struct.isSetImageversion()) { + oprot.writeString(struct.imageversion); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getImageData_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.imageid = iprot.readString(); + struct.setImageidIsSet(true); + } + if (incoming.get(1)) { + struct.imageversion = iprot.readString(); + struct.setImageversionIsSet(true); + } + } + } + + } + + public static class getImageData_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getImageData_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getImageData_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getImageData_resultTupleSchemeFactory()); + } + + public Map success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getImageData_result.class, metaDataMap); + } + + public getImageData_result() { + } + + public getImageData_result( + Map success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getImageData_result(getImageData_result other) { + if (other.isSetSuccess()) { + Map __this__success = new HashMap(other.success); + this.success = __this__success; + } + } + + public getImageData_result deepCopy() { + return new getImageData_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public void putToSuccess(String key, String val) { + if (this.success == null) { + this.success = new HashMap(); + } + this.success.put(key, val); + } + + public Map getSuccess() { + return this.success; + } + + public getImageData_result setSuccess(Map success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getImageData_result) + return this.equals((getImageData_result)that); + return false; + } + + public boolean equals(getImageData_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getImageData_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getImageData_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getImageData_resultStandardSchemeFactory implements SchemeFactory { + public getImageData_resultStandardScheme getScheme() { + return new getImageData_resultStandardScheme(); + } + } + + private static class getImageData_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getImageData_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map42 = iprot.readMapBegin(); + struct.success = new HashMap(2*_map42.size); + for (int _i43 = 0; _i43 < _map42.size; ++_i43) + { + String _key44; + String _val45; + _key44 = iprot.readString(); + _val45 = iprot.readString(); + struct.success.put(_key44, _val45); + } + iprot.readMapEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getImageData_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size())); + for (Map.Entry _iter46 : struct.success.entrySet()) + { + oprot.writeString(_iter46.getKey()); + oprot.writeString(_iter46.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getImageData_resultTupleSchemeFactory implements SchemeFactory { + public getImageData_resultTupleScheme getScheme() { + return new getImageData_resultTupleScheme(); + } + } + + private static class getImageData_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getImageData_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (Map.Entry _iter47 : struct.success.entrySet()) + { + oprot.writeString(_iter47.getKey()); + oprot.writeString(_iter47.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getImageData_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map48 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new HashMap(2*_map48.size); + for (int _i49 = 0; _i49 < _map48.size; ++_i49) + { + String _key50; + String _val51; + _key50 = iprot.readString(); + _val51 = iprot.readString(); + struct.success.put(_key50, _val51); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class getLectureData_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureData_args"); + + private static final org.apache.thrift.protocol.TField LECTUREID_FIELD_DESC = new org.apache.thrift.protocol.TField("lectureid", org.apache.thrift.protocol.TType.STRING, (short)-1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getLectureData_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getLectureData_argsTupleSchemeFactory()); + } + + public String lectureid; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + LECTUREID((short)-1, "lectureid"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // LECTUREID + return LECTUREID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.LECTUREID, new org.apache.thrift.meta_data.FieldMetaData("lectureid", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLectureData_args.class, metaDataMap); + } + + public getLectureData_args() { + } + + public getLectureData_args( + String lectureid) + { + this(); + this.lectureid = lectureid; + } + + /** + * Performs a deep copy on other. + */ + public getLectureData_args(getLectureData_args other) { + if (other.isSetLectureid()) { + this.lectureid = other.lectureid; + } + } + + public getLectureData_args deepCopy() { + return new getLectureData_args(this); + } + + @Override + public void clear() { + this.lectureid = null; + } + + public String getLectureid() { + return this.lectureid; + } + + public getLectureData_args setLectureid(String lectureid) { + this.lectureid = lectureid; + return this; + } + + public void unsetLectureid() { + this.lectureid = null; + } + + /** Returns true if field lectureid is set (has been assigned a value) and false otherwise */ + public boolean isSetLectureid() { + return this.lectureid != null; + } + + public void setLectureidIsSet(boolean value) { + if (!value) { + this.lectureid = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case LECTUREID: + if (value == null) { + unsetLectureid(); + } else { + setLectureid((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case LECTUREID: + return getLectureid(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case LECTUREID: + return isSetLectureid(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getLectureData_args) + return this.equals((getLectureData_args)that); + return false; + } + + public boolean equals(getLectureData_args that) { + if (that == null) + return false; + + boolean this_present_lectureid = true && this.isSetLectureid(); + boolean that_present_lectureid = true && that.isSetLectureid(); + if (this_present_lectureid || that_present_lectureid) { + if (!(this_present_lectureid && that_present_lectureid)) + return false; + if (!this.lectureid.equals(that.lectureid)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getLectureData_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetLectureid()).compareTo(other.isSetLectureid()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLectureid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lectureid, other.lectureid); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getLectureData_args("); + boolean first = true; + + sb.append("lectureid:"); + if (this.lectureid == null) { + sb.append("null"); + } else { + sb.append(this.lectureid); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getLectureData_argsStandardSchemeFactory implements SchemeFactory { + public getLectureData_argsStandardScheme getScheme() { + return new getLectureData_argsStandardScheme(); + } + } + + private static class getLectureData_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureData_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // LECTUREID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.lectureid = iprot.readString(); + struct.setLectureidIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getLectureData_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.lectureid != null) { + oprot.writeFieldBegin(LECTUREID_FIELD_DESC); + oprot.writeString(struct.lectureid); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getLectureData_argsTupleSchemeFactory implements SchemeFactory { + public getLectureData_argsTupleScheme getScheme() { + return new getLectureData_argsTupleScheme(); + } + } + + private static class getLectureData_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getLectureData_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetLectureid()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetLectureid()) { + oprot.writeString(struct.lectureid); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getLectureData_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.lectureid = iprot.readString(); + struct.setLectureidIsSet(true); + } + } + } + + } + + public static class getLectureData_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureData_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getLectureData_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getLectureData_resultTupleSchemeFactory()); + } + + public Map success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLectureData_result.class, metaDataMap); + } + + public getLectureData_result() { + } + + public getLectureData_result( + Map success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getLectureData_result(getLectureData_result other) { + if (other.isSetSuccess()) { + Map __this__success = new HashMap(other.success); + this.success = __this__success; + } + } + + public getLectureData_result deepCopy() { + return new getLectureData_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public void putToSuccess(String key, String val) { + if (this.success == null) { + this.success = new HashMap(); + } + this.success.put(key, val); + } + + public Map getSuccess() { + return this.success; + } + + public getLectureData_result setSuccess(Map success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getLectureData_result) + return this.equals((getLectureData_result)that); + return false; + } + + public boolean equals(getLectureData_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getLectureData_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getLectureData_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getLectureData_resultStandardSchemeFactory implements SchemeFactory { + public getLectureData_resultStandardScheme getScheme() { + return new getLectureData_resultStandardScheme(); + } + } + + private static class getLectureData_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureData_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map52 = iprot.readMapBegin(); + struct.success = new HashMap(2*_map52.size); + for (int _i53 = 0; _i53 < _map52.size; ++_i53) + { + String _key54; + String _val55; + _key54 = iprot.readString(); + _val55 = iprot.readString(); + struct.success.put(_key54, _val55); + } + iprot.readMapEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getLectureData_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size())); + for (Map.Entry _iter56 : struct.success.entrySet()) + { + oprot.writeString(_iter56.getKey()); + oprot.writeString(_iter56.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getLectureData_resultTupleSchemeFactory implements SchemeFactory { + public getLectureData_resultTupleScheme getScheme() { + return new getLectureData_resultTupleScheme(); + } + } + + private static class getLectureData_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getLectureData_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (Map.Entry _iter57 : struct.success.entrySet()) + { + oprot.writeString(_iter57.getKey()); + oprot.writeString(_iter57.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getLectureData_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map58 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new HashMap(2*_map58.size); + for (int _i59 = 0; _i59 < _map58.size; ++_i59) + { + String _key60; + String _val61; + _key60 = iprot.readString(); + _val61 = iprot.readString(); + struct.success.put(_key60, _val61); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class updateImageData_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateImageData_args"); + + private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField NEW_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("newName", org.apache.thrift.protocol.TType.STRING, (short)-2); + private static final org.apache.thrift.protocol.TField DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("desc", org.apache.thrift.protocol.TType.STRING, (short)-3); + private static final org.apache.thrift.protocol.TField IMAGE_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("image_path", org.apache.thrift.protocol.TType.STRING, (short)-4); + private static final org.apache.thrift.protocol.TField LICENSE_FIELD_DESC = new org.apache.thrift.protocol.TField("license", org.apache.thrift.protocol.TType.BOOL, (short)-5); + private static final org.apache.thrift.protocol.TField INTERNET_FIELD_DESC = new org.apache.thrift.protocol.TField("internet", org.apache.thrift.protocol.TType.BOOL, (short)-6); + private static final org.apache.thrift.protocol.TField RAM_FIELD_DESC = new org.apache.thrift.protocol.TField("ram", org.apache.thrift.protocol.TType.I64, (short)-7); + private static final org.apache.thrift.protocol.TField CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("cpu", org.apache.thrift.protocol.TType.I64, (short)-8); + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-9); + private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-10); + private static final org.apache.thrift.protocol.TField IS_TEMPLATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isTemplate", org.apache.thrift.protocol.TType.BOOL, (short)-11); + private static final org.apache.thrift.protocol.TField FILESIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("filesize", org.apache.thrift.protocol.TType.I64, (short)-12); + private static final org.apache.thrift.protocol.TField SHARE_MODE_FIELD_DESC = new org.apache.thrift.protocol.TField("shareMode", org.apache.thrift.protocol.TType.I64, (short)-13); + private static final org.apache.thrift.protocol.TField OS_FIELD_DESC = new org.apache.thrift.protocol.TField("os", org.apache.thrift.protocol.TType.STRING, (short)-14); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new updateImageData_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new updateImageData_argsTupleSchemeFactory()); + } + + public String name; // required + public String newName; // required + public String desc; // required + public String image_path; // required + public boolean license; // required + public boolean internet; // required + public long ram; // required + public long cpu; // required + public String id; // required + public String version; // required + public boolean isTemplate; // required + public long filesize; // required + public long shareMode; // required + public String os; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + NAME((short)-1, "name"), + NEW_NAME((short)-2, "newName"), + DESC((short)-3, "desc"), + IMAGE_PATH((short)-4, "image_path"), + LICENSE((short)-5, "license"), + INTERNET((short)-6, "internet"), + RAM((short)-7, "ram"), + CPU((short)-8, "cpu"), + ID((short)-9, "id"), + VERSION((short)-10, "version"), + IS_TEMPLATE((short)-11, "isTemplate"), + FILESIZE((short)-12, "filesize"), + SHARE_MODE((short)-13, "shareMode"), + OS((short)-14, "os"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // NAME + return NAME; + case -2: // NEW_NAME + return NEW_NAME; + case -3: // DESC + return DESC; + case -4: // IMAGE_PATH + return IMAGE_PATH; + case -5: // LICENSE + return LICENSE; + case -6: // INTERNET + return INTERNET; + case -7: // RAM + return RAM; + case -8: // CPU + return CPU; + case -9: // ID + return ID; + case -10: // VERSION + return VERSION; + case -11: // IS_TEMPLATE + return IS_TEMPLATE; + case -12: // FILESIZE + return FILESIZE; + case -13: // SHARE_MODE + return SHARE_MODE; + case -14: // OS + return OS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __LICENSE_ISSET_ID = 0; + private static final int __INTERNET_ISSET_ID = 1; + private static final int __RAM_ISSET_ID = 2; + private static final int __CPU_ISSET_ID = 3; + private static final int __ISTEMPLATE_ISSET_ID = 4; + private static final int __FILESIZE_ISSET_ID = 5; + private static final int __SHAREMODE_ISSET_ID = 6; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NEW_NAME, new org.apache.thrift.meta_data.FieldMetaData("newName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.DESC, new org.apache.thrift.meta_data.FieldMetaData("desc", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IMAGE_PATH, new org.apache.thrift.meta_data.FieldMetaData("image_path", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LICENSE, new org.apache.thrift.meta_data.FieldMetaData("license", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.INTERNET, new org.apache.thrift.meta_data.FieldMetaData("internet", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.RAM, new org.apache.thrift.meta_data.FieldMetaData("ram", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int"))); + tmpMap.put(_Fields.CPU, new org.apache.thrift.meta_data.FieldMetaData("cpu", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int"))); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IS_TEMPLATE, new org.apache.thrift.meta_data.FieldMetaData("isTemplate", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.FILESIZE, new org.apache.thrift.meta_data.FieldMetaData("filesize", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.SHARE_MODE, new org.apache.thrift.meta_data.FieldMetaData("shareMode", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int"))); + tmpMap.put(_Fields.OS, new org.apache.thrift.meta_data.FieldMetaData("os", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateImageData_args.class, metaDataMap); + } + + public updateImageData_args() { + } + + public updateImageData_args( + String name, + String newName, + String desc, + String image_path, + boolean license, + boolean internet, + long ram, + long cpu, + String id, + String version, + boolean isTemplate, + long filesize, + long shareMode, + String os) + { + this(); + this.name = name; + this.newName = newName; + this.desc = desc; + this.image_path = image_path; + this.license = license; + setLicenseIsSet(true); + this.internet = internet; + setInternetIsSet(true); + this.ram = ram; + setRamIsSet(true); + this.cpu = cpu; + setCpuIsSet(true); + this.id = id; + this.version = version; + this.isTemplate = isTemplate; + setIsTemplateIsSet(true); + this.filesize = filesize; + setFilesizeIsSet(true); + this.shareMode = shareMode; + setShareModeIsSet(true); + this.os = os; + } + + /** + * Performs a deep copy on other. + */ + public updateImageData_args(updateImageData_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetName()) { + this.name = other.name; + } + if (other.isSetNewName()) { + this.newName = other.newName; + } + if (other.isSetDesc()) { + this.desc = other.desc; + } + if (other.isSetImage_path()) { + this.image_path = other.image_path; + } + this.license = other.license; + this.internet = other.internet; + this.ram = other.ram; + this.cpu = other.cpu; + if (other.isSetId()) { + this.id = other.id; + } + if (other.isSetVersion()) { + this.version = other.version; + } + this.isTemplate = other.isTemplate; + this.filesize = other.filesize; + this.shareMode = other.shareMode; + if (other.isSetOs()) { + this.os = other.os; + } + } + + public updateImageData_args deepCopy() { + return new updateImageData_args(this); + } + + @Override + public void clear() { + this.name = null; + this.newName = null; + this.desc = null; + this.image_path = null; + setLicenseIsSet(false); + this.license = false; + setInternetIsSet(false); + this.internet = false; + setRamIsSet(false); + this.ram = 0; + setCpuIsSet(false); + this.cpu = 0; + this.id = null; + this.version = null; + setIsTemplateIsSet(false); + this.isTemplate = false; + setFilesizeIsSet(false); + this.filesize = 0; + setShareModeIsSet(false); + this.shareMode = 0; + this.os = null; + } + + public String getName() { + return this.name; + } + + public updateImageData_args setName(String name) { + this.name = name; + return this; + } + + public void unsetName() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean isSetName() { + return this.name != null; + } + + public void setNameIsSet(boolean value) { + if (!value) { + this.name = null; + } + } + + public String getNewName() { + return this.newName; + } + + public updateImageData_args setNewName(String newName) { + this.newName = newName; + return this; + } + + public void unsetNewName() { + this.newName = null; + } + + /** Returns true if field newName is set (has been assigned a value) and false otherwise */ + public boolean isSetNewName() { + return this.newName != null; + } + + public void setNewNameIsSet(boolean value) { + if (!value) { + this.newName = null; + } + } + + public String getDesc() { + return this.desc; + } + + public updateImageData_args setDesc(String desc) { + this.desc = desc; + return this; + } + + public void unsetDesc() { + this.desc = null; + } + + /** Returns true if field desc is set (has been assigned a value) and false otherwise */ + public boolean isSetDesc() { + return this.desc != null; + } + + public void setDescIsSet(boolean value) { + if (!value) { + this.desc = null; + } + } + + public String getImage_path() { + return this.image_path; + } + + public updateImageData_args setImage_path(String image_path) { + this.image_path = image_path; + return this; + } + + public void unsetImage_path() { + this.image_path = null; + } + + /** Returns true if field image_path is set (has been assigned a value) and false otherwise */ + public boolean isSetImage_path() { + return this.image_path != null; + } + + public void setImage_pathIsSet(boolean value) { + if (!value) { + this.image_path = null; + } + } + + public boolean isLicense() { + return this.license; + } + + public updateImageData_args setLicense(boolean license) { + this.license = license; + setLicenseIsSet(true); + return this; + } + + public void unsetLicense() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LICENSE_ISSET_ID); + } + + /** Returns true if field license is set (has been assigned a value) and false otherwise */ + public boolean isSetLicense() { + return EncodingUtils.testBit(__isset_bitfield, __LICENSE_ISSET_ID); + } + + public void setLicenseIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LICENSE_ISSET_ID, value); + } + + public boolean isInternet() { + return this.internet; + } + + public updateImageData_args setInternet(boolean internet) { + this.internet = internet; + setInternetIsSet(true); + return this; + } + + public void unsetInternet() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INTERNET_ISSET_ID); + } + + /** Returns true if field internet is set (has been assigned a value) and false otherwise */ + public boolean isSetInternet() { + return EncodingUtils.testBit(__isset_bitfield, __INTERNET_ISSET_ID); + } + + public void setInternetIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INTERNET_ISSET_ID, value); + } + + public long getRam() { + return this.ram; + } + + public updateImageData_args setRam(long ram) { + this.ram = ram; + setRamIsSet(true); + return this; + } + + public void unsetRam() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RAM_ISSET_ID); + } + + /** Returns true if field ram is set (has been assigned a value) and false otherwise */ + public boolean isSetRam() { + return EncodingUtils.testBit(__isset_bitfield, __RAM_ISSET_ID); + } + + public void setRamIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RAM_ISSET_ID, value); + } + + public long getCpu() { + return this.cpu; + } + + public updateImageData_args setCpu(long cpu) { + this.cpu = cpu; + setCpuIsSet(true); + return this; + } + + public void unsetCpu() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CPU_ISSET_ID); + } + + /** Returns true if field cpu is set (has been assigned a value) and false otherwise */ + public boolean isSetCpu() { + return EncodingUtils.testBit(__isset_bitfield, __CPU_ISSET_ID); + } + + public void setCpuIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CPU_ISSET_ID, value); + } + + public String getId() { + return this.id; + } + + public updateImageData_args setId(String id) { + this.id = id; + return this; + } + + public void unsetId() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return this.id != null; + } + + public void setIdIsSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public String getVersion() { + return this.version; + } + + public updateImageData_args setVersion(String version) { + this.version = version; + return this; + } + + public void unsetVersion() { + this.version = null; + } + + /** Returns true if field version is set (has been assigned a value) and false otherwise */ + public boolean isSetVersion() { + return this.version != null; + } + + public void setVersionIsSet(boolean value) { + if (!value) { + this.version = null; + } + } + + public boolean isIsTemplate() { + return this.isTemplate; + } + + public updateImageData_args setIsTemplate(boolean isTemplate) { + this.isTemplate = isTemplate; + setIsTemplateIsSet(true); + return this; + } + + public void unsetIsTemplate() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID); + } + + /** Returns true if field isTemplate is set (has been assigned a value) and false otherwise */ + public boolean isSetIsTemplate() { + return EncodingUtils.testBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID); + } + + public void setIsTemplateIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID, value); + } + + public long getFilesize() { + return this.filesize; + } + + public updateImageData_args setFilesize(long filesize) { + this.filesize = filesize; + setFilesizeIsSet(true); + return this; + } + + public void unsetFilesize() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILESIZE_ISSET_ID); + } + + /** Returns true if field filesize is set (has been assigned a value) and false otherwise */ + public boolean isSetFilesize() { + return EncodingUtils.testBit(__isset_bitfield, __FILESIZE_ISSET_ID); + } + + public void setFilesizeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILESIZE_ISSET_ID, value); + } + + public long getShareMode() { + return this.shareMode; + } + + public updateImageData_args setShareMode(long shareMode) { + this.shareMode = shareMode; + setShareModeIsSet(true); + return this; + } + + public void unsetShareMode() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SHAREMODE_ISSET_ID); + } + + /** Returns true if field shareMode is set (has been assigned a value) and false otherwise */ + public boolean isSetShareMode() { + return EncodingUtils.testBit(__isset_bitfield, __SHAREMODE_ISSET_ID); + } + + public void setShareModeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SHAREMODE_ISSET_ID, value); + } + + public String getOs() { + return this.os; + } + + public updateImageData_args setOs(String os) { + this.os = os; + return this; + } + + public void unsetOs() { + this.os = null; + } + + /** Returns true if field os is set (has been assigned a value) and false otherwise */ + public boolean isSetOs() { + return this.os != null; + } + + public void setOsIsSet(boolean value) { + if (!value) { + this.os = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NAME: + if (value == null) { + unsetName(); + } else { + setName((String)value); + } + break; + + case NEW_NAME: + if (value == null) { + unsetNewName(); + } else { + setNewName((String)value); + } + break; + + case DESC: + if (value == null) { + unsetDesc(); + } else { + setDesc((String)value); + } + break; + + case IMAGE_PATH: + if (value == null) { + unsetImage_path(); + } else { + setImage_path((String)value); + } + break; + + case LICENSE: + if (value == null) { + unsetLicense(); + } else { + setLicense((Boolean)value); + } + break; + + case INTERNET: + if (value == null) { + unsetInternet(); + } else { + setInternet((Boolean)value); + } + break; + + case RAM: + if (value == null) { + unsetRam(); + } else { + setRam((Long)value); + } + break; + + case CPU: + if (value == null) { + unsetCpu(); + } else { + setCpu((Long)value); + } + break; + + case ID: + if (value == null) { + unsetId(); + } else { + setId((String)value); + } + break; + + case VERSION: + if (value == null) { + unsetVersion(); + } else { + setVersion((String)value); + } + break; + + case IS_TEMPLATE: + if (value == null) { + unsetIsTemplate(); + } else { + setIsTemplate((Boolean)value); + } + break; + + case FILESIZE: + if (value == null) { + unsetFilesize(); + } else { + setFilesize((Long)value); + } + break; + + case SHARE_MODE: + if (value == null) { + unsetShareMode(); + } else { + setShareMode((Long)value); + } + break; + + case OS: + if (value == null) { + unsetOs(); + } else { + setOs((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return getName(); + + case NEW_NAME: + return getNewName(); + + case DESC: + return getDesc(); + + case IMAGE_PATH: + return getImage_path(); + + case LICENSE: + return Boolean.valueOf(isLicense()); + + case INTERNET: + return Boolean.valueOf(isInternet()); + + case RAM: + return Long.valueOf(getRam()); + + case CPU: + return Long.valueOf(getCpu()); + + case ID: + return getId(); + + case VERSION: + return getVersion(); + + case IS_TEMPLATE: + return Boolean.valueOf(isIsTemplate()); + + case FILESIZE: + return Long.valueOf(getFilesize()); + + case SHARE_MODE: + return Long.valueOf(getShareMode()); + + case OS: + return getOs(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case NAME: + return isSetName(); + case NEW_NAME: + return isSetNewName(); + case DESC: + return isSetDesc(); + case IMAGE_PATH: + return isSetImage_path(); + case LICENSE: + return isSetLicense(); + case INTERNET: + return isSetInternet(); + case RAM: + return isSetRam(); + case CPU: + return isSetCpu(); + case ID: + return isSetId(); + case VERSION: + return isSetVersion(); + case IS_TEMPLATE: + return isSetIsTemplate(); + case FILESIZE: + return isSetFilesize(); + case SHARE_MODE: + return isSetShareMode(); + case OS: + return isSetOs(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof updateImageData_args) + return this.equals((updateImageData_args)that); + return false; + } + + public boolean equals(updateImageData_args that) { + if (that == null) + return false; + + boolean this_present_name = true && this.isSetName(); + boolean that_present_name = true && that.isSetName(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + boolean this_present_newName = true && this.isSetNewName(); + boolean that_present_newName = true && that.isSetNewName(); + if (this_present_newName || that_present_newName) { + if (!(this_present_newName && that_present_newName)) + return false; + if (!this.newName.equals(that.newName)) + return false; + } + + boolean this_present_desc = true && this.isSetDesc(); + boolean that_present_desc = true && that.isSetDesc(); + if (this_present_desc || that_present_desc) { + if (!(this_present_desc && that_present_desc)) + return false; + if (!this.desc.equals(that.desc)) + return false; + } + + boolean this_present_image_path = true && this.isSetImage_path(); + boolean that_present_image_path = true && that.isSetImage_path(); + if (this_present_image_path || that_present_image_path) { + if (!(this_present_image_path && that_present_image_path)) + return false; + if (!this.image_path.equals(that.image_path)) + return false; + } + + boolean this_present_license = true; + boolean that_present_license = true; + if (this_present_license || that_present_license) { + if (!(this_present_license && that_present_license)) + return false; + if (this.license != that.license) + return false; + } + + boolean this_present_internet = true; + boolean that_present_internet = true; + if (this_present_internet || that_present_internet) { + if (!(this_present_internet && that_present_internet)) + return false; + if (this.internet != that.internet) + return false; + } + + boolean this_present_ram = true; + boolean that_present_ram = true; + if (this_present_ram || that_present_ram) { + if (!(this_present_ram && that_present_ram)) + return false; + if (this.ram != that.ram) + return false; + } + + boolean this_present_cpu = true; + boolean that_present_cpu = true; + if (this_present_cpu || that_present_cpu) { + if (!(this_present_cpu && that_present_cpu)) + return false; + if (this.cpu != that.cpu) + return false; + } + + boolean this_present_id = true && this.isSetId(); + boolean that_present_id = true && that.isSetId(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + boolean this_present_version = true && this.isSetVersion(); + boolean that_present_version = true && that.isSetVersion(); + if (this_present_version || that_present_version) { + if (!(this_present_version && that_present_version)) + return false; + if (!this.version.equals(that.version)) + return false; + } + + boolean this_present_isTemplate = true; + boolean that_present_isTemplate = true; + if (this_present_isTemplate || that_present_isTemplate) { + if (!(this_present_isTemplate && that_present_isTemplate)) + return false; + if (this.isTemplate != that.isTemplate) + return false; + } + + boolean this_present_filesize = true; + boolean that_present_filesize = true; + if (this_present_filesize || that_present_filesize) { + if (!(this_present_filesize && that_present_filesize)) + return false; + if (this.filesize != that.filesize) + return false; + } + + boolean this_present_shareMode = true; + boolean that_present_shareMode = true; + if (this_present_shareMode || that_present_shareMode) { + if (!(this_present_shareMode && that_present_shareMode)) + return false; + if (this.shareMode != that.shareMode) + return false; + } + + boolean this_present_os = true && this.isSetOs(); + boolean that_present_os = true && that.isSetOs(); + if (this_present_os || that_present_os) { + if (!(this_present_os && that_present_os)) + return false; + if (!this.os.equals(that.os)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(updateImageData_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNewName()).compareTo(other.isSetNewName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNewName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.newName, other.newName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDesc()).compareTo(other.isSetDesc()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDesc()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.desc, other.desc); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetImage_path()).compareTo(other.isSetImage_path()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImage_path()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.image_path, other.image_path); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLicense()).compareTo(other.isSetLicense()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLicense()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.license, other.license); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetInternet()).compareTo(other.isSetInternet()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetInternet()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internet, other.internet); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRam()).compareTo(other.isSetRam()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRam()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ram, other.ram); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetCpu()).compareTo(other.isSetCpu()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCpu()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cpu, other.cpu); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIsTemplate()).compareTo(other.isSetIsTemplate()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIsTemplate()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isTemplate, other.isTemplate); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFilesize()).compareTo(other.isSetFilesize()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFilesize()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filesize, other.filesize); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetShareMode()).compareTo(other.isSetShareMode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetShareMode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shareMode, other.shareMode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOs()).compareTo(other.isSetOs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.os, other.os); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("updateImageData_args("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + if (!first) sb.append(", "); + sb.append("newName:"); + if (this.newName == null) { + sb.append("null"); + } else { + sb.append(this.newName); + } + first = false; + if (!first) sb.append(", "); + sb.append("desc:"); + if (this.desc == null) { + sb.append("null"); + } else { + sb.append(this.desc); + } + first = false; + if (!first) sb.append(", "); + sb.append("image_path:"); + if (this.image_path == null) { + sb.append("null"); + } else { + sb.append(this.image_path); + } + first = false; + if (!first) sb.append(", "); + sb.append("license:"); + sb.append(this.license); + first = false; + if (!first) sb.append(", "); + sb.append("internet:"); + sb.append(this.internet); + first = false; + if (!first) sb.append(", "); + sb.append("ram:"); + sb.append(this.ram); + first = false; + if (!first) sb.append(", "); + sb.append("cpu:"); + sb.append(this.cpu); + first = false; + if (!first) sb.append(", "); + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + if (!first) sb.append(", "); + sb.append("version:"); + if (this.version == null) { + sb.append("null"); + } else { + sb.append(this.version); + } + first = false; + if (!first) sb.append(", "); + sb.append("isTemplate:"); + sb.append(this.isTemplate); + first = false; + if (!first) sb.append(", "); + sb.append("filesize:"); + sb.append(this.filesize); + first = false; + if (!first) sb.append(", "); + sb.append("shareMode:"); + sb.append(this.shareMode); + first = false; + if (!first) sb.append(", "); + sb.append("os:"); + if (this.os == null) { + sb.append("null"); + } else { + sb.append(this.os); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class updateImageData_argsStandardSchemeFactory implements SchemeFactory { + public updateImageData_argsStandardScheme getScheme() { + return new updateImageData_argsStandardScheme(); + } + } + + private static class updateImageData_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, updateImageData_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // NEW_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.newName = iprot.readString(); + struct.setNewNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -3: // DESC + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.desc = iprot.readString(); + struct.setDescIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -4: // IMAGE_PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.image_path = iprot.readString(); + struct.setImage_pathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -5: // LICENSE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.license = iprot.readBool(); + struct.setLicenseIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -6: // INTERNET + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.internet = iprot.readBool(); + struct.setInternetIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -7: // RAM + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.ram = iprot.readI64(); + struct.setRamIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -8: // CPU + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.cpu = iprot.readI64(); + struct.setCpuIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -9: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -10: // VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -11: // IS_TEMPLATE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.isTemplate = iprot.readBool(); + struct.setIsTemplateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -12: // FILESIZE + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.filesize = iprot.readI64(); + struct.setFilesizeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -13: // SHARE_MODE + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.shareMode = iprot.readI64(); + struct.setShareModeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -14: // OS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.os = iprot.readString(); + struct.setOsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, updateImageData_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.os != null) { + oprot.writeFieldBegin(OS_FIELD_DESC); + oprot.writeString(struct.os); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(SHARE_MODE_FIELD_DESC); + oprot.writeI64(struct.shareMode); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(FILESIZE_FIELD_DESC); + oprot.writeI64(struct.filesize); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_TEMPLATE_FIELD_DESC); + oprot.writeBool(struct.isTemplate); + oprot.writeFieldEnd(); + if (struct.version != null) { + oprot.writeFieldBegin(VERSION_FIELD_DESC); + oprot.writeString(struct.version); + oprot.writeFieldEnd(); + } + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(CPU_FIELD_DESC); + oprot.writeI64(struct.cpu); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(RAM_FIELD_DESC); + oprot.writeI64(struct.ram); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(INTERNET_FIELD_DESC); + oprot.writeBool(struct.internet); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(LICENSE_FIELD_DESC); + oprot.writeBool(struct.license); + oprot.writeFieldEnd(); + if (struct.image_path != null) { + oprot.writeFieldBegin(IMAGE_PATH_FIELD_DESC); + oprot.writeString(struct.image_path); + oprot.writeFieldEnd(); + } + if (struct.desc != null) { + oprot.writeFieldBegin(DESC_FIELD_DESC); + oprot.writeString(struct.desc); + oprot.writeFieldEnd(); + } + if (struct.newName != null) { + oprot.writeFieldBegin(NEW_NAME_FIELD_DESC); + oprot.writeString(struct.newName); + oprot.writeFieldEnd(); + } + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class updateImageData_argsTupleSchemeFactory implements SchemeFactory { + public updateImageData_argsTupleScheme getScheme() { + return new updateImageData_argsTupleScheme(); + } + } + + private static class updateImageData_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, updateImageData_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetName()) { + optionals.set(0); + } + if (struct.isSetNewName()) { + optionals.set(1); + } + if (struct.isSetDesc()) { + optionals.set(2); + } + if (struct.isSetImage_path()) { + optionals.set(3); + } + if (struct.isSetLicense()) { + optionals.set(4); + } + if (struct.isSetInternet()) { + optionals.set(5); + } + if (struct.isSetRam()) { + optionals.set(6); + } + if (struct.isSetCpu()) { + optionals.set(7); + } + if (struct.isSetId()) { + optionals.set(8); + } + if (struct.isSetVersion()) { + optionals.set(9); + } + if (struct.isSetIsTemplate()) { + optionals.set(10); + } + if (struct.isSetFilesize()) { + optionals.set(11); + } + if (struct.isSetShareMode()) { + optionals.set(12); + } + if (struct.isSetOs()) { + optionals.set(13); + } + oprot.writeBitSet(optionals, 14); + if (struct.isSetName()) { + oprot.writeString(struct.name); + } + if (struct.isSetNewName()) { + oprot.writeString(struct.newName); + } + if (struct.isSetDesc()) { + oprot.writeString(struct.desc); + } + if (struct.isSetImage_path()) { + oprot.writeString(struct.image_path); + } + if (struct.isSetLicense()) { + oprot.writeBool(struct.license); + } + if (struct.isSetInternet()) { + oprot.writeBool(struct.internet); + } + if (struct.isSetRam()) { + oprot.writeI64(struct.ram); + } + if (struct.isSetCpu()) { + oprot.writeI64(struct.cpu); + } + if (struct.isSetId()) { + oprot.writeString(struct.id); + } + if (struct.isSetVersion()) { + oprot.writeString(struct.version); + } + if (struct.isSetIsTemplate()) { + oprot.writeBool(struct.isTemplate); + } + if (struct.isSetFilesize()) { + oprot.writeI64(struct.filesize); + } + if (struct.isSetShareMode()) { + oprot.writeI64(struct.shareMode); + } + if (struct.isSetOs()) { + oprot.writeString(struct.os); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, updateImageData_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(14); + if (incoming.get(0)) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } + if (incoming.get(1)) { + struct.newName = iprot.readString(); + struct.setNewNameIsSet(true); + } + if (incoming.get(2)) { + struct.desc = iprot.readString(); + struct.setDescIsSet(true); + } + if (incoming.get(3)) { + struct.image_path = iprot.readString(); + struct.setImage_pathIsSet(true); + } + if (incoming.get(4)) { + struct.license = iprot.readBool(); + struct.setLicenseIsSet(true); + } + if (incoming.get(5)) { + struct.internet = iprot.readBool(); + struct.setInternetIsSet(true); + } + if (incoming.get(6)) { + struct.ram = iprot.readI64(); + struct.setRamIsSet(true); + } + if (incoming.get(7)) { + struct.cpu = iprot.readI64(); + struct.setCpuIsSet(true); + } + if (incoming.get(8)) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } + if (incoming.get(9)) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } + if (incoming.get(10)) { + struct.isTemplate = iprot.readBool(); + struct.setIsTemplateIsSet(true); + } + if (incoming.get(11)) { + struct.filesize = iprot.readI64(); + struct.setFilesizeIsSet(true); + } + if (incoming.get(12)) { + struct.shareMode = iprot.readI64(); + struct.setShareModeIsSet(true); + } + if (incoming.get(13)) { + struct.os = iprot.readString(); + struct.setOsIsSet(true); + } + } + } + + } + + public static class updateImageData_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateImageData_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new updateImageData_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new updateImageData_resultTupleSchemeFactory()); + } + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateImageData_result.class, metaDataMap); + } + + public updateImageData_result() { + } + + public updateImageData_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public updateImageData_result(updateImageData_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public updateImageData_result deepCopy() { + return new updateImageData_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public updateImageData_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof updateImageData_result) + return this.equals((updateImageData_result)that); + return false; + } + + public boolean equals(updateImageData_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(updateImageData_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("updateImageData_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class updateImageData_resultStandardSchemeFactory implements SchemeFactory { + public updateImageData_resultStandardScheme getScheme() { + return new updateImageData_resultStandardScheme(); + } + } + + private static class updateImageData_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, updateImageData_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, updateImageData_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class updateImageData_resultTupleSchemeFactory implements SchemeFactory { + public updateImageData_resultTupleScheme getScheme() { + return new updateImageData_resultTupleScheme(); + } + } + + private static class updateImageData_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, updateImageData_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, updateImageData_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class deleteImageData_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageData_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteImageData_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteImageData_argsTupleSchemeFactory()); + } + + public String id; // required + public String version; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + ID((short)-1, "id"), + VERSION((short)-2, "version"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // ID + return ID; + case -2: // VERSION + return VERSION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteImageData_args.class, metaDataMap); + } + + public deleteImageData_args() { + } + + public deleteImageData_args( + String id, + String version) + { + this(); + this.id = id; + this.version = version; + } + + /** + * Performs a deep copy on other. + */ + public deleteImageData_args(deleteImageData_args other) { + if (other.isSetId()) { + this.id = other.id; + } + if (other.isSetVersion()) { + this.version = other.version; + } + } + + public deleteImageData_args deepCopy() { + return new deleteImageData_args(this); + } + + @Override + public void clear() { + this.id = null; + this.version = null; + } + + public String getId() { + return this.id; + } + + public deleteImageData_args setId(String id) { + this.id = id; + return this; + } + + public void unsetId() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return this.id != null; + } + + public void setIdIsSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public String getVersion() { + return this.version; + } + + public deleteImageData_args setVersion(String version) { + this.version = version; + return this; + } + + public void unsetVersion() { + this.version = null; + } + + /** Returns true if field version is set (has been assigned a value) and false otherwise */ + public boolean isSetVersion() { + return this.version != null; + } + + public void setVersionIsSet(boolean value) { + if (!value) { + this.version = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unsetId(); + } else { + setId((String)value); + } + break; + + case VERSION: + if (value == null) { + unsetVersion(); + } else { + setVersion((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return getId(); + + case VERSION: + return getVersion(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case ID: + return isSetId(); + case VERSION: + return isSetVersion(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteImageData_args) + return this.equals((deleteImageData_args)that); + return false; + } + + public boolean equals(deleteImageData_args that) { + if (that == null) + return false; + + boolean this_present_id = true && this.isSetId(); + boolean that_present_id = true && that.isSetId(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + boolean this_present_version = true && this.isSetVersion(); + boolean that_present_version = true && that.isSetVersion(); + if (this_present_version || that_present_version) { + if (!(this_present_version && that_present_version)) + return false; + if (!this.version.equals(that.version)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(deleteImageData_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("deleteImageData_args("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + if (!first) sb.append(", "); + sb.append("version:"); + if (this.version == null) { + sb.append("null"); + } else { + sb.append(this.version); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class deleteImageData_argsStandardSchemeFactory implements SchemeFactory { + public deleteImageData_argsStandardScheme getScheme() { + return new deleteImageData_argsStandardScheme(); + } + } + + private static class deleteImageData_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageData_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, deleteImageData_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.version != null) { + oprot.writeFieldBegin(VERSION_FIELD_DESC); + oprot.writeString(struct.version); + oprot.writeFieldEnd(); + } + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteImageData_argsTupleSchemeFactory implements SchemeFactory { + public deleteImageData_argsTupleScheme getScheme() { + return new deleteImageData_argsTupleScheme(); + } + } + + private static class deleteImageData_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageData_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + if (struct.isSetVersion()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetId()) { + oprot.writeString(struct.id); + } + if (struct.isSetVersion()) { + oprot.writeString(struct.version); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageData_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } + if (incoming.get(1)) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } + } + } + + } + + public static class deleteImageData_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageData_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteImageData_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteImageData_resultTupleSchemeFactory()); + } + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteImageData_result.class, metaDataMap); + } + + public deleteImageData_result() { + } + + public deleteImageData_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public deleteImageData_result(deleteImageData_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public deleteImageData_result deepCopy() { + return new deleteImageData_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public deleteImageData_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteImageData_result) + return this.equals((deleteImageData_result)that); + return false; + } + + public boolean equals(deleteImageData_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(deleteImageData_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("deleteImageData_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class deleteImageData_resultStandardSchemeFactory implements SchemeFactory { + public deleteImageData_resultStandardScheme getScheme() { + return new deleteImageData_resultStandardScheme(); + } + } + + private static class deleteImageData_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageData_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, deleteImageData_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteImageData_resultTupleSchemeFactory implements SchemeFactory { + public deleteImageData_resultTupleScheme getScheme() { + return new deleteImageData_resultTupleScheme(); + } + } + + private static class deleteImageData_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageData_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageData_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class updateLecturedata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateLecturedata_args"); + + private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField NEW_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("newName", org.apache.thrift.protocol.TType.STRING, (short)-2); + private static final org.apache.thrift.protocol.TField SHORTDESC_FIELD_DESC = new org.apache.thrift.protocol.TField("shortdesc", org.apache.thrift.protocol.TType.STRING, (short)-3); + private static final org.apache.thrift.protocol.TField DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("desc", org.apache.thrift.protocol.TType.STRING, (short)-4); + private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.STRING, (short)-5); + private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.STRING, (short)-6); + private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.BOOL, (short)-7); + private static final org.apache.thrift.protocol.TField IMAGEID_FIELD_DESC = new org.apache.thrift.protocol.TField("imageid", org.apache.thrift.protocol.TType.STRING, (short)-8); + private static final org.apache.thrift.protocol.TField IMAGEVERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("imageversion", org.apache.thrift.protocol.TType.STRING, (short)-9); + private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRING, (short)-10); + private static final org.apache.thrift.protocol.TField FIRSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstname", org.apache.thrift.protocol.TType.STRING, (short)-11); + private static final org.apache.thrift.protocol.TField LASTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastname", org.apache.thrift.protocol.TType.STRING, (short)-12); + private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-13); + private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("Mail", org.apache.thrift.protocol.TType.STRING, (short)-14); + private static final org.apache.thrift.protocol.TField TEL_FIELD_DESC = new org.apache.thrift.protocol.TField("Tel", org.apache.thrift.protocol.TType.STRING, (short)-15); + private static final org.apache.thrift.protocol.TField FAK_FIELD_DESC = new org.apache.thrift.protocol.TField("Fak", org.apache.thrift.protocol.TType.STRING, (short)-16); + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-17); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new updateLecturedata_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new updateLecturedata_argsTupleSchemeFactory()); + } + + public String name; // required + public String newName; // required + public String shortdesc; // required + public String desc; // required + public String startDate; // required + public String endDate; // required + public boolean isActive; // required + public String imageid; // required + public String imageversion; // required + public String user; // required + public String firstname; // required + public String lastname; // required + public String university; // required + public String Mail; // required + public String Tel; // required + public String Fak; // required + public String id; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + NAME((short)-1, "name"), + NEW_NAME((short)-2, "newName"), + SHORTDESC((short)-3, "shortdesc"), + DESC((short)-4, "desc"), + START_DATE((short)-5, "startDate"), + END_DATE((short)-6, "endDate"), + IS_ACTIVE((short)-7, "isActive"), + IMAGEID((short)-8, "imageid"), + IMAGEVERSION((short)-9, "imageversion"), + USER((short)-10, "user"), + FIRSTNAME((short)-11, "firstname"), + LASTNAME((short)-12, "lastname"), + UNIVERSITY((short)-13, "university"), + MAIL((short)-14, "Mail"), + TEL((short)-15, "Tel"), + FAK((short)-16, "Fak"), + ID((short)-17, "id"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // NAME + return NAME; + case -2: // NEW_NAME + return NEW_NAME; + case -3: // SHORTDESC + return SHORTDESC; + case -4: // DESC + return DESC; + case -5: // START_DATE + return START_DATE; + case -6: // END_DATE + return END_DATE; + case -7: // IS_ACTIVE + return IS_ACTIVE; + case -8: // IMAGEID + return IMAGEID; + case -9: // IMAGEVERSION + return IMAGEVERSION; + case -10: // USER + return USER; + case -11: // FIRSTNAME + return FIRSTNAME; + case -12: // LASTNAME + return LASTNAME; + case -13: // UNIVERSITY + return UNIVERSITY; + case -14: // MAIL + return MAIL; + case -15: // TEL + return TEL; + case -16: // FAK + return FAK; + case -17: // ID + return ID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __ISACTIVE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NEW_NAME, new org.apache.thrift.meta_data.FieldMetaData("newName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SHORTDESC, new org.apache.thrift.meta_data.FieldMetaData("shortdesc", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.DESC, new org.apache.thrift.meta_data.FieldMetaData("desc", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.IMAGEID, new org.apache.thrift.meta_data.FieldMetaData("imageid", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IMAGEVERSION, new org.apache.thrift.meta_data.FieldMetaData("imageversion", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.FIRSTNAME, new org.apache.thrift.meta_data.FieldMetaData("firstname", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LASTNAME, new org.apache.thrift.meta_data.FieldMetaData("lastname", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("Mail", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TEL, new org.apache.thrift.meta_data.FieldMetaData("Tel", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.FAK, new org.apache.thrift.meta_data.FieldMetaData("Fak", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateLecturedata_args.class, metaDataMap); + } + + public updateLecturedata_args() { + } + + public updateLecturedata_args( + String name, + String newName, + String shortdesc, + String desc, + String startDate, + String endDate, + boolean isActive, + String imageid, + String imageversion, + String user, + String firstname, + String lastname, + String university, + String Mail, + String Tel, + String Fak, + String id) + { + this(); + this.name = name; + this.newName = newName; + this.shortdesc = shortdesc; + this.desc = desc; + this.startDate = startDate; + this.endDate = endDate; + this.isActive = isActive; + setIsActiveIsSet(true); + this.imageid = imageid; + this.imageversion = imageversion; + this.user = user; + this.firstname = firstname; + this.lastname = lastname; + this.university = university; + this.Mail = Mail; + this.Tel = Tel; + this.Fak = Fak; + this.id = id; + } + + /** + * Performs a deep copy on other. + */ + public updateLecturedata_args(updateLecturedata_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetName()) { + this.name = other.name; + } + if (other.isSetNewName()) { + this.newName = other.newName; + } + if (other.isSetShortdesc()) { + this.shortdesc = other.shortdesc; + } + if (other.isSetDesc()) { + this.desc = other.desc; + } + if (other.isSetStartDate()) { + this.startDate = other.startDate; + } + if (other.isSetEndDate()) { + this.endDate = other.endDate; + } + this.isActive = other.isActive; + if (other.isSetImageid()) { + this.imageid = other.imageid; + } + if (other.isSetImageversion()) { + this.imageversion = other.imageversion; + } + if (other.isSetUser()) { + this.user = other.user; + } + if (other.isSetFirstname()) { + this.firstname = other.firstname; + } + if (other.isSetLastname()) { + this.lastname = other.lastname; + } + if (other.isSetUniversity()) { + this.university = other.university; + } + if (other.isSetMail()) { + this.Mail = other.Mail; + } + if (other.isSetTel()) { + this.Tel = other.Tel; + } + if (other.isSetFak()) { + this.Fak = other.Fak; + } + if (other.isSetId()) { + this.id = other.id; + } + } + + public updateLecturedata_args deepCopy() { + return new updateLecturedata_args(this); + } + + @Override + public void clear() { + this.name = null; + this.newName = null; + this.shortdesc = null; + this.desc = null; + this.startDate = null; + this.endDate = null; + setIsActiveIsSet(false); + this.isActive = false; + this.imageid = null; + this.imageversion = null; + this.user = null; + this.firstname = null; + this.lastname = null; + this.university = null; + this.Mail = null; + this.Tel = null; + this.Fak = null; + this.id = null; + } + + public String getName() { + return this.name; + } + + public updateLecturedata_args setName(String name) { + this.name = name; + return this; + } + + public void unsetName() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean isSetName() { + return this.name != null; + } + + public void setNameIsSet(boolean value) { + if (!value) { + this.name = null; + } + } + + public String getNewName() { + return this.newName; + } + + public updateLecturedata_args setNewName(String newName) { + this.newName = newName; + return this; + } + + public void unsetNewName() { + this.newName = null; + } + + /** Returns true if field newName is set (has been assigned a value) and false otherwise */ + public boolean isSetNewName() { + return this.newName != null; + } + + public void setNewNameIsSet(boolean value) { + if (!value) { + this.newName = null; + } + } + + public String getShortdesc() { + return this.shortdesc; + } + + public updateLecturedata_args setShortdesc(String shortdesc) { + this.shortdesc = shortdesc; + return this; + } + + public void unsetShortdesc() { + this.shortdesc = null; + } + + /** Returns true if field shortdesc is set (has been assigned a value) and false otherwise */ + public boolean isSetShortdesc() { + return this.shortdesc != null; + } + + public void setShortdescIsSet(boolean value) { + if (!value) { + this.shortdesc = null; + } + } + + public String getDesc() { + return this.desc; + } + + public updateLecturedata_args setDesc(String desc) { + this.desc = desc; + return this; + } + + public void unsetDesc() { + this.desc = null; + } + + /** Returns true if field desc is set (has been assigned a value) and false otherwise */ + public boolean isSetDesc() { + return this.desc != null; + } + + public void setDescIsSet(boolean value) { + if (!value) { + this.desc = null; + } + } + + public String getStartDate() { + return this.startDate; + } + + public updateLecturedata_args setStartDate(String startDate) { + this.startDate = startDate; + return this; + } + + public void unsetStartDate() { + this.startDate = null; + } + + /** Returns true if field startDate is set (has been assigned a value) and false otherwise */ + public boolean isSetStartDate() { + return this.startDate != null; + } + + public void setStartDateIsSet(boolean value) { + if (!value) { + this.startDate = null; + } + } + + public String getEndDate() { + return this.endDate; + } + + public updateLecturedata_args setEndDate(String endDate) { + this.endDate = endDate; + return this; + } + + public void unsetEndDate() { + this.endDate = null; + } + + /** Returns true if field endDate is set (has been assigned a value) and false otherwise */ + public boolean isSetEndDate() { + return this.endDate != null; + } + + public void setEndDateIsSet(boolean value) { + if (!value) { + this.endDate = null; + } + } + + public boolean isIsActive() { + return this.isActive; + } + + public updateLecturedata_args setIsActive(boolean isActive) { + this.isActive = isActive; + setIsActiveIsSet(true); + return this; + } + + public void unsetIsActive() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISACTIVE_ISSET_ID); + } + + /** Returns true if field isActive is set (has been assigned a value) and false otherwise */ + public boolean isSetIsActive() { + return EncodingUtils.testBit(__isset_bitfield, __ISACTIVE_ISSET_ID); + } + + public void setIsActiveIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISACTIVE_ISSET_ID, value); + } + + public String getImageid() { + return this.imageid; + } + + public updateLecturedata_args setImageid(String imageid) { + this.imageid = imageid; + return this; + } + + public void unsetImageid() { + this.imageid = null; + } + + /** Returns true if field imageid is set (has been assigned a value) and false otherwise */ + public boolean isSetImageid() { + return this.imageid != null; + } + + public void setImageidIsSet(boolean value) { + if (!value) { + this.imageid = null; + } + } + + public String getImageversion() { + return this.imageversion; + } + + public updateLecturedata_args setImageversion(String imageversion) { + this.imageversion = imageversion; + return this; + } + + public void unsetImageversion() { + this.imageversion = null; + } + + /** Returns true if field imageversion is set (has been assigned a value) and false otherwise */ + public boolean isSetImageversion() { + return this.imageversion != null; + } + + public void setImageversionIsSet(boolean value) { + if (!value) { + this.imageversion = null; + } + } + + public String getUser() { + return this.user; + } + + public updateLecturedata_args setUser(String user) { + this.user = user; + return this; + } + + public void unsetUser() { + this.user = null; + } + + /** Returns true if field user is set (has been assigned a value) and false otherwise */ + public boolean isSetUser() { + return this.user != null; + } + + public void setUserIsSet(boolean value) { + if (!value) { + this.user = null; + } + } + + public String getFirstname() { + return this.firstname; + } + + public updateLecturedata_args setFirstname(String firstname) { + this.firstname = firstname; + return this; + } + + public void unsetFirstname() { + this.firstname = null; + } + + /** Returns true if field firstname is set (has been assigned a value) and false otherwise */ + public boolean isSetFirstname() { + return this.firstname != null; + } + + public void setFirstnameIsSet(boolean value) { + if (!value) { + this.firstname = null; + } + } + + public String getLastname() { + return this.lastname; + } + + public updateLecturedata_args setLastname(String lastname) { + this.lastname = lastname; + return this; + } + + public void unsetLastname() { + this.lastname = null; + } + + /** Returns true if field lastname is set (has been assigned a value) and false otherwise */ + public boolean isSetLastname() { + return this.lastname != null; + } + + public void setLastnameIsSet(boolean value) { + if (!value) { + this.lastname = null; + } + } + + public String getUniversity() { + return this.university; + } + + public updateLecturedata_args setUniversity(String university) { + this.university = university; + return this; + } + + public void unsetUniversity() { + this.university = null; + } + + /** Returns true if field university is set (has been assigned a value) and false otherwise */ + public boolean isSetUniversity() { + return this.university != null; + } + + public void setUniversityIsSet(boolean value) { + if (!value) { + this.university = null; + } + } + + public String getMail() { + return this.Mail; + } + + public updateLecturedata_args setMail(String Mail) { + this.Mail = Mail; + return this; + } + + public void unsetMail() { + this.Mail = null; + } + + /** Returns true if field Mail is set (has been assigned a value) and false otherwise */ + public boolean isSetMail() { + return this.Mail != null; + } + + public void setMailIsSet(boolean value) { + if (!value) { + this.Mail = null; + } + } + + public String getTel() { + return this.Tel; + } + + public updateLecturedata_args setTel(String Tel) { + this.Tel = Tel; + return this; + } + + public void unsetTel() { + this.Tel = null; + } + + /** Returns true if field Tel is set (has been assigned a value) and false otherwise */ + public boolean isSetTel() { + return this.Tel != null; + } + + public void setTelIsSet(boolean value) { + if (!value) { + this.Tel = null; + } + } + + public String getFak() { + return this.Fak; + } + + public updateLecturedata_args setFak(String Fak) { + this.Fak = Fak; + return this; + } + + public void unsetFak() { + this.Fak = null; + } + + /** Returns true if field Fak is set (has been assigned a value) and false otherwise */ + public boolean isSetFak() { + return this.Fak != null; + } + + public void setFakIsSet(boolean value) { + if (!value) { + this.Fak = null; + } + } + + public String getId() { + return this.id; + } + + public updateLecturedata_args setId(String id) { + this.id = id; + return this; + } + + public void unsetId() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return this.id != null; + } + + public void setIdIsSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NAME: + if (value == null) { + unsetName(); + } else { + setName((String)value); + } + break; + + case NEW_NAME: + if (value == null) { + unsetNewName(); + } else { + setNewName((String)value); + } + break; + + case SHORTDESC: + if (value == null) { + unsetShortdesc(); + } else { + setShortdesc((String)value); + } + break; + + case DESC: + if (value == null) { + unsetDesc(); + } else { + setDesc((String)value); + } + break; + + case START_DATE: + if (value == null) { + unsetStartDate(); + } else { + setStartDate((String)value); + } + break; + + case END_DATE: + if (value == null) { + unsetEndDate(); + } else { + setEndDate((String)value); + } + break; + + case IS_ACTIVE: + if (value == null) { + unsetIsActive(); + } else { + setIsActive((Boolean)value); + } + break; + + case IMAGEID: + if (value == null) { + unsetImageid(); + } else { + setImageid((String)value); + } + break; + + case IMAGEVERSION: + if (value == null) { + unsetImageversion(); + } else { + setImageversion((String)value); + } + break; + + case USER: + if (value == null) { + unsetUser(); + } else { + setUser((String)value); + } + break; + + case FIRSTNAME: + if (value == null) { + unsetFirstname(); + } else { + setFirstname((String)value); + } + break; + + case LASTNAME: + if (value == null) { + unsetLastname(); + } else { + setLastname((String)value); + } + break; + + case UNIVERSITY: + if (value == null) { + unsetUniversity(); + } else { + setUniversity((String)value); + } + break; + + case MAIL: + if (value == null) { + unsetMail(); + } else { + setMail((String)value); + } + break; + + case TEL: + if (value == null) { + unsetTel(); + } else { + setTel((String)value); + } + break; + + case FAK: + if (value == null) { + unsetFak(); + } else { + setFak((String)value); + } + break; + + case ID: + if (value == null) { + unsetId(); + } else { + setId((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return getName(); + + case NEW_NAME: + return getNewName(); + + case SHORTDESC: + return getShortdesc(); + + case DESC: + return getDesc(); + + case START_DATE: + return getStartDate(); + + case END_DATE: + return getEndDate(); + + case IS_ACTIVE: + return Boolean.valueOf(isIsActive()); + + case IMAGEID: + return getImageid(); + + case IMAGEVERSION: + return getImageversion(); + + case USER: + return getUser(); + + case FIRSTNAME: + return getFirstname(); + + case LASTNAME: + return getLastname(); + + case UNIVERSITY: + return getUniversity(); + + case MAIL: + return getMail(); + + case TEL: + return getTel(); + + case FAK: + return getFak(); + + case ID: + return getId(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case NAME: + return isSetName(); + case NEW_NAME: + return isSetNewName(); + case SHORTDESC: + return isSetShortdesc(); + case DESC: + return isSetDesc(); + case START_DATE: + return isSetStartDate(); + case END_DATE: + return isSetEndDate(); + case IS_ACTIVE: + return isSetIsActive(); + case IMAGEID: + return isSetImageid(); + case IMAGEVERSION: + return isSetImageversion(); + case USER: + return isSetUser(); + case FIRSTNAME: + return isSetFirstname(); + case LASTNAME: + return isSetLastname(); + case UNIVERSITY: + return isSetUniversity(); + case MAIL: + return isSetMail(); + case TEL: + return isSetTel(); + case FAK: + return isSetFak(); + case ID: + return isSetId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof updateLecturedata_args) + return this.equals((updateLecturedata_args)that); + return false; + } + + public boolean equals(updateLecturedata_args that) { + if (that == null) + return false; + + boolean this_present_name = true && this.isSetName(); + boolean that_present_name = true && that.isSetName(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + boolean this_present_newName = true && this.isSetNewName(); + boolean that_present_newName = true && that.isSetNewName(); + if (this_present_newName || that_present_newName) { + if (!(this_present_newName && that_present_newName)) + return false; + if (!this.newName.equals(that.newName)) + return false; + } + + boolean this_present_shortdesc = true && this.isSetShortdesc(); + boolean that_present_shortdesc = true && that.isSetShortdesc(); + if (this_present_shortdesc || that_present_shortdesc) { + if (!(this_present_shortdesc && that_present_shortdesc)) + return false; + if (!this.shortdesc.equals(that.shortdesc)) + return false; + } + + boolean this_present_desc = true && this.isSetDesc(); + boolean that_present_desc = true && that.isSetDesc(); + if (this_present_desc || that_present_desc) { + if (!(this_present_desc && that_present_desc)) + return false; + if (!this.desc.equals(that.desc)) + return false; + } + + boolean this_present_startDate = true && this.isSetStartDate(); + boolean that_present_startDate = true && that.isSetStartDate(); + if (this_present_startDate || that_present_startDate) { + if (!(this_present_startDate && that_present_startDate)) + return false; + if (!this.startDate.equals(that.startDate)) + return false; + } + + boolean this_present_endDate = true && this.isSetEndDate(); + boolean that_present_endDate = true && that.isSetEndDate(); + if (this_present_endDate || that_present_endDate) { + if (!(this_present_endDate && that_present_endDate)) + return false; + if (!this.endDate.equals(that.endDate)) + return false; + } + + boolean this_present_isActive = true; + boolean that_present_isActive = true; + if (this_present_isActive || that_present_isActive) { + if (!(this_present_isActive && that_present_isActive)) + return false; + if (this.isActive != that.isActive) + return false; + } + + boolean this_present_imageid = true && this.isSetImageid(); + boolean that_present_imageid = true && that.isSetImageid(); + if (this_present_imageid || that_present_imageid) { + if (!(this_present_imageid && that_present_imageid)) + return false; + if (!this.imageid.equals(that.imageid)) + return false; + } + + boolean this_present_imageversion = true && this.isSetImageversion(); + boolean that_present_imageversion = true && that.isSetImageversion(); + if (this_present_imageversion || that_present_imageversion) { + if (!(this_present_imageversion && that_present_imageversion)) + return false; + if (!this.imageversion.equals(that.imageversion)) + return false; + } + + boolean this_present_user = true && this.isSetUser(); + boolean that_present_user = true && that.isSetUser(); + if (this_present_user || that_present_user) { + if (!(this_present_user && that_present_user)) + return false; + if (!this.user.equals(that.user)) + return false; + } + + boolean this_present_firstname = true && this.isSetFirstname(); + boolean that_present_firstname = true && that.isSetFirstname(); + if (this_present_firstname || that_present_firstname) { + if (!(this_present_firstname && that_present_firstname)) + return false; + if (!this.firstname.equals(that.firstname)) + return false; + } + + boolean this_present_lastname = true && this.isSetLastname(); + boolean that_present_lastname = true && that.isSetLastname(); + if (this_present_lastname || that_present_lastname) { + if (!(this_present_lastname && that_present_lastname)) + return false; + if (!this.lastname.equals(that.lastname)) + return false; + } + + boolean this_present_university = true && this.isSetUniversity(); + boolean that_present_university = true && that.isSetUniversity(); + if (this_present_university || that_present_university) { + if (!(this_present_university && that_present_university)) + return false; + if (!this.university.equals(that.university)) + return false; + } + + boolean this_present_Mail = true && this.isSetMail(); + boolean that_present_Mail = true && that.isSetMail(); + if (this_present_Mail || that_present_Mail) { + if (!(this_present_Mail && that_present_Mail)) + return false; + if (!this.Mail.equals(that.Mail)) + return false; + } + + boolean this_present_Tel = true && this.isSetTel(); + boolean that_present_Tel = true && that.isSetTel(); + if (this_present_Tel || that_present_Tel) { + if (!(this_present_Tel && that_present_Tel)) + return false; + if (!this.Tel.equals(that.Tel)) + return false; + } + + boolean this_present_Fak = true && this.isSetFak(); + boolean that_present_Fak = true && that.isSetFak(); + if (this_present_Fak || that_present_Fak) { + if (!(this_present_Fak && that_present_Fak)) + return false; + if (!this.Fak.equals(that.Fak)) + return false; + } + + boolean this_present_id = true && this.isSetId(); + boolean that_present_id = true && that.isSetId(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(updateLecturedata_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNewName()).compareTo(other.isSetNewName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNewName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.newName, other.newName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetShortdesc()).compareTo(other.isSetShortdesc()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetShortdesc()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shortdesc, other.shortdesc); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDesc()).compareTo(other.isSetDesc()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDesc()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.desc, other.desc); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(other.isSetStartDate()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartDate()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, other.startDate); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(other.isSetEndDate()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEndDate()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, other.endDate); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(other.isSetIsActive()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIsActive()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isActive, other.isActive); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetImageid()).compareTo(other.isSetImageid()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImageid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageid, other.imageid); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetImageversion()).compareTo(other.isSetImageversion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImageversion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageversion, other.imageversion); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUser()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFirstname()).compareTo(other.isSetFirstname()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFirstname()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstname, other.firstname); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLastname()).compareTo(other.isSetLastname()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLastname()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastname, other.lastname); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUniversity()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMail()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Mail, other.Mail); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTel()).compareTo(other.isSetTel()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTel()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Tel, other.Tel); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFak()).compareTo(other.isSetFak()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFak()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Fak, other.Fak); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("updateLecturedata_args("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + if (!first) sb.append(", "); + sb.append("newName:"); + if (this.newName == null) { + sb.append("null"); + } else { + sb.append(this.newName); + } + first = false; + if (!first) sb.append(", "); + sb.append("shortdesc:"); + if (this.shortdesc == null) { + sb.append("null"); + } else { + sb.append(this.shortdesc); + } + first = false; + if (!first) sb.append(", "); + sb.append("desc:"); + if (this.desc == null) { + sb.append("null"); + } else { + sb.append(this.desc); + } + first = false; + if (!first) sb.append(", "); + sb.append("startDate:"); + if (this.startDate == null) { + sb.append("null"); + } else { + sb.append(this.startDate); + } + first = false; + if (!first) sb.append(", "); + sb.append("endDate:"); + if (this.endDate == null) { + sb.append("null"); + } else { + sb.append(this.endDate); + } + first = false; + if (!first) sb.append(", "); + sb.append("isActive:"); + sb.append(this.isActive); + first = false; + if (!first) sb.append(", "); + sb.append("imageid:"); + if (this.imageid == null) { + sb.append("null"); + } else { + sb.append(this.imageid); + } + first = false; + if (!first) sb.append(", "); + sb.append("imageversion:"); + if (this.imageversion == null) { + sb.append("null"); + } else { + sb.append(this.imageversion); + } + first = false; + if (!first) sb.append(", "); + sb.append("user:"); + if (this.user == null) { + sb.append("null"); + } else { + sb.append(this.user); + } + first = false; + if (!first) sb.append(", "); + sb.append("firstname:"); + if (this.firstname == null) { + sb.append("null"); + } else { + sb.append(this.firstname); + } + first = false; + if (!first) sb.append(", "); + sb.append("lastname:"); + if (this.lastname == null) { + sb.append("null"); + } else { + sb.append(this.lastname); + } + first = false; + if (!first) sb.append(", "); + sb.append("university:"); + if (this.university == null) { + sb.append("null"); + } else { + sb.append(this.university); + } + first = false; + if (!first) sb.append(", "); + sb.append("Mail:"); + if (this.Mail == null) { + sb.append("null"); + } else { + sb.append(this.Mail); + } + first = false; + if (!first) sb.append(", "); + sb.append("Tel:"); + if (this.Tel == null) { + sb.append("null"); + } else { + sb.append(this.Tel); + } + first = false; + if (!first) sb.append(", "); + sb.append("Fak:"); + if (this.Fak == null) { + sb.append("null"); + } else { + sb.append(this.Fak); + } + first = false; + if (!first) sb.append(", "); + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class updateLecturedata_argsStandardSchemeFactory implements SchemeFactory { + public updateLecturedata_argsStandardScheme getScheme() { + return new updateLecturedata_argsStandardScheme(); + } + } + + private static class updateLecturedata_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, updateLecturedata_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // NEW_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.newName = iprot.readString(); + struct.setNewNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -3: // SHORTDESC + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.shortdesc = iprot.readString(); + struct.setShortdescIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -4: // DESC + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.desc = iprot.readString(); + struct.setDescIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -5: // START_DATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.startDate = iprot.readString(); + struct.setStartDateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -6: // END_DATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.endDate = iprot.readString(); + struct.setEndDateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -7: // IS_ACTIVE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.isActive = iprot.readBool(); + struct.setIsActiveIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -8: // IMAGEID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imageid = iprot.readString(); + struct.setImageidIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -9: // IMAGEVERSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imageversion = iprot.readString(); + struct.setImageversionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -10: // USER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.user = iprot.readString(); + struct.setUserIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -11: // FIRSTNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.firstname = iprot.readString(); + struct.setFirstnameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -12: // LASTNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.lastname = iprot.readString(); + struct.setLastnameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -13: // UNIVERSITY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.university = iprot.readString(); + struct.setUniversityIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -14: // MAIL + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Mail = iprot.readString(); + struct.setMailIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -15: // TEL + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Tel = iprot.readString(); + struct.setTelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -16: // FAK + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Fak = iprot.readString(); + struct.setFakIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -17: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, updateLecturedata_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + if (struct.Fak != null) { + oprot.writeFieldBegin(FAK_FIELD_DESC); + oprot.writeString(struct.Fak); + oprot.writeFieldEnd(); + } + if (struct.Tel != null) { + oprot.writeFieldBegin(TEL_FIELD_DESC); + oprot.writeString(struct.Tel); + oprot.writeFieldEnd(); + } + if (struct.Mail != null) { + oprot.writeFieldBegin(MAIL_FIELD_DESC); + oprot.writeString(struct.Mail); + oprot.writeFieldEnd(); + } + if (struct.university != null) { + oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC); + oprot.writeString(struct.university); + oprot.writeFieldEnd(); + } + if (struct.lastname != null) { + oprot.writeFieldBegin(LASTNAME_FIELD_DESC); + oprot.writeString(struct.lastname); + oprot.writeFieldEnd(); + } + if (struct.firstname != null) { + oprot.writeFieldBegin(FIRSTNAME_FIELD_DESC); + oprot.writeString(struct.firstname); + oprot.writeFieldEnd(); + } + if (struct.user != null) { + oprot.writeFieldBegin(USER_FIELD_DESC); + oprot.writeString(struct.user); + oprot.writeFieldEnd(); + } + if (struct.imageversion != null) { + oprot.writeFieldBegin(IMAGEVERSION_FIELD_DESC); + oprot.writeString(struct.imageversion); + oprot.writeFieldEnd(); + } + if (struct.imageid != null) { + oprot.writeFieldBegin(IMAGEID_FIELD_DESC); + oprot.writeString(struct.imageid); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC); + oprot.writeBool(struct.isActive); + oprot.writeFieldEnd(); + if (struct.endDate != null) { + oprot.writeFieldBegin(END_DATE_FIELD_DESC); + oprot.writeString(struct.endDate); + oprot.writeFieldEnd(); + } + if (struct.startDate != null) { + oprot.writeFieldBegin(START_DATE_FIELD_DESC); + oprot.writeString(struct.startDate); + oprot.writeFieldEnd(); + } + if (struct.desc != null) { + oprot.writeFieldBegin(DESC_FIELD_DESC); + oprot.writeString(struct.desc); + oprot.writeFieldEnd(); + } + if (struct.shortdesc != null) { + oprot.writeFieldBegin(SHORTDESC_FIELD_DESC); + oprot.writeString(struct.shortdesc); + oprot.writeFieldEnd(); + } + if (struct.newName != null) { + oprot.writeFieldBegin(NEW_NAME_FIELD_DESC); + oprot.writeString(struct.newName); + oprot.writeFieldEnd(); + } + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class updateLecturedata_argsTupleSchemeFactory implements SchemeFactory { + public updateLecturedata_argsTupleScheme getScheme() { + return new updateLecturedata_argsTupleScheme(); + } + } + + private static class updateLecturedata_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetName()) { + optionals.set(0); + } + if (struct.isSetNewName()) { + optionals.set(1); + } + if (struct.isSetShortdesc()) { + optionals.set(2); + } + if (struct.isSetDesc()) { + optionals.set(3); + } + if (struct.isSetStartDate()) { + optionals.set(4); + } + if (struct.isSetEndDate()) { + optionals.set(5); + } + if (struct.isSetIsActive()) { + optionals.set(6); + } + if (struct.isSetImageid()) { + optionals.set(7); + } + if (struct.isSetImageversion()) { + optionals.set(8); + } + if (struct.isSetUser()) { + optionals.set(9); + } + if (struct.isSetFirstname()) { + optionals.set(10); + } + if (struct.isSetLastname()) { + optionals.set(11); + } + if (struct.isSetUniversity()) { + optionals.set(12); + } + if (struct.isSetMail()) { + optionals.set(13); + } + if (struct.isSetTel()) { + optionals.set(14); + } + if (struct.isSetFak()) { + optionals.set(15); + } + if (struct.isSetId()) { + optionals.set(16); + } + oprot.writeBitSet(optionals, 17); + if (struct.isSetName()) { + oprot.writeString(struct.name); + } + if (struct.isSetNewName()) { + oprot.writeString(struct.newName); + } + if (struct.isSetShortdesc()) { + oprot.writeString(struct.shortdesc); + } + if (struct.isSetDesc()) { + oprot.writeString(struct.desc); + } + if (struct.isSetStartDate()) { + oprot.writeString(struct.startDate); + } + if (struct.isSetEndDate()) { + oprot.writeString(struct.endDate); + } + if (struct.isSetIsActive()) { + oprot.writeBool(struct.isActive); + } + if (struct.isSetImageid()) { + oprot.writeString(struct.imageid); + } + if (struct.isSetImageversion()) { + oprot.writeString(struct.imageversion); + } + if (struct.isSetUser()) { + oprot.writeString(struct.user); + } + if (struct.isSetFirstname()) { + oprot.writeString(struct.firstname); + } + if (struct.isSetLastname()) { + oprot.writeString(struct.lastname); + } + if (struct.isSetUniversity()) { + oprot.writeString(struct.university); + } + if (struct.isSetMail()) { + oprot.writeString(struct.Mail); + } + if (struct.isSetTel()) { + oprot.writeString(struct.Tel); + } + if (struct.isSetFak()) { + oprot.writeString(struct.Fak); + } + if (struct.isSetId()) { + oprot.writeString(struct.id); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(17); + if (incoming.get(0)) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } + if (incoming.get(1)) { + struct.newName = iprot.readString(); + struct.setNewNameIsSet(true); + } + if (incoming.get(2)) { + struct.shortdesc = iprot.readString(); + struct.setShortdescIsSet(true); + } + if (incoming.get(3)) { + struct.desc = iprot.readString(); + struct.setDescIsSet(true); + } + if (incoming.get(4)) { + struct.startDate = iprot.readString(); + struct.setStartDateIsSet(true); + } + if (incoming.get(5)) { + struct.endDate = iprot.readString(); + struct.setEndDateIsSet(true); + } + if (incoming.get(6)) { + struct.isActive = iprot.readBool(); + struct.setIsActiveIsSet(true); + } + if (incoming.get(7)) { + struct.imageid = iprot.readString(); + struct.setImageidIsSet(true); + } + if (incoming.get(8)) { + struct.imageversion = iprot.readString(); + struct.setImageversionIsSet(true); + } + if (incoming.get(9)) { + struct.user = iprot.readString(); + struct.setUserIsSet(true); + } + if (incoming.get(10)) { + struct.firstname = iprot.readString(); + struct.setFirstnameIsSet(true); + } + if (incoming.get(11)) { + struct.lastname = iprot.readString(); + struct.setLastnameIsSet(true); + } + if (incoming.get(12)) { + struct.university = iprot.readString(); + struct.setUniversityIsSet(true); + } + if (incoming.get(13)) { + struct.Mail = iprot.readString(); + struct.setMailIsSet(true); + } + if (incoming.get(14)) { + struct.Tel = iprot.readString(); + struct.setTelIsSet(true); + } + if (incoming.get(15)) { + struct.Fak = iprot.readString(); + struct.setFakIsSet(true); + } + if (incoming.get(16)) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } + } + } + + } + + public static class updateLecturedata_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateLecturedata_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new updateLecturedata_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new updateLecturedata_resultTupleSchemeFactory()); + } + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateLecturedata_result.class, metaDataMap); + } + + public updateLecturedata_result() { + } + + public updateLecturedata_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public updateLecturedata_result(updateLecturedata_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public updateLecturedata_result deepCopy() { + return new updateLecturedata_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public updateLecturedata_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof updateLecturedata_result) + return this.equals((updateLecturedata_result)that); + return false; + } + + public boolean equals(updateLecturedata_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(updateLecturedata_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("updateLecturedata_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class updateLecturedata_resultStandardSchemeFactory implements SchemeFactory { + public updateLecturedata_resultStandardScheme getScheme() { + return new updateLecturedata_resultStandardScheme(); + } + } + + private static class updateLecturedata_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, updateLecturedata_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, updateLecturedata_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class updateLecturedata_resultTupleSchemeFactory implements SchemeFactory { + public updateLecturedata_resultTupleScheme getScheme() { + return new updateLecturedata_resultTupleScheme(); + } + } + + private static class updateLecturedata_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class deleteImageServer_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageServer_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteImageServer_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteImageServer_argsTupleSchemeFactory()); + } + + public String id; // required + public String version; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + ID((short)-1, "id"), + VERSION((short)-2, "version"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // ID + return ID; + case -2: // VERSION + return VERSION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteImageServer_args.class, metaDataMap); + } + + public deleteImageServer_args() { + } + + public deleteImageServer_args( + String id, + String version) + { + this(); + this.id = id; + this.version = version; + } + + /** + * Performs a deep copy on other. + */ + public deleteImageServer_args(deleteImageServer_args other) { + if (other.isSetId()) { + this.id = other.id; + } + if (other.isSetVersion()) { + this.version = other.version; + } + } + + public deleteImageServer_args deepCopy() { + return new deleteImageServer_args(this); + } + + @Override + public void clear() { + this.id = null; + this.version = null; + } + + public String getId() { + return this.id; + } + + public deleteImageServer_args setId(String id) { + this.id = id; + return this; + } + + public void unsetId() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return this.id != null; + } + + public void setIdIsSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public String getVersion() { + return this.version; + } + + public deleteImageServer_args setVersion(String version) { + this.version = version; + return this; + } + + public void unsetVersion() { + this.version = null; + } + + /** Returns true if field version is set (has been assigned a value) and false otherwise */ + public boolean isSetVersion() { + return this.version != null; + } + + public void setVersionIsSet(boolean value) { + if (!value) { + this.version = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unsetId(); + } else { + setId((String)value); + } + break; + + case VERSION: + if (value == null) { + unsetVersion(); + } else { + setVersion((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return getId(); + + case VERSION: + return getVersion(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case ID: + return isSetId(); + case VERSION: + return isSetVersion(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteImageServer_args) + return this.equals((deleteImageServer_args)that); + return false; + } + + public boolean equals(deleteImageServer_args that) { + if (that == null) + return false; + + boolean this_present_id = true && this.isSetId(); + boolean that_present_id = true && that.isSetId(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + boolean this_present_version = true && this.isSetVersion(); + boolean that_present_version = true && that.isSetVersion(); + if (this_present_version || that_present_version) { + if (!(this_present_version && that_present_version)) + return false; + if (!this.version.equals(that.version)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(deleteImageServer_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("deleteImageServer_args("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + if (!first) sb.append(", "); + sb.append("version:"); + if (this.version == null) { + sb.append("null"); + } else { + sb.append(this.version); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class deleteImageServer_argsStandardSchemeFactory implements SchemeFactory { + public deleteImageServer_argsStandardScheme getScheme() { + return new deleteImageServer_argsStandardScheme(); + } + } + + private static class deleteImageServer_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageServer_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, deleteImageServer_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.version != null) { + oprot.writeFieldBegin(VERSION_FIELD_DESC); + oprot.writeString(struct.version); + oprot.writeFieldEnd(); + } + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteImageServer_argsTupleSchemeFactory implements SchemeFactory { + public deleteImageServer_argsTupleScheme getScheme() { + return new deleteImageServer_argsTupleScheme(); + } + } + + private static class deleteImageServer_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + if (struct.isSetVersion()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetId()) { + oprot.writeString(struct.id); + } + if (struct.isSetVersion()) { + oprot.writeString(struct.version); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } + if (incoming.get(1)) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } + } + } + + } + + public static class deleteImageServer_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageServer_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteImageServer_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteImageServer_resultTupleSchemeFactory()); + } + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteImageServer_result.class, metaDataMap); + } + + public deleteImageServer_result() { + } + + public deleteImageServer_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public deleteImageServer_result(deleteImageServer_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public deleteImageServer_result deepCopy() { + return new deleteImageServer_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public deleteImageServer_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteImageServer_result) + return this.equals((deleteImageServer_result)that); + return false; + } + + public boolean equals(deleteImageServer_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(deleteImageServer_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("deleteImageServer_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class deleteImageServer_resultStandardSchemeFactory implements SchemeFactory { + public deleteImageServer_resultStandardScheme getScheme() { + return new deleteImageServer_resultStandardScheme(); + } + } + + private static class deleteImageServer_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageServer_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, deleteImageServer_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteImageServer_resultTupleSchemeFactory implements SchemeFactory { + public deleteImageServer_resultTupleScheme getScheme() { + return new deleteImageServer_resultTupleScheme(); + } + } + + private static class deleteImageServer_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class connectedToLecture_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("connectedToLecture_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new connectedToLecture_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new connectedToLecture_argsTupleSchemeFactory()); + } + + public String id; // required + public String version; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + ID((short)-1, "id"), + VERSION((short)-2, "version"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // ID + return ID; + case -2: // VERSION + return VERSION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(connectedToLecture_args.class, metaDataMap); + } + + public connectedToLecture_args() { + } + + public connectedToLecture_args( + String id, + String version) + { + this(); + this.id = id; + this.version = version; + } + + /** + * Performs a deep copy on other. + */ + public connectedToLecture_args(connectedToLecture_args other) { + if (other.isSetId()) { + this.id = other.id; + } + if (other.isSetVersion()) { + this.version = other.version; + } + } + + public connectedToLecture_args deepCopy() { + return new connectedToLecture_args(this); + } + + @Override + public void clear() { + this.id = null; + this.version = null; + } + + public String getId() { + return this.id; + } + + public connectedToLecture_args setId(String id) { + this.id = id; + return this; + } + + public void unsetId() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return this.id != null; + } + + public void setIdIsSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public String getVersion() { + return this.version; + } + + public connectedToLecture_args setVersion(String version) { + this.version = version; + return this; + } + + public void unsetVersion() { + this.version = null; + } + + /** Returns true if field version is set (has been assigned a value) and false otherwise */ + public boolean isSetVersion() { + return this.version != null; + } + + public void setVersionIsSet(boolean value) { + if (!value) { + this.version = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unsetId(); + } else { + setId((String)value); + } + break; + + case VERSION: + if (value == null) { + unsetVersion(); + } else { + setVersion((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return getId(); + + case VERSION: + return getVersion(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case ID: + return isSetId(); + case VERSION: + return isSetVersion(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof connectedToLecture_args) + return this.equals((connectedToLecture_args)that); + return false; + } + + public boolean equals(connectedToLecture_args that) { + if (that == null) + return false; + + boolean this_present_id = true && this.isSetId(); + boolean that_present_id = true && that.isSetId(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + boolean this_present_version = true && this.isSetVersion(); + boolean that_present_version = true && that.isSetVersion(); + if (this_present_version || that_present_version) { + if (!(this_present_version && that_present_version)) + return false; + if (!this.version.equals(that.version)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(connectedToLecture_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("connectedToLecture_args("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + if (!first) sb.append(", "); + sb.append("version:"); + if (this.version == null) { + sb.append("null"); + } else { + sb.append(this.version); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class connectedToLecture_argsStandardSchemeFactory implements SchemeFactory { + public connectedToLecture_argsStandardScheme getScheme() { + return new connectedToLecture_argsStandardScheme(); + } + } + + private static class connectedToLecture_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, connectedToLecture_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, connectedToLecture_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.version != null) { + oprot.writeFieldBegin(VERSION_FIELD_DESC); + oprot.writeString(struct.version); + oprot.writeFieldEnd(); + } + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class connectedToLecture_argsTupleSchemeFactory implements SchemeFactory { + public connectedToLecture_argsTupleScheme getScheme() { + return new connectedToLecture_argsTupleScheme(); + } + } + + private static class connectedToLecture_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, connectedToLecture_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + if (struct.isSetVersion()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetId()) { + oprot.writeString(struct.id); + } + if (struct.isSetVersion()) { + oprot.writeString(struct.version); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, connectedToLecture_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } + if (incoming.get(1)) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } + } + } + + } + + public static class connectedToLecture_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("connectedToLecture_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new connectedToLecture_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new connectedToLecture_resultTupleSchemeFactory()); + } + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(connectedToLecture_result.class, metaDataMap); + } + + public connectedToLecture_result() { + } + + public connectedToLecture_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public connectedToLecture_result(connectedToLecture_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public connectedToLecture_result deepCopy() { + return new connectedToLecture_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public connectedToLecture_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof connectedToLecture_result) + return this.equals((connectedToLecture_result)that); + return false; + } + + public boolean equals(connectedToLecture_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(connectedToLecture_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("connectedToLecture_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class connectedToLecture_resultStandardSchemeFactory implements SchemeFactory { + public connectedToLecture_resultStandardScheme getScheme() { + return new connectedToLecture_resultStandardScheme(); + } + } + + private static class connectedToLecture_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, connectedToLecture_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, connectedToLecture_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class connectedToLecture_resultTupleSchemeFactory implements SchemeFactory { + public connectedToLecture_resultTupleScheme getScheme() { + return new connectedToLecture_resultTupleScheme(); + } + } + + private static class connectedToLecture_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, connectedToLecture_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, connectedToLecture_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class deleteLecture_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteLecture_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField HS_FIELD_DESC = new org.apache.thrift.protocol.TField("hs", org.apache.thrift.protocol.TType.STRING, (short)-2); + private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRING, (short)-3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteLecture_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteLecture_argsTupleSchemeFactory()); + } + + public String id; // required + public String hs; // required + public String user; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + ID((short)-1, "id"), + HS((short)-2, "hs"), + USER((short)-3, "user"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // ID + return ID; + case -2: // HS + return HS; + case -3: // USER + return USER; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.HS, new org.apache.thrift.meta_data.FieldMetaData("hs", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteLecture_args.class, metaDataMap); + } + + public deleteLecture_args() { + } + + public deleteLecture_args( + String id, + String hs, + String user) + { + this(); + this.id = id; + this.hs = hs; + this.user = user; + } + + /** + * Performs a deep copy on other. + */ + public deleteLecture_args(deleteLecture_args other) { + if (other.isSetId()) { + this.id = other.id; + } + if (other.isSetHs()) { + this.hs = other.hs; + } + if (other.isSetUser()) { + this.user = other.user; + } + } + + public deleteLecture_args deepCopy() { + return new deleteLecture_args(this); + } + + @Override + public void clear() { + this.id = null; + this.hs = null; + this.user = null; + } + + public String getId() { + return this.id; + } + + public deleteLecture_args setId(String id) { + this.id = id; + return this; + } + + public void unsetId() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return this.id != null; + } + + public void setIdIsSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public String getHs() { + return this.hs; + } + + public deleteLecture_args setHs(String hs) { + this.hs = hs; + return this; + } + + public void unsetHs() { + this.hs = null; + } + + /** Returns true if field hs is set (has been assigned a value) and false otherwise */ + public boolean isSetHs() { + return this.hs != null; + } + + public void setHsIsSet(boolean value) { + if (!value) { + this.hs = null; + } + } + + public String getUser() { + return this.user; + } + + public deleteLecture_args setUser(String user) { + this.user = user; + return this; + } + + public void unsetUser() { + this.user = null; + } + + /** Returns true if field user is set (has been assigned a value) and false otherwise */ + public boolean isSetUser() { + return this.user != null; + } + + public void setUserIsSet(boolean value) { + if (!value) { + this.user = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unsetId(); + } else { + setId((String)value); + } + break; + + case HS: + if (value == null) { + unsetHs(); + } else { + setHs((String)value); + } + break; + + case USER: + if (value == null) { + unsetUser(); + } else { + setUser((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return getId(); + + case HS: + return getHs(); + + case USER: + return getUser(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case ID: + return isSetId(); + case HS: + return isSetHs(); + case USER: + return isSetUser(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteLecture_args) + return this.equals((deleteLecture_args)that); + return false; + } + + public boolean equals(deleteLecture_args that) { + if (that == null) + return false; + + boolean this_present_id = true && this.isSetId(); + boolean that_present_id = true && that.isSetId(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + boolean this_present_hs = true && this.isSetHs(); + boolean that_present_hs = true && that.isSetHs(); + if (this_present_hs || that_present_hs) { + if (!(this_present_hs && that_present_hs)) + return false; + if (!this.hs.equals(that.hs)) + return false; + } + + boolean this_present_user = true && this.isSetUser(); + boolean that_present_user = true && that.isSetUser(); + if (this_present_user || that_present_user) { + if (!(this_present_user && that_present_user)) + return false; + if (!this.user.equals(that.user)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(deleteLecture_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetHs()).compareTo(other.isSetHs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hs, other.hs); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUser()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("deleteLecture_args("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + if (!first) sb.append(", "); + sb.append("hs:"); + if (this.hs == null) { + sb.append("null"); + } else { + sb.append(this.hs); + } + first = false; + if (!first) sb.append(", "); + sb.append("user:"); + if (this.user == null) { + sb.append("null"); + } else { + sb.append(this.user); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class deleteLecture_argsStandardSchemeFactory implements SchemeFactory { + public deleteLecture_argsStandardScheme getScheme() { + return new deleteLecture_argsStandardScheme(); + } + } + + private static class deleteLecture_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteLecture_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // HS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.hs = iprot.readString(); + struct.setHsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -3: // USER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.user = iprot.readString(); + struct.setUserIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, deleteLecture_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.user != null) { + oprot.writeFieldBegin(USER_FIELD_DESC); + oprot.writeString(struct.user); + oprot.writeFieldEnd(); + } + if (struct.hs != null) { + oprot.writeFieldBegin(HS_FIELD_DESC); + oprot.writeString(struct.hs); + oprot.writeFieldEnd(); + } + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteLecture_argsTupleSchemeFactory implements SchemeFactory { + public deleteLecture_argsTupleScheme getScheme() { + return new deleteLecture_argsTupleScheme(); + } + } + + private static class deleteLecture_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteLecture_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + if (struct.isSetHs()) { + optionals.set(1); + } + if (struct.isSetUser()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetId()) { + oprot.writeString(struct.id); + } + if (struct.isSetHs()) { + oprot.writeString(struct.hs); + } + if (struct.isSetUser()) { + oprot.writeString(struct.user); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteLecture_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } + if (incoming.get(1)) { + struct.hs = iprot.readString(); + struct.setHsIsSet(true); + } + if (incoming.get(2)) { + struct.user = iprot.readString(); + struct.setUserIsSet(true); + } + } + } + + } + + public static class deleteLecture_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteLecture_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteLecture_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteLecture_resultTupleSchemeFactory()); + } + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteLecture_result.class, metaDataMap); + } + + public deleteLecture_result() { + } + + public deleteLecture_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public deleteLecture_result(deleteLecture_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public deleteLecture_result deepCopy() { + return new deleteLecture_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public deleteLecture_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteLecture_result) + return this.equals((deleteLecture_result)that); + return false; + } + + public boolean equals(deleteLecture_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(deleteLecture_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("deleteLecture_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class deleteLecture_resultStandardSchemeFactory implements SchemeFactory { + public deleteLecture_resultStandardScheme getScheme() { + return new deleteLecture_resultStandardScheme(); + } + } + + private static class deleteLecture_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteLecture_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, deleteLecture_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteLecture_resultTupleSchemeFactory implements SchemeFactory { + public deleteLecture_resultTupleScheme getScheme() { + return new deleteLecture_resultTupleScheme(); + } + } + + private static class deleteLecture_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteLecture_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteLecture_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class checkUser_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkUser_args"); + + private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)-1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new checkUser_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new checkUser_argsTupleSchemeFactory()); + } + + public String username; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + USERNAME((short)-1, "username"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // USERNAME + return USERNAME; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkUser_args.class, metaDataMap); + } + + public checkUser_args() { + } + + public checkUser_args( + String username) + { + this(); + this.username = username; + } + + /** + * Performs a deep copy on other. + */ + public checkUser_args(checkUser_args other) { + if (other.isSetUsername()) { + this.username = other.username; + } + } + + public checkUser_args deepCopy() { + return new checkUser_args(this); + } + + @Override + public void clear() { + this.username = null; + } + + public String getUsername() { + return this.username; + } + + public checkUser_args setUsername(String username) { + this.username = username; + return this; + } + + public void unsetUsername() { + this.username = null; + } + + /** Returns true if field username is set (has been assigned a value) and false otherwise */ + public boolean isSetUsername() { + return this.username != null; + } + + public void setUsernameIsSet(boolean value) { + if (!value) { + this.username = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case USERNAME: + if (value == null) { + unsetUsername(); + } else { + setUsername((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case USERNAME: + return getUsername(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case USERNAME: + return isSetUsername(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof checkUser_args) + return this.equals((checkUser_args)that); + return false; + } + + public boolean equals(checkUser_args that) { + if (that == null) + return false; + + boolean this_present_username = true && this.isSetUsername(); + boolean that_present_username = true && that.isSetUsername(); + if (this_present_username || that_present_username) { + if (!(this_present_username && that_present_username)) + return false; + if (!this.username.equals(that.username)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(checkUser_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUsername()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("checkUser_args("); + boolean first = true; + + sb.append("username:"); + if (this.username == null) { + sb.append("null"); + } else { + sb.append(this.username); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class checkUser_argsStandardSchemeFactory implements SchemeFactory { + public checkUser_argsStandardScheme getScheme() { + return new checkUser_argsStandardScheme(); + } + } + + private static class checkUser_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, checkUser_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // USERNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, checkUser_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.username != null) { + oprot.writeFieldBegin(USERNAME_FIELD_DESC); + oprot.writeString(struct.username); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class checkUser_argsTupleSchemeFactory implements SchemeFactory { + public checkUser_argsTupleScheme getScheme() { + return new checkUser_argsTupleScheme(); + } + } + + private static class checkUser_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, checkUser_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUsername()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetUsername()) { + oprot.writeString(struct.username); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, checkUser_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } + } + } + + } + + public static class checkUser_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkUser_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new checkUser_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new checkUser_resultTupleSchemeFactory()); + } + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkUser_result.class, metaDataMap); + } + + public checkUser_result() { + } + + public checkUser_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public checkUser_result(checkUser_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public checkUser_result deepCopy() { + return new checkUser_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public checkUser_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof checkUser_result) + return this.equals((checkUser_result)that); + return false; + } + + public boolean equals(checkUser_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(checkUser_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("checkUser_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class checkUser_resultStandardSchemeFactory implements SchemeFactory { + public checkUser_resultStandardScheme getScheme() { + return new checkUser_resultStandardScheme(); + } + } + + private static class checkUser_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, checkUser_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, checkUser_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class checkUser_resultTupleSchemeFactory implements SchemeFactory { + public checkUser_resultTupleScheme getScheme() { + return new checkUser_resultTupleScheme(); + } + } + + private static class checkUser_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, checkUser_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, checkUser_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class createUser_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createUser_args"); + + private static final org.apache.thrift.protocol.TField LOGIN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("loginName", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField LAST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastName", org.apache.thrift.protocol.TType.STRING, (short)-2); + private static final org.apache.thrift.protocol.TField FIRST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstName", org.apache.thrift.protocol.TType.STRING, (short)-3); + private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("mail", org.apache.thrift.protocol.TType.STRING, (short)-4); + private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new createUser_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new createUser_argsTupleSchemeFactory()); + } + + public String loginName; // required + public String lastName; // required + public String firstName; // required + public String mail; // required + public String university; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + LOGIN_NAME((short)-1, "loginName"), + LAST_NAME((short)-2, "lastName"), + FIRST_NAME((short)-3, "firstName"), + MAIL((short)-4, "mail"), + UNIVERSITY((short)-5, "university"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // LOGIN_NAME + return LOGIN_NAME; + case -2: // LAST_NAME + return LAST_NAME; + case -3: // FIRST_NAME + return FIRST_NAME; + case -4: // MAIL + return MAIL; + case -5: // UNIVERSITY + return UNIVERSITY; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.LOGIN_NAME, new org.apache.thrift.meta_data.FieldMetaData("loginName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LAST_NAME, new org.apache.thrift.meta_data.FieldMetaData("lastName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.FIRST_NAME, new org.apache.thrift.meta_data.FieldMetaData("firstName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("mail", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createUser_args.class, metaDataMap); + } + + public createUser_args() { + } + + public createUser_args( + String loginName, + String lastName, + String firstName, + String mail, + String university) + { + this(); + this.loginName = loginName; + this.lastName = lastName; + this.firstName = firstName; + this.mail = mail; + this.university = university; + } + + /** + * Performs a deep copy on other. + */ + public createUser_args(createUser_args other) { + if (other.isSetLoginName()) { + this.loginName = other.loginName; + } + if (other.isSetLastName()) { + this.lastName = other.lastName; + } + if (other.isSetFirstName()) { + this.firstName = other.firstName; + } + if (other.isSetMail()) { + this.mail = other.mail; + } + if (other.isSetUniversity()) { + this.university = other.university; + } + } + + public createUser_args deepCopy() { + return new createUser_args(this); + } + + @Override + public void clear() { + this.loginName = null; + this.lastName = null; + this.firstName = null; + this.mail = null; + this.university = null; + } + + public String getLoginName() { + return this.loginName; + } + + public createUser_args setLoginName(String loginName) { + this.loginName = loginName; + return this; + } + + public void unsetLoginName() { + this.loginName = null; + } + + /** Returns true if field loginName is set (has been assigned a value) and false otherwise */ + public boolean isSetLoginName() { + return this.loginName != null; + } + + public void setLoginNameIsSet(boolean value) { + if (!value) { + this.loginName = null; + } + } + + public String getLastName() { + return this.lastName; + } + + public createUser_args setLastName(String lastName) { + this.lastName = lastName; + return this; + } + + public void unsetLastName() { + this.lastName = null; + } + + /** Returns true if field lastName is set (has been assigned a value) and false otherwise */ + public boolean isSetLastName() { + return this.lastName != null; + } + + public void setLastNameIsSet(boolean value) { + if (!value) { + this.lastName = null; + } + } + + public String getFirstName() { + return this.firstName; + } + + public createUser_args setFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + public void unsetFirstName() { + this.firstName = null; + } + + /** Returns true if field firstName is set (has been assigned a value) and false otherwise */ + public boolean isSetFirstName() { + return this.firstName != null; + } + + public void setFirstNameIsSet(boolean value) { + if (!value) { + this.firstName = null; + } + } + + public String getMail() { + return this.mail; + } + + public createUser_args setMail(String mail) { + this.mail = mail; + return this; + } + + public void unsetMail() { + this.mail = null; + } + + /** Returns true if field mail is set (has been assigned a value) and false otherwise */ + public boolean isSetMail() { + return this.mail != null; + } + + public void setMailIsSet(boolean value) { + if (!value) { + this.mail = null; + } + } + + public String getUniversity() { + return this.university; + } + + public createUser_args setUniversity(String university) { + this.university = university; + return this; + } + + public void unsetUniversity() { + this.university = null; + } + + /** Returns true if field university is set (has been assigned a value) and false otherwise */ + public boolean isSetUniversity() { + return this.university != null; + } + + public void setUniversityIsSet(boolean value) { + if (!value) { + this.university = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case LOGIN_NAME: + if (value == null) { + unsetLoginName(); + } else { + setLoginName((String)value); + } + break; + + case LAST_NAME: + if (value == null) { + unsetLastName(); + } else { + setLastName((String)value); + } + break; + + case FIRST_NAME: + if (value == null) { + unsetFirstName(); + } else { + setFirstName((String)value); + } + break; + + case MAIL: + if (value == null) { + unsetMail(); + } else { + setMail((String)value); + } + break; + + case UNIVERSITY: + if (value == null) { + unsetUniversity(); + } else { + setUniversity((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case LOGIN_NAME: + return getLoginName(); + + case LAST_NAME: + return getLastName(); + + case FIRST_NAME: + return getFirstName(); + + case MAIL: + return getMail(); + + case UNIVERSITY: + return getUniversity(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case LOGIN_NAME: + return isSetLoginName(); + case LAST_NAME: + return isSetLastName(); + case FIRST_NAME: + return isSetFirstName(); + case MAIL: + return isSetMail(); + case UNIVERSITY: + return isSetUniversity(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof createUser_args) + return this.equals((createUser_args)that); + return false; + } + + public boolean equals(createUser_args that) { + if (that == null) + return false; + + boolean this_present_loginName = true && this.isSetLoginName(); + boolean that_present_loginName = true && that.isSetLoginName(); + if (this_present_loginName || that_present_loginName) { + if (!(this_present_loginName && that_present_loginName)) + return false; + if (!this.loginName.equals(that.loginName)) + return false; + } + + boolean this_present_lastName = true && this.isSetLastName(); + boolean that_present_lastName = true && that.isSetLastName(); + if (this_present_lastName || that_present_lastName) { + if (!(this_present_lastName && that_present_lastName)) + return false; + if (!this.lastName.equals(that.lastName)) + return false; + } + + boolean this_present_firstName = true && this.isSetFirstName(); + boolean that_present_firstName = true && that.isSetFirstName(); + if (this_present_firstName || that_present_firstName) { + if (!(this_present_firstName && that_present_firstName)) + return false; + if (!this.firstName.equals(that.firstName)) + return false; + } + + boolean this_present_mail = true && this.isSetMail(); + boolean that_present_mail = true && that.isSetMail(); + if (this_present_mail || that_present_mail) { + if (!(this_present_mail && that_present_mail)) + return false; + if (!this.mail.equals(that.mail)) + return false; + } + + boolean this_present_university = true && this.isSetUniversity(); + boolean that_present_university = true && that.isSetUniversity(); + if (this_present_university || that_present_university) { + if (!(this_present_university && that_present_university)) + return false; + if (!this.university.equals(that.university)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(createUser_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetLoginName()).compareTo(other.isSetLoginName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLoginName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.loginName, other.loginName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLastName()).compareTo(other.isSetLastName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLastName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastName, other.lastName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFirstName()).compareTo(other.isSetFirstName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFirstName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstName, other.firstName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMail()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mail, other.mail); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUniversity()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("createUser_args("); + boolean first = true; + + sb.append("loginName:"); + if (this.loginName == null) { + sb.append("null"); + } else { + sb.append(this.loginName); + } + first = false; + if (!first) sb.append(", "); + sb.append("lastName:"); + if (this.lastName == null) { + sb.append("null"); + } else { + sb.append(this.lastName); + } + first = false; + if (!first) sb.append(", "); + sb.append("firstName:"); + if (this.firstName == null) { + sb.append("null"); + } else { + sb.append(this.firstName); + } + first = false; + if (!first) sb.append(", "); + sb.append("mail:"); + if (this.mail == null) { + sb.append("null"); + } else { + sb.append(this.mail); + } + first = false; + if (!first) sb.append(", "); + sb.append("university:"); + if (this.university == null) { + sb.append("null"); + } else { + sb.append(this.university); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class createUser_argsStandardSchemeFactory implements SchemeFactory { + public createUser_argsStandardScheme getScheme() { + return new createUser_argsStandardScheme(); + } + } + + private static class createUser_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, createUser_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // LOGIN_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.loginName = iprot.readString(); + struct.setLoginNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // LAST_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.lastName = iprot.readString(); + struct.setLastNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -3: // FIRST_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.firstName = iprot.readString(); + struct.setFirstNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -4: // MAIL + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.mail = iprot.readString(); + struct.setMailIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -5: // UNIVERSITY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.university = iprot.readString(); + struct.setUniversityIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, createUser_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.university != null) { + oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC); + oprot.writeString(struct.university); + oprot.writeFieldEnd(); + } + if (struct.mail != null) { + oprot.writeFieldBegin(MAIL_FIELD_DESC); + oprot.writeString(struct.mail); + oprot.writeFieldEnd(); + } + if (struct.firstName != null) { + oprot.writeFieldBegin(FIRST_NAME_FIELD_DESC); + oprot.writeString(struct.firstName); + oprot.writeFieldEnd(); + } + if (struct.lastName != null) { + oprot.writeFieldBegin(LAST_NAME_FIELD_DESC); + oprot.writeString(struct.lastName); + oprot.writeFieldEnd(); + } + if (struct.loginName != null) { + oprot.writeFieldBegin(LOGIN_NAME_FIELD_DESC); + oprot.writeString(struct.loginName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class createUser_argsTupleSchemeFactory implements SchemeFactory { + public createUser_argsTupleScheme getScheme() { + return new createUser_argsTupleScheme(); + } + } + + private static class createUser_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, createUser_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetLoginName()) { + optionals.set(0); + } + if (struct.isSetLastName()) { + optionals.set(1); + } + if (struct.isSetFirstName()) { + optionals.set(2); + } + if (struct.isSetMail()) { + optionals.set(3); + } + if (struct.isSetUniversity()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetLoginName()) { + oprot.writeString(struct.loginName); + } + if (struct.isSetLastName()) { + oprot.writeString(struct.lastName); + } + if (struct.isSetFirstName()) { + oprot.writeString(struct.firstName); + } + if (struct.isSetMail()) { + oprot.writeString(struct.mail); + } + if (struct.isSetUniversity()) { + oprot.writeString(struct.university); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, createUser_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.loginName = iprot.readString(); + struct.setLoginNameIsSet(true); + } + if (incoming.get(1)) { + struct.lastName = iprot.readString(); + struct.setLastNameIsSet(true); + } + if (incoming.get(2)) { + struct.firstName = iprot.readString(); + struct.setFirstNameIsSet(true); + } + if (incoming.get(3)) { + struct.mail = iprot.readString(); + struct.setMailIsSet(true); + } + if (incoming.get(4)) { + struct.university = iprot.readString(); + struct.setUniversityIsSet(true); + } + } + } + + } + + public static class createUser_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createUser_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new createUser_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new createUser_resultTupleSchemeFactory()); + } + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createUser_result.class, metaDataMap); + } + + public createUser_result() { + } + + public createUser_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public createUser_result(createUser_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public createUser_result deepCopy() { + return new createUser_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public createUser_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof createUser_result) + return this.equals((createUser_result)that); + return false; + } + + public boolean equals(createUser_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(createUser_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("createUser_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class createUser_resultStandardSchemeFactory implements SchemeFactory { + public createUser_resultStandardScheme getScheme() { + return new createUser_resultStandardScheme(); + } + } + + private static class createUser_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, createUser_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, createUser_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class createUser_resultTupleSchemeFactory implements SchemeFactory { + public createUser_resultTupleScheme getScheme() { + return new createUser_resultTupleScheme(); + } + } + + private static class createUser_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, createUser_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, createUser_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class writeImageRights_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeImageRights_args"); + + private static final org.apache.thrift.protocol.TField IMAGENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imagename", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)-2); + private static final org.apache.thrift.protocol.TField LAST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastName", org.apache.thrift.protocol.TType.STRING, (short)-3); + private static final org.apache.thrift.protocol.TField FIRST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstName", org.apache.thrift.protocol.TType.STRING, (short)-4); + private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("mail", org.apache.thrift.protocol.TType.STRING, (short)-5); + private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-6); + private static final org.apache.thrift.protocol.TField ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.STRING, (short)-7); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new writeImageRights_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new writeImageRights_argsTupleSchemeFactory()); + } + + public String imagename; // required + public String username; // required + public String lastName; // required + public String firstName; // required + public String mail; // required + public String university; // required + public String role; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + IMAGENAME((short)-1, "imagename"), + USERNAME((short)-2, "username"), + LAST_NAME((short)-3, "lastName"), + FIRST_NAME((short)-4, "firstName"), + MAIL((short)-5, "mail"), + UNIVERSITY((short)-6, "university"), + ROLE((short)-7, "role"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // IMAGENAME + return IMAGENAME; + case -2: // USERNAME + return USERNAME; + case -3: // LAST_NAME + return LAST_NAME; + case -4: // FIRST_NAME + return FIRST_NAME; + case -5: // MAIL + return MAIL; + case -6: // UNIVERSITY + return UNIVERSITY; + case -7: // ROLE + return ROLE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IMAGENAME, new org.apache.thrift.meta_data.FieldMetaData("imagename", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LAST_NAME, new org.apache.thrift.meta_data.FieldMetaData("lastName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.FIRST_NAME, new org.apache.thrift.meta_data.FieldMetaData("firstName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("mail", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeImageRights_args.class, metaDataMap); + } + + public writeImageRights_args() { + } + + public writeImageRights_args( + String imagename, + String username, + String lastName, + String firstName, + String mail, + String university, + String role) + { + this(); + this.imagename = imagename; + this.username = username; + this.lastName = lastName; + this.firstName = firstName; + this.mail = mail; + this.university = university; + this.role = role; + } + + /** + * Performs a deep copy on other. + */ + public writeImageRights_args(writeImageRights_args other) { + if (other.isSetImagename()) { + this.imagename = other.imagename; + } + if (other.isSetUsername()) { + this.username = other.username; + } + if (other.isSetLastName()) { + this.lastName = other.lastName; + } + if (other.isSetFirstName()) { + this.firstName = other.firstName; + } + if (other.isSetMail()) { + this.mail = other.mail; + } + if (other.isSetUniversity()) { + this.university = other.university; + } + if (other.isSetRole()) { + this.role = other.role; + } + } + + public writeImageRights_args deepCopy() { + return new writeImageRights_args(this); + } + + @Override + public void clear() { + this.imagename = null; + this.username = null; + this.lastName = null; + this.firstName = null; + this.mail = null; + this.university = null; + this.role = null; + } + + public String getImagename() { + return this.imagename; + } + + public writeImageRights_args setImagename(String imagename) { + this.imagename = imagename; + return this; + } + + public void unsetImagename() { + this.imagename = null; + } + + /** Returns true if field imagename is set (has been assigned a value) and false otherwise */ + public boolean isSetImagename() { + return this.imagename != null; + } + + public void setImagenameIsSet(boolean value) { + if (!value) { + this.imagename = null; + } + } + + public String getUsername() { + return this.username; + } + + public writeImageRights_args setUsername(String username) { + this.username = username; + return this; + } + + public void unsetUsername() { + this.username = null; + } + + /** Returns true if field username is set (has been assigned a value) and false otherwise */ + public boolean isSetUsername() { + return this.username != null; + } + + public void setUsernameIsSet(boolean value) { + if (!value) { + this.username = null; + } + } + + public String getLastName() { + return this.lastName; + } + + public writeImageRights_args setLastName(String lastName) { + this.lastName = lastName; + return this; + } + + public void unsetLastName() { + this.lastName = null; + } + + /** Returns true if field lastName is set (has been assigned a value) and false otherwise */ + public boolean isSetLastName() { + return this.lastName != null; + } + + public void setLastNameIsSet(boolean value) { + if (!value) { + this.lastName = null; + } + } + + public String getFirstName() { + return this.firstName; + } + + public writeImageRights_args setFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + public void unsetFirstName() { + this.firstName = null; + } + + /** Returns true if field firstName is set (has been assigned a value) and false otherwise */ + public boolean isSetFirstName() { + return this.firstName != null; + } + + public void setFirstNameIsSet(boolean value) { + if (!value) { + this.firstName = null; + } + } + + public String getMail() { + return this.mail; + } + + public writeImageRights_args setMail(String mail) { + this.mail = mail; + return this; + } + + public void unsetMail() { + this.mail = null; + } + + /** Returns true if field mail is set (has been assigned a value) and false otherwise */ + public boolean isSetMail() { + return this.mail != null; + } + + public void setMailIsSet(boolean value) { + if (!value) { + this.mail = null; + } + } + + public String getUniversity() { + return this.university; + } + + public writeImageRights_args setUniversity(String university) { + this.university = university; + return this; + } + + public void unsetUniversity() { + this.university = null; + } + + /** Returns true if field university is set (has been assigned a value) and false otherwise */ + public boolean isSetUniversity() { + return this.university != null; + } + + public void setUniversityIsSet(boolean value) { + if (!value) { + this.university = null; + } + } + + public String getRole() { + return this.role; + } + + public writeImageRights_args setRole(String role) { + this.role = role; + return this; + } + + public void unsetRole() { + this.role = null; + } + + /** Returns true if field role is set (has been assigned a value) and false otherwise */ + public boolean isSetRole() { + return this.role != null; + } + + public void setRoleIsSet(boolean value) { + if (!value) { + this.role = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IMAGENAME: + if (value == null) { + unsetImagename(); + } else { + setImagename((String)value); + } + break; + + case USERNAME: + if (value == null) { + unsetUsername(); + } else { + setUsername((String)value); + } + break; + + case LAST_NAME: + if (value == null) { + unsetLastName(); + } else { + setLastName((String)value); + } + break; + + case FIRST_NAME: + if (value == null) { + unsetFirstName(); + } else { + setFirstName((String)value); + } + break; + + case MAIL: + if (value == null) { + unsetMail(); + } else { + setMail((String)value); + } + break; + + case UNIVERSITY: + if (value == null) { + unsetUniversity(); + } else { + setUniversity((String)value); + } + break; + + case ROLE: + if (value == null) { + unsetRole(); + } else { + setRole((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IMAGENAME: + return getImagename(); + + case USERNAME: + return getUsername(); + + case LAST_NAME: + return getLastName(); + + case FIRST_NAME: + return getFirstName(); + + case MAIL: + return getMail(); + + case UNIVERSITY: + return getUniversity(); + + case ROLE: + return getRole(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case IMAGENAME: + return isSetImagename(); + case USERNAME: + return isSetUsername(); + case LAST_NAME: + return isSetLastName(); + case FIRST_NAME: + return isSetFirstName(); + case MAIL: + return isSetMail(); + case UNIVERSITY: + return isSetUniversity(); + case ROLE: + return isSetRole(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof writeImageRights_args) + return this.equals((writeImageRights_args)that); + return false; + } + + public boolean equals(writeImageRights_args that) { + if (that == null) + return false; + + boolean this_present_imagename = true && this.isSetImagename(); + boolean that_present_imagename = true && that.isSetImagename(); + if (this_present_imagename || that_present_imagename) { + if (!(this_present_imagename && that_present_imagename)) + return false; + if (!this.imagename.equals(that.imagename)) + return false; + } + + boolean this_present_username = true && this.isSetUsername(); + boolean that_present_username = true && that.isSetUsername(); + if (this_present_username || that_present_username) { + if (!(this_present_username && that_present_username)) + return false; + if (!this.username.equals(that.username)) + return false; + } + + boolean this_present_lastName = true && this.isSetLastName(); + boolean that_present_lastName = true && that.isSetLastName(); + if (this_present_lastName || that_present_lastName) { + if (!(this_present_lastName && that_present_lastName)) + return false; + if (!this.lastName.equals(that.lastName)) + return false; + } + + boolean this_present_firstName = true && this.isSetFirstName(); + boolean that_present_firstName = true && that.isSetFirstName(); + if (this_present_firstName || that_present_firstName) { + if (!(this_present_firstName && that_present_firstName)) + return false; + if (!this.firstName.equals(that.firstName)) + return false; + } + + boolean this_present_mail = true && this.isSetMail(); + boolean that_present_mail = true && that.isSetMail(); + if (this_present_mail || that_present_mail) { + if (!(this_present_mail && that_present_mail)) + return false; + if (!this.mail.equals(that.mail)) + return false; + } + + boolean this_present_university = true && this.isSetUniversity(); + boolean that_present_university = true && that.isSetUniversity(); + if (this_present_university || that_present_university) { + if (!(this_present_university && that_present_university)) + return false; + if (!this.university.equals(that.university)) + return false; + } + + boolean this_present_role = true && this.isSetRole(); + boolean that_present_role = true && that.isSetRole(); + if (this_present_role || that_present_role) { + if (!(this_present_role && that_present_role)) + return false; + if (!this.role.equals(that.role)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(writeImageRights_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetImagename()).compareTo(other.isSetImagename()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImagename()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagename, other.imagename); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUsername()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLastName()).compareTo(other.isSetLastName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLastName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastName, other.lastName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFirstName()).compareTo(other.isSetFirstName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFirstName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstName, other.firstName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMail()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mail, other.mail); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUniversity()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRole()).compareTo(other.isSetRole()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRole()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, other.role); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("writeImageRights_args("); + boolean first = true; + + sb.append("imagename:"); + if (this.imagename == null) { + sb.append("null"); + } else { + sb.append(this.imagename); + } + first = false; + if (!first) sb.append(", "); + sb.append("username:"); + if (this.username == null) { + sb.append("null"); + } else { + sb.append(this.username); + } + first = false; + if (!first) sb.append(", "); + sb.append("lastName:"); + if (this.lastName == null) { + sb.append("null"); + } else { + sb.append(this.lastName); + } + first = false; + if (!first) sb.append(", "); + sb.append("firstName:"); + if (this.firstName == null) { + sb.append("null"); + } else { + sb.append(this.firstName); + } + first = false; + if (!first) sb.append(", "); + sb.append("mail:"); + if (this.mail == null) { + sb.append("null"); + } else { + sb.append(this.mail); + } + first = false; + if (!first) sb.append(", "); + sb.append("university:"); + if (this.university == null) { + sb.append("null"); + } else { + sb.append(this.university); + } + first = false; + if (!first) sb.append(", "); + sb.append("role:"); + if (this.role == null) { + sb.append("null"); + } else { + sb.append(this.role); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class writeImageRights_argsStandardSchemeFactory implements SchemeFactory { + public writeImageRights_argsStandardScheme getScheme() { + return new writeImageRights_argsStandardScheme(); + } + } + + private static class writeImageRights_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, writeImageRights_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // IMAGENAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imagename = iprot.readString(); + struct.setImagenameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // USERNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -3: // LAST_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.lastName = iprot.readString(); + struct.setLastNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -4: // FIRST_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.firstName = iprot.readString(); + struct.setFirstNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -5: // MAIL + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.mail = iprot.readString(); + struct.setMailIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -6: // UNIVERSITY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.university = iprot.readString(); + struct.setUniversityIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -7: // ROLE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.role = iprot.readString(); + struct.setRoleIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, writeImageRights_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.role != null) { + oprot.writeFieldBegin(ROLE_FIELD_DESC); + oprot.writeString(struct.role); + oprot.writeFieldEnd(); + } + if (struct.university != null) { + oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC); + oprot.writeString(struct.university); + oprot.writeFieldEnd(); + } + if (struct.mail != null) { + oprot.writeFieldBegin(MAIL_FIELD_DESC); + oprot.writeString(struct.mail); + oprot.writeFieldEnd(); + } + if (struct.firstName != null) { + oprot.writeFieldBegin(FIRST_NAME_FIELD_DESC); + oprot.writeString(struct.firstName); + oprot.writeFieldEnd(); + } + if (struct.lastName != null) { + oprot.writeFieldBegin(LAST_NAME_FIELD_DESC); + oprot.writeString(struct.lastName); + oprot.writeFieldEnd(); + } + if (struct.username != null) { + oprot.writeFieldBegin(USERNAME_FIELD_DESC); + oprot.writeString(struct.username); + oprot.writeFieldEnd(); + } + if (struct.imagename != null) { + oprot.writeFieldBegin(IMAGENAME_FIELD_DESC); + oprot.writeString(struct.imagename); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class writeImageRights_argsTupleSchemeFactory implements SchemeFactory { + public writeImageRights_argsTupleScheme getScheme() { + return new writeImageRights_argsTupleScheme(); + } + } + + private static class writeImageRights_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, writeImageRights_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetImagename()) { + optionals.set(0); + } + if (struct.isSetUsername()) { + optionals.set(1); + } + if (struct.isSetLastName()) { + optionals.set(2); + } + if (struct.isSetFirstName()) { + optionals.set(3); + } + if (struct.isSetMail()) { + optionals.set(4); + } + if (struct.isSetUniversity()) { + optionals.set(5); + } + if (struct.isSetRole()) { + optionals.set(6); + } + oprot.writeBitSet(optionals, 7); + if (struct.isSetImagename()) { + oprot.writeString(struct.imagename); + } + if (struct.isSetUsername()) { + oprot.writeString(struct.username); + } + if (struct.isSetLastName()) { + oprot.writeString(struct.lastName); + } + if (struct.isSetFirstName()) { + oprot.writeString(struct.firstName); + } + if (struct.isSetMail()) { + oprot.writeString(struct.mail); + } + if (struct.isSetUniversity()) { + oprot.writeString(struct.university); + } + if (struct.isSetRole()) { + oprot.writeString(struct.role); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, writeImageRights_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(7); + if (incoming.get(0)) { + struct.imagename = iprot.readString(); + struct.setImagenameIsSet(true); + } + if (incoming.get(1)) { + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } + if (incoming.get(2)) { + struct.lastName = iprot.readString(); + struct.setLastNameIsSet(true); + } + if (incoming.get(3)) { + struct.firstName = iprot.readString(); + struct.setFirstNameIsSet(true); + } + if (incoming.get(4)) { + struct.mail = iprot.readString(); + struct.setMailIsSet(true); + } + if (incoming.get(5)) { + struct.university = iprot.readString(); + struct.setUniversityIsSet(true); + } + if (incoming.get(6)) { + struct.role = iprot.readString(); + struct.setRoleIsSet(true); + } + } + } + + } + + public static class writeImageRights_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeImageRights_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new writeImageRights_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new writeImageRights_resultTupleSchemeFactory()); + } + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeImageRights_result.class, metaDataMap); + } + + public writeImageRights_result() { + } + + public writeImageRights_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public writeImageRights_result(writeImageRights_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public writeImageRights_result deepCopy() { + return new writeImageRights_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public writeImageRights_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof writeImageRights_result) + return this.equals((writeImageRights_result)that); + return false; + } + + public boolean equals(writeImageRights_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(writeImageRights_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("writeImageRights_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class writeImageRights_resultStandardSchemeFactory implements SchemeFactory { + public writeImageRights_resultStandardScheme getScheme() { + return new writeImageRights_resultStandardScheme(); + } + } + + private static class writeImageRights_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, writeImageRights_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, writeImageRights_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class writeImageRights_resultTupleSchemeFactory implements SchemeFactory { + public writeImageRights_resultTupleScheme getScheme() { + return new writeImageRights_resultTupleScheme(); + } + } + + private static class writeImageRights_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, writeImageRights_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, writeImageRights_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class writeLectureRights_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeLectureRights_args"); + + private static final org.apache.thrift.protocol.TField LECTURENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lecturename", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)-2); + private static final org.apache.thrift.protocol.TField LAST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastName", org.apache.thrift.protocol.TType.STRING, (short)-3); + private static final org.apache.thrift.protocol.TField FIRST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstName", org.apache.thrift.protocol.TType.STRING, (short)-4); + private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("mail", org.apache.thrift.protocol.TType.STRING, (short)-5); + private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-6); + private static final org.apache.thrift.protocol.TField ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.STRING, (short)-7); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new writeLectureRights_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new writeLectureRights_argsTupleSchemeFactory()); + } + + public String lecturename; // required + public String username; // required + public String lastName; // required + public String firstName; // required + public String mail; // required + public String university; // required + public String role; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + LECTURENAME((short)-1, "lecturename"), + USERNAME((short)-2, "username"), + LAST_NAME((short)-3, "lastName"), + FIRST_NAME((short)-4, "firstName"), + MAIL((short)-5, "mail"), + UNIVERSITY((short)-6, "university"), + ROLE((short)-7, "role"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // LECTURENAME + return LECTURENAME; + case -2: // USERNAME + return USERNAME; + case -3: // LAST_NAME + return LAST_NAME; + case -4: // FIRST_NAME + return FIRST_NAME; + case -5: // MAIL + return MAIL; + case -6: // UNIVERSITY + return UNIVERSITY; + case -7: // ROLE + return ROLE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.LECTURENAME, new org.apache.thrift.meta_data.FieldMetaData("lecturename", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LAST_NAME, new org.apache.thrift.meta_data.FieldMetaData("lastName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.FIRST_NAME, new org.apache.thrift.meta_data.FieldMetaData("firstName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("mail", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeLectureRights_args.class, metaDataMap); + } + + public writeLectureRights_args() { + } + + public writeLectureRights_args( + String lecturename, + String username, + String lastName, + String firstName, + String mail, + String university, + String role) + { + this(); + this.lecturename = lecturename; + this.username = username; + this.lastName = lastName; + this.firstName = firstName; + this.mail = mail; + this.university = university; + this.role = role; + } + + /** + * Performs a deep copy on other. + */ + public writeLectureRights_args(writeLectureRights_args other) { + if (other.isSetLecturename()) { + this.lecturename = other.lecturename; + } + if (other.isSetUsername()) { + this.username = other.username; + } + if (other.isSetLastName()) { + this.lastName = other.lastName; + } + if (other.isSetFirstName()) { + this.firstName = other.firstName; + } + if (other.isSetMail()) { + this.mail = other.mail; + } + if (other.isSetUniversity()) { + this.university = other.university; + } + if (other.isSetRole()) { + this.role = other.role; + } + } + + public writeLectureRights_args deepCopy() { + return new writeLectureRights_args(this); + } + + @Override + public void clear() { + this.lecturename = null; + this.username = null; + this.lastName = null; + this.firstName = null; + this.mail = null; + this.university = null; + this.role = null; + } + + public String getLecturename() { + return this.lecturename; + } + + public writeLectureRights_args setLecturename(String lecturename) { + this.lecturename = lecturename; + return this; + } + + public void unsetLecturename() { + this.lecturename = null; + } + + /** Returns true if field lecturename is set (has been assigned a value) and false otherwise */ + public boolean isSetLecturename() { + return this.lecturename != null; + } + + public void setLecturenameIsSet(boolean value) { + if (!value) { + this.lecturename = null; + } + } + + public String getUsername() { + return this.username; + } + + public writeLectureRights_args setUsername(String username) { + this.username = username; + return this; + } + + public void unsetUsername() { + this.username = null; + } + + /** Returns true if field username is set (has been assigned a value) and false otherwise */ + public boolean isSetUsername() { + return this.username != null; + } + + public void setUsernameIsSet(boolean value) { + if (!value) { + this.username = null; + } + } + + public String getLastName() { + return this.lastName; + } + + public writeLectureRights_args setLastName(String lastName) { + this.lastName = lastName; + return this; + } + + public void unsetLastName() { + this.lastName = null; + } + + /** Returns true if field lastName is set (has been assigned a value) and false otherwise */ + public boolean isSetLastName() { + return this.lastName != null; + } + + public void setLastNameIsSet(boolean value) { + if (!value) { + this.lastName = null; + } + } + + public String getFirstName() { + return this.firstName; + } + + public writeLectureRights_args setFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + public void unsetFirstName() { + this.firstName = null; + } + + /** Returns true if field firstName is set (has been assigned a value) and false otherwise */ + public boolean isSetFirstName() { + return this.firstName != null; + } + + public void setFirstNameIsSet(boolean value) { + if (!value) { + this.firstName = null; + } + } + + public String getMail() { + return this.mail; + } + + public writeLectureRights_args setMail(String mail) { + this.mail = mail; + return this; + } + + public void unsetMail() { + this.mail = null; + } + + /** Returns true if field mail is set (has been assigned a value) and false otherwise */ + public boolean isSetMail() { + return this.mail != null; + } + + public void setMailIsSet(boolean value) { + if (!value) { + this.mail = null; + } + } + + public String getUniversity() { + return this.university; + } + + public writeLectureRights_args setUniversity(String university) { + this.university = university; + return this; + } + + public void unsetUniversity() { + this.university = null; + } + + /** Returns true if field university is set (has been assigned a value) and false otherwise */ + public boolean isSetUniversity() { + return this.university != null; + } + + public void setUniversityIsSet(boolean value) { + if (!value) { + this.university = null; + } + } + + public String getRole() { + return this.role; + } + + public writeLectureRights_args setRole(String role) { + this.role = role; + return this; + } + + public void unsetRole() { + this.role = null; + } + + /** Returns true if field role is set (has been assigned a value) and false otherwise */ + public boolean isSetRole() { + return this.role != null; + } + + public void setRoleIsSet(boolean value) { + if (!value) { + this.role = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case LECTURENAME: + if (value == null) { + unsetLecturename(); + } else { + setLecturename((String)value); + } + break; + + case USERNAME: + if (value == null) { + unsetUsername(); + } else { + setUsername((String)value); + } + break; + + case LAST_NAME: + if (value == null) { + unsetLastName(); + } else { + setLastName((String)value); + } + break; + + case FIRST_NAME: + if (value == null) { + unsetFirstName(); + } else { + setFirstName((String)value); + } + break; + + case MAIL: + if (value == null) { + unsetMail(); + } else { + setMail((String)value); + } + break; + + case UNIVERSITY: + if (value == null) { + unsetUniversity(); + } else { + setUniversity((String)value); + } + break; + + case ROLE: + if (value == null) { + unsetRole(); + } else { + setRole((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case LECTURENAME: + return getLecturename(); + + case USERNAME: + return getUsername(); + + case LAST_NAME: + return getLastName(); + + case FIRST_NAME: + return getFirstName(); + + case MAIL: + return getMail(); + + case UNIVERSITY: + return getUniversity(); + + case ROLE: + return getRole(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case LECTURENAME: + return isSetLecturename(); + case USERNAME: + return isSetUsername(); + case LAST_NAME: + return isSetLastName(); + case FIRST_NAME: + return isSetFirstName(); + case MAIL: + return isSetMail(); + case UNIVERSITY: + return isSetUniversity(); + case ROLE: + return isSetRole(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof writeLectureRights_args) + return this.equals((writeLectureRights_args)that); + return false; + } + + public boolean equals(writeLectureRights_args that) { + if (that == null) + return false; + + boolean this_present_lecturename = true && this.isSetLecturename(); + boolean that_present_lecturename = true && that.isSetLecturename(); + if (this_present_lecturename || that_present_lecturename) { + if (!(this_present_lecturename && that_present_lecturename)) + return false; + if (!this.lecturename.equals(that.lecturename)) + return false; + } + + boolean this_present_username = true && this.isSetUsername(); + boolean that_present_username = true && that.isSetUsername(); + if (this_present_username || that_present_username) { + if (!(this_present_username && that_present_username)) + return false; + if (!this.username.equals(that.username)) + return false; + } + + boolean this_present_lastName = true && this.isSetLastName(); + boolean that_present_lastName = true && that.isSetLastName(); + if (this_present_lastName || that_present_lastName) { + if (!(this_present_lastName && that_present_lastName)) + return false; + if (!this.lastName.equals(that.lastName)) + return false; + } + + boolean this_present_firstName = true && this.isSetFirstName(); + boolean that_present_firstName = true && that.isSetFirstName(); + if (this_present_firstName || that_present_firstName) { + if (!(this_present_firstName && that_present_firstName)) + return false; + if (!this.firstName.equals(that.firstName)) + return false; + } + + boolean this_present_mail = true && this.isSetMail(); + boolean that_present_mail = true && that.isSetMail(); + if (this_present_mail || that_present_mail) { + if (!(this_present_mail && that_present_mail)) + return false; + if (!this.mail.equals(that.mail)) + return false; + } + + boolean this_present_university = true && this.isSetUniversity(); + boolean that_present_university = true && that.isSetUniversity(); + if (this_present_university || that_present_university) { + if (!(this_present_university && that_present_university)) + return false; + if (!this.university.equals(that.university)) + return false; + } + + boolean this_present_role = true && this.isSetRole(); + boolean that_present_role = true && that.isSetRole(); + if (this_present_role || that_present_role) { + if (!(this_present_role && that_present_role)) + return false; + if (!this.role.equals(that.role)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(writeLectureRights_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetLecturename()).compareTo(other.isSetLecturename()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLecturename()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lecturename, other.lecturename); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUsername()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLastName()).compareTo(other.isSetLastName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLastName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastName, other.lastName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFirstName()).compareTo(other.isSetFirstName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFirstName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstName, other.firstName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMail()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mail, other.mail); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUniversity()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRole()).compareTo(other.isSetRole()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRole()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, other.role); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("writeLectureRights_args("); + boolean first = true; + + sb.append("lecturename:"); + if (this.lecturename == null) { + sb.append("null"); + } else { + sb.append(this.lecturename); + } + first = false; + if (!first) sb.append(", "); + sb.append("username:"); + if (this.username == null) { + sb.append("null"); + } else { + sb.append(this.username); + } + first = false; + if (!first) sb.append(", "); + sb.append("lastName:"); + if (this.lastName == null) { + sb.append("null"); + } else { + sb.append(this.lastName); + } + first = false; + if (!first) sb.append(", "); + sb.append("firstName:"); + if (this.firstName == null) { + sb.append("null"); + } else { + sb.append(this.firstName); + } + first = false; + if (!first) sb.append(", "); + sb.append("mail:"); + if (this.mail == null) { + sb.append("null"); + } else { + sb.append(this.mail); + } + first = false; + if (!first) sb.append(", "); + sb.append("university:"); + if (this.university == null) { + sb.append("null"); + } else { + sb.append(this.university); + } + first = false; + if (!first) sb.append(", "); + sb.append("role:"); + if (this.role == null) { + sb.append("null"); + } else { + sb.append(this.role); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class writeLectureRights_argsStandardSchemeFactory implements SchemeFactory { + public writeLectureRights_argsStandardScheme getScheme() { + return new writeLectureRights_argsStandardScheme(); + } + } + + private static class writeLectureRights_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, writeLectureRights_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // LECTURENAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.lecturename = iprot.readString(); + struct.setLecturenameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // USERNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -3: // LAST_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.lastName = iprot.readString(); + struct.setLastNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -4: // FIRST_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.firstName = iprot.readString(); + struct.setFirstNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -5: // MAIL + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.mail = iprot.readString(); + struct.setMailIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -6: // UNIVERSITY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.university = iprot.readString(); + struct.setUniversityIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -7: // ROLE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.role = iprot.readString(); + struct.setRoleIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, writeLectureRights_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.role != null) { + oprot.writeFieldBegin(ROLE_FIELD_DESC); + oprot.writeString(struct.role); + oprot.writeFieldEnd(); + } + if (struct.university != null) { + oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC); + oprot.writeString(struct.university); + oprot.writeFieldEnd(); + } + if (struct.mail != null) { + oprot.writeFieldBegin(MAIL_FIELD_DESC); + oprot.writeString(struct.mail); + oprot.writeFieldEnd(); + } + if (struct.firstName != null) { + oprot.writeFieldBegin(FIRST_NAME_FIELD_DESC); + oprot.writeString(struct.firstName); + oprot.writeFieldEnd(); + } + if (struct.lastName != null) { + oprot.writeFieldBegin(LAST_NAME_FIELD_DESC); + oprot.writeString(struct.lastName); + oprot.writeFieldEnd(); + } + if (struct.username != null) { + oprot.writeFieldBegin(USERNAME_FIELD_DESC); + oprot.writeString(struct.username); + oprot.writeFieldEnd(); + } + if (struct.lecturename != null) { + oprot.writeFieldBegin(LECTURENAME_FIELD_DESC); + oprot.writeString(struct.lecturename); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class writeLectureRights_argsTupleSchemeFactory implements SchemeFactory { + public writeLectureRights_argsTupleScheme getScheme() { + return new writeLectureRights_argsTupleScheme(); + } + } + + private static class writeLectureRights_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, writeLectureRights_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetLecturename()) { + optionals.set(0); + } + if (struct.isSetUsername()) { + optionals.set(1); + } + if (struct.isSetLastName()) { + optionals.set(2); + } + if (struct.isSetFirstName()) { + optionals.set(3); + } + if (struct.isSetMail()) { + optionals.set(4); + } + if (struct.isSetUniversity()) { + optionals.set(5); + } + if (struct.isSetRole()) { + optionals.set(6); + } + oprot.writeBitSet(optionals, 7); + if (struct.isSetLecturename()) { + oprot.writeString(struct.lecturename); + } + if (struct.isSetUsername()) { + oprot.writeString(struct.username); + } + if (struct.isSetLastName()) { + oprot.writeString(struct.lastName); + } + if (struct.isSetFirstName()) { + oprot.writeString(struct.firstName); + } + if (struct.isSetMail()) { + oprot.writeString(struct.mail); + } + if (struct.isSetUniversity()) { + oprot.writeString(struct.university); + } + if (struct.isSetRole()) { + oprot.writeString(struct.role); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, writeLectureRights_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(7); + if (incoming.get(0)) { + struct.lecturename = iprot.readString(); + struct.setLecturenameIsSet(true); + } + if (incoming.get(1)) { + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } + if (incoming.get(2)) { + struct.lastName = iprot.readString(); + struct.setLastNameIsSet(true); + } + if (incoming.get(3)) { + struct.firstName = iprot.readString(); + struct.setFirstNameIsSet(true); + } + if (incoming.get(4)) { + struct.mail = iprot.readString(); + struct.setMailIsSet(true); + } + if (incoming.get(5)) { + struct.university = iprot.readString(); + struct.setUniversityIsSet(true); + } + if (incoming.get(6)) { + struct.role = iprot.readString(); + struct.setRoleIsSet(true); + } + } + } + + } + + public static class writeLectureRights_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("writeLectureRights_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new writeLectureRights_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new writeLectureRights_resultTupleSchemeFactory()); + } + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeLectureRights_result.class, metaDataMap); + } + + public writeLectureRights_result() { + } + + public writeLectureRights_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public writeLectureRights_result(writeLectureRights_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public writeLectureRights_result deepCopy() { + return new writeLectureRights_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public writeLectureRights_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof writeLectureRights_result) + return this.equals((writeLectureRights_result)that); + return false; + } + + public boolean equals(writeLectureRights_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(writeLectureRights_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("writeLectureRights_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class writeLectureRights_resultStandardSchemeFactory implements SchemeFactory { + public writeLectureRights_resultStandardScheme getScheme() { + return new writeLectureRights_resultStandardScheme(); + } + } + + private static class writeLectureRights_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, writeLectureRights_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, writeLectureRights_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class writeLectureRights_resultTupleSchemeFactory implements SchemeFactory { + public writeLectureRights_resultTupleScheme getScheme() { + return new writeLectureRights_resultTupleScheme(); + } + } + + private static class writeLectureRights_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, writeLectureRights_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, writeLectureRights_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + +} diff --git a/dozentenmodulserver/src/main/java/server/ServerHandler.java b/dozentenmodulserver/src/main/java/server/ServerHandler.java new file mode 100644 index 00000000..35b9579a --- /dev/null +++ b/dozentenmodulserver/src/main/java/server/ServerHandler.java @@ -0,0 +1,547 @@ +package server; + +import java.io.File; +import java.io.IOException; +import java.math.BigInteger; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.sql.SQLException; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.TransformerException; +import models.Configuration; +import org.apache.commons.io.FileUtils; +import org.apache.log4j.Logger; +import org.apache.thrift.TException; + +import com.mysql.jdbc.StringUtils; + +import sql.SQL; +import util.XMLCreator; + + + +public class ServerHandler implements Server.Iface { + static SQL sql = new SQL(); + + private static Logger log = Logger.getLogger(ServerHandler.class); + + @Override + public User getFtpUser() throws TException { + log.info(new Date() + " - returning FTPUser..."); + User user = new User(); + user.setUserName(UUID.randomUUID().toString().substring(0, 8)); + user.setPassword(getEncodedSha1Sum(UUID.randomUUID().toString() + .substring(0, 8))); + if (Configuration.config.getAbsolute_path().endsWith("/")) { + user.setPath(Configuration.config.getAbsolute_path()); + } else { + user.setPath(Configuration.config.getAbsolute_path() + "/"); + } + + // check if folder temp and folder prod exist + if (folderTempExists() == true && folderProdExists() == true) { + sql.writeFTPUser(user.getUserName(), user.getPassword()); + return user; + } else { + log.info(new Date() + " - returning null user"); + return null; + } + } + + public boolean folderTempExists() { + // check if folder temp exists, otherwise create it + Path path = null; + if (Configuration.config.getAbsolute_path().endsWith("/")) { + path = Paths.get(Configuration.config.getAbsolute_path() + "temp"); + } else { + path = Paths.get(Configuration.config.getAbsolute_path() + "/temp"); + } + + if (Files.exists(path) == true) { + log.info(new Date() + " - folder '" + path + + "' exists, no further action"); + return true; + } else { + // create directory and set permissions + boolean success = (new File(path + "")).mkdirs(); + + if (!success) { + log.info(new Date() + " - failed to create folder '" + path + + "'"); + return false; + } else { + // set permissions + try { + Runtime.getRuntime().exec("chmod 777 " + path); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + log.info(new Date() + " - folder '" + path + + "' successfully created"); + return true; + } + } + + }// end folderTempExists() + + public boolean folderProdExists() { + // check if folder temp exists, otherwise create it + Path path = null; + if (Configuration.config.getAbsolute_path().endsWith("/")) { + path = Paths.get(Configuration.config.getAbsolute_path() + "prod"); + } else { + path = Paths.get(Configuration.config.getAbsolute_path() + "/prod"); + } + + if (Files.exists(path) == true) { + log.info(new Date() + " - folder '" + path + + "' exists, no further action"); + return true; + } else { + // create directory and set permissions + boolean success = (new File(path + "")).mkdirs(); + + if (!success) { + log.info(new Date() + " - failed to create folder '" + path + + "'"); + return false; + } else { + // set permissions + try { + Runtime.getRuntime().exec("chmod 777 " + path); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + log.info(new Date() + " - folder '" + path + + "' successfully created"); + return true; + } + } + + }// end folderProdExists() + + + + public String getEncodedSha1Sum(String key) { + try { + MessageDigest md = MessageDigest.getInstance("SHA1"); + md.update(key.getBytes()); + log.info(new Date() + " - successfully returned EncodedSha1Sum"); + return new BigInteger(1, md.digest()).toString(16); + } catch (NoSuchAlgorithmException e) { + // handle error case to taste + } + return null; + } + + @Override + public long DeleteFtpUser(String user) throws TException { + return sql.DeleteUser(user); + } + + @Override + public String getPathOfImage(String image_id, String version) + throws TException { + log.info(new Date() + " - successfully returned PathOfImage: " + + sql.getPathOfImage(image_id, version)); + return sql.getPathOfImage(image_id, version); + + } + + @Override + public boolean writeVLdata(String imagename, String desc ,String login, + String firstname, String lastname, String university, String Mail, + String Tel, String Fak, boolean license, boolean internet, + long ram, long cpu, String imagePath, boolean isTemplate, + long filesize, long shareMode, String os) throws TException { + + String mode=null; + + if(shareMode==0) + { + mode="only_local"; + } + else{ + mode="to_be_published"; + } + + String pk_institution = sql.setInstitution(university); + + String pk_person = sql.setPerson(login, lastname, firstname, Mail, + new Date(), pk_institution); + + //OS impl Select and write + //ACHTUNG: Anzahl der Leerzeichen muss eingehalten werden: 'Windows 7 32 bit" + String pk_os=sql.getOSpk(os.substring(0, nthIndexOf(os, " ", 2)),os.substring(nthIndexOf(os," ", 2), os.lastIndexOf(" ")).replace(" ", "")); + + sql.setImageData(pk_person, license, internet, cpu, ram, imagename,desc, + imagePath, isTemplate, filesize,mode,pk_os); + + log.info(new Date() + " - written VLdata"); + // TODO Auto-generated method stub + return true; + } + + @Override + public List getImageList() throws TException { + return sql.getImageList(); + + } + + @Override + public List getAllOS() throws TException { + return sql.getAllOS(); + + } + + @Override + public Map getPersonData(String Vorname, String Nachname) + throws TException { + return sql.getPersonData(Vorname, Nachname); + + } + + @Override + public boolean writeLecturedata(String name, String shortdesc, String desc, + String startDate, String endDate, boolean isActive, + String imagename, String login, String firstname, String lastname, + String university, String Mail, String Tel, String Fak) + throws TException { + String pk_image = null; + Map map = new HashMap(); + int imageversion = 0; + String pk_institution = sql.setInstitution(university); + String pk_person = sql.setPerson(login, lastname, firstname, Mail, + new Date(), pk_institution); + + map = sql.getImageIDandVersion(imagename); + + pk_image = map.get("GUID"); + imageversion = Integer.parseInt(map.get("version")); + sql.setLectureData(pk_person, pk_image, imageversion, name, desc, + shortdesc, startDate, endDate, isActive); + XMLCreator xml = new XMLCreator(sql.getConnection(), name); + try { + xml.create(name); + log.info(new Date() + " - XML created."); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (TransformerException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return false; + } + + @Override + public boolean startFileCopy(String filename) throws TException { + //copy file from folder temp to folder prod + String file = Configuration.config.getAbsolute_path() + "temp/" + + filename; + File tmpFile = new File(file); + + log.info(new Date() + + " - Trying to move file to '/srv/openslx/nfs/prod/" + + tmpFile.getName() + "'"); + try { + FileUtils.moveFile(tmpFile, + new File(Configuration.config.getAbsolute_path() + "prod/" + + filename)); + // int ret = sql.UpdateImagePath(filename); + if (sql.UpdateImagePath(filename) == 0) { + log.info(new Date() + " - file moved and database updated."); + } + + } catch (IOException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to move file."); + e.printStackTrace(); + } + return true; + } + + @Override + public Map getImageData(String imageid, String imageversion) + throws TException { + log.info(new Date() + " - returning ImageData: " + + sql.getImageData(imageid, imageversion).size() + "items."); + return sql.getImageData(imageid, imageversion); + } + + @Override + public boolean updateImageData(String name, String newName,String desc, + String image_path, boolean license, boolean internet, long ram, + long cpu, String id, String version, boolean isTemplate, + long filesize, long shareMode, String os) throws TException { + String mode=null; + + if(shareMode==0) + { + mode="only_local"; + } + else{ + mode="to_be_published"; + } + String pk_os=sql.getOSpk(os.substring(0, nthIndexOf(os, " ", 2)),os.substring(nthIndexOf(os," ", 2), os.lastIndexOf(" ")).replace(" ", "")); + sql.UpdateImageData(name, newName,desc ,image_path, license, internet, cpu, + ram, id, version, isTemplate, filesize,mode,pk_os); + return false; + } + + + + + @Override + public List getLectureList() throws TException { + + + log.info(new Date().toString() + " - returning LectureList: " + + sql.getLectureList().size() + " items."); + return sql.getLectureList(); + + + } + + @Override + public boolean updateLecturedata(String name, String newName, + String shortdesc, String desc, String startDate, String endDate, + boolean isActive, String imageid,String imageversion,String user ,String firstname, + String lastname, String university, String Mail, String Tel, + String Fak, String id) throws TException { + Map map = new HashMap(); + map = sql.getDeleteXMLData(id); + sql.updateLectureData(imageid, imageversion, lastname, newName, desc, + shortdesc, startDate, endDate, isActive, id); + + String path = Configuration.config.getAbsolute_path() + + "prod/" + + map.get("date") + .substring(0, map.get("date").length() - 2) + "_" + + university + "_" + user + "_" + map.get("name") + ".xml"; + File tmpFile=new File(path); + try { + FileUtils.forceDelete(tmpFile); + } catch (IOException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + XMLCreator xml = new XMLCreator(sql.getConnection(), newName); + try { + xml.create(newName); + } catch (SQLException | ParserConfigurationException + | TransformerException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + return false; + } + + @Override + public boolean deleteImageServer(String imageid, String imageversion) + throws TException { + + String stringFile = sql.getFile(imageid, imageversion); + log.info(new Date() + " - File to Delete: " + stringFile); + + File tmpFile = new File(Configuration.config.getAbsolute_path() + + stringFile); + + try { + // File wird von Server gel�scht + FileUtils.forceDelete(tmpFile); + return true; + + } catch (IOException e) { + log.info(new Date() + " - Failed to execute deleteImageServer."); + e.printStackTrace(); + + } + + return false; + } + + @Override + public boolean deleteImageData(String id, String version) throws TException { + + return sql.deleteImage(id, version); + } + + @Override + public boolean connectedToLecture(String id, String version) + throws TException { + // TODO Auto-generated method stub + return sql.connectedToLecture(id, version); + } + + public boolean deleteLecture(String id, String hs, String user) { + Map map = new HashMap(); + map = sql.getDeleteXMLData(id); + try { + + String path = Configuration.config.getAbsolute_path() + + "prod/" + + map.get("date") + .substring(0, map.get("date").length() - 2) + "_" + + hs + "_" + user + "_" + map.get("name") + ".xml"; + File xmlFile = new File(path); + FileUtils.forceDelete(xmlFile); + } catch (IOException e) { + log.info(new Date() + " - Failed to execute deleteLecture"); + e.printStackTrace(); + } + return sql.deleteLecture(id); + + } + + @Override + public List getAllUniversities() throws TException { + return sql.getAllUniversities(); + + } + + @Override + public Map getLectureData(String lectureid) + throws TException { + log.info(new Date() + " - returning LectureData: " + + sql.getLectureData(lectureid).size() + "items."); + return sql.getLectureData(lectureid); + } + + + + + public static int nthIndexOf(final String string, final String token, + final int index) + { + int j = 0; + + for (int i = 0; i < index; i++) + { + j = string.indexOf(token, j + 1); + if (j == -1) break; + } + + return j; + } + + @Override + public boolean checkUser(String username) throws TException { + return sql.checkUser(username); + + } + + @Override + public boolean createUser(String loginName, String lastName, + String firstName, String mail, String university) throws TException { + String pk_institution = sql.setInstitution(university); + String pk_person = sql.setPerson(loginName, lastName, firstName, mail, + new Date(), pk_institution); + return true; + } + + @Override + public boolean writeImageRights(String imagename, String username, String lastName, String firstName, String mail, String university, String role) + throws TException { + String pk_image = null; + Map map = new HashMap(); + int imageversion = 0; + String pk_institution = sql.setInstitution(university); + String pk_person = sql.setPerson(username, lastName, firstName, mail, + new Date(), pk_institution); + map = sql.getImageIDandVersion(imagename); + pk_image = map.get("GUID"); + imageversion = Integer.parseInt(map.get("version")); + + if(role.equals("Dozent")) { + int read=1; + int write=1; + int changePermission=0; + int admin=0; + int linkallowed=1; + int roleID=sql.getRoleID(role); + + sql.setImageRights(pk_person, pk_image, roleID, read, write, changePermission, admin, linkallowed); + + }else if(role.equals("Admin")){ + int read=1; + int write=1; + int changePermission=1; + int admin=1; + int linkallowed=1; + int roleID=sql.getRoleID(role); + + sql.setImageRights(pk_person, pk_image, roleID, read, write, changePermission, admin, linkallowed); + } + else{ + int read=1; + int write=0; + int changePermission=0; + int admin=0; + int linkallowed=0; + int roleID=sql.getRoleID(role); + + sql.setImageRights(pk_person, pk_image, roleID, read, write, changePermission, admin, linkallowed); + } + + return true; + } + + @Override + public boolean writeLectureRights(String lecturename, String username, + String lastName, String firstName, String mail, String university, + String role) throws TException { + String pk_lecture = null; + + String pk_institution = sql.setInstitution(university); + String pk_person = sql.setPerson(username, lastName, firstName, mail, + new Date(), pk_institution); + pk_lecture=sql.getLectureID(lecturename); + + if(role.equals("Dozent")) { + int read=1; + int write=1; + int changePermission=0; + int admin=0; + int roleID=sql.getRoleID(role); + + sql.setLectureRights(pk_person, pk_lecture, roleID, read, write, changePermission, admin); + + }else if(role.equals("Admin")){ + int read=1; + int write=1; + int changePermission=1; + int admin=1; + int roleID=sql.getRoleID(role); + + sql.setLectureRights(pk_person, pk_lecture, roleID, read, write, changePermission, admin); + } + else{ + int read=0; + int write=0; + int changePermission=0; + int admin=0; + int roleID=sql.getRoleID(role); + + sql.setLectureRights(pk_person, pk_lecture, roleID, read, write, changePermission, admin); + } + + return true; + } + + +} diff --git a/dozentenmodulserver/src/main/java/server/StartServer.java b/dozentenmodulserver/src/main/java/server/StartServer.java new file mode 100644 index 00000000..7280ee99 --- /dev/null +++ b/dozentenmodulserver/src/main/java/server/StartServer.java @@ -0,0 +1,75 @@ +package server; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import models.Configuration; +import org.apache.log4j.BasicConfigurator; +import org.apache.log4j.Logger; +import org.ini4j.InvalidFileFormatException; +import org.ini4j.Wini; +import server.BinaryListener; + + +public class StartServer { + + /** + * @param args + */ + + private static Logger log = Logger.getLogger(StartServer.class); + + private static List servers = new ArrayList<>(); + + public static void main(String[] args) { + + String version = "Version: 1.03"; + String buildDate = "Build Date: 09.09.2014"; + + //get going and show basic information in logfile + BasicConfigurator.configure(); + log.info("***** " + new Date() + " - starting Application *****"); + log.info(new Date() + " - "+version+" , "+buildDate); + + + + // get Configuration + try { + log.info(new Date() + " - Getting config from .ini-file"); + Wini ini = new Wini(new File("Server_Config.ini")); + Configuration.config.setAbsolute_path(ini.get("ftp", + "path_absolute")); + Configuration.config + .setSql_connection(ini.get("sql", "connection")); + Configuration.config.setSql_pass(ini.get("sql", "pass")); + Configuration.config.setSql_user(ini.get("sql", "user")); + } catch (InvalidFileFormatException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (IOException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + // Start Server + Thread t; + t = new Thread(new BinaryListener()); + servers.add(t); + t.start(); + for (Thread wait : servers) { + boolean success = false; + while (!success) { + try { + wait.join(); + success = true; + } catch (InterruptedException e) { + // Do nothing... + } + } + } + log.info(new Date() + " - all Servers shut down, exiting...\n"); + + } + +} diff --git a/dozentenmodulserver/src/main/java/server/TBinaryProtocolSafe.java b/dozentenmodulserver/src/main/java/server/TBinaryProtocolSafe.java new file mode 100644 index 00000000..843b58b1 --- /dev/null +++ b/dozentenmodulserver/src/main/java/server/TBinaryProtocolSafe.java @@ -0,0 +1,123 @@ +package server; + +import java.io.UnsupportedEncodingException; +import java.nio.ByteBuffer; + +import org.apache.thrift.TException; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.protocol.TMessage; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.protocol.TProtocolFactory; +import org.apache.thrift.transport.TTransport; + +/** + * Binary protocol implementation for thrift. + * Will not read messages bigger than 12MiB. + * + */ +public class TBinaryProtocolSafe extends TBinaryProtocol +{ + /** + * Factory + */ + @SuppressWarnings( "serial" ) + public static class Factory implements TProtocolFactory + { + + protected boolean strictRead_ = false; + protected boolean strictWrite_ = true; + + public Factory() + { + this( false, true ); + } + + public Factory(boolean strictRead, boolean strictWrite) + { + strictRead_ = strictRead; + strictWrite_ = strictWrite; + } + + public TProtocol getProtocol( TTransport trans ) + { + return new TBinaryProtocolSafe( trans, strictRead_, strictWrite_ ); + } + } + + private static final int maxLen = 12 * 1024 * 1024; // 12 MiB + + /** + * Constructor + */ + public TBinaryProtocolSafe(TTransport trans) + { + this( trans, false, true ); + } + + public TBinaryProtocolSafe(TTransport trans, boolean strictRead, boolean strictWrite) + { + super( trans ); + strictRead_ = strictRead; + strictWrite_ = strictWrite; + } + + /** + * Reading methods. + */ + + public TMessage readMessageBegin() throws TException + { + int size = readI32(); + if ( size > maxLen ) + throw new TProtocolException( TProtocolException.SIZE_LIMIT, "Payload too big." ); + if ( size < 0 ) { + int version = size & VERSION_MASK; + if ( version != VERSION_1 ) { + throw new TProtocolException( TProtocolException.BAD_VERSION, "Bad version in readMessageBegin" ); + } + return new TMessage( readString(), (byte) ( size & 0x000000ff ), readI32() ); + } else { + if ( strictRead_ ) { + throw new TProtocolException( TProtocolException.BAD_VERSION, "Missing version in readMessageBegin, old client?" ); + } + return new TMessage( readStringBody( size ), readByte(), readI32() ); + } + } + + public String readString() throws TException + { + int size = readI32(); + if ( size > maxLen ) + throw new TProtocolException( TProtocolException.SIZE_LIMIT, "Payload too big." ); + if ( trans_.getBytesRemainingInBuffer() >= size ) { + try { + String s = new String( trans_.getBuffer(), trans_.getBufferPosition(), size, "UTF-8" ); + trans_.consumeBuffer( size ); + return s; + } catch ( UnsupportedEncodingException e ) { + throw new TException( "JVM DOES NOT SUPPORT UTF-8" ); + } + } + + return readStringBody( size ); + } + + public ByteBuffer readBinary() throws TException + { + int size = readI32(); + if ( size > maxLen ) + throw new TProtocolException( TProtocolException.SIZE_LIMIT, "Payload too big." ); + if ( trans_.getBytesRemainingInBuffer() >= size ) { + ByteBuffer bb = ByteBuffer.wrap( trans_.getBuffer(), trans_.getBufferPosition(), size ); + trans_.consumeBuffer( size ); + return bb; + } + + byte[] buf = new byte[ size ]; + trans_.readAll( buf, 0, size ); + return ByteBuffer.wrap( buf ); + } + +} + diff --git a/dozentenmodulserver/src/main/java/server/User.java b/dozentenmodulserver/src/main/java/server/User.java new file mode 100644 index 00000000..7bf98cc4 --- /dev/null +++ b/dozentenmodulserver/src/main/java/server/User.java @@ -0,0 +1,588 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package server; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class User implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("User"); + + private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)-2); + private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)-3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new UserStandardSchemeFactory()); + schemes.put(TupleScheme.class, new UserTupleSchemeFactory()); + } + + public String userName; // required + public String password; // required + public String path; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + USER_NAME((short)-1, "userName"), + PASSWORD((short)-2, "password"), + PATH((short)-3, "path"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // USER_NAME + return USER_NAME; + case -2: // PASSWORD + return PASSWORD; + case -3: // PATH + return PATH; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(User.class, metaDataMap); + } + + public User() { + } + + public User( + String userName, + String password, + String path) + { + this(); + this.userName = userName; + this.password = password; + this.path = path; + } + + /** + * Performs a deep copy on other. + */ + public User(User other) { + if (other.isSetUserName()) { + this.userName = other.userName; + } + if (other.isSetPassword()) { + this.password = other.password; + } + if (other.isSetPath()) { + this.path = other.path; + } + } + + public User deepCopy() { + return new User(this); + } + + @Override + public void clear() { + this.userName = null; + this.password = null; + this.path = null; + } + + public String getUserName() { + return this.userName; + } + + public User setUserName(String userName) { + this.userName = userName; + return this; + } + + public void unsetUserName() { + this.userName = null; + } + + /** Returns true if field userName is set (has been assigned a value) and false otherwise */ + public boolean isSetUserName() { + return this.userName != null; + } + + public void setUserNameIsSet(boolean value) { + if (!value) { + this.userName = null; + } + } + + public String getPassword() { + return this.password; + } + + public User setPassword(String password) { + this.password = password; + return this; + } + + public void unsetPassword() { + this.password = null; + } + + /** Returns true if field password is set (has been assigned a value) and false otherwise */ + public boolean isSetPassword() { + return this.password != null; + } + + public void setPasswordIsSet(boolean value) { + if (!value) { + this.password = null; + } + } + + public String getPath() { + return this.path; + } + + public User setPath(String path) { + this.path = path; + return this; + } + + public void unsetPath() { + this.path = null; + } + + /** Returns true if field path is set (has been assigned a value) and false otherwise */ + public boolean isSetPath() { + return this.path != null; + } + + public void setPathIsSet(boolean value) { + if (!value) { + this.path = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case USER_NAME: + if (value == null) { + unsetUserName(); + } else { + setUserName((String)value); + } + break; + + case PASSWORD: + if (value == null) { + unsetPassword(); + } else { + setPassword((String)value); + } + break; + + case PATH: + if (value == null) { + unsetPath(); + } else { + setPath((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case USER_NAME: + return getUserName(); + + case PASSWORD: + return getPassword(); + + case PATH: + return getPath(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case USER_NAME: + return isSetUserName(); + case PASSWORD: + return isSetPassword(); + case PATH: + return isSetPath(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof User) + return this.equals((User)that); + return false; + } + + public boolean equals(User that) { + if (that == null) + return false; + + boolean this_present_userName = true && this.isSetUserName(); + boolean that_present_userName = true && that.isSetUserName(); + if (this_present_userName || that_present_userName) { + if (!(this_present_userName && that_present_userName)) + return false; + if (!this.userName.equals(that.userName)) + return false; + } + + boolean this_present_password = true && this.isSetPassword(); + boolean that_present_password = true && that.isSetPassword(); + if (this_present_password || that_present_password) { + if (!(this_present_password && that_present_password)) + return false; + if (!this.password.equals(that.password)) + return false; + } + + boolean this_present_path = true && this.isSetPath(); + boolean that_present_path = true && that.isSetPath(); + if (this_present_path || that_present_path) { + if (!(this_present_path && that_present_path)) + return false; + if (!this.path.equals(that.path)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(User other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUserName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPassword()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPath()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("User("); + boolean first = true; + + sb.append("userName:"); + if (this.userName == null) { + sb.append("null"); + } else { + sb.append(this.userName); + } + first = false; + if (!first) sb.append(", "); + sb.append("password:"); + if (this.password == null) { + sb.append("null"); + } else { + sb.append(this.password); + } + first = false; + if (!first) sb.append(", "); + sb.append("path:"); + if (this.path == null) { + sb.append("null"); + } else { + sb.append(this.path); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class UserStandardSchemeFactory implements SchemeFactory { + public UserStandardScheme getScheme() { + return new UserStandardScheme(); + } + } + + private static class UserStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, User struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // USER_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.userName = iprot.readString(); + struct.setUserNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // PASSWORD + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.password = iprot.readString(); + struct.setPasswordIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -3: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, User struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + if (struct.password != null) { + oprot.writeFieldBegin(PASSWORD_FIELD_DESC); + oprot.writeString(struct.password); + oprot.writeFieldEnd(); + } + if (struct.userName != null) { + oprot.writeFieldBegin(USER_NAME_FIELD_DESC); + oprot.writeString(struct.userName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class UserTupleSchemeFactory implements SchemeFactory { + public UserTupleScheme getScheme() { + return new UserTupleScheme(); + } + } + + private static class UserTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, User struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUserName()) { + optionals.set(0); + } + if (struct.isSetPassword()) { + optionals.set(1); + } + if (struct.isSetPath()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetUserName()) { + oprot.writeString(struct.userName); + } + if (struct.isSetPassword()) { + oprot.writeString(struct.password); + } + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, User struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.userName = iprot.readString(); + struct.setUserNameIsSet(true); + } + if (incoming.get(1)) { + struct.password = iprot.readString(); + struct.setPasswordIsSet(true); + } + if (incoming.get(2)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + } + } + +} + diff --git a/dozentenmodulserver/src/main/java/sql/SQL.java b/dozentenmodulserver/src/main/java/sql/SQL.java new file mode 100644 index 00000000..9a115f09 --- /dev/null +++ b/dozentenmodulserver/src/main/java/sql/SQL.java @@ -0,0 +1,1013 @@ +package sql; + +import java.sql.*; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.UUID; + +import models.Configuration; + +import org.apache.log4j.Logger; +import server.BinaryListener; +import server.Image; +import server.Lecture; + +public class SQL { + + private static Logger log = Logger.getLogger(BinaryListener.class); + + public Connection getConnection() { + try { + Class.forName("com.mysql.jdbc.Driver").newInstance(); + } catch (InstantiationException | IllegalAccessException + | ClassNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + try { + Connection con = DriverManager + .getConnection("jdbc:mysql://"+Configuration.config.getSql_connection()+"?user="+Configuration.config.getSql_user()+"&password="+Configuration.config.getSql_pass()+""); + con.setAutoCommit(false); + + return con; + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to return connection to Client."); + e.printStackTrace(); + } + return null; + } + + public int writeFTPUser(String user, String pass) { + Statement stm; + try { + Connection con=getConnection(); + stm = con.createStatement(); + + int ret = stm + .executeUpdate("INSERT INTO `bwLehrpool`.`FtpUsers`(`User`,`Password`,`Uid`,`Gid`,`Dir`)VALUES('" + + user + + "',SHA1('" + + pass + + "'),'10001','12345','"+Configuration.config.getAbsolute_path()+"temp/');"); + con.commit(); + con.close(); + log.info(new Date() + " - created FTPUser " + user + " : " + pass + + "."); + return ret; + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to writeFTPUser."); + e.printStackTrace(); + } + return -1; + } + + public int DeleteUser(String user) { + Statement stm; + try { + Connection con=getConnection(); + stm = con.createStatement(); + + int ret = stm + .executeUpdate("DELETE FROM `bwLehrpool`.`FtpUsers` where User like '" + + user + "';"); + con.commit(); + con.close(); + log.info(new Date() + " - FTPUser " + user + " deleted."); + return ret; + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to DeleteUser."); + e.printStackTrace(); + } + return -1; + } + + public ResultSet getImage() { + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + ResultSet rs=stm + .executeQuery("SELECT image_name FROM bwLehrpool.m_VLData_imageInfo;"); + con.close(); + return rs; + + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getImage."); + e.printStackTrace(); + } + + return null; + } + + public String getPathOfImage(String image_id, + String version) { + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + ResultSet rs=stm + .executeQuery("SELECT image_path FROM bwLehrpool.m_VLData_imageInfo where GUID_imageID='" + + image_id + + "' and imageVersion='" + + version + + "';"); + rs.first(); + String path=rs.getString("image_path"); + con.close(); + return path; + + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getPathOfImage."); + e.printStackTrace(); + } + + return null; + } + + public String setInstitution(String university) { + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + + ResultSet ret = stm + .executeQuery("SELECT * FROM bwLehrpool.m_institution where name like'" + + university + "';"); + + if (ret.next() == false) { + + String id = UUID.randomUUID().toString(); + stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_institution`(`institutionID`,`name`)VALUES('" + + id + "','" + university + "');"); + con.commit(); + ResultSet rs = stm + .executeQuery("SELECT institutionID FROM bwLehrpool.m_institution WHERE name like '" + + university + "';"); + rs.next(); + String institution=rs.getString("institutionID"); + con.close(); + + return institution; + } else { + String institution=ret.getString("institutionID"); + con.close(); + return institution; + } + + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to setInstitution."); + e.printStackTrace(); + } + return "-1"; + } + + public String setPerson(String login, String lastname, + String firstname, String mail, Date lastlogin, String Institution) { + DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + + ResultSet ret = stm + .executeQuery("SELECT userID FROM bwLehrpool.m_user where Nachname like '" + + lastname + + "' and Vorname like '" + + firstname + + "';"); + + if (ret.next() == false) { + + String id = UUID.randomUUID().toString(); + stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_user`(`userID`,`loginName`,`nachname`,`vorname`,`mail`,`lastLogin`,`institution`)VALUES('" + + id + + "','" + + login + + "','" + + lastname + + "','" + + firstname + + "','" + + mail + + "','" + + formatter.format(new Date()) + + "','" + + Institution + + "');"); + con.commit(); + ResultSet rs = stm + .executeQuery("SELECT userID FROM bwLehrpool.m_user where Nachname like '" + + lastname + + "' and Vorname like '" + + firstname + + "';"); + rs.next(); + String userid=rs.getString("userID"); + con.close(); + return userid; + } else { + ret.first(); + String userid=ret.getString("userID"); + con.close(); + return userid; + } + + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to setPerson."); + e.printStackTrace(); + } + return "-1"; + } + + public boolean setImageData(String pk_person, boolean license, + boolean internet, long cpu, long ram, String imagename,String desc, + String imagePath, boolean isTemplate, long filesize, String shareMode, String pk_os) { + + DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + + int internet_bol = 0; + int license_bol = 0; + if (internet == true) { + internet_bol = 1; + } + if (license == true) { + license_bol = 1; + } + + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + + String uid = UUID.randomUUID().toString(); + stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_VLData_imageInfo`(`GUID_imageID`,`imageVersion`,`image_name`,`image_description`,`image_path`,`image_lastCall`,`image_create_time`,`image_update_time`,`image_owner`,`image_change_by`,`rec_create_time`,`rec_change_time`,`rec_owner`,`rec_change_by`,`content_operatingSystem`,`status_isCompressed`,`status_isSecure`,`status_isOptimzed`,`status_isValid`,`status_isReady`,`status_isDeleted`,`status_isLastOfficialVersion`,`cond_hasLicenseRestriction`,`cond_hasInternetRestriction`,`cond_minRAM`,`cond_minCPUs`,`image_isTemplate`,`image_filesize`,`image_syncMode`)VALUES('" + + uid // GUID_imageID + + "',1,'" // imageVersion + + imagename // image_name + + "','" +desc //image_description + + "','" + imagePath // image_path + + "','" + formatter.format(new Date()) // image_lastCall + + "','" + formatter.format(new Date()) // image_create_time + + "','" + formatter.format(new Date()) // image_update_time + + "','" + pk_person // image_owner + + "','" + pk_person // image_change_by + + "','" + formatter.format(new Date()) // rec_create_time + + "','" + formatter.format(new Date()) // rec_change_time + + "','" + pk_person // rec_owner + + "','" + pk_person // rec_change_by + + "','" + pk_os // content_operatingSystem + + "',1" // status_isCompressed + + ",1" // status_isSecure + + ",1" // status_isOptimzed + + ",1" // status_isValid + + ",1" // status_isReady + + ",0" // status_isDeleted + + ",0,'" // status_isLastOfficialVersion + + license_bol // cond_hasLicenseRestriction + + "','" + internet_bol // cond_hasInternetRestriction + + "','" + ram // cond_minRAM + + "','" + cpu // cond_minCPUs + + "','" + isTemplate //image_isTemplate + + "','" + filesize //image_filesize + + "','" + shareMode //shareMode + + "');"); + con.commit(); + con.close(); + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to setImageData."); + e.printStackTrace(); + } + return true; + + } + + public List getImageList() { + + Connection con=getConnection(); + Statement stm; + List list = new ArrayList(); + try { + + stm = con.createStatement(); + ResultSet res=stm + .executeQuery("SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name,os.architecture, '' as lecture,vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user, vl.image_isTemplate FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and vl.image_owner=u.userID and vl.image_name not in (SELECT vl.image_name FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID) union SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name,os.architecture, lect.name as lecture, vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user, vl.image_isTemplate FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID;"); + + + + while (res.next()) { + + + list.add(new Image(res.getString("GUID_imageID"), res + .getString("imageVersion"), + res.getString("image_name"), res + .getString("cond_hasLicenseRestriction"), res + .getString("name")+" "+res.getString("architecture")+" bit", res.getString("lecture"), + res.getString("image_update_time"), res + .getString("user"), res.getString("image_isTemplate"))); + + } + + con.close(); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + + return list; + + } + + public List getLectureList() { + List list = new ArrayList(); + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + ResultSet res=stm + .executeQuery("SELECT l.lectureID, l.name, l.isActive,l.startTime,l.endTime,l.lastUsed,l.description, i.image_name, concat(u.Nachname,' ',u.Vorname) as user FROM bwLehrpool.m_VLData_lecture l, bwLehrpool.m_VLData_imageInfo i, bwLehrpool.m_user u where i.GUID_imageID=l.imageID and l.admin_owner=u.userID;"); + while (res.next()) { + + list.add(new Lecture(res.getString("lectureID"), res + .getString("name"), res.getString("isActive"), res + .getString("startTime"), res.getString("endTime"), res + .getString("lastUsed"), res.getString("description"), + res.getString("image_name"), res.getString("user"))); + + } + con.close(); + return list; + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getLectureList."); + e.printStackTrace(); + } + return null; + } + + public List getAllOS() { + List list = new ArrayList<>(); + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + ResultSet rs=stm + .executeQuery("SELECT name, architecture FROM bwLehrpool.m_operatingSystem;"); + while (rs.next()) { + list.add(rs.getString("name")+" "+rs.getString("architecture")+" bit"); + } + return list; + + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getAllOS."); + e.printStackTrace(); + } + + return null; + + } + + public Map getPersonData(String Vorname, + String Nachname) { + Map map = new HashMap(); + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + ResultSet rs= stm + .executeQuery("SELECT u.Nachname, u.Vorname, u.mail, i.name FROM bwLehrpool.m_user u, bwLehrpool.m_institution i where u.Nachname like '" + + Nachname + + "' and u.Vorname like '" + + Vorname + + "' and u.institution=i.institutionID;"); + while (rs.next()) { + + map.put("mail", rs.getString("mail")); + map.put("Nachname", rs.getString("Nachname")); + map.put("Vorname", rs.getString("Vorname")); + map.put("Hochschule", rs.getString("name")); + + } + con.close(); + return map; + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getPersonData."); + e.printStackTrace(); + } + return null; + } + + public int setLectureData(String pk_person, String pk_image, + int imageversion, String name, String desc, String shortdesc, + String start, String end, boolean isactive) { + + DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + int active_bol = 0; + + if (isactive == true) { + active_bol = 1; + } + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + + String uid = UUID.randomUUID().toString(); + stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_VLData_lecture`(`lectureID`,`name`,`isActive`,`startTime`,`endTime`,`lastUsed`,`shortDescription`,`description`,`imageID`,`imageVersion`,`admin_createTime`,`admin_changeTime`,`admin_owner`,`admin_change_by`)VALUES('" + + uid + + "','" + + name + + "','" + + active_bol + + "','" + + start + + "','" + + end + + "','" + + formatter.format(new Date()) + + "','" + + shortdesc + + "','" + + desc + + "','" + + pk_image + + "','" + + imageversion + + "','" + + formatter.format(new Date()) + + "','" + + formatter.format(new Date()) + + "','" + + pk_person + + "','" + + pk_person + "');"); + con.commit(); + con.close(); + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to setLectureData."); + e.printStackTrace(); + } + return 0; + + } + + public Map getImageIDandVersion(String name) { + Map map = new HashMap(); + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + ResultSet image= stm + .executeQuery("SELECT GUID_imageID, imageVersion FROM bwLehrpool.m_VLData_imageInfo where image_name like '" + + name + "';"); + while (image.next()) { + map.put("GUID", image.getString("GUID_imageID")); + map.put("version", String.valueOf(image.getString("imageVersion"))); + + } + con.close(); + return map; + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getImageIDandVersion."); + e.printStackTrace(); + } + return null; + } + + public Map getImageData(String id, String version) { + Map map = new HashMap(); + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + ResultSet data=stm + .executeQuery("SELECT u.mail, i.GUID_imageID, i.imageVersion, i.image_name,i.image_description,i.image_update_time,i.cond_hasInternetRestriction,i.cond_hasLicenseRestriction, i.cond_minCPUs,i.cond_minRAM, i.image_syncMode,i.image_filesize,i.image_path, i.image_isTemplate,os.GuestOS, concat(u.Nachname,' ',u.Vorname) as Owner FROM bwLehrpool.m_VLData_imageInfo i,bwLehrpool.m_user u,bwLehrpool.m_operatingSystem os where i.image_owner=u.userID and i.content_operatingSystem=os.operatingSystemID and GUID_imageID = '" + id + "' and imageVersion = '" + version + "' ;"); + while (data.next()) { + map.put("name", data.getString("image_name")); + map.put("internet", + data.getString("cond_hasInternetRestriction")); + map.put("license", data.getString("cond_hasLicenseRestriction")); + map.put("cpu", data.getString("cond_minCPUs")); + map.put("ram", data.getString("cond_minRAM")); + map.put("shareMode", data.getString("image_syncMode")); + map.put("filesize", data.getString("image_filesize")); + map.put("path", data.getString("image_path")); + map.put("template", data.getString("image_isTemplate")); + map.put("os",data.getString("GuestOS")); + map.put("owner", data.getString("Owner")); + map.put("lastupdate", data.getString("image_update_time")); + map.put("desc", data.getString("image_description")); + map.put("id", data.getString("GUID_imageID")); + map.put("version", data.getString("imageVersion")); + map.put("mail", data.getString("mail")); + + } + con.close(); + return map; + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getImageData."); + e.printStackTrace(); + } + return null; + } + + public int UpdateImageData(String name, String newName,String desc,String image_path, + boolean license, boolean internet, long cpu, long ram, String id, + String version, boolean isTemplate, long filesize, String shareMode,String ospk) { + try { + Connection con=getConnection(); + DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + Statement stm = con.createStatement(); + int newVersion = Integer.parseInt(version) + 1; + + int internet_bol = 0; + int license_bol = 0; + if (internet == true) { + internet_bol = 1; + } + if (license == true) { + license_bol = 1; + } + log.info(new Date() + " - 'image_name` = '" + newName+ "\n length of name="+newName.length()); + + stm.executeUpdate("UPDATE `bwLehrpool`.`m_VLData_imageInfo` SET `imageVersion` = '" + + newVersion + + "',`image_name` = '" + + newName + + "',`image_description` = '" + + desc + + "',`image_path` = '" + + image_path + + "',`image_update_time` = '" + + formatter.format(new Date()) + + "',`rec_change_time` = '" + + formatter.format(new Date()) + + "',`cond_hasLicenseRestriction` = '" + + license_bol + + "',`cond_hasInternetRestriction` = '" + + internet_bol + + "',`cond_minRAM` = '" + + ram + + "',`cond_minCPUs` = '" + + cpu + + "',`image_isTemplate` = '" + + isTemplate + + "',`content_operatingSystem` = '" + + ospk + + "',`image_filesize` = '" + + filesize + + "',`image_syncMode` = '" + + shareMode + + "' WHERE `GUID_imageID` = '" + + id + + "' AND `imageVersion` = '" + version + "';"); + con.commit(); + con.close(); + return 0; + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to UpdateImageData."); + e.printStackTrace(); + } + return -1; + } + + public boolean deleteImage(String id, String version) { + + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + + stm.executeUpdate("DELETE FROM bwLehrpool.m_VLData_imageInfo where GUID_imageID = '" + + id + "' " + "AND imageVersion = '" + version + "';"); + + con.commit(); + con.close(); + return true; + + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to deleteImage."); + e.printStackTrace(); + } + + return false; + } + + public int updateLectureData(String pk_image, + String imageversion, String name, String newName, String desc, + String shortdesc, String start, String end, boolean isactive, + String id) { + + DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + int active_bol = 0; + + if (isactive == true) { + active_bol = 1; + } + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + stm.executeUpdate("UPDATE `bwLehrpool`.`m_VLData_lecture` SET `name` = '" + + newName + + "',`isActive` = '" + + active_bol + + "',`startTime` = '" + + start + + "',`endTime` = '" + + end + + "',`description` = '" + + desc + + "',`imageID` = '" + + pk_image + + "',`imageVersion` = '" + + imageversion + + "',`admin_changeTime` = '" + + formatter.format(new Date()) + + "'WHERE `lectureID` = '" + id + "';"); + con.commit(); + con.close(); + log.info(new Date() + " - Succeeded to updateLectureData."); + + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to updateLectureData."); + e.printStackTrace(); + } + + return 0; + + } + + public boolean connectedToLecture(String id, String version) { + + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + + ResultSet rs = stm.executeQuery("SELECT lectureID FROM " + + "bwLehrpool.m_VLData_lecture WHERE imageID = '" + id + + "' AND imageVersion = '" + version + "';"); + boolean ret=rs.first(); + con.close(); + return ret; + + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + + " - Failed to execute method connectedToLecture."); + e.printStackTrace(); + } + + return false; + + } + + public boolean deleteLecture(String id) { + + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + stm.executeUpdate("DELETE FROM bwLehrpool.m_VLData_lecture WHERE lectureID = '" + + id + "';"); + + con.commit(); + con.close(); + return true; + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to deleteLecture."); + e.printStackTrace(); + } + + return false; + } + + public String getFile(String imageid, String imageversion) { + + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + + ResultSet rs = stm + .executeQuery("SELECT image_path FROM bwLehrpool.m_VLData_imageInfo WHERE GUID_imageID = '" + + imageid + + "' AND imageVersion = '" + + imageversion + + "';"); + rs.next(); + String path=rs.getString("image_path"); + con.close(); + return path; + + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getFile."); + e.printStackTrace(); + } + + return null; + } + + public Map getDeleteXMLData(String id) { + Map map = new HashMap(); + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + + ResultSet rs = stm + .executeQuery("SELECT name, admin_createTime FROM bwLehrpool.m_VLData_lecture where lectureID='" + + id + "';"); + rs.next(); + map.put("date", rs.getString("admin_createTime").replace(" ", "") + .replace("-", "").replace(":", "")); + map.put("name", rs.getString("name")); + + + con.close(); + return map; + + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getDeleteXMLData."); + e.printStackTrace(); + } + + return null; + } + + public int UpdateImagePath(String name) { + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + String image_path="prod/"+name; + + stm.executeUpdate("UPDATE `bwLehrpool`.`m_VLData_imageInfo` SET `image_path` = '" + + image_path + + "' WHERE `image_path` = '" + + "temp/"+name + "';"); + con.commit(); + con.close(); + return 0; + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to UpdateImagePath."); + e.printStackTrace(); + } + return -1; + } + + public List getAllUniversities() { + List list = new ArrayList<>(); + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + ResultSet rs=stm + .executeQuery("SELECT name FROM bwLehrpool.m_institution;"); + while (rs.next()) { + list.add(rs.getString("name")); + } + return list; + + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getAllUniversities."); + e.printStackTrace(); + } + + return null; + + } + + public String getOSpk(String os, + String architecture) { + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + log.info(new Date() + " - Getting PrimaryKey for OS: "+os+" architecture: "+architecture); + ResultSet rs=stm + .executeQuery("SELECT operatingSystemID FROM bwLehrpool.m_operatingSystem where name like '" + + os + + "' and architecture like '" + + architecture + + "';"); + rs.first(); + String pkos=rs.getString("operatingSystemID"); + log.info(new Date() + " - Key is "+pkos); + con.close(); + return pkos; + + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getOSpk."); + e.printStackTrace(); + } + + return null; + } + + public String getOS(String pk) { + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + //log.info(new Date() + " - OS: "+os+" architecture: "+architecture); + ResultSet rs=stm + .executeQuery("SELECT name,architecture FROM bwLehrpool.m_operatingSystem where operatingSystemID = '" + + pk + + "';"); + rs.first(); + String os=rs.getString("name")+" "+rs.getString("architecture"); + con.close(); + return os; + + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getOS."); + e.printStackTrace(); + } + + return null; + } + + public Map getLectureData(String id) { + Map map = new HashMap(); + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + ResultSet data=stm + .executeQuery("select l.name, l.isActive, l.startTime, l.endTime, l.lastUsed, l.description, i.image_path, l.imageVersion, concat(u.Nachname,' ',u.Vorname) as owner from m_VLData_lecture l, m_user u, m_VLData_imageInfo i where l.admin_owner=u.userID and l.imageID=i.GUID_imageID and lectureID= '" + id + "' ;"); + while (data.next()) { + map.put("name", data.getString("name")); + map.put("isActive", + data.getString("isActive")); + map.put("startTime", data.getString("startTime")); + map.put("endTime", data.getString("endTime")); + map.put("lastUsed", data.getString("lastUsed")); + map.put("desc", data.getString("description")); + map.put("imagepath", data.getString("image_path")); + map.put("imageversion", data.getString("imageVersion")); + map.put("owner", data.getString("Owner")); + + } + con.close(); + return map; + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getLectureData."); + e.printStackTrace(); + } + return null; + } + + public boolean checkUser(String username) { + Statement stm; + boolean ret=false; + try { + Connection con=getConnection(); + stm = con.createStatement(); + ResultSet rs=stm.executeQuery("Select * from m_user where loginName like '"+username+"'"); + if(rs.next()) + { + ret=true; + log.info(new Date() + " - User " + rs.getString("loginName") + " exist."); + } + else{ + ret=false; + log.info(new Date() + " - User " + rs.getString("loginName") + " not exist."); + } + con.close(); + + + } catch (SQLException e) { + // TODO Auto-generated catch block + + e.printStackTrace(); + } + return ret; + } + + public int setImageRights(String pk_person, String pk_image,int role ,int read, int write, int changePermission, int admin,int linkallowed) { + + + + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + + String uid = UUID.randomUUID().toString(); + stm.executeUpdate("INSERT INTO `bwLehrpool`.`pm_VLData_image`(`GUID`,`GUID_imageID`,`roleID`,`userID`,`image_read`,`image_write`,`image_admin`,`image_changePermission`,`link_allowed`)VALUES('" + + uid + + "','" + + pk_image + + "','" + + role + + "','" + + pk_person + + "','" + + read + + "','" + + write + + "','" + + admin + + "','" + + changePermission + + "','" + + linkallowed+ "');"); + con.commit(); + con.close(); + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to setImageRights."); + e.printStackTrace(); + } + return 0; + + } + public int getRoleID(String role) { + + + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + + ResultSet rs=stm + .executeQuery("SELECT roleID FROM bwLehrpool.m_role where name like '"+ role+ "';"); + rs.first(); + + return rs.getInt("roleID"); + + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getRoleID."); + e.printStackTrace(); + } + return -1; + } + public int setLectureRights(String pk_person, String pk_lecture,int role ,int read, int write, int changePermission, int admin) { + + + + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + + String uid = UUID.randomUUID().toString(); + stm.executeUpdate("INSERT INTO `bwLehrpool`.`pm_VLData_lecture`(`GUID`,`lectureID`,`roleID`,`userID`,`rec_read`,`rec_write`,`rec_admin`,`rec_changePermission`)VALUES('" + + uid + + "','" + + pk_lecture + + "','" + + role + + "','" + + pk_person + + "','" + + read + + "','" + + write + + "','" + + admin + + "','" + + changePermission+ "');"); + con.commit(); + con.close(); + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to setLectureRights."); + e.printStackTrace(); + } + return 0; + + } + public String getLectureID(String name) { + String id=null; + try { + Connection con=getConnection(); + Statement stm = con.createStatement(); + ResultSet lecture= stm + .executeQuery("SELECT lectureID FROM bwLehrpool.m_VLData_lecture where name like '" + + name + "';"); + while (lecture.next()) { + id=lecture.getString("lectureID"); + + } + con.close(); + return id; + } catch (SQLException e) { + // TODO Auto-generated catch block + log.info(new Date() + " - Failed to LectureID."); + e.printStackTrace(); + } + return id; + } +} diff --git a/dozentenmodulserver/src/main/java/util/XMLCreator.java b/dozentenmodulserver/src/main/java/util/XMLCreator.java new file mode 100644 index 00000000..46cdef5d --- /dev/null +++ b/dozentenmodulserver/src/main/java/util/XMLCreator.java @@ -0,0 +1,230 @@ +package util; + +import java.io.File; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import models.Configuration; + +import org.apache.log4j.Logger; +import org.w3c.dom.Comment; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import server.BinaryListener; +import sql.SQL; + +public class XMLCreator { + + /* + * This class offers methods to create XML files for the (old) version of + * managing VMware *.vmdks + */ + + private Connection con = null; + private Statement st = null; + private ResultSet rs = null; + private String vmName; + private String filePath = Configuration.config.getAbsolute_path()+"prod/"; + private String imageName; + private String xmlName; + private static Logger log = Logger.getLogger( BinaryListener.class ); + + + // phone param not existing + private String query = "SELECT m_VLData_imageInfo.image_path ,vorname, nachname, mail, shortdescription, description, m_operatingSystem.guestOS as os,m_VLData_lecture.admin_createTime as createtime ,m_VLData_lecture.admin_changeTime as time, m_VLData_lecture.name as lectureName, m_user.institution as userInstitution, m_user.loginName as loginName, m_VLData_lecture.isActive, m_institution.name as institutionName " + + "FROM bwLehrpool.m_VLData_lecture, bwLehrpool.m_VLData_imageInfo, bwLehrpool.m_user, bwLehrpool.m_operatingSystem, bwLehrpool.m_institution " + + "WHERE m_user.userID = m_VLData_lecture.admin_owner " + + "AND m_VLData_imageInfo.GUID_imageID = m_VLData_lecture.imageID " + + "AND m_VLData_imageInfo.content_operatingSystem = m_operatingSystem.operatingSystemID " + + "AND m_user.institution = m_institution.institutionID " + + "AND m_VLData_lecture.name = "; + + public XMLCreator(Connection con) { + this.con = con; + } + + public XMLCreator(Connection con, String vmName) { + this.con = con; + this.vmName = vmName; + } + + public boolean create() throws SQLException, ParserConfigurationException, + TransformerException { + + // System.out.println(query); + + if (con == null || vmName == null) { + return false; + } + query += "'" + this.vmName + "';"; + + boolean success = startCreation(); + + if (success) { + return true; + } + log.info(new Date() + " - Could not create XML-File '"+vmName+"'. Error in create(String vmName)."); + return false; + + } + + // overload method for dynamic setting of param vmName instead of static + // context above + public boolean create(String vmName) throws SQLException, + ParserConfigurationException, TransformerException { + // System.out.println(query); + + if (con == null || vmName == null) { + return false; + } + query += "'" + vmName + "';"; + + boolean success = startCreation(); + + if (success) { + return true; + } + log.info(new Date() + " - Could not create XML-File '"+vmName+"'. Error in create(String vmName)."); + return false; + } + + private boolean startCreation() throws SQLException, + ParserConfigurationException, TransformerException { + // get needed data from database + st = con.createStatement(); + rs = st.executeQuery(query); + rs.next(); + + // factory + DocumentBuilderFactory docFactory = DocumentBuilderFactory + .newInstance(); + DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); + + // root elements - dynamic content + Document doc = docBuilder.newDocument(); + Element rootElement = doc.createElement("settings"); + doc.appendChild(rootElement); + + Element entry = doc.createElement("eintrag"); + rootElement.appendChild(entry); + + Element prio = doc.createElement("priority"); + entry.appendChild(prio); + prio.setAttribute("param", "0"); + + Comment fComment = doc.createComment("Diesen Abschnitt erg�nzen"); + entry.appendChild(fComment); + + Element imgName = doc.createElement("image_name"); + entry.appendChild(imgName); + imageName = rs.getString("image_path").substring( + rs.getString("image_path").lastIndexOf("/")+1); //+1 um das f�hrende "/" los zu werden + + imgName.setAttribute("param", imageName); + + Element creator = doc.createElement("creator"); + entry.appendChild(creator); + creator.setAttribute("param", + (rs.getString("vorname") + " " + rs.getString("nachname"))); + + Element email = doc.createElement("email"); + entry.appendChild(email); + email.setAttribute("param", rs.getString("mail")); + + // TODO check whether necessary + Element phone = doc.createElement("phone"); + entry.appendChild(phone); + phone.setAttribute("param", ""); + + Element shortDesc = doc.createElement("short_description"); + entry.appendChild(shortDesc); + shortDesc.setAttribute("param", rs.getString("lectureName")); + + // TODO append latest change date and time + Element longDesc = doc.createElement("long_description"); + entry.appendChild(longDesc); + longDesc.setAttribute("param", rs.getString("description") + + "; last update: " + rs.getString("time")); + + Element os = doc.createElement("os"); + entry.appendChild(os); + os.setAttribute("param", rs.getString("os")); + + Comment sComment = doc.createComment("Diesen Abschnitt erg�nzen"); + entry.appendChild(sComment); + + // static content following - second part of xml descriptor + + Element netwParam = doc.createElement("network"); + entry.appendChild(netwParam); + netwParam.setAttribute("param", "nat"); + + Element netcParam = doc.createElement("netcard"); + entry.appendChild(netcParam); + netcParam.setAttribute("param", "e1000"); + + Element vm = doc.createElement("virtualmachine"); + entry.appendChild(vm); + vm.setAttribute("param", "vmware"); + + // TODO Fallunterscheidung + Element icon = doc.createElement("icon"); + entry.appendChild(icon); + icon.setAttribute("param", "windows"); + + Element active = doc.createElement("active"); + entry.appendChild(active); + + //set activity + if(rs.getString("isActive").equals("1")){ + active.setAttribute("param", "true"); + } else if(rs.getString("isActive").equals("0")){ + active.setAttribute("param", "false"); + } + + Element pools = doc.createElement("pools"); + entry.appendChild(pools); + pools.setAttribute("param", "default"); + + Element enable3d = doc.createElement("enable3d"); + entry.appendChild(enable3d); + enable3d.setAttribute("param", "true"); + + // write virtual document to file + TransformerFactory transformerFactory = TransformerFactory + .newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + DOMSource source = new DOMSource(doc); + + //Set XML-filename + xmlName=rs.getString("createtime").substring(0, rs.getString("createtime").length() - 2).replace("-", "").replace(" ", "").replace(":", "") + "_" + rs.getString("institutionName") + "_" + rs.getString("loginName") + "_" + rs.getString("lectureName") + ".xml"; + + //Write file + StreamResult result = new StreamResult(new File(filePath+ xmlName)); // see filepath at top of class + + transformer.transform(source, result); + + // cleanup + rs.close(); + st.close(); + + // return + log.info(new Date() + " - XML-File '"+xmlName+"' successfully created."); + return true; + } +} diff --git a/dozentenmodulserver/src/test/java/bwlehrpool/AppTest.java b/dozentenmodulserver/src/test/java/bwlehrpool/AppTest.java new file mode 100644 index 00000000..ffcdcc2e --- /dev/null +++ b/dozentenmodulserver/src/test/java/bwlehrpool/AppTest.java @@ -0,0 +1,38 @@ +package bwlehrpool; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/dozentenmodulserver/thrift/server.thrift b/dozentenmodulserver/thrift/server.thrift new file mode 100644 index 00000000..51bc1765 --- /dev/null +++ b/dozentenmodulserver/thrift/server.thrift @@ -0,0 +1,61 @@ +/** + * Define some namespace/package name for our stuff + */ +namespace java server + +typedef i64 int + +struct User{ + string userName, + string password, + string path, +} + +struct Image{ + string id, + string version, + string imageName, + string licenseRestriction, + string osName, + string lectureName, + string updateTime, + string userData, + string isTemplate, +} +struct Lecture{ + string id, + string lecturename, + string isActive, + string starttime, + string endtime, + string lastused, + string desc, + string imagename, + string username, + +} +service Server{ + User getFtpUser(), + int DeleteFtpUser(string user), + string getPathOfImage(string image_id,string version), + bool writeVLdata(string imagename, string desc ,string login ,string firstname, string lastname,string university, string Mail, string Tel, string Fak, bool license, bool internet, int ram, int cpu, string imagePath, bool isTemplate ,i64 filesize, int shareMode, string os), + list getImageList(), + list getLectureList(), + list getAllOS(), + list getAllUniversities(), + map getPersonData(string Vorname, string Nachname), + bool writeLecturedata(string name, string shortdesc, string desc,string startDate, string endDate, bool isActive, string imagename,string login,string firstname,string lastname, string university, string Mail, string Tel,string Fak), + bool startFileCopy(string file), + map getImageData(string imageid, string imageversion), + map getLectureData(string lectureid), + bool updateImageData(string name, string newName,string desc,string image_path,bool license, bool internet, int ram,int cpu, string id, string version,bool isTemplate ,i64 filesize, int shareMode, string os), + bool deleteImageData(string id, string version), + bool updateLecturedata(string name, string newName ,string shortdesc, string desc,string startDate, string endDate, bool isActive, string imageid, string imageversion,string user,string firstname,string lastname, string university, string Mail, string Tel,string Fak, string id), + bool deleteImageServer(string id, string version), + bool connectedToLecture(string id, string version), + bool deleteLecture(string id, string hs, string user), + bool checkUser(string username), + bool createUser(string loginName, string lastName, string firstName, string mail, string university), + bool writeImageRights(string imagename, string username, string lastName, string firstName, string mail, string university, string role), + bool writeLectureRights(string lecturename, string username, string lastName, string firstName, string mail, string university, string role), +} \ No newline at end of file -- cgit v1.2.3-55-g7522