From 256d0ef72fe6158f45197dd48ff6acf9f90766c9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Apr 2014 18:02:34 +0200 Subject: dfsvfds --- Dozentenmodulserver/bin/server/ServerHandler.class | Bin 4044 -> 13856 bytes Dozentenmodulserver/src/server/ServerHandler.java | 8 -------- 2 files changed, 8 deletions(-) diff --git a/Dozentenmodulserver/bin/server/ServerHandler.class b/Dozentenmodulserver/bin/server/ServerHandler.class index 8f9b9c51..6a7243b9 100644 Binary files a/Dozentenmodulserver/bin/server/ServerHandler.class and b/Dozentenmodulserver/bin/server/ServerHandler.class differ diff --git a/Dozentenmodulserver/src/server/ServerHandler.java b/Dozentenmodulserver/src/server/ServerHandler.java index 3bf1eddf..fda5da46 100644 --- a/Dozentenmodulserver/src/server/ServerHandler.java +++ b/Dozentenmodulserver/src/server/ServerHandler.java @@ -241,18 +241,15 @@ public class ServerHandler implements Server.Iface { System.out.println("Vor Move" + new Date()); try { -<<<<<<< HEAD //der übergebene Filename ist falsch - hier muss der generierte name geholt werden, nicht der ursprüngliche name. wo wird dieser eingelesen? FileUtils.moveFile(tmpFile, new File("141.79.128.103:/srv/nfs4slx/"+tmpFile.getName())); -======= // der übergebene Filename ist falsch - hier muss der generierte // name geholt werden, nicht der ursprüngliche name. wo wird dieser // eingelesen? FileUtils.moveFile(tmpFile, new File("141.79.128.103:/srv/nfs4slx/" + tmpFile.getName())); log.info(new Date() + " - file moved"); ->>>>>>> 05f774a71379f4bb795fd5c072bfa71469e1c409 } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -340,11 +337,6 @@ public class ServerHandler implements Server.Iface { return null; } -<<<<<<< HEAD - - -======= ->>>>>>> 05f774a71379f4bb795fd5c072bfa71469e1c409 @Override public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, -- cgit v1.2.3-55-g7522 From b78800aac8b52bb44e11b798346ca3fafe18c8bd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Apr 2014 10:41:04 +0200 Subject: Verbindung korrigiert --- Dozentenmodul/bin/gui/image/SearchEditImage_GUI$4.class | Bin 1298 -> 0 bytes Dozentenmodul/bin/gui/image/SearchEditImage_GUI$5.class | Bin 938 -> 0 bytes Dozentenmodul/bin/gui/image/SearchEditImage_GUI$8.class | Bin 980 -> 0 bytes 3 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Dozentenmodul/bin/gui/image/SearchEditImage_GUI$4.class delete mode 100644 Dozentenmodul/bin/gui/image/SearchEditImage_GUI$5.class delete mode 100644 Dozentenmodul/bin/gui/image/SearchEditImage_GUI$8.class diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$4.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$4.class deleted file mode 100644 index 6514ae56..00000000 Binary files a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$4.class and /dev/null differ diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$5.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$5.class deleted file mode 100644 index 12325d18..00000000 Binary files a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$5.class and /dev/null differ diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$8.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$8.class deleted file mode 100644 index d03d40d7..00000000 Binary files a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$8.class and /dev/null differ -- cgit v1.2.3-55-g7522 From cbc155422ac3181ee04e75653e6f302594a2e006 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Apr 2014 10:41:11 +0200 Subject: Verbindung korrigiert --- Dozentenmodul/bin/gui/intro/Login_GUI.class | Bin 9013 -> 9009 bytes Dozentenmodul/bin/thrift/ThriftConnection.class | Bin 1590 -> 1928 bytes Dozentenmodul/src/gui/intro/Login_GUI.java | 2 +- Dozentenmodul/src/thrift/ThriftConnection.java | 8 +- Dozentenmodulserver/bin/sql/SQL.class | Bin 15446 -> 15418 bytes Dozentenmodulserver/src/sql/SQL.java | 185 +++++++++++------------- 6 files changed, 92 insertions(+), 103 deletions(-) diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI.class b/Dozentenmodul/bin/gui/intro/Login_GUI.class index 0d712499..ea041701 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI.class and b/Dozentenmodul/bin/gui/intro/Login_GUI.class differ diff --git a/Dozentenmodul/bin/thrift/ThriftConnection.class b/Dozentenmodul/bin/thrift/ThriftConnection.class index bebd7389..fa1d8d58 100644 Binary files a/Dozentenmodul/bin/thrift/ThriftConnection.class and b/Dozentenmodul/bin/thrift/ThriftConnection.class differ diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java index dcd90969..aa28b3b6 100644 --- a/Dozentenmodul/src/gui/intro/Login_GUI.java +++ b/Dozentenmodul/src/gui/intro/Login_GUI.java @@ -303,7 +303,7 @@ public class Login_GUI extends JFrame { // client has returned with error isClientReturnedCorrectly = false; System.out.println("Fehler: Client hat von Masterserver (" + masterServerIP - + ") hat keine korrekten Verbindungsdaten erhalten."); + + ") keine korrekten Verbindungsdaten erhalten."); } return isClientReturnedCorrectly; diff --git a/Dozentenmodul/src/thrift/ThriftConnection.java b/Dozentenmodul/src/thrift/ThriftConnection.java index 648d8f86..058128a4 100644 --- a/Dozentenmodul/src/thrift/ThriftConnection.java +++ b/Dozentenmodul/src/thrift/ThriftConnection.java @@ -1,5 +1,7 @@ package thrift; +import models.SessionData; + import org.apache.thrift.protocol.TBinaryProtocol; import org.apache.thrift.protocol.TProtocol; import org.apache.thrift.transport.TSocket; @@ -10,7 +12,9 @@ import server.Server; import server.Server.Client; public class ThriftConnection { - final TTransport transport = new TSocket("141.79.128.121", 9090); + + private String satAddress = ""+SessionData.session.getServerAdress(); + final TTransport transport = new TSocket(satAddress, 9090); //final TTransport transport = new TSocket("141.79.128.102", 9090); public Client getThriftConnection() { @@ -26,7 +30,7 @@ public class ThriftConnection { final Server.Client client = new Server.Client(protocol); - System.out.println("Verbindung wurde aufgebaut."); + System.out.println("Verbindung wurde aufgebaut. Satellit="+satAddress); return client; } diff --git a/Dozentenmodulserver/bin/sql/SQL.class b/Dozentenmodulserver/bin/sql/SQL.class index 9310440e..88cc19e7 100644 Binary files a/Dozentenmodulserver/bin/sql/SQL.class and b/Dozentenmodulserver/bin/sql/SQL.class differ diff --git a/Dozentenmodulserver/src/sql/SQL.java b/Dozentenmodulserver/src/sql/SQL.java index daffbf0b..5ae5fde0 100644 --- a/Dozentenmodulserver/src/sql/SQL.java +++ b/Dozentenmodulserver/src/sql/SQL.java @@ -1,10 +1,7 @@ package sql; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; +import java.sql.*; + import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -18,8 +15,8 @@ import server.ServerHandler; public class SQL { - private static Logger log = Logger.getLogger( BinaryListener.class ); - + private static Logger log = Logger.getLogger(BinaryListener.class); + public Connection getConnection() { try { Class.forName("com.mysql.jdbc.Driver").newInstance(); @@ -54,7 +51,8 @@ public class SQL { + pass + "'),'10001','12345','/srv/openslx/nfs/temp');"); con.commit(); - log.info(new Date() + " - created FTPUser "+user+" : "+pass+"."); + log.info(new Date() + " - created FTPUser " + user + " : " + pass + + "."); return ret; } catch (SQLException e) { // TODO Auto-generated catch block @@ -73,11 +71,11 @@ public class SQL { .executeUpdate("DELETE FROM `bwLehrpool`.`FtpUsers` where User like '" + user + "';"); con.commit(); - log.info(new Date() + " - FTPUser "+user+" deleted."); + log.info(new Date() + " - FTPUser " + user + " deleted."); return ret; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Could not delete FTPUser "+user+"."); + log.info(new Date() + " - Could not delete FTPUser " + user + "."); e.printStackTrace(); } return -1; @@ -215,44 +213,31 @@ public class SQL { Random random = new Random(); int uid = random.nextInt(); stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_VLData_imageInfo`(`GUID_imageID`,`imageVersion`,`image_name`,`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`)VALUES('" - + uid //GUID_imageID - + "',1,'" //imageVersion - + imagename //image_name - + "','" - + 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 - + "',0" //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 + + uid // GUID_imageID + + "',1,'" // imageVersion + + imagename // image_name + + "','" + 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 + + "',0" // 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 + "');"); con.commit(); @@ -448,8 +433,6 @@ public class SQL { } return -1; } - - /** * @@ -457,33 +440,33 @@ public class SQL { * @param version * @return */ - - public boolean deleteImage(Connection con, String id, String version) { - - System.out.println("delete image"); - + + public boolean deleteImage(Connection con, String id, String version) { + + System.out.println("delete image"); + try { - Statement stm=con.createStatement(); - + Statement stm = con.createStatement(); System.out.println("delete image"); - - stm.executeUpdate("DELETE FROM bwLehrpool.m_VLData_imageInfo where GUID_imageID = '"+id+"' " + - "AND imageVersion = '"+version+"';"); - + + stm.executeUpdate("DELETE FROM bwLehrpool.m_VLData_imageInfo where GUID_imageID = '" + + id + "' " + "AND imageVersion = '" + version + "';"); + return true; - + } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } - + return false; - } - + } + public int updateLectureData(Connection con, int pk_image, - int imageversion, String name, String newName ,String desc, String shortdesc, - String start, String end, boolean isactive, String id) { + int 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; @@ -494,54 +477,56 @@ public class SQL { try { 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+"';" ); + + 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(); - } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } - + return 0; } - - public boolean connectedToEvents (Connection con, String id, String version) { - + + public boolean connectedToEvents(Connection con, String id, String version) { + try { - Statement stm=con.createStatement(); - - ResultSet rs = stm.executeQuery("SELECT ...VERANSTALTUNG_VERKNÜPFUNG... FROM " + - "bwLehrpool.m_VLData_imageInfo where GUID_imageID = '"+id+"' " + - "AND imageVersion = '"+version+"';"); - + Statement stm = con.createStatement(); + + ResultSet rs = stm + .executeQuery("SELECT ...VERANSTALTUNG_VERKNÜPFUNG... FROM " + + "bwLehrpool.m_VLData_imageInfo where GUID_imageID = '" + + id + + "' " + + "AND imageVersion = '" + + version + + "';"); + return !rs.wasNull(); - - + } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } - + return false; - - } + + } } -- cgit v1.2.3-55-g7522