Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
j.hoerdt
sensor2graph
Commits
7c896ce1
Commit
7c896ce1
authored
Apr 16, 2021
by
j.hoerdt
Browse files
fix compile errors
parent
8bc05375
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/sensor2graph/Sensor.java
View file @
7c896ce1
...
...
@@ -5,15 +5,10 @@ import sensor2graph.georev.*;
import
org.neo4j.driver.*
;
import
org.neo4j.driver.Record
;
import
okhttp3.
MediaType
;
import
okhttp3.
*
;
import
com.google.gson.*
;
import
java.net.*
;
import
java.net.http.*
;
import
java.net.http.HttpRequest.BodyPublishers
;
import
java.net.http.HttpResponse.BodyHandlers
;
import
java.time.Duration
;
import
java.util.*
;
import
java.util.function.*
;
import
java.util.logging.*
;
...
...
@@ -74,7 +69,7 @@ class Sensor {
Request
request
=
new
Request
.
Builder
()
.
url
(
Main
.
pid_registry_uri
+
target_uri
)
.
method
(
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
,
body
.
toString
()))
)
.
method
(
method
,
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
)
,
body
.
toString
()))
.
header
(
"Accept"
,
"application/json"
)
.
header
(
"Content-Type"
,
"application/json"
)
.
header
(
"Authorization"
,
"Handle clientCert=\"true\""
)
...
...
@@ -84,14 +79,13 @@ class Sensor {
System
.
out
.
println
(
response
.
body
().
string
()
+
response
.
code
());
Main
.
glogger
.
fine
(
"status: "
+
response
.
code
());
Main
.
glogger
.
fine
(
"resp: "
+
response
.
body
().
string
());
}
if
(
response
.
code
()
/
100
!=
2
)
{
throw
new
Exception
(
"request to pid registry failed with status code "
+
response
.
statusCode
()
+
", reponse: "
+
response
.
body
());
if
(
response
.
code
()
/
100
!=
2
)
{
throw
new
Exception
(
"request to pid registry failed with status code "
+
response
.
code
()
+
", reponse: "
+
response
.
body
().
string
());
}
return
response
.
body
().
string
();
}
return
response
.
body
();
}
private
void
add_attribute
(
JsonArray
body
,
String
registered_type
,
String
parsed_data
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment