Skip to content

Commit

Permalink
Switch to native HttpClient for legacy Olog client
Browse files Browse the repository at this point in the history
  • Loading branch information
georgweiss committed Jan 20, 2025
1 parent 6f83593 commit c5a6edd
Show file tree
Hide file tree
Showing 11 changed files with 431 additions and 716 deletions.
4 changes: 0 additions & 4 deletions app/logbook/elog/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
</parent>
<artifactId>app-logbook-elog</artifactId>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-core -->
<!-- https://mvnrepository.com/artifact/com.sun.jersey.contribs/jersey-multipart -->
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-impl -->
<dependency>
<groupId>org.phoebus</groupId>
<artifactId>core-logbook</artifactId>
Expand Down
14 changes: 0 additions & 14 deletions app/logbook/olog/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
<artifactId>app-logbook-olog-client</artifactId>

<dependencies>
<!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-core -->
<!-- https://mvnrepository.com/artifact/com.sun.jersey.contribs/jersey-multipart -->
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-impl -->
<dependency>
<groupId>org.phoebus</groupId>
<artifactId>core-logbook</artifactId>
Expand Down Expand Up @@ -46,16 +42,6 @@
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.19</version>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-multipart</artifactId>
<version>1.19</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import org.phoebus.logbook.LogClient;
import org.phoebus.logbook.LogFactory;
import org.phoebus.olog.api.OlogClient;
import org.phoebus.olog.api.OlogClient.OlogClientBuilder;
import org.phoebus.security.tokens.SimpleAuthenticationToken;

Expand All @@ -23,7 +24,7 @@ public String getId() {
public LogClient getLogClient() {
if (oLogClient == null) {
try {
oLogClient = OlogClientBuilder.serviceURL().create();
oLogClient = OlogClient.builder().build();
} catch (Exception e) {
logger.log(Level.SEVERE, "Failed to create olog client", e);
}
Expand All @@ -36,11 +37,10 @@ public LogClient getLogClient(Object authToken) {
try {
if (authToken instanceof SimpleAuthenticationToken) {
SimpleAuthenticationToken token = (SimpleAuthenticationToken) authToken;
return OlogClientBuilder.serviceURL().withHTTPAuthentication(true).username(token.getUsername()).password(token.getPassword())
.create();
return OlogClient.builder().username(token.getUsername()).password(token.getPassword())
.build();
} else if (oLogClient == null) {
oLogClient = OlogClientBuilder.serviceURL().create();

oLogClient = OlogClient.builder().build();
}
} catch (Exception e) {
logger.log(Level.SEVERE, "Failed to create olog client", e);
Expand Down

This file was deleted.

Loading

0 comments on commit c5a6edd

Please sign in to comment.