class javadoc
This commit is contained in:
		
							
								
								
									
										3
									
								
								.idea/misc.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										3
									
								
								.idea/misc.xml
									
									
									
										generated
									
									
									
								
							@@ -4,6 +4,9 @@
 | 
			
		||||
  <component name="JavaScriptSettings">
 | 
			
		||||
    <option name="languageLevel" value="ES6" />
 | 
			
		||||
  </component>
 | 
			
		||||
  <component name="JavadocGenerationManager">
 | 
			
		||||
    <option name="OUTPUT_DIRECTORY" value="$USER_HOME$/Schreibtisch/testjavadoc" />
 | 
			
		||||
  </component>
 | 
			
		||||
  <component name="ProjectRootManager" version="2" languageLevel="JDK_13" default="true" project-jdk-name="13" project-jdk-type="JavaSDK">
 | 
			
		||||
    <output url="file://$PROJECT_DIR$/out" />
 | 
			
		||||
  </component>
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
}
 | 
			
		||||
@@ -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();
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -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";
 | 
			
		||||
 
 | 
			
		||||
@@ -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";
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
@@ -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");
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,9 @@
 | 
			
		||||
package com.wasteinformationserver.website.datarequests.login;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
public class LoginState {
 | 
			
		||||
    private LoginState() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private static LoginState mythis = new LoginState();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user