Skip to content
Snippets Groups Projects

WIP

12 files
+ 237
80
Compare changes
  • Side-by-side
  • Inline

Files

package at.tuwien;
package at.ac.tuwien.ifs.dbrepo;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.BufferedReader;
import java.io.IOException;
@@ -13,12 +14,13 @@ import java.nio.charset.Charset;
import java.util.Base64;
public class Client {
private static final Logger log = Logger.getLogger(Client.class);
private static final Logger log = LoggerFactory.getLogger(Client.class);
public static void postService(String data) throws IOException {
try {
final String urlString = System.getenv("METADATA_SERVICE_ENDPOINT");
log.debugf("METADATA_SERVICE_ENDPOINT: %s", urlString);
log.debug("METADATA_SERVICE_ENDPOINT: {}", urlString);
if (urlString == null || urlString.isEmpty()) {
throw new IllegalArgumentException("Environment variable METADATA_SERVICE_ENDPOINT is not set or is empty.");
}
@@ -26,7 +28,7 @@ public class Client {
if (systemUsername == null || systemUsername.isEmpty()) {
throw new IllegalArgumentException("Environment variable SYSTEM_USERNAME is not set or is empty.");
}
log.debugf("SYSTEM_USERNAME: %s", systemUsername);
log.debug("SYSTEM_USERNAME: {}", systemUsername);
final String systemPassword = System.getenv("SYSTEM_PASSWORD");
if (systemPassword == null || systemPassword.isEmpty()) {
throw new IllegalArgumentException("Environment variable SYSTEM_PASSWORD is not set or is empty.");
@@ -51,10 +53,8 @@ public class Client {
final BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String output;
log.debugf("Output from Server .... \n");
while ((output = br.readLine()) != null) {
System.out.println(output);
log.debugf("Input from Server: %s", output);
log.debug("input from server: {}", output);
}
conn.disconnect();
} catch (IOException e) {
Loading