diff --git a/DeFi-Data-Engine/DeFi Data Engine/src/main/java/org/out/socket/SocketManager.java b/DeFi-Data-Engine/DeFi Data Engine/src/main/java/org/out/socket/SocketManager.java index 0d923738..2444deab 100644 --- a/DeFi-Data-Engine/DeFi Data Engine/src/main/java/org/out/socket/SocketManager.java +++ b/DeFi-Data-Engine/DeFi Data Engine/src/main/java/org/out/socket/SocketManager.java @@ -84,14 +84,13 @@ public void run() { // execute valid response to engine Response response = producer.send(tag, sub_tag, data); - out.writeUTF(new JSONObject() - .put("response", "200") - .put("code", response.code()) - .put("message", response.message()) - .put("data", response.data()) - .toString()); - out.flush(); - System.out.println("<<>>"); +// out.writeUTF(new JSONObject() +// .put("response", "200") +// .put("code", response.code()) +// .put("message", response.message()) +// .put("data", response.data()) +// .toString()); +// out.flush(); } catch(Exception e) { break; diff --git a/DeFi-Data-Engine/DeFi Data Engine/src/main/java/org/properties/Config.java b/DeFi-Data-Engine/DeFi Data Engine/src/main/java/org/properties/Config.java index 0879bcde..0ddad2b8 100644 --- a/DeFi-Data-Engine/DeFi Data Engine/src/main/java/org/properties/Config.java +++ b/DeFi-Data-Engine/DeFi Data Engine/src/main/java/org/properties/Config.java @@ -8,24 +8,6 @@ public class Config { private static final HashMap properties; static { -// properties = new HashMap(); -// -// String[] files = new File("src/main/resources/config").list(); -// -// for(String file : files) { -// if(file.lastIndexOf(".properties") == file.length() - 11) { -// String name = file.substring(0, file.length() - 11); -// properties.put(name, new Properties()); -// -// try (FileInputStream in = new FileInputStream("src/main/resources/config/" + file)) { -// properties.get(name).load(in); -// } catch(Exception e) { -// e.printStackTrace(); -// System.exit(1); -// } -// } -// } - properties = new HashMap(); Properties app_properties = new Properties(); diff --git a/DeFi-Data-Engine/Rest Application/src/main/java/org/properties/Config.java b/DeFi-Data-Engine/Rest Application/src/main/java/org/properties/Config.java index c6210aef..91ec6a33 100644 --- a/DeFi-Data-Engine/Rest Application/src/main/java/org/properties/Config.java +++ b/DeFi-Data-Engine/Rest Application/src/main/java/org/properties/Config.java @@ -8,24 +8,6 @@ public class Config { private static final HashMap properties; static { -// properties = new HashMap(); -// -// String[] files = new File("config").list(); -// -// for(String file : files) { -// if(file.lastIndexOf(".properties") == file.length() - 11) { -// String name = file.substring(0, file.length() - 11); -// properties.put(name, new Properties()); -// -// try (FileInputStream in = new FileInputStream("config/" + file)) { -// properties.get(name).load(in); -// } catch(Exception e) { -// e.printStackTrace(); -// System.exit(1); -// } -// } -// } - properties = new HashMap(); Properties app_properties = new Properties(); diff --git a/DeFi-Data-Engine/Testing Environment/src/test/connection/socket/LocalTest.java b/DeFi-Data-Engine/Testing Environment/src/test/connection/socket/LocalTest.java index 6d7c931f..8b1558eb 100644 --- a/DeFi-Data-Engine/Testing Environment/src/test/connection/socket/LocalTest.java +++ b/DeFi-Data-Engine/Testing Environment/src/test/connection/socket/LocalTest.java @@ -1,7 +1,6 @@ package test.connection.socket; import java.io.BufferedReader; -import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStreamReader; @@ -16,7 +15,8 @@ public class LocalTest { - private static final String host = "localhost"; + //private static final String host = "localhost"; + private static final String host = "defi-de.idea.rpi.edu"; public static void main(String[] args) throws UnknownHostException, IOException { final Socket socket = SocketFactory.getDefault().createSocket(host, 61200); @@ -38,14 +38,14 @@ public static void main(String[] args) throws UnknownHostException, IOException + "destination&&&%s&&&" + "key&&&%s&&&" + "start_date&&&2022-08-01&&&" - + "end_date&&&2022-08-02&&&" + + "end_date&&&2022-09-01&&&" + "query&&&aave-protocol-dated&&&" + "request&&&aave-protocol-dated\n", destination, key)); while(true) { - System.out.print(readLine(in)); + System.out.println(readLine(in)); } // String rqst_protocol_dated = String.format("http://%s:8080/defi/v1/rest/request_dated?" @@ -79,6 +79,7 @@ public static void main(String[] args) throws UnknownHostException, IOException } public static String request(String str) throws IOException { + System.out.println(str); URL obj = new URL(str); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); @@ -105,8 +106,9 @@ public static String request(String str) throws IOException { public static final String readLine(BufferedReader in) throws IOException { StringBuilder out = new StringBuilder(); char c = 0; - while((c = (char)in.read()) != 10) + while((c = (char)in.read()) != 10) { out.append(c); + } return out.toString(); }