diff --git a/.idea/misc.xml b/.idea/misc.xml
index 6619eb6..938722b 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -4,6 +4,9 @@
+
+
+
diff --git a/build.gradle b/build.gradle
index ebbda18..163b0dd 100644
--- a/build.gradle
+++ b/build.gradle
@@ -47,6 +47,12 @@ task createProperties(dependsOn: processResources) {
}
}
+task myJavadocs(type: Javadoc) {
+ title = "JAVADOC WasteInformationServer"
+ source = sourceSets.main.allJava
+ classpath = sourceSets.main.runtimeClasspath
+}
+
classes {
dependsOn createProperties
}
\ No newline at end of file
diff --git a/src/java/com/wasteinformationserver/Main.java b/src/java/com/wasteinformationserver/Main.java
index 15710d1..f1b770f 100644
--- a/src/java/com/wasteinformationserver/Main.java
+++ b/src/java/com/wasteinformationserver/Main.java
@@ -47,11 +47,9 @@ public class Main {
//startup mqtt service
Log.message("starting mqtt service");
- try {
- MqttService m = new MqttService("mqtt.heili.eu", "1883");
- m.startupService();
- } catch (Exception e) {
- Log.error("An error occured in the class mqtt");
- }
+
+ MqttService m = new MqttService("mqtt.heili.eu", "1883");
+ m.startupService();
+
}
}
\ No newline at end of file
diff --git a/src/java/com/wasteinformationserver/basicutils/Info.java b/src/java/com/wasteinformationserver/basicutils/Info.java
index 381648a..06e4ae3 100644
--- a/src/java/com/wasteinformationserver/basicutils/Info.java
+++ b/src/java/com/wasteinformationserver/basicutils/Info.java
@@ -7,6 +7,11 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;
+/**
+ * get basic infos about Software
+ *
+ * @author Lukas Heiligenbrunner
+ */
public class Info {
private static String version = "not init";
private static String builddate = "not init";
diff --git a/src/java/com/wasteinformationserver/basicutils/Log.java b/src/java/com/wasteinformationserver/basicutils/Log.java
index 0a0c1d1..c001438 100644
--- a/src/java/com/wasteinformationserver/basicutils/Log.java
+++ b/src/java/com/wasteinformationserver/basicutils/Log.java
@@ -5,6 +5,11 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
+/**
+ * fancy debug and Logging messages
+ *
+ * @author Lukas Heiligenbrunner
+ */
public class Log {
private static final String ANSI_RESET = "\u001B[0m";
diff --git a/src/java/com/wasteinformationserver/db/JDBC.java b/src/java/com/wasteinformationserver/db/JDBC.java
index b0b351c..a9a7919 100644
--- a/src/java/com/wasteinformationserver/db/JDBC.java
+++ b/src/java/com/wasteinformationserver/db/JDBC.java
@@ -5,6 +5,11 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+/**
+ * basic connection class to a Database
+ *
+ * @author Lukas Heiligenbrunner
+ */
public class JDBC {
private static Connection conn;
diff --git a/src/java/com/wasteinformationserver/mqtt/MqttService.java b/src/java/com/wasteinformationserver/mqtt/MqttService.java
index 2f37d9f..83c16ef 100644
--- a/src/java/com/wasteinformationserver/mqtt/MqttService.java
+++ b/src/java/com/wasteinformationserver/mqtt/MqttService.java
@@ -11,11 +11,25 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
+/**
+ * Mqtt Service to receive and send back messages to the Hardware
+ * todo
+ *
+ * @author Lukas Heiligenbrunner
+ * @author Gregor Dutzler
+ */
public class MqttService {
private MqttClient client = null;
private String serveruri;
private JDBC db;
+ /**
+ * init mqtt service
+ * JDBC has to be inited before
+ *
+ * @param serverurl mqtt server ip or hostname
+ * @param port mqtt server port
+ */
public MqttService(String serverurl, String port) {
serveruri = "tcp://" + serverurl + ":" + port;
try {
@@ -25,8 +39,10 @@ public class MqttService {
}
}
+ /**
+ * startup of the mqtt service
+ */
public void startupService() {
-
try {
client = new MqttClient(serveruri, "JavaSample42");
MqttConnectOptions connOpts = new MqttConnectOptions();
@@ -90,7 +106,7 @@ public class MqttService {
}
}
- public void checkDatabase(int citywastezoneid, int deviceid) {
+ private void checkDatabase(int citywastezoneid, int deviceid) {
int wastetype = -1;
ResultSet set2 = db.executeQuery("SELECT * FROM cities WHERE `id`='" + citywastezoneid + "'");
try {
diff --git a/src/java/com/wasteinformationserver/website/HttpTools.java b/src/java/com/wasteinformationserver/website/HttpTools.java
index 8bd51b5..82aa4f3 100644
--- a/src/java/com/wasteinformationserver/website/HttpTools.java
+++ b/src/java/com/wasteinformationserver/website/HttpTools.java
@@ -4,7 +4,18 @@ import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
+/**
+ * basic http tools
+ *
+ * @author Lukas Heiligenbrunner
+ */
public class HttpTools {
+ /**
+ * create md5 hash of string
+ *
+ * @param value input string
+ * @return md5 hash
+ */
public static String StringToMD5(String value) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
diff --git a/src/java/com/wasteinformationserver/website/datarequests/login/LoginState.java b/src/java/com/wasteinformationserver/website/datarequests/login/LoginState.java
index 72d5238..b061403 100644
--- a/src/java/com/wasteinformationserver/website/datarequests/login/LoginState.java
+++ b/src/java/com/wasteinformationserver/website/datarequests/login/LoginState.java
@@ -1,8 +1,9 @@
package com.wasteinformationserver.website.datarequests.login;
+/**
+ *
+ */
public class LoginState {
- private LoginState() {
- }
private static LoginState mythis = new LoginState();