Commit a5fd9339 authored by j.hoerdt's avatar j.hoerdt
Browse files

generate a uuid as pid ourselves

parent b98f9381
......@@ -42,8 +42,8 @@ class Sensor {
}
private String register_new_pid(Record rec) throws Exception {
String response_body = request_to_registry("POST", "21.11138/USER01", rec);
return new Gson().fromJson(response_body, JsonObject.class).get("epic-pid").getAsString();
String response_body = request_to_registry("PUT", Main.prefix_for_new_pids + UUID.randomUUID().toString(), rec);
return new Gson().fromJson(response_body, JsonObject.class).get("handle").getAsString();
}
private void update_pid(String pid, Record rec) throws Exception {
......@@ -128,6 +128,8 @@ class Sensor {
.header("Authorization", "Handle clientCert=\"true\"")
.build();
Main.glogger.fine("request uri: " + Main.pid_registry_uri + target_uri);
try (Response response = Handle.http_client.newCall(request).execute()) {
var response_body = response.body().string();
Main.glogger.fine("status: " + response.code());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment