commit 3b1848725dec23c6dfad9fe0ffcdc37ba1c10a96 Author: Tuan-Dat Tran Date: Sun Apr 14 02:29:02 2024 +0200 Initial commit for Network Information Security Exercises Signed-off-by: Tuan-Dat Tran diff --git a/NIS_Client.iml b/NIS_Client.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/NIS_Client.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/doc/allclasses-frame.html b/doc/allclasses-frame.html new file mode 100644 index 0000000..842a938 --- /dev/null +++ b/doc/allclasses-frame.html @@ -0,0 +1,37 @@ + + + + + + +All Classes + + + + + + + + + + + +All Classes +
+ + + + + +
Client +
+Connection +
+TaskDefs +
+TaskObject +
+
+ + + diff --git a/doc/allclasses-noframe.html b/doc/allclasses-noframe.html new file mode 100644 index 0000000..ce88237 --- /dev/null +++ b/doc/allclasses-noframe.html @@ -0,0 +1,37 @@ + + + + + + +All Classes + + + + + + + + + + + +All Classes +
+ + + + + +
Client +
+Connection +
+TaskDefs +
+TaskObject +
+
+ + + diff --git a/doc/constant-values.html b/doc/constant-values.html new file mode 100644 index 0000000..a866fdb --- /dev/null +++ b/doc/constant-values.html @@ -0,0 +1,298 @@ + + + + + + +Constant Field Values + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Constant Field Values

+
+
+Contents + + + + + + +
+de.unidue.*
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
de.unidue.iem.tdr.nis.client.TaskDefs
+public static final intTASK_AES_3ROUNDS14
+public static final intTASK_AES_GF810
+public static final intTASK_AES_KEYEXPANSION11
+public static final intTASK_AES_MIXCOLUMNS12
+public static final intTASK_AES_TRANSFORMATION13
+public static final intTASK_CLEARTEXT1
+public static final intTASK_DES_FEISTEL8
+public static final intTASK_DES_KEYSCHEDULE6
+public static final intTASK_DES_RBLOCK7
+public static final intTASK_DES_ROUND9
+public static final intTASK_DIFFIEHELLMAN18
+public static final intTASK_ELGAMAL_DECRYPTION22
+public static final intTASK_ELGAMAL_ENCRYPTION21
+public static final intTASK_FACTORIZATION4
+public static final intTASK_MODULO3
+public static final intTASK_RC4_ENCRYPTION17
+public static final intTASK_RC4_KEYSCHEDULE16
+public static final intTASK_RC4_LOOP15
+public static final intTASK_RSA_DECRYPTION20
+public static final intTASK_RSA_ENCRYPTION19
+public static final intTASK_VIGENERE5
+public static final intTASK_XOR2
+ +

+ +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/doc/de/unidue/iem/tdr/nis/client/Client.html b/doc/de/unidue/iem/tdr/nis/client/Client.html new file mode 100644 index 0000000..55b15f1 --- /dev/null +++ b/doc/de/unidue/iem/tdr/nis/client/Client.html @@ -0,0 +1,361 @@ + + + + + + +Client + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +de.unidue.iem.tdr.nis.client +
+Class Client

+
+java.lang.Object
+  extended by de.unidue.iem.tdr.nis.client.Client
+
+
+
All Implemented Interfaces:
TaskDefs
+
+
+
+
public class Client
extends java.lang.Object
implements TaskDefs
+ + +

+Diese Klasse ermöglicht das Abrufen von Aufgaben vom Server und die + Implementierung der dazugehörigen Lösungen. +

+ Nähere Informationen zu den anderen Klassen und den einzelnen Aufgabentypen + entnehmen Sie bitte der entsprechenden Dokumentation im TMT und den Javadocs + zu den anderen Klassen. +

+ +

+

+
See Also:
Connection, +TaskObject
+
+ +

+ + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from interface de.unidue.iem.tdr.nis.client.TaskDefs
TASK_AES_3ROUNDS, TASK_AES_GF8, TASK_AES_KEYEXPANSION, TASK_AES_MIXCOLUMNS, TASK_AES_TRANSFORMATION, TASK_CLEARTEXT, TASK_DES_FEISTEL, TASK_DES_KEYSCHEDULE, TASK_DES_RBLOCK, TASK_DES_ROUND, TASK_DIFFIEHELLMAN, TASK_ELGAMAL_DECRYPTION, TASK_ELGAMAL_ENCRYPTION, TASK_FACTORIZATION, TASK_MODULO, TASK_RC4_ENCRYPTION, TASK_RC4_KEYSCHEDULE, TASK_RC4_LOOP, TASK_RSA_DECRYPTION, TASK_RSA_ENCRYPTION, TASK_VIGENERE, TASK_XOR
+  + + + + + + + + + + +
+Constructor Summary
Client() + +
+          Klassenkonstruktor.
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidclose() + +
+          Beendet die Verbindungs zum Server.
+ booleanisReady() + +
+          Besteht die Verbindung zum Server?
+static voidmain(java.lang.String[] args) + +
+           
+ voidtaskLoop() + +
+          Durchläuft eine Liste von Aufgaben und fordert diese vom Server an.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+Client

+
+public Client()
+
+
Klassenkonstruktor. Baut die Verbindung zum Server auf. +

+

+ + + + + + + + +
+Method Detail
+ +

+isReady

+
+public boolean isReady()
+
+
Besteht die Verbindung zum Server? +

+

+
+
+
+ +
Returns:
true, falls Verbindung bereit, andernfalls false
+
+
+
+ +

+close

+
+public void close()
+
+
Beendet die Verbindungs zum Server. +

+

+
+
+
+
+
+
+
+ +

+taskLoop

+
+public void taskLoop()
+
+
Durchläuft eine Liste von Aufgaben und fordert diese vom Server an. +

+

+
+
+
+
+
+
+
+ +

+main

+
+public static void main(java.lang.String[] args)
+
+
+
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/doc/de/unidue/iem/tdr/nis/client/Connection.html b/doc/de/unidue/iem/tdr/nis/client/Connection.html new file mode 100644 index 0000000..c9d6a19 --- /dev/null +++ b/doc/de/unidue/iem/tdr/nis/client/Connection.html @@ -0,0 +1,404 @@ + + + + + + +Connection + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +de.unidue.iem.tdr.nis.client +
+Class Connection

+
+java.lang.Object
+  extended by de.unidue.iem.tdr.nis.client.Connection
+
+
+
+
public class Connection
extends java.lang.Object
+ + +

+Diese Klasse ermöglicht die Kommunikation mit dem Server. Verbindungsauf und + -abbau sind Ihnen in der Klasse Client schon vorgegeben. Für Sie sind + die Methoden sendSolution(String solution), getTask(int taskId), + getTask(int taskId, String[] params) und + sendMoreParams(TaskObject task, String[] params) relevant. +

+ Bitte verändern Sie diese Klasse nicht. +

+ +

+

+
See Also:
Client
+
+ +

+ + + + + + + + + + + + +
+Constructor Summary
+protected Connection() + +
+          Klassenkonstruktor.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+protected  booleanauth(int userId, + java.lang.String password) + +
+          Meldet einen Benutzer am Server an.
+protected  voidclose() + +
+          Beendet die Verbindung mit dem Server.
+protected  TaskObjectgetTask(int taskId) + +
+          Ruft gezielt eine Aufgabe vom Server ab.
+protected  TaskObjectgetTask(int taskId, + java.lang.String[] params) + +
+          Ruft gezielt eine Aufgabe vom Server ab und sendet dabei Parameter mit.
+protected  booleanisReady() + +
+          Gibt an, ob die Verbindungs zum Server bereit ist.
+protected  voidsendMoreParams(TaskObject task, + java.lang.String[] params) + +
+          Sendet weitere Parameter an den Server
+protected  booleansendSolution(java.lang.String solution) + +
+          Sendet eine Lösung an den Server
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+Connection

+
+protected Connection()
+
+
Klassenkonstruktor. Baut die Verbindung zum Server auf. +

+

+ + + + + + + + +
+Method Detail
+ +

+isReady

+
+protected boolean isReady()
+
+
Gibt an, ob die Verbindungs zum Server bereit ist. +

+

+ +
Returns:
true, falls die Verbindung besteht, sonst false
+
+
+
+ +

+auth

+
+protected boolean auth(int userId,
+                       java.lang.String password)
+
+
Meldet einen Benutzer am Server an. +

+

+
Parameters:
userId - Matrikelnr des Benutzers
password - Passwort des Benutzers +
Returns:
true, wenn die Anmeldung erfolgreich war, ansonsten false.
+
+
+
+ +

+close

+
+protected void close()
+
+
Beendet die Verbindung mit dem Server. +

+

+
+
+
+
+ +

+getTask

+
+protected TaskObject getTask(int taskId)
+
+
Ruft gezielt eine Aufgabe vom Server ab. +

+

+
Parameters:
taskId - Identifikator der gewünschten Aufgabe +
Returns:
Aufgabe in Form von TaskObject
+
+
+
+ +

+getTask

+
+protected TaskObject getTask(int taskId,
+                             java.lang.String[] params)
+
+
Ruft gezielt eine Aufgabe vom Server ab und sendet dabei Parameter mit. +

+

+
Parameters:
taskId - Identifikator der gewünschten Aufgabe
params - Parameterliste +
Returns:
Aufgabe in Form von TaskObject
+
+
+
+ +

+sendMoreParams

+
+protected void sendMoreParams(TaskObject task,
+                              java.lang.String[] params)
+
+
Sendet weitere Parameter an den Server +

+

+
Parameters:
task - TaskObject in welches die Antwort vom Server geparst wird
params - Parameter-Liste
+
+
+
+ +

+sendSolution

+
+protected boolean sendSolution(java.lang.String solution)
+
+
Sendet eine Lösung an den Server +

+

+
Parameters:
solution - Lösung des Studierenden
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/doc/de/unidue/iem/tdr/nis/client/TaskDefs.html b/doc/de/unidue/iem/tdr/nis/client/TaskDefs.html new file mode 100644 index 0000000..d26d16a --- /dev/null +++ b/doc/de/unidue/iem/tdr/nis/client/TaskDefs.html @@ -0,0 +1,587 @@ + + + + + + +TaskDefs + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +de.unidue.iem.tdr.nis.client +
+Interface TaskDefs

+
+
All Known Implementing Classes:
Client
+
+
+
+
public interface TaskDefs
+ + +

+Stellt Konstanten für die verschiedenen Aufgabentypen zur Verfügung. +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static intTASK_AES_3ROUNDS + +
+           
+static intTASK_AES_GF8 + +
+           
+static intTASK_AES_KEYEXPANSION + +
+           
+static intTASK_AES_MIXCOLUMNS + +
+           
+static intTASK_AES_TRANSFORMATION + +
+           
+static intTASK_CLEARTEXT + +
+           
+static intTASK_DES_FEISTEL + +
+           
+static intTASK_DES_KEYSCHEDULE + +
+           
+static intTASK_DES_RBLOCK + +
+           
+static intTASK_DES_ROUND + +
+           
+static intTASK_DIFFIEHELLMAN + +
+           
+static intTASK_ELGAMAL_DECRYPTION + +
+           
+static intTASK_ELGAMAL_ENCRYPTION + +
+           
+static intTASK_FACTORIZATION + +
+           
+static intTASK_MODULO + +
+           
+static intTASK_RC4_ENCRYPTION + +
+           
+static intTASK_RC4_KEYSCHEDULE + +
+           
+static intTASK_RC4_LOOP + +
+           
+static intTASK_RSA_DECRYPTION + +
+           
+static intTASK_RSA_ENCRYPTION + +
+           
+static intTASK_VIGENERE + +
+           
+static intTASK_XOR + +
+           
+  +

+ + + + + + + + +
+Field Detail
+ +

+TASK_CLEARTEXT

+
+static final int TASK_CLEARTEXT
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_XOR

+
+static final int TASK_XOR
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_MODULO

+
+static final int TASK_MODULO
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_FACTORIZATION

+
+static final int TASK_FACTORIZATION
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_VIGENERE

+
+static final int TASK_VIGENERE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_DES_KEYSCHEDULE

+
+static final int TASK_DES_KEYSCHEDULE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_DES_RBLOCK

+
+static final int TASK_DES_RBLOCK
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_DES_FEISTEL

+
+static final int TASK_DES_FEISTEL
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_DES_ROUND

+
+static final int TASK_DES_ROUND
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_AES_GF8

+
+static final int TASK_AES_GF8
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_AES_KEYEXPANSION

+
+static final int TASK_AES_KEYEXPANSION
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_AES_MIXCOLUMNS

+
+static final int TASK_AES_MIXCOLUMNS
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_AES_TRANSFORMATION

+
+static final int TASK_AES_TRANSFORMATION
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_AES_3ROUNDS

+
+static final int TASK_AES_3ROUNDS
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_RC4_LOOP

+
+static final int TASK_RC4_LOOP
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_RC4_KEYSCHEDULE

+
+static final int TASK_RC4_KEYSCHEDULE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_RC4_ENCRYPTION

+
+static final int TASK_RC4_ENCRYPTION
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_DIFFIEHELLMAN

+
+static final int TASK_DIFFIEHELLMAN
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_RSA_ENCRYPTION

+
+static final int TASK_RSA_ENCRYPTION
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_RSA_DECRYPTION

+
+static final int TASK_RSA_DECRYPTION
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_ELGAMAL_ENCRYPTION

+
+static final int TASK_ELGAMAL_ENCRYPTION
+
+
+
See Also:
Constant Field Values
+
+
+ +

+TASK_ELGAMAL_DECRYPTION

+
+static final int TASK_ELGAMAL_DECRYPTION
+
+
+
See Also:
Constant Field Values
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/doc/de/unidue/iem/tdr/nis/client/TaskObject.html b/doc/de/unidue/iem/tdr/nis/client/TaskObject.html new file mode 100644 index 0000000..a794cb6 --- /dev/null +++ b/doc/de/unidue/iem/tdr/nis/client/TaskObject.html @@ -0,0 +1,560 @@ + + + + + + +TaskObject + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +de.unidue.iem.tdr.nis.client +
+Class TaskObject

+
+java.lang.Object
+  extended by de.unidue.iem.tdr.nis.client.TaskObject
+
+
+
+
public class TaskObject
extends java.lang.Object
+ + +

+Diese Klasse beinhaltet alle relevanten Informationen, die der Client + benötigt, um eine Aufgabe zu lösen. +

+ Bitte verändern Sie diese Klasse nicht. +

+ +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
TaskObject() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ double[]getDoubleArray() + +
+          Liefert das komplette Double-Array
+ doublegetDoubleArray(int pos) + +
+          Liefert einen spezifischen Wert des Double-Arrays
+ int[]getIntArray() + +
+          Liefert das komplette Int-Array
+ intgetIntArray(int pos) + +
+          Liefert spezifisches Wert aus dem Int-Array
+ java.lang.String[]getStringArray() + +
+          Liefert das komplette String-Array
+ java.lang.StringgetStringArray(int pos) + +
+          Liefert einen spezifischen Wert aus dem String-Array
+ intgetType() + +
+          Liefert den Aufgabentyp
+ voidprintTO() + +
+          Gibt das gesamte Task-Object aus
+protected  voidsetDoubleArray(double[] da) + +
+           
+ voidsetDoubleArray(double d, + int pos) + +
+          Füllt das Double-Array
+protected  voidsetIntArray(int[] ia) + +
+           
+ voidsetIntArray(int i, + int pos) + +
+          Füllt das Int-Array
+protected  voidsetStringArray(java.lang.String[] sa) + +
+           
+ voidsetStringArray(java.lang.String s, + int pos) + +
+          Füllt das String-Array
+ voidsetType(int t) + +
+          Setzt den Aufgabentyp
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+TaskObject

+
+public TaskObject()
+
+
+ + + + + + + + +
+Method Detail
+ +

+setType

+
+public void setType(int t)
+
+
Setzt den Aufgabentyp +

+

+
Parameters:
t - Aufgabentyp
+
+
+
+ +

+getType

+
+public int getType()
+
+
Liefert den Aufgabentyp +

+

+ +
Returns:
Aufgabentyp als Integer
+
+
+
+ +

+setStringArray

+
+protected void setStringArray(java.lang.String[] sa)
+
+
+
+
+
+
+ +

+setStringArray

+
+public void setStringArray(java.lang.String s,
+                           int pos)
+
+
Füllt das String-Array +

+

+
Parameters:
s - einzufügender String
pos - Position im Array
+
+
+
+ +

+getStringArray

+
+public java.lang.String getStringArray(int pos)
+
+
Liefert einen spezifischen Wert aus dem String-Array +

+

+
Parameters:
pos - Position im String-Array +
Returns:
String der Array-Position pos
+
+
+
+ +

+getStringArray

+
+public java.lang.String[] getStringArray()
+
+
Liefert das komplette String-Array +

+

+ +
Returns:
sa
+
+
+
+ +

+setIntArray

+
+protected void setIntArray(int[] ia)
+
+
+
+
+
+
+ +

+setIntArray

+
+public void setIntArray(int i,
+                        int pos)
+
+
Füllt das Int-Array +

+

+
Parameters:
i - einzufügende Zahl
pos - Position im Array
+
+
+
+ +

+getIntArray

+
+public int getIntArray(int pos)
+
+
Liefert spezifisches Wert aus dem Int-Array +

+

+
Parameters:
pos - Position im Array +
Returns:
Int der Position pos
+
+
+
+ +

+getIntArray

+
+public int[] getIntArray()
+
+
Liefert das komplette Int-Array +

+

+ +
Returns:
Int-Array
+
+
+
+ +

+setDoubleArray

+
+protected void setDoubleArray(double[] da)
+
+
+
+
+
+
+ +

+setDoubleArray

+
+public void setDoubleArray(double d,
+                           int pos)
+
+
Füllt das Double-Array +

+

+
Parameters:
d - einzufügende Zahl
pos - Position im Array
+
+
+
+ +

+getDoubleArray

+
+public double getDoubleArray(int pos)
+
+
Liefert einen spezifischen Wert des Double-Arrays +

+

+
Parameters:
pos - Position im Array +
Returns:
Double der Position pos
+
+
+
+ +

+getDoubleArray

+
+public double[] getDoubleArray()
+
+
Liefert das komplette Double-Array +

+

+ +
Returns:
Double-Array
+
+
+
+ +

+printTO

+
+public void printTO()
+
+
Gibt das gesamte Task-Object aus +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/doc/de/unidue/iem/tdr/nis/client/class-use/Client.html b/doc/de/unidue/iem/tdr/nis/client/class-use/Client.html new file mode 100644 index 0000000..eb19d48 --- /dev/null +++ b/doc/de/unidue/iem/tdr/nis/client/class-use/Client.html @@ -0,0 +1,142 @@ + + + + + + +Uses of Class de.unidue.iem.tdr.nis.client.Client + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
de.unidue.iem.tdr.nis.client.Client

+
+No usage of de.unidue.iem.tdr.nis.client.Client +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/doc/de/unidue/iem/tdr/nis/client/class-use/Connection.html b/doc/de/unidue/iem/tdr/nis/client/class-use/Connection.html new file mode 100644 index 0000000..de5377a --- /dev/null +++ b/doc/de/unidue/iem/tdr/nis/client/class-use/Connection.html @@ -0,0 +1,142 @@ + + + + + + +Uses of Class de.unidue.iem.tdr.nis.client.Connection + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
de.unidue.iem.tdr.nis.client.Connection

+
+No usage of de.unidue.iem.tdr.nis.client.Connection +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/doc/de/unidue/iem/tdr/nis/client/class-use/TaskDefs.html b/doc/de/unidue/iem/tdr/nis/client/class-use/TaskDefs.html new file mode 100644 index 0000000..61b65a8 --- /dev/null +++ b/doc/de/unidue/iem/tdr/nis/client/class-use/TaskDefs.html @@ -0,0 +1,166 @@ + + + + + + +Uses of Interface de.unidue.iem.tdr.nis.client.TaskDefs + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Interface
de.unidue.iem.tdr.nis.client.TaskDefs

+
+ + + + + +
+Uses of TaskDefs in de.unidue.iem.tdr.nis.client
+  +

+ + + + + + + + + +
Classes in de.unidue.iem.tdr.nis.client that implement TaskDefs
+ classClient + +
+          Diese Klasse ermöglicht das Abrufen von Aufgaben vom Server und die + Implementierung der dazugehörigen Lösungen.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/doc/de/unidue/iem/tdr/nis/client/class-use/TaskObject.html b/doc/de/unidue/iem/tdr/nis/client/class-use/TaskObject.html new file mode 100644 index 0000000..62dd102 --- /dev/null +++ b/doc/de/unidue/iem/tdr/nis/client/class-use/TaskObject.html @@ -0,0 +1,191 @@ + + + + + + +Uses of Class de.unidue.iem.tdr.nis.client.TaskObject + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
de.unidue.iem.tdr.nis.client.TaskObject

+
+ + + + + +
+Uses of TaskObject in de.unidue.iem.tdr.nis.client
+  +

+ + + + + + + + + + + + + +
Methods in de.unidue.iem.tdr.nis.client that return TaskObject
+protected  TaskObjectConnection.getTask(int taskId) + +
+          Ruft gezielt eine Aufgabe vom Server ab.
+protected  TaskObjectConnection.getTask(int taskId, + java.lang.String[] params) + +
+          Ruft gezielt eine Aufgabe vom Server ab und sendet dabei Parameter mit.
+  +

+ + + + + + + + + +
Methods in de.unidue.iem.tdr.nis.client with parameters of type TaskObject
+protected  voidConnection.sendMoreParams(TaskObject task, + java.lang.String[] params) + +
+          Sendet weitere Parameter an den Server
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/doc/de/unidue/iem/tdr/nis/client/package-frame.html b/doc/de/unidue/iem/tdr/nis/client/package-frame.html new file mode 100644 index 0000000..5f6d0af --- /dev/null +++ b/doc/de/unidue/iem/tdr/nis/client/package-frame.html @@ -0,0 +1,47 @@ + + + + + + +de.unidue.iem.tdr.nis.client + + + + + + + + + + + +de.unidue.iem.tdr.nis.client + + + + +
+Interfaces  + +
+TaskDefs
+ + + + + + +
+Classes  + +
+Client +
+Connection +
+TaskObject
+ + + + diff --git a/doc/de/unidue/iem/tdr/nis/client/package-summary.html b/doc/de/unidue/iem/tdr/nis/client/package-summary.html new file mode 100644 index 0000000..49b3433 --- /dev/null +++ b/doc/de/unidue/iem/tdr/nis/client/package-summary.html @@ -0,0 +1,179 @@ + + + + + + +de.unidue.iem.tdr.nis.client + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package de.unidue.iem.tdr.nis.client +

+ + + + + + + + + +
+Interface Summary
TaskDefsStellt Konstanten für die verschiedenen Aufgabentypen zur Verfügung.
+  + +

+ + + + + + + + + + + + + + + + + +
+Class Summary
ClientDiese Klasse ermöglicht das Abrufen von Aufgaben vom Server und die + Implementierung der dazugehörigen Lösungen.
ConnectionDiese Klasse ermöglicht die Kommunikation mit dem Server.
TaskObjectDiese Klasse beinhaltet alle relevanten Informationen, die der Client + benötigt, um eine Aufgabe zu lösen.
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/doc/de/unidue/iem/tdr/nis/client/package-tree.html b/doc/de/unidue/iem/tdr/nis/client/package-tree.html new file mode 100644 index 0000000..bca5cc1 --- /dev/null +++ b/doc/de/unidue/iem/tdr/nis/client/package-tree.html @@ -0,0 +1,154 @@ + + + + + + +de.unidue.iem.tdr.nis.client Class Hierarchy + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package de.unidue.iem.tdr.nis.client +

