|
2 | 2 | import java.io.BufferedReader;
|
3 | 3 | import java.io.DataOutputStream;
|
4 | 4 | import java.io.InputStreamReader;
|
5 |
| -import java.io.StringReader; |
6 | 5 | import java.net.URL;
|
7 | 6 | import java.util.concurrent.Executors;
|
8 | 7 | import java.util.concurrent.ScheduledExecutorService;
|
|
14 | 13 | import com.google.gson.JsonObject;
|
15 | 14 | import com.google.gson.JsonParser;
|
16 | 15 |
|
| 16 | +/** |
| 17 | + * Manages the connection to Redunda |
| 18 | + * */ |
17 | 19 | public class PingService {
|
18 | 20 | /**
|
19 | 21 | * The API-key for the current instance. You can get the key in the Instances-overview on Redunda
|
@@ -60,13 +62,19 @@ public PingService(String key, int pingInterval) {
|
60 | 62 | this.interval = pingInterval;
|
61 | 63 | }
|
62 | 64 |
|
| 65 | + /** |
| 66 | + * Enables or disables the debugging mode. |
| 67 | + * */ |
63 | 68 | public void setDebugging(boolean debug) {
|
64 | 69 | this.debugging = debug;
|
65 | 70 | if (this.debugging == true) {
|
66 | 71 | PingService.standby = new AtomicBoolean(false);
|
67 | 72 | }
|
68 | 73 | }
|
69 | 74 |
|
| 75 | + /** |
| 76 | + * Returns is PingService is in debugging mode. |
| 77 | + * */ |
70 | 78 | public boolean getDebugging() {
|
71 | 79 | return this.debugging;
|
72 | 80 | }
|
@@ -118,11 +126,6 @@ private void execute() throws Throwable {
|
118 | 126 | wr.writeBytes(parameters);
|
119 | 127 | wr.flush();
|
120 | 128 | wr.close();
|
121 |
| - |
122 |
| - //int responseCode = con.getResponseCode(); |
123 |
| - //System.out.println("\nSending 'POST' request to URL : " + url); |
124 |
| - //System.out.println("Post parameters : " + parameters); |
125 |
| - //System.out.println("Response Code : " + responseCode); |
126 | 129 |
|
127 | 130 | BufferedReader in = new BufferedReader(
|
128 | 131 | new InputStreamReader(con.getInputStream()));
|
|
0 commit comments