diff options
| author | unknown | 2014-04-10 10:29:52 +0200 |
|---|---|---|
| committer | unknown | 2014-04-10 10:29:52 +0200 |
| commit | ec67e80ff104bf90d307bf264283eb79d937f262 (patch) | |
| tree | ffd2dde8e010d3ad8c69ca5372d8f2fed3a99b65 /Dozentenmodul | |
| parent | Haufen Konsolenausgaben enfernt (diff) | |
| download | tutor-module-ec67e80ff104bf90d307bf264283eb79d937f262.tar.gz tutor-module-ec67e80ff104bf90d307bf264283eb79d937f262.tar.xz tutor-module-ec67e80ff104bf90d307bf264283eb79d937f262.zip | |
Test
Diffstat (limited to 'Dozentenmodul')
25 files changed, 114 insertions, 6 deletions
diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$8.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$8.class Binary files differindex 8feae5df..e3beaa57 100644 --- a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$8.class +++ b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$8.class diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class Binary files differindex bddb3425..cec2cfad 100644 --- a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class +++ b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$1.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$1.class Binary files differindex 40fe319c..28596b7f 100644 --- a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$1.class +++ b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$1.class diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class Binary files differindex 30c1812c..8b17dab5 100644 --- a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class +++ b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class Binary files differindex 6d6c863c..0b03bc49 100644 --- a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class +++ b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class Binary files differindex ef04eb8c..75c93b92 100644 --- a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class +++ b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class Binary files differindex d4bc6778..0c97260a 100644 --- a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class +++ b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class Binary files differindex 623a9c0e..842bbb87 100644 --- a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class +++ b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class Binary files differindex c8860206..0f9f8a09 100644 --- a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class +++ b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$1.class b/Dozentenmodul/bin/gui/intro/Login_GUI$1.class Binary files differindex a5df5dde..a064efc0 100644 --- a/Dozentenmodul/bin/gui/intro/Login_GUI$1.class +++ b/Dozentenmodul/bin/gui/intro/Login_GUI$1.class diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$2.class b/Dozentenmodul/bin/gui/intro/Login_GUI$2.class Binary files differindex e012848d..9c179a21 100644 --- a/Dozentenmodul/bin/gui/intro/Login_GUI$2.class +++ b/Dozentenmodul/bin/gui/intro/Login_GUI$2.class diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$3.class b/Dozentenmodul/bin/gui/intro/Login_GUI$3.class Binary files differindex 110634ac..33e222c7 100644 --- a/Dozentenmodul/bin/gui/intro/Login_GUI$3.class +++ b/Dozentenmodul/bin/gui/intro/Login_GUI$3.class diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$4.class b/Dozentenmodul/bin/gui/intro/Login_GUI$4.class Binary files differindex 6a5edcf2..0fa234c1 100644 --- a/Dozentenmodul/bin/gui/intro/Login_GUI$4.class +++ b/Dozentenmodul/bin/gui/intro/Login_GUI$4.class diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$5.class b/Dozentenmodul/bin/gui/intro/Login_GUI$5.class Binary files differindex 95da5c83..c09574b4 100644 --- a/Dozentenmodul/bin/gui/intro/Login_GUI$5.class +++ b/Dozentenmodul/bin/gui/intro/Login_GUI$5.class diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI.class b/Dozentenmodul/bin/gui/intro/Login_GUI.class Binary files differindex 26499333..7f627245 100644 --- a/Dozentenmodul/bin/gui/intro/Login_GUI.class +++ b/Dozentenmodul/bin/gui/intro/Login_GUI.class diff --git a/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardScheme.class b/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardScheme.class Binary files differindex f7b6f6b6..9b8c9ed9 100644 --- a/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardScheme.class +++ b/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardScheme.class diff --git a/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardSchemeFactory.class b/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardSchemeFactory.class Binary files differindex 245e7cdc..132cbe65 100644 --- a/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardSchemeFactory.class +++ b/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardSchemeFactory.class diff --git a/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleScheme.class b/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleScheme.class Binary files differindex 9c968929..eaa4e9a6 100644 --- a/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleScheme.class +++ b/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleScheme.class diff --git a/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleSchemeFactory.class b/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleSchemeFactory.class Binary files differindex 2c83a82f..0abd2b91 100644 --- a/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleSchemeFactory.class +++ b/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleSchemeFactory.class diff --git a/Dozentenmodul/bin/thrift/SessionData$_Fields.class b/Dozentenmodul/bin/thrift/SessionData$_Fields.class Binary files differindex 13a9da4f..8a9df0f6 100644 --- a/Dozentenmodul/bin/thrift/SessionData$_Fields.class +++ b/Dozentenmodul/bin/thrift/SessionData$_Fields.class diff --git a/Dozentenmodul/bin/thrift/SessionData.class b/Dozentenmodul/bin/thrift/SessionData.class Binary files differindex f8597a01..f084b247 100644 --- a/Dozentenmodul/bin/thrift/SessionData.class +++ b/Dozentenmodul/bin/thrift/SessionData.class diff --git a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java index e8c0c4b9..81e34dcc 100644 --- a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java @@ -350,6 +350,7 @@ public class FTPCreateUploader_GUI extends JFrame implements btnZurck.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dispose(); + thrift.closeThriftConnection(); CreateImageTechnisch_GUI m = new CreateImageTechnisch_GUI(); m.setVisible(true); } diff --git a/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java b/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java index 4a54e346..dd8782f3 100644 --- a/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java @@ -47,8 +47,6 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener JProgressBar progressBar; String host = "141.79.128.121"; int port = 21; - String username = "openslx"; - String password = "openslx-ng"; String downloadFile = ""; static String arg = ""; DownloadTask task; diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java index 488c6b69..e2db747e 100644 --- a/Dozentenmodul/src/gui/intro/Login_GUI.java +++ b/Dozentenmodul/src/gui/intro/Login_GUI.java @@ -12,6 +12,8 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.io.IOException; +import java.nio.channels.SeekableByteChannel; + import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; @@ -23,6 +25,8 @@ import javax.swing.JTextField; 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.Wini; @@ -179,6 +183,10 @@ public class Login_GUI extends JFrame { String passText = new String(pass.getPassword()); System.out.println("Benutzer:" +username.getText() + "\nPasswort" + passText); result = client.authenticate(username.getText(), passText); + SessionData.session.setAuthToken(result.authToken); + SessionData.session.setSessionID(result.sessionId); + SessionData.session.setServerAdress(result.serverAddress); + System.out.println("Server Adresse: "+result.serverAddress); } catch (thrift.AuthenticationException e) { System.out.println("Authentifizierung fehlgeschlagen: " + e.message); @@ -232,6 +240,7 @@ public class Login_GUI extends JFrame { person.verantwortlicher.setVorname(user.firstName); person.verantwortlicher.setEMail(user.eMail); person.verantwortlicher.setHochschule(hochschule); + // Öffne das Hauprmenü MainMenue_GUI main = new MainMenue_GUI(); main.setVisible(true); diff --git a/Dozentenmodul/src/thrift/SessionData.java b/Dozentenmodul/src/thrift/SessionData.java index 98ef43b4..51f0f80b 100644 --- a/Dozentenmodul/src/thrift/SessionData.java +++ b/Dozentenmodul/src/thrift/SessionData.java @@ -37,6 +37,7 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField AUTH_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("authToken", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField SERVER_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("serverAddress", org.apache.thrift.protocol.TType.STRING, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -46,11 +47,13 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session public String sessionId; // required public String authToken; // required + public String serverAddress; // 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 { SESSION_ID((short)1, "sessionId"), - AUTH_TOKEN((short)2, "authToken"); + AUTH_TOKEN((short)2, "authToken"), + SERVER_ADDRESS((short)3, "serverAddress"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -69,6 +72,8 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session return SESSION_ID; case 2: // AUTH_TOKEN return AUTH_TOKEN; + case 3: // SERVER_ADDRESS + return SERVER_ADDRESS; default: return null; } @@ -116,6 +121,8 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "ID"))); tmpMap.put(_Fields.AUTH_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("authToken", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Token"))); + tmpMap.put(_Fields.SERVER_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("serverAddress", 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(SessionData.class, metaDataMap); } @@ -125,11 +132,13 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session public SessionData( String sessionId, - String authToken) + String authToken, + String serverAddress) { this(); this.sessionId = sessionId; this.authToken = authToken; + this.serverAddress = serverAddress; } /** @@ -142,6 +151,9 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session if (other.isSetAuthToken()) { this.authToken = other.authToken; } + if (other.isSetServerAddress()) { + this.serverAddress = other.serverAddress; + } } public SessionData deepCopy() { @@ -152,6 +164,7 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session public void clear() { this.sessionId = null; this.authToken = null; + this.serverAddress = null; } public String getSessionId() { @@ -202,6 +215,30 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session } } + public String getServerAddress() { + return this.serverAddress; + } + + public SessionData setServerAddress(String serverAddress) { + this.serverAddress = serverAddress; + return this; + } + + public void unsetServerAddress() { + this.serverAddress = null; + } + + /** Returns true if field serverAddress is set (has been assigned a value) and false otherwise */ + public boolean isSetServerAddress() { + return this.serverAddress != null; + } + + public void setServerAddressIsSet(boolean value) { + if (!value) { + this.serverAddress = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_ID: @@ -220,6 +257,14 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session } break; + case SERVER_ADDRESS: + if (value == null) { + unsetServerAddress(); + } else { + setServerAddress((String)value); + } + break; + } } @@ -231,6 +276,9 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session case AUTH_TOKEN: return getAuthToken(); + case SERVER_ADDRESS: + return getServerAddress(); + } throw new IllegalStateException(); } @@ -246,6 +294,8 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session return isSetSessionId(); case AUTH_TOKEN: return isSetAuthToken(); + case SERVER_ADDRESS: + return isSetServerAddress(); } throw new IllegalStateException(); } @@ -281,6 +331,15 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session return false; } + boolean this_present_serverAddress = true && this.isSetServerAddress(); + boolean that_present_serverAddress = true && that.isSetServerAddress(); + if (this_present_serverAddress || that_present_serverAddress) { + if (!(this_present_serverAddress && that_present_serverAddress)) + return false; + if (!this.serverAddress.equals(that.serverAddress)) + return false; + } + return true; } @@ -317,6 +376,16 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session return lastComparison; } } + lastComparison = Boolean.valueOf(isSetServerAddress()).compareTo(other.isSetServerAddress()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServerAddress()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverAddress, other.serverAddress); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -352,6 +421,14 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session sb.append(this.authToken); } first = false; + if (!first) sb.append(", "); + sb.append("serverAddress:"); + if (this.serverAddress == null) { + sb.append("null"); + } else { + sb.append(this.serverAddress); + } + first = false; sb.append(")"); return sb.toString(); } @@ -411,6 +488,14 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 3: // SERVER_ADDRESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.serverAddress = iprot.readString(); + struct.setServerAddressIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -436,6 +521,11 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session oprot.writeString(struct.authToken); oprot.writeFieldEnd(); } + if (struct.serverAddress != null) { + oprot.writeFieldBegin(SERVER_ADDRESS_FIELD_DESC); + oprot.writeString(struct.serverAddress); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -460,19 +550,25 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session if (struct.isSetAuthToken()) { optionals.set(1); } - oprot.writeBitSet(optionals, 2); + if (struct.isSetServerAddress()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetSessionId()) { oprot.writeString(struct.sessionId); } if (struct.isSetAuthToken()) { oprot.writeString(struct.authToken); } + if (struct.isSetServerAddress()) { + oprot.writeString(struct.serverAddress); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, SessionData struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.sessionId = iprot.readString(); struct.setSessionIdIsSet(true); @@ -481,6 +577,10 @@ public class SessionData implements org.apache.thrift.TBase<SessionData, Session struct.authToken = iprot.readString(); struct.setAuthTokenIsSet(true); } + if (incoming.get(2)) { + struct.serverAddress = iprot.readString(); + struct.setServerAddressIsSet(true); + } } } |