+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/doc/de/unidue/iem/tdr/nis/client/package-use.html b/doc/de/unidue/iem/tdr/nis/client/package-use.html new file mode 100644 index 0000000..9b3e7eb --- /dev/null +++ b/doc/de/unidue/iem/tdr/nis/client/package-use.html @@ -0,0 +1,162 @@ + + + + + + +Uses of Package de.unidue.iem.tdr.nis.client + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
de.unidue.iem.tdr.nis.client

+
+ + + + + + + + + + + +
+Classes in de.unidue.iem.tdr.nis.client used by de.unidue.iem.tdr.nis.client
TaskDefs + +
+          Stellt Konstanten für die verschiedenen Aufgabentypen zur Verfügung.
TaskObject + +
+          Diese Klasse beinhaltet alle relevanten Informationen, die der Client + benötigt, um eine Aufgabe zu lösen.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/doc/deprecated-list.html b/doc/deprecated-list.html new file mode 100644 index 0000000..d9be961 --- /dev/null +++ b/doc/deprecated-list.html @@ -0,0 +1,144 @@ + + + + + + +Deprecated List + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Deprecated API

+
+
+Contents + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/doc/help-doc.html b/doc/help-doc.html new file mode 100644 index 0000000..d3fff06 --- /dev/null +++ b/doc/help-doc.html @@ -0,0 +1,215 @@ + + + + + + +API Help + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+How This API Document Is Organized

+
+This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

+Package

+
+ +

+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    +
  • Interfaces (italic)
  • Classes
  • Enums
  • Exceptions
  • Errors
  • Annotation Types
+
+

+Class/Interface

+
+ +

+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description +

    +

  • Nested Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary +

    +

  • Field Detail
  • Constructor Detail
  • Method Detail
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+ +

+Annotation Type

+
+ +

+Each annotation type has its own separate page with the following sections:

    +
  • Annotation Type declaration
  • Annotation Type description
  • Required Element Summary
  • Optional Element Summary
  • Element Detail
+
+ +

+Enum

+
+ +

+Each enum has its own separate page with the following sections:

    +
  • Enum declaration
  • Enum description
  • Enum Constant Summary
  • Enum Constant Detail
+
+

+Use

+
+Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
+

+Tree (Class Hierarchy)

+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    +
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+

+Deprecated API

+
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+

+Index

+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+

+Prev/Next

+These links take you to the next or previous class, interface, package, or related page.

+Frames/No Frames

+These links show and hide the HTML frames. All pages are available with or without frames. +

+

+Serialized Form

+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +

+

+Constant Field Values

+The Constant Field Values page lists the static final fields and their values. +

+ + +This help file applies to API documentation generated using the standard doclet. + +
+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/doc/index-files/index-1.html b/doc/index-files/index-1.html new file mode 100644 index 0000000..4fa96e9 --- /dev/null +++ b/doc/index-files/index-1.html @@ -0,0 +1,143 @@ + + + + + + +A-Index + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+

+A

+
+
auth(int, String) - +Method in class de.unidue.iem.tdr.nis.client.Connection +
Meldet einen Benutzer am Server an. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+ + + diff --git a/doc/index-files/index-2.html b/doc/index-files/index-2.html new file mode 100644 index 0000000..35c5885 --- /dev/null +++ b/doc/index-files/index-2.html @@ -0,0 +1,153 @@ + + + + + + +C-Index + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+

+C

+
+
Client - Class in de.unidue.iem.tdr.nis.client
Diese Klasse ermöglicht das Abrufen von Aufgaben vom Server und die + Implementierung der dazugehörigen Lösungen.
Client() - +Constructor for class de.unidue.iem.tdr.nis.client.Client +
Klassenkonstruktor. +
close() - +Method in class de.unidue.iem.tdr.nis.client.Client +
Beendet die Verbindungs zum Server. +
close() - +Method in class de.unidue.iem.tdr.nis.client.Connection +
Beendet die Verbindung mit dem Server. +
Connection - Class in de.unidue.iem.tdr.nis.client
Diese Klasse ermöglicht die Kommunikation mit dem Server.
Connection() - +Constructor for class de.unidue.iem.tdr.nis.client.Connection +
Klassenkonstruktor. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+ + + diff --git a/doc/index-files/index-3.html b/doc/index-files/index-3.html new file mode 100644 index 0000000..0f97d1a --- /dev/null +++ b/doc/index-files/index-3.html @@ -0,0 +1,140 @@ + + + + + + +D-Index + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+

+D

+
+
de.unidue.iem.tdr.nis.client - package de.unidue.iem.tdr.nis.client
 
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+ + + diff --git a/doc/index-files/index-4.html b/doc/index-files/index-4.html new file mode 100644 index 0000000..16088ec --- /dev/null +++ b/doc/index-files/index-4.html @@ -0,0 +1,167 @@ + + + + + + +G-Index + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+

+G

+
+
getDoubleArray(int) - +Method in class de.unidue.iem.tdr.nis.client.TaskObject +
Liefert einen spezifischen Wert des Double-Arrays +
getDoubleArray() - +Method in class de.unidue.iem.tdr.nis.client.TaskObject +
Liefert das komplette Double-Array +
getIntArray(int) - +Method in class de.unidue.iem.tdr.nis.client.TaskObject +
Liefert spezifisches Wert aus dem Int-Array +
getIntArray() - +Method in class de.unidue.iem.tdr.nis.client.TaskObject +
Liefert das komplette Int-Array +
getStringArray(int) - +Method in class de.unidue.iem.tdr.nis.client.TaskObject +
Liefert einen spezifischen Wert aus dem String-Array +
getStringArray() - +Method in class de.unidue.iem.tdr.nis.client.TaskObject +
Liefert das komplette String-Array +
getTask(int) - +Method in class de.unidue.iem.tdr.nis.client.Connection +
Ruft gezielt eine Aufgabe vom Server ab. +
getTask(int, String[]) - +Method in class de.unidue.iem.tdr.nis.client.Connection +
Ruft gezielt eine Aufgabe vom Server ab und sendet dabei Parameter mit. +
getType() - +Method in class de.unidue.iem.tdr.nis.client.TaskObject +
Liefert den Aufgabentyp +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+ + + diff --git a/doc/index-files/index-5.html b/doc/index-files/index-5.html new file mode 100644 index 0000000..ceb8766 --- /dev/null +++ b/doc/index-files/index-5.html @@ -0,0 +1,146 @@ + + + + + + +I-Index + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+

+I

+
+
isReady() - +Method in class de.unidue.iem.tdr.nis.client.Client +
Besteht die Verbindung zum Server? +
isReady() - +Method in class de.unidue.iem.tdr.nis.client.Connection +
Gibt an, ob die Verbindungs zum Server bereit ist. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+ + + diff --git a/doc/index-files/index-6.html b/doc/index-files/index-6.html new file mode 100644 index 0000000..511cb60 --- /dev/null +++ b/doc/index-files/index-6.html @@ -0,0 +1,143 @@ + + + + + + +M-Index + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+

+M

+
+
main(String[]) - +Static method in class de.unidue.iem.tdr.nis.client.Client +
  +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+ + + diff --git a/doc/index-files/index-7.html b/doc/index-files/index-7.html new file mode 100644 index 0000000..a2dd30c --- /dev/null +++ b/doc/index-files/index-7.html @@ -0,0 +1,143 @@ + + + + + + +P-Index + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+

+P

+
+
printTO() - +Method in class de.unidue.iem.tdr.nis.client.TaskObject +
Gibt das gesamte Task-Object aus +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+ + + diff --git a/doc/index-files/index-8.html b/doc/index-files/index-8.html new file mode 100644 index 0000000..fccf873 --- /dev/null +++ b/doc/index-files/index-8.html @@ -0,0 +1,167 @@ + + + + + + +S-Index + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+

+S

+
+
sendMoreParams(TaskObject, String[]) - +Method in class de.unidue.iem.tdr.nis.client.Connection +
Sendet weitere Parameter an den Server +
sendSolution(String) - +Method in class de.unidue.iem.tdr.nis.client.Connection +
Sendet eine Lösung an den Server +
setDoubleArray(double[]) - +Method in class de.unidue.iem.tdr.nis.client.TaskObject +
  +
setDoubleArray(double, int) - +Method in class de.unidue.iem.tdr.nis.client.TaskObject +
Füllt das Double-Array +
setIntArray(int[]) - +Method in class de.unidue.iem.tdr.nis.client.TaskObject +
  +
setIntArray(int, int) - +Method in class de.unidue.iem.tdr.nis.client.TaskObject +
Füllt das Int-Array +
setStringArray(String[]) - +Method in class de.unidue.iem.tdr.nis.client.TaskObject +
  +
setStringArray(String, int) - +Method in class de.unidue.iem.tdr.nis.client.TaskObject +
Füllt das String-Array +
setType(int) - +Method in class de.unidue.iem.tdr.nis.client.TaskObject +
Setzt den Aufgabentyp +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+ + + diff --git a/doc/index-files/index-9.html b/doc/index-files/index-9.html new file mode 100644 index 0000000..2b0f245 --- /dev/null +++ b/doc/index-files/index-9.html @@ -0,0 +1,213 @@ + + + + + + +T-Index + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+

+T

+
+
TASK_AES_3ROUNDS - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_AES_GF8 - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_AES_KEYEXPANSION - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_AES_MIXCOLUMNS - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_AES_TRANSFORMATION - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_CLEARTEXT - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_DES_FEISTEL - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_DES_KEYSCHEDULE - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_DES_RBLOCK - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_DES_ROUND - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_DIFFIEHELLMAN - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_ELGAMAL_DECRYPTION - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_ELGAMAL_ENCRYPTION - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_FACTORIZATION - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_MODULO - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_RC4_ENCRYPTION - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_RC4_KEYSCHEDULE - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_RC4_LOOP - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_RSA_DECRYPTION - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_RSA_ENCRYPTION - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_VIGENERE - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TASK_XOR - +Static variable in interface de.unidue.iem.tdr.nis.client.TaskDefs +
  +
TaskDefs - Interface in de.unidue.iem.tdr.nis.client
Stellt Konstanten für die verschiedenen Aufgabentypen zur Verfügung.
taskLoop() - +Method in class de.unidue.iem.tdr.nis.client.Client +
Durchläuft eine Liste von Aufgaben und fordert diese vom Server an. +
TaskObject - Class in de.unidue.iem.tdr.nis.client
Diese Klasse beinhaltet alle relevanten Informationen, die der Client + benötigt, um eine Aufgabe zu lösen.
TaskObject() - +Constructor for class de.unidue.iem.tdr.nis.client.TaskObject +
  +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D G I M P S T
+ + + diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..5aafeb2 --- /dev/null +++ b/doc/index.html @@ -0,0 +1,36 @@ + + + + + + +Generated Documentation (Untitled) + + + + + + + + +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="de/unidue/iem/tdr/nis/client/package-summary.html">Non-frame version.</A> + + + diff --git a/doc/overview-tree.html b/doc/overview-tree.html new file mode 100644 index 0000000..9b94ea9 --- /dev/null +++ b/doc/overview-tree.html @@ -0,0 +1,156 @@ + + + + + + +Class Hierarchy + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For All Packages

+
+
+
Package Hierarchies:
de.unidue.iem.tdr.nis.client
+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/doc/package-list b/doc/package-list new file mode 100644 index 0000000..96ac252 --- /dev/null +++ b/doc/package-list @@ -0,0 +1 @@ +de.unidue.iem.tdr.nis.client diff --git a/doc/resources/inherit.gif b/doc/resources/inherit.gif new file mode 100644 index 0000000..c814867 Binary files /dev/null and b/doc/resources/inherit.gif differ diff --git a/doc/stylesheet.css b/doc/stylesheet.css new file mode 100644 index 0000000..cbd3428 --- /dev/null +++ b/doc/stylesheet.css @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF; color:#000000 } + +/* Headings */ +h1 { font-size: 145% } + +/* Table colors */ +.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ +.TableRowColor { background: #FFFFFF; color:#000000 } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} + diff --git a/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/Client.class b/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/Client.class new file mode 100644 index 0000000..243d39c Binary files /dev/null and b/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/Client.class differ diff --git a/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/Connection.class b/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/Connection.class new file mode 100644 index 0000000..71551f5 Binary files /dev/null and b/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/Connection.class differ diff --git a/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/Loesungsmethoden.class b/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/Loesungsmethoden.class new file mode 100644 index 0000000..056bde9 Binary files /dev/null and b/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/Loesungsmethoden.class differ diff --git a/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/TaskDefs.class b/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/TaskDefs.class new file mode 100644 index 0000000..ff17a03 Binary files /dev/null and b/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/TaskDefs.class differ diff --git a/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/TaskObject.class b/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/TaskObject.class new file mode 100644 index 0000000..f4b0c66 Binary files /dev/null and b/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/TaskObject.class differ diff --git a/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/client.iml b/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/client.iml new file mode 100644 index 0000000..b107a2d --- /dev/null +++ b/out/production/NIS_Client/de/unidue/iem/tdr/nis/client/client.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/NIS_Client.iml b/src/NIS_Client.iml new file mode 100644 index 0000000..b107a2d --- /dev/null +++ b/src/NIS_Client.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/de/unidue/iem/tdr/nis/client/Client.java b/src/de/unidue/iem/tdr/nis/client/Client.java new file mode 100644 index 0000000..6e11ea3 --- /dev/null +++ b/src/de/unidue/iem/tdr/nis/client/Client.java @@ -0,0 +1,131 @@ +package de.unidue.iem.tdr.nis.client; + +/** + * Diese Klasse ermglicht das Abrufen von Aufgaben vom Server und die + * Implementierung der dazugehrigen Lsungen. + *

+ * Nhere Informationen zu den anderen Klassen und den einzelnen Aufgabentypen + * entnehmen Sie bitte der entsprechenden Dokumentation im TMT und den Javadocs + * zu den anderen Klassen. + * + * @see Connection + * @see TaskObject + * + */ +public class Client implements TaskDefs { + private Connection con; + private TaskObject currentTask; + + /* hier bitte die Matrikelnummer eintragen */ + private final int matrikelnr = 3030462; + + /* hier bitte das TMT-Passwort eintragen */ + private final String password = "wt9YTDt2"; + + /* Aufgaben, die bearbeitet werden sollen */ + private final int[] tasks = { TASK_CLEARTEXT, TASK_XOR, TASK_MODULO, + TASK_FACTORIZATION, TASK_VIGENERE, TASK_DES_KEYSCHEDULE, + TASK_DES_RBLOCK, TASK_DES_FEISTEL, TASK_DES_ROUND, TASK_AES_GF8, + TASK_AES_KEYEXPANSION, TASK_AES_MIXCOLUMNS, + TASK_AES_TRANSFORMATION, TASK_AES_3ROUNDS, TASK_RC4_LOOP, + TASK_RC4_KEYSCHEDULE, TASK_RC4_ENCRYPTION, TASK_DIFFIEHELLMAN, + TASK_RSA_ENCRYPTION, TASK_RSA_DECRYPTION, TASK_ELGAMAL_ENCRYPTION, + TASK_ELGAMAL_DECRYPTION }; + + /** + * Klassenkonstruktor. Baut die Verbindung zum Server auf. + */ + public Client() { + con = new Connection(); + if (con.auth(matrikelnr, password)) + System.out.println("Anmeldung erfolgreich."); + else + System.out.println("Anmeldung nicht erfolgreich."); + } + + /** + * Besteht die Verbindung zum Server? + * + * @return true, falls Verbindung bereit, andernfalls false + */ + public boolean isReady() { + return con.isReady(); + } + + /** + * Beendet die Verbindungs zum Server. + */ + public void close() { + con.close(); + } + + /** + * Durchluft eine Liste von Aufgaben und fordert diese vom Server an. + */ + public void taskLoop() { + String solution; + Loesungsmethoden lm = new Loesungsmethoden(); + for (int i = 0; i < 9; i++) { + switch (tasks[i]) { + case TASK_CLEARTEXT: + currentTask = con.getTask(tasks[i]); + solution = currentTask.getStringArray(0); + break; + case TASK_XOR: + currentTask = con.getTask(tasks[i]); + + String XORone = lm.stringConv(currentTask.getStringArray(0)); + String XORtwo = lm.stringConv(currentTask.getStringArray(1)); + + solution = lm.stringXOR(XORone,XORtwo); + break; + case TASK_MODULO: + currentTask = con.getTask(tasks[i]); + + int MODone = currentTask.getIntArray(0); + int MODtwo = currentTask.getIntArray(1); + + solution = Integer.toString(lm.MOD(MODone,MODtwo)); + break; + case TASK_FACTORIZATION: + currentTask = con.getTask(tasks[i]); + + int num = currentTask.getIntArray(0); + + solution = lm.factorization(num); + break; + case TASK_VIGENERE: + currentTask = con.getTask(tasks[i]); + + String crypt_msg = currentTask.getStringArray(0); + String key = currentTask.getStringArray(1); + + solution = lm.decrypt_vigenere(crypt_msg, key); + case TASK_DES_KEYSCHEDULE: + solution = ""; + case TASK_DES_RBLOCK: + solution = ""; + case TASK_DES_FEISTEL: + solution = ""; + case TASK_DES_ROUND: + solution = ""; + default: + currentTask = con.getTask(tasks[i]); + solution = "Nicht implementiert!"; + } + + if (con.sendSolution(solution)) + System.out.println("Aufgabe " + tasks[i] + ": Loesung korrekt"); + else + System.out.println("Aufgabe " + tasks[i] + ": Loesung falsch"); + } + } + + public static void main(String[] args) { + Client c = new Client(); + if (c.isReady()) { + c.taskLoop(); + } + c.close(); + } +} \ No newline at end of file diff --git a/src/de/unidue/iem/tdr/nis/client/Connection.java b/src/de/unidue/iem/tdr/nis/client/Connection.java new file mode 100644 index 0000000..d0a7fc5 --- /dev/null +++ b/src/de/unidue/iem/tdr/nis/client/Connection.java @@ -0,0 +1,362 @@ +package de.unidue.iem.tdr.nis.client; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.ConnectException; +import java.net.Socket; +import java.net.UnknownHostException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.Formatter; +import java.util.StringTokenizer; + +/** + * Diese Klasse ermglicht die Kommunikation mit dem Server. Verbindungsauf und + * -abbau sind Ihnen in der Klasse {@link Client} schon vorgegeben. Fr Sie sind + * die Methoden {@link #sendSolution(String solution)}, {@link #getTask(int taskId)}, + * {@link #getTask(int taskId, String[] params)} und + * {@link #sendMoreParams(TaskObject task, String[] params)} relevant. + *

+ * Bitte verndern Sie diese Klasse nicht. + * + * @see Client + * + */ +public class Connection { + /* packettypes */ + private final static int AUTHENTICATION = 1; + private final static int TASKREQUEST = 2; + private final static int SOLUTION = 3; + private final static int MOREPARAMS = 4; + private final static int BYE = Integer.MAX_VALUE; + + /* Verbindungsinformationen */ + private String host = "tmt.tdr.iem.uni-due.de"; + private int port = 40001; + private Socket s = null; + private BufferedReader in = null; + private PrintWriter out = null; + private boolean ready = false; + private boolean serverClosed = false; + + /** Zuletzt empfangenes Paket */ + private String[] input; + + /** + * Klassenkonstruktor. Baut die Verbindung zum Server auf. + */ + protected Connection() { + try { + s = new Socket(host, port); + s.setSoTimeout(3000); + in = new BufferedReader(new InputStreamReader(s.getInputStream())); + out = new PrintWriter(s.getOutputStream(), false); + + getResponse(); + for (int i = 1; i < input.length; i++) + System.out.println(input[i]); + ready = true; + } catch (UnknownHostException e) { + printErr(e, + "Der angegebene Hostname kann nicht aufgeloest werden.", + true); + } catch (ConnectException e) { + printErr(e, "Fehler beim Verbindungsaufbau.", true); + } catch (IOException e) { + printErr(e, "Der Server konnte nicht erreicht werden.", true); + } + } + + /** + * Gibt an, ob die Verbindungs zum Server bereit ist. + * + * @return true, falls die Verbindung besteht, sonst false + */ + protected boolean isReady() { + return ready; + } + + /** + * Meldet einen Benutzer am Server an. + * + * @param userId + * Matrikelnr des Benutzers + * @param password + * Passwort des Benutzers + * @return true, wenn die Anmeldung erfolgreich war, ansonsten false. + */ + protected boolean auth(int userId, String password) { + String[] params = new String[2]; + params[0] = String.valueOf(userId); + params[1] = hashPw(password); + sendRequest(AUTHENTICATION, params); + getResponse(); + if (input.length == 2) + if (input[1].equalsIgnoreCase("STATUS_OK")) + return true; + return false; + } + + /** + * Beendet die Verbindung mit dem Server. + */ + protected void close() { + try { + if (!serverClosed) { + out.println(BYE); + out.flush(); + } + in.close(); + out.close(); + s.close(); + System.out.println("Verbindung beendet."); + } catch (IOException e) { + } + } + + /** + * Ruft gezielt eine Aufgabe vom Server ab. + * + * @param taskId + * Identifikator der gewnschten Aufgabe + * @return Aufgabe in Form von TaskObject + */ + protected TaskObject getTask(int taskId) { + sendRequest(TASKREQUEST, String.valueOf(taskId)); + getResponse(); + TaskObject task = new TaskObject(); + task.setType(taskId); + parseTaskObject(task); + return task; + } + + /** + * + * Ruft gezielt eine Aufgabe vom Server ab und sendet dabei Parameter mit. + * + * @param taskId + * Identifikator der gewnschten Aufgabe + * @param params + * Parameterliste + * @return Aufgabe in Form von TaskObject + */ + protected TaskObject getTask(int taskId, String[] params) { + String[] request = new String[params.length + 1]; + request[0] = String.valueOf(taskId); + for (int i = 0; i < params.length; i++) { + request[i + 1] = params[i]; + } + sendRequest(TASKREQUEST, request); + getResponse(); + TaskObject task = new TaskObject(); + task.setType(taskId); + parseTaskObject(task); + return task; + } + + /** + * Sendet weitere Parameter an den Server + * + * @param task + * TaskObject in welches die Antwort vom Server geparst wird + * @param params + * Parameter-Liste + */ + protected void sendMoreParams(TaskObject task, String[] params) { + sendRequest(MOREPARAMS, params); + getResponse(); + parseTaskObject(task); + } + + /** + * Sendet eine Lsung an den Server + * + * @param solution + * Lsung des Studierenden + */ + protected boolean sendSolution(String solution) { + String[] params = new String[1]; + params[0] = solution; + sendRequest(SOLUTION, params); + getResponse(); + if (input[1].equalsIgnoreCase("SOLUTION_OK")) + return true; + return false; + } + + /** + * Empfngt eine Antwort vom Server. Der Inhalt wird in this.input + * gespeichert, wenn der Server keinen Fehler meldet. Ansonsten wird die + * Fehlermeldung ausgegeben und die Verbindung vom Server beendet. + */ + private void getResponse() { + boolean error = false; + int status; + input = null; + try { + ArrayList inputList = new ArrayList(); + String tmp = in.readLine(); + + if (tmp.equals(String.valueOf(Integer.MAX_VALUE))) { + serverClosed = true; + close(); + System.exit(0); + } + + status = Integer.parseInt(tmp.substring(0, 3)); + + if (status != 200) { + error = true; + System.out.println("Fehler: " + tmp); + } + + while (tmp != null && !tmp.isEmpty()) { + inputList.add(tmp); + tmp = in.readLine(); + if (error) { + System.out.println(tmp); + } + } + + input = new String[inputList.size()]; + inputList.toArray(input); + + /* + * Server beendet bei einem Fehler immer die Verbindung. -> + * BYE-Paket empfangen. + */ + if (error) + getResponse(); + + } catch (IOException e) { + printErr(e, "E/A-Fehler beim Empfang einer Servernachricht.", true); + } catch (NumberFormatException e) { + printErr(e, "Fehlerhaftes Paket empfangen.", true); + } + } + + /** + * Erzeugt einen SHA-1-Hash + * + * @param password + * zu hashendes Passwort + * @return SHA-1-Hash + */ + private String hashPw(String password) { + MessageDigest md; + Formatter fmt = new Formatter(); + try { + md = MessageDigest.getInstance("SHA-1"); + byte[] encryptPw = md.digest(password.getBytes()); + for (int i = 0; i < encryptPw.length; i++) { + fmt.format("%02x", encryptPw[i] & 0xff); + } + } catch (NoSuchAlgorithmException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + return fmt.toString(); + } + + /** + * Gibt eine Fehlermeldung aus und beendet nach Bedarf das Programm. + * + * @param e + * Exception + * @param msg + * Fehlermeldung + * @param close + * true, wenn das Programm beendet werden soll, ansonsten false + */ + private void printErr(Exception e, String msg, boolean close) { + if (e != null) + e.printStackTrace(); + System.err.println("Fehler: " + msg); + if (close) { + if (ready) + close(); + System.exit(-1); + } + } + + /** + * Sendet eine Anfrage mit einem Parameter + * + * @param packetType + * Pakettyp-Identifikator + * @param param + * Parameter + */ + private void sendRequest(int packetType, String param) { + String[] params = new String[1]; + params[0] = param; + sendRequest(packetType, params); + } + + /** + * Sendet eine Anfrage (bestehend aus mindestens einem + * Pakettyp-Identifikator (Int) und optionalen Parametern) an den Server. + * + * @param packetType + * Identifikator des Pakettyps + * @param params + * Liste der Parameter als String-Array + */ + private void sendRequest(int packetType, String[] params) { + out.println(packetType); + if (params != null) { + for (int i = 0; i < params.length; i++) + out.println(params[i]); + } + out.println(); + out.flush(); + } + + /** + * Erzeugt aus den eingehenden Daten die Inhaltsarrays eines TasksObjects + * Die Funktion geht davon aus, dass sie nur aufgerufen wird, wenn wirklich + * ein TaskObject bertragen wurde + * + * @param task + * TaskObject, das mit Daten gefllt werden soll + */ + private void parseTaskObject(TaskObject task) { + for (int i = 1; i < input.length;) { + StringTokenizer st = new StringTokenizer(input[i], "="); + if (st.countTokens() != 2) { + printErr(null, "Fehlerhaftes Paket erhalten.", true); + } + + String tmp = st.nextToken(); + if (tmp.equalsIgnoreCase("STRINGARRAY")) { + i++; + int length = Integer.parseInt(st.nextToken()); + task.setStringArray(new String[length]); + for (int j = 0; j < length; j++) { + task.setStringArray(input[i + j], j); + } + i += length; + } else if (tmp.equalsIgnoreCase("INTARRAY")) { + i++; + int length = Integer.parseInt(st.nextToken()); + task.setIntArray(new int[length]); + for (int j = 0; j < length; j++) { + task.setIntArray(Integer.parseInt(input[i + j]), j); + } + i += length; + } else if (tmp.equalsIgnoreCase("DOUBLEARRAY")) { + i++; + int length = Integer.parseInt(st.nextToken()); + task.setDoubleArray(new double[length]); + for (int j = 0; j < length; j++) { + task.setDoubleArray(Double.parseDouble(input[i + j]), j); + } + i += length; + } + } + } +} \ No newline at end of file diff --git a/src/de/unidue/iem/tdr/nis/client/Loesungsmethoden.java b/src/de/unidue/iem/tdr/nis/client/Loesungsmethoden.java new file mode 100644 index 0000000..c3f7a7c --- /dev/null +++ b/src/de/unidue/iem/tdr/nis/client/Loesungsmethoden.java @@ -0,0 +1,219 @@ +package de.unidue.iem.tdr.nis.client; + +/** + * Created by tu on 15/05/17. + */ +public class Loesungsmethoden { + + /** + * Staendig geteilt die kleinste moegliche Primzahl rechnen + */ + public String factorization(int num) { + // 126 / 2 = 63 -> nicht weiter durch 2 teilbar, naechste p + // 63 / 3 = 21 -> weiter durch 3 teilbar, 3 weiternutzen + // 21 / 3 = 7 -> nicht weiter durch 3 teilbar, naechste p + // 7 / 7 = 1 -> fertig + // returns 2, 3, 3, 7; + StringBuilder sb = new StringBuilder(); + int result = num; + int prime = 2; + while (result != 1) { + prime = 2; + while (!devideable(result, prime)) { + prime = getNextPrime(prime, num); + } + result /= prime; + sb.append(prime).append("*"); + } + sb.deleteCharAt(sb.length() - 1); + return sb.toString(); + } + + private boolean devideable(int devidable, int by) { + return (devidable % by) == 0; + } + + private int getNextPrime(int initPrime, int cap) { + for (int i = initPrime; i <= cap; i++) { + if (isPrime(i) && !(i == initPrime || i == cap)) { + return i; + } + } + System.exit(0); + return 0; + } + + private boolean isPrime(int possPrime) { + if (possPrime == 0) { + return false; + } + for (int i = 1; i <= possPrime; i++) { + if (!(i == 1 || i == possPrime)) { + return !devideable(possPrime, i); + } + } + return true; + } + + public String stringXOR(String one, String two) { + if (!(one.length() == two.length())) { + String appendable = ""; + if (one.length() < two.length()) { + for (int i = 0; i < two.length() - one.length(); i++) { + appendable += "0"; + } + one = appendable + one; + } else { + for (int i = 0; i < one.length() - two.length(); i++) { + appendable += "0"; + } + two = appendable + two; + } + } + char firstBit; + char secondBit; + StringBuilder result = new StringBuilder(); + for (int i = 0; i < one.length(); i++) { + firstBit = one.charAt(i); + secondBit = two.charAt(i); + result.append(charXOR(firstBit, secondBit)); + } + return result.toString(); + } + + private char charXOR(char a, char b) { + if (a == b) { + return '0'; + } else if (a != b) { + return '1'; + } + return '.'; + } + + public String stringConv(String hex) { + StringBuilder result = new StringBuilder(); + for (int i = 0; i < hex.length(); i++) { + String bite = hexConv(hex.charAt(i)); + result.append(bite); + } + return result.toString(); + } + + private String hexConv(char hex) { + switch (hex) { + case '0': + return "0000"; + case '1': + return "0001"; + case '2': + return "0010"; + case '3': + return "0011"; + case '4': + return "0100"; + case '5': + return "0101"; + case '6': + return "0110"; + case '7': + return "0111"; + case '8': + return "1000"; + case '9': + return "1001"; + case 'a': + return "1010"; + case 'b': + return "1011"; + case 'c': + return "1100"; + case 'd': + return "1101"; + case 'e': + return "1110"; + case 'f': + return "1111"; + default: + return "empty"; + } + } + + public int MOD(int a, int b) { + // 21 mod 10 + // 21 - 10 = 11 + // 11 - 10 = 1 + // oops 1 - 10 is negative 👠+ while ((a - b) > 0) { + a -= b; + } + return a; + } + + public String decrypt_vigenere(String c_msg, String key) { + char[][] vigArray = getVigenereTable(); + char[] c_msgArray = c_msg.toCharArray(); + char[] keyArray = key.toCharArray(); + StringBuilder de_msg = new StringBuilder(); + for(int i = 0; i= 0; i--) { + vigTable[vigTable.length-1-i] = vigenereArray(i+1); + } + return vigTable; + } + + private char[] vigenereArray(int rot) { + char[] vigenereTable = new char[26]; + char[] asciiTable = getASCIITable(); + if(rot%26==0){ + return asciiTable; + } + for (int i = 0; i < vigenereTable.length; i++) { + vigenereTable[(i+rot) % vigenereTable.length ] = getASCIITable()[i]; + } + return vigenereTable; + } + + private char[] getASCIITable() { + char[] table = new char[26]; + int j = 0; + for (int i = 1; i <= 26; i++) { + table[j] = getAsciiLetter(i); + j++; + } + return table; + } + + private char getAsciiLetter(int ord) { + if (ord > 26 || ord <= 0) { + ord = -96; + } + ord = ord + 96; + return (char) ord; + } + + private int getAsciiNumber(char chr){ + return (int) chr; + } + + public static void main(String[] args) { + Loesungsmethoden lm = new Loesungsmethoden(); + int index = 0; + for(char[] sub: lm.getVigenereTable()){ + for(char i: sub){ + System.out.print(i); + } + System.out.println(); + } + } +} diff --git a/src/de/unidue/iem/tdr/nis/client/TaskDefs.java b/src/de/unidue/iem/tdr/nis/client/TaskDefs.java new file mode 100644 index 0000000..cf463d6 --- /dev/null +++ b/src/de/unidue/iem/tdr/nis/client/TaskDefs.java @@ -0,0 +1,30 @@ +package de.unidue.iem.tdr.nis.client; + +/** + * Stellt Konstanten fr die verschiedenen Aufgabentypen zur Verfgung. + * + */ +public interface TaskDefs { + static final int TASK_CLEARTEXT = 1; + static final int TASK_XOR = 2; + static final int TASK_MODULO = 3; + static final int TASK_FACTORIZATION = 4; + static final int TASK_VIGENERE = 5; + static final int TASK_DES_KEYSCHEDULE = 6; + static final int TASK_DES_RBLOCK = 7; + static final int TASK_DES_FEISTEL = 8; + static final int TASK_DES_ROUND = 9; + static final int TASK_AES_GF8 = 10; + static final int TASK_AES_KEYEXPANSION = 11; + static final int TASK_AES_MIXCOLUMNS = 12; + static final int TASK_AES_TRANSFORMATION = 13; + static final int TASK_AES_3ROUNDS = 14; + static final int TASK_RC4_LOOP = 15; + static final int TASK_RC4_KEYSCHEDULE = 16; + static final int TASK_RC4_ENCRYPTION = 17; + static final int TASK_DIFFIEHELLMAN = 18; + static final int TASK_RSA_ENCRYPTION = 19; + static final int TASK_RSA_DECRYPTION = 20; + static final int TASK_ELGAMAL_ENCRYPTION = 21; + static final int TASK_ELGAMAL_DECRYPTION = 22; +} diff --git a/src/de/unidue/iem/tdr/nis/client/TaskObject.java b/src/de/unidue/iem/tdr/nis/client/TaskObject.java new file mode 100644 index 0000000..477dd22 --- /dev/null +++ b/src/de/unidue/iem/tdr/nis/client/TaskObject.java @@ -0,0 +1,197 @@ +package de.unidue.iem.tdr.nis.client; + +/** + * Diese Klasse beinhaltet alle relevanten Informationen, die der Client + * bentigt, um eine Aufgabe zu lsen. + *

+ * Bitte verndern Sie diese Klasse nicht. + */ +public class TaskObject { + /** + * Der Aufgabentyp als Int. + */ + private int type = 0; + + /** + * Drei Arrays die alle relevanten Daten der Aufgabenstellung beinhalten. + */ + private String[] sa; + private int[] ia; + private double[] da; + + /** + * Setzt den Aufgabentyp + * + * @param t + * Aufgabentyp + */ + public void setType(int t) { + this.type = t; + } + + /** + * Liefert den Aufgabentyp + * + * @return Aufgabentyp als Integer + */ + public int getType() { + return this.type; + } + + protected void setStringArray(String[] sa) { + this.sa = sa; + } + + /** + * Fllt das String-Array + * + * @param s + * einzufgender String + * @param pos + * Position im Array + */ + public void setStringArray(String s, int pos) { + if (pos < this.sa.length) + this.sa[pos] = s; + else + System.err.println("Position " + pos + + " liegt nicht im Bereich des Arrays."); + } + + /** + * Liefert einen spezifischen Wert aus dem String-Array + * + * @param pos + * Position im String-Array + * @return String der Array-Position pos + */ + public String getStringArray(int pos) { + if (this.sa == null) + return null; + if (pos < this.sa.length) + return this.sa[pos]; + else + System.err.println("Position " + pos + + " liegt nicht im Bereich des Arrays."); + return null; + } + + /** + * Liefert das komplette String-Array + * + * @return sa + */ + public String[] getStringArray() { + return sa; + } + + protected void setIntArray(int[] ia) { + this.ia = ia; + } + + /** + * Fllt das Int-Array + * + * @param i + * einzufgende Zahl + * @param pos + * Position im Array + */ + public void setIntArray(int i, int pos) { + if (pos < this.ia.length) + this.ia[pos] = i; + else + System.err.println("Position " + pos + + " liegt nicht im Bereich des Arrays."); + } + + /** + * Liefert spezifisches Wert aus dem Int-Array + * + * @param pos + * Position im Array + * @return Int der Position pos + */ + public int getIntArray(int pos) { + if (this.ia == null) + return Integer.MIN_VALUE; + if (pos < this.ia.length) + return this.ia[pos]; + else + System.err.println("Position " + pos + + " liegt nicht im Bereich des Arrays."); + return Integer.MIN_VALUE; + } + + /** + * Liefert das komplette Int-Array + * + * @return Int-Array + */ + public int[] getIntArray() { + return ia; + } + + protected void setDoubleArray(double[] da) { + this.da = da; + } + + /** + * Fllt das Double-Array + * + * @param d + * einzufgende Zahl + * @param pos + * Position im Array + */ + public void setDoubleArray(double d, int pos) { + if (pos < this.da.length) + this.da[pos] = d; + else + System.err.println("Position " + pos + + " liegt nicht im Bereich des Arrays."); + } + + /** + * Liefert einen spezifischen Wert des Double-Arrays + * + * @param pos + * Position im Array + * @return Double der Position pos + */ + public double getDoubleArray(int pos) { + if (this.da == null) + return Double.MIN_VALUE; + if (pos < this.da.length) + return this.da[pos]; + else + System.err.println("Position " + pos + + " liegt nicht im Bereich des Arrays."); + return Double.MIN_VALUE; + } + + /** + * Liefert das komplette Double-Array + * + * @return Double-Array + */ + public double[] getDoubleArray() { + return da; + } + + /** + * Gibt das gesamte Task-Object aus + */ + public void printTO() { + System.out.println("Task-Type: " + this.type); + if (sa != null) + for (int i = 0; i < this.sa.length; i++) + System.out.println("SA" + i + ": " + sa[i]); + if (da != null) + for (int i = 0; i < this.da.length; i++) + System.out.println("DA" + i + ": " + da[i]); + if (ia != null) + for (int i = 0; i < this.ia.length; i++) + System.out.println("IA" + i + ": " + ia[i]); + } +} diff --git a/src/de/unidue/iem/tdr/nis/client/client.iml b/src/de/unidue/iem/tdr/nis/client/client.iml new file mode 100644 index 0000000..b107a2d --- /dev/null +++ b/src/de/unidue/iem/tdr/nis/client/client.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file