javadoc
This commit is contained in:
		@@ -22,6 +22,15 @@ public class Log {
 | 
			
		||||
    private static final String ANSI_CYAN = "\u001B[36m";
 | 
			
		||||
    private static final String ANSI_WHITE = "\u001B[37m";
 | 
			
		||||
 | 
			
		||||
    // TODO: 30.01.20 update to enum 
 | 
			
		||||
//    public enum Kind{
 | 
			
		||||
//        CRITICAL_ERROR,
 | 
			
		||||
//        ERROR,
 | 
			
		||||
//        WARNING,
 | 
			
		||||
//        INFO,
 | 
			
		||||
//        MESSAGE,
 | 
			
		||||
//        DEBUG
 | 
			
		||||
//    }
 | 
			
		||||
    public static final int CRITICAL_ERROR = 6;
 | 
			
		||||
    public static final int ERROR = 5;
 | 
			
		||||
    public static final int WARNING = 4;
 | 
			
		||||
 
 | 
			
		||||
@@ -37,6 +37,8 @@ public class JDBC {
 | 
			
		||||
        usernamec = username;
 | 
			
		||||
        passwordc = password;
 | 
			
		||||
        dbnamec = dbname;
 | 
			
		||||
        ipc = ip;
 | 
			
		||||
        portc = port;
 | 
			
		||||
        JDBC = new JDBC(username, password, dbname, ip, port);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -61,7 +63,7 @@ public class JDBC {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static void logintodb(String username, String password, String dbname, String ip, int port) throws IOException {
 | 
			
		||||
    private static void logintodb(String username, String password, String dbname, String ip, int port) throws IOException {
 | 
			
		||||
        Database db = new MySQLConnector(
 | 
			
		||||
                username,
 | 
			
		||||
                password,
 | 
			
		||||
 
 | 
			
		||||
@@ -8,6 +8,10 @@ import java.io.IOException;
 | 
			
		||||
import java.io.OutputStream;
 | 
			
		||||
import java.util.HashMap;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * basic GET request handler
 | 
			
		||||
 * reply function has to be implemented!
 | 
			
		||||
 */
 | 
			
		||||
public abstract class GetRequest implements HttpHandler {
 | 
			
		||||
    @Override
 | 
			
		||||
    public void handle(HttpExchange httpExchange) throws IOException {
 | 
			
		||||
 
 | 
			
		||||
@@ -9,8 +9,11 @@ import java.io.InputStream;
 | 
			
		||||
import java.io.OutputStream;
 | 
			
		||||
import java.util.HashMap;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * basic POST request handler
 | 
			
		||||
 * reply function has to be implemented!
 | 
			
		||||
 */
 | 
			
		||||
public abstract class PostRequest implements HttpHandler {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void handle(HttpExchange httpExchange) throws IOException {
 | 
			
		||||
        if (httpExchange.getRequestMethod().equals("POST")) {
 | 
			
		||||
 
 | 
			
		||||
@@ -5,6 +5,9 @@ import com.wasteinformationserver.website.basicrequest.PostRequest;
 | 
			
		||||
 | 
			
		||||
import java.util.HashMap;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * request handler for checking the login state of a user
 | 
			
		||||
 */
 | 
			
		||||
public class CheckLoginState extends PostRequest {
 | 
			
		||||
    @Override
 | 
			
		||||
    public String request(HashMap<String, String> params) {
 | 
			
		||||
 
 | 
			
		||||
@@ -10,6 +10,11 @@ import java.sql.ResultSet;
 | 
			
		||||
import java.sql.SQLException;
 | 
			
		||||
import java.util.HashMap;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * request handler of new login request of user
 | 
			
		||||
 * - checks the truth of username and password
 | 
			
		||||
 * - replies right error messages or the success login
 | 
			
		||||
 */
 | 
			
		||||
public class LoginRequest extends PostRequest {
 | 
			
		||||
    @Override
 | 
			
		||||
    public String request(HashMap<String, String> params) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user