Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.

Commit 1555b63

Browse files
committed
improved logging
1 parent 7edc0d8 commit 1555b63

4 files changed

Lines changed: 29 additions & 27 deletions

File tree

codex-process-data-transfer/src/main/java/de/netzwerk_universitaetsmedizin/codex/processes/data_transfer/client/FttpClientFactory.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public void testConnection()
9494
private final String fttpStudy;
9595
private final String fttpTarget;
9696

97-
private final String proxySchemeHostPort;
97+
private final String proxyUrl;
9898
private final String proxyUsername;
9999
private final String proxyPassword;
100100

@@ -103,7 +103,7 @@ public void testConnection()
103103
public FttpClientFactory(Path trustStorePath, Path certificatePath, Path privateKeyPath, char[] privateKeyPassword,
104104
int connectTimeout, int socketTimeout, int connectionRequestTimeout, String fttpBasicAuthUsername,
105105
String fttpBasicAuthPassword, String fttpServerBase, String fttpApiKey, String fttpStudy, String fttpTarget,
106-
String proxySchemeHostPort, String proxyUsername, String proxyPassword, boolean hapiClientVerbose)
106+
String proxyUrl, String proxyUsername, String proxyPassword, boolean hapiClientVerbose)
107107
{
108108
this.trustStorePath = trustStorePath;
109109
this.certificatePath = certificatePath;
@@ -122,7 +122,7 @@ public FttpClientFactory(Path trustStorePath, Path certificatePath, Path private
122122
this.fttpStudy = fttpStudy;
123123
this.fttpTarget = fttpTarget;
124124

125-
this.proxySchemeHostPort = proxySchemeHostPort;
125+
this.proxyUrl = proxyUrl;
126126
this.proxyUsername = proxyUsername;
127127
this.proxyPassword = proxyPassword;
128128

@@ -135,10 +135,11 @@ public void onContextRefreshedEvent(ContextRefreshedEvent event)
135135
try
136136
{
137137
logger.info(
138-
"Testing connection to fTTP with {trustStorePath: {}, certificatePath: {}, privateKeyPath: {}, privateKeyPassword: {}, fttpBasicAuthUsername {}, fttpBasicAuthPassword {}, fttpServerBase: {}, fttpApiKey: {}, fttpStudy: {}, fttpTarget: {}}",
138+
"Testing connection to fTTP with {trustStorePath: {}, certificatePath: {}, privateKeyPath: {}, privateKeyPassword: {},"
139+
+ " basicAuthUsername {}, basicAuthPassword {}, serverBase: {}, apiKey: {}, study: {}, target: {}, proxyUrl {}, proxyUsername, proxyPassword {}}",
139140
trustStorePath, certificatePath, privateKeyPath, privateKeyPassword != null ? "***" : "null",
140141
fttpBasicAuthUsername, fttpBasicAuthPassword != null ? "***" : "null", fttpServerBase, fttpApiKey,
141-
fttpStudy, fttpTarget);
142+
fttpStudy, fttpTarget, proxyUrl, proxyUsername, proxyPassword != null ? "***" : "null");
142143

143144
getFttpClient().testConnection();
144145
}
@@ -174,7 +175,7 @@ protected FttpClient createFttpClient()
174175

175176
return new FttpClientImpl(trustStore, keyStore, keyStorePassword, connectTimeout, socketTimeout,
176177
connectionRequestTimeout, fttpBasicAuthUsername, fttpBasicAuthPassword, fttpServerBase, fttpApiKey,
177-
fttpStudy, fttpTarget, proxySchemeHostPort, proxyUsername, proxyPassword, hapiClientVerbose);
178+
fttpStudy, fttpTarget, proxyUrl, proxyUsername, proxyPassword, hapiClientVerbose);
178179
}
179180

180181
private KeyStore readTrustStore(Path trustPath)

codex-process-data-transfer/src/main/java/de/netzwerk_universitaetsmedizin/codex/processes/data_transfer/client/FttpClientImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class FttpClientImpl implements FttpClient
4848

4949
public FttpClientImpl(KeyStore trustStore, KeyStore keyStore, char[] keyStorePassword, int connectTimeout,
5050
int socketTimeout, int connectionRequestTimeout, String fttpBasicAuthUsername, String fttpBasicAuthPassword,
51-
String fttpServerBase, String fttpApiKey, String fttpStudy, String fttpTarget, String proxySchemeHostPort,
51+
String fttpServerBase, String fttpApiKey, String fttpStudy, String fttpTarget, String proxyUrl,
5252
String proxyUsername, String proxyPassword, boolean hapiClientVerbose)
5353
{
5454
clientFactory = createClientFactory(trustStore, keyStore, keyStorePassword, connectTimeout, socketTimeout,
@@ -63,7 +63,7 @@ public FttpClientImpl(KeyStore trustStore, KeyStore keyStore, char[] keyStorePas
6363
this.fttpStudy = fttpStudy;
6464
this.fttpTarget = fttpTarget;
6565

66-
configureProxy(clientFactory, proxySchemeHostPort, proxyUsername, proxyPassword);
66+
configureProxy(clientFactory, proxyUrl, proxyUsername, proxyPassword);
6767

6868
this.hapiClientVerbose = hapiClientVerbose;
6969
}
@@ -88,14 +88,14 @@ protected ApacheRestfulClientFactoryWithTlsConfig createClientFactory(KeyStore t
8888
return hapiClientFactory;
8989
}
9090

91-
private void configureProxy(IRestfulClientFactory clientFactory, String proxySchemeHostPort, String proxyUsername,
91+
private void configureProxy(IRestfulClientFactory clientFactory, String proxyUrl, String proxyUsername,
9292
String proxyPassword)
9393
{
94-
if (proxySchemeHostPort != null && !proxySchemeHostPort.isBlank())
94+
if (proxyUrl != null && !proxyUrl.isBlank())
9595
{
9696
try
9797
{
98-
URL url = new URL(proxySchemeHostPort);
98+
URL url = new URL(proxyUrl);
9999
clientFactory.setProxy(url.getHost(), url.getPort());
100100
clientFactory.setProxyCredentials(proxyUsername, proxyPassword);
101101

codex-process-data-transfer/src/main/java/de/netzwerk_universitaetsmedizin/codex/processes/data_transfer/client/GeccoClientFactory.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public boolean shouldUseChainedParameterNotLogicalReference()
9797
private final String geccoServerBasicAuthPassword;
9898
private final String geccoServerBearerToken;
9999

100-
private final String proxySchemeHostPort;
100+
private final String proxyUrl;
101101
private final String proxyUsername;
102102
private final String proxyPassword;
103103

@@ -112,7 +112,7 @@ public boolean shouldUseChainedParameterNotLogicalReference()
112112
public GeccoClientFactory(Path trustStorePath, Path certificatePath, Path privateKeyPath, char[] privateKeyPassword,
113113
int connectTimeout, int socketTimeout, int connectionRequestTimeout, String geccoServerBase,
114114
String geccoServerBasicAuthUsername, String geccoServerBasicAuthPassword, String geccoServerBearerToken,
115-
String proxySchemeHostPort, String proxyUsername, String proxyPassword, boolean hapiClientVerbose,
115+
String proxyUrl, String proxyUsername, String proxyPassword, boolean hapiClientVerbose,
116116
FhirContext fhirContext, Path searchBundleOverride, String localIdentifierValue,
117117
Class<GeccoFhirClient> geccoFhirClientClass, boolean useChainedParameterNotLogicalReference)
118118
{
@@ -131,7 +131,7 @@ public GeccoClientFactory(Path trustStorePath, Path certificatePath, Path privat
131131
this.geccoServerBasicAuthPassword = geccoServerBasicAuthPassword;
132132
this.geccoServerBearerToken = geccoServerBearerToken;
133133

134-
this.proxySchemeHostPort = proxySchemeHostPort;
134+
this.proxyUrl = proxyUrl;
135135
this.proxyUsername = proxyUsername;
136136
this.proxyPassword = proxyPassword;
137137
this.hapiClientVerbose = hapiClientVerbose;
@@ -150,10 +150,11 @@ public void onContextRefreshedEvent(ContextRefreshedEvent event)
150150
{
151151
logger.info(
152152
"Testing connection to GECCO FHIR server with {trustStorePath: {}, certificatePath: {}, privateKeyPath: {}, privateKeyPassword: {},"
153-
+ " geccoServerBasicAuthUsername {}, geccoServerBasicAuthPassword {}, geccoServerBearerToken {}, geccoServerBase: {}}",
153+
+ " basicAuthUsername {}, basicAuthPassword {}, bearerToken {}, serverBase: {}, proxyUrl {}, proxyUsername, proxyPassword {}}",
154154
trustStorePath, certificatePath, privateKeyPath, privateKeyPassword != null ? "***" : "null",
155155
geccoServerBasicAuthUsername, geccoServerBasicAuthPassword != null ? "***" : "null",
156-
geccoServerBearerToken != null ? "***" : "null", geccoServerBase);
156+
geccoServerBearerToken != null ? "***" : "null", geccoServerBase, proxyUrl, proxyUsername,
157+
proxyPassword != null ? "***" : "null");
157158

158159
getGeccoClient().testConnection();
159160
}
@@ -197,7 +198,7 @@ protected GeccoClient createGeccoClient()
197198

198199
return new GeccoClientImpl(trustStore, keyStore, keyStorePassword, connectTimeout, socketTimeout,
199200
connectionRequestTimeout, geccoServerBasicAuthUsername, geccoServerBasicAuthPassword,
200-
geccoServerBearerToken, geccoServerBase, proxySchemeHostPort, proxyUsername, proxyPassword,
201+
geccoServerBearerToken, geccoServerBase, proxyUrl, proxyUsername, proxyPassword,
201202
hapiClientVerbose, fhirContext, searchBundleOverride, localIdentifierValue, geccoFhirClientClass,
202203
useChainedParameterNotLogicalReference);
203204
}

codex-process-data-transfer/src/main/java/de/netzwerk_universitaetsmedizin/codex/processes/data_transfer/client/GeccoClientImpl.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ public class GeccoClientImpl implements GeccoClient
4242

4343
public GeccoClientImpl(KeyStore trustStore, KeyStore keyStore, char[] keyStorePassword, int connectTimeout,
4444
int socketTimeout, int connectionRequestTimeout, String geccoServerBasicAuthUsername,
45-
String geccoServerBasicAuthPassword, String geccoServerBearerToken, String geccoServerBase,
46-
String proxySchemeHostPort, String proxyUsername, String proxyPassword, boolean hapiClientVerbose,
47-
FhirContext fhirContext, Path searchBundleOverride, String localIdentifierValue,
48-
Class<GeccoFhirClient> geccoFhirClientClass, boolean useChainedParameterNotLogicalReference)
45+
String geccoServerBasicAuthPassword, String geccoServerBearerToken, String geccoServerBase, String proxyUrl,
46+
String proxyUsername, String proxyPassword, boolean hapiClientVerbose, FhirContext fhirContext,
47+
Path searchBundleOverride, String localIdentifierValue, Class<GeccoFhirClient> geccoFhirClientClass,
48+
boolean useChainedParameterNotLogicalReference)
4949
{
5050
clientFactory = createClientFactory(trustStore, keyStore, keyStorePassword, connectTimeout, socketTimeout,
5151
connectionRequestTimeout);
@@ -56,7 +56,7 @@ public GeccoClientImpl(KeyStore trustStore, KeyStore keyStore, char[] keyStorePa
5656
this.geccoServerBasicAuthPassword = geccoServerBasicAuthPassword;
5757
this.geccoServerBearerToken = geccoServerBearerToken;
5858

59-
configureProxy(clientFactory, proxySchemeHostPort, proxyUsername, proxyPassword);
59+
configureProxy(clientFactory, proxyUrl, proxyUsername, proxyPassword);
6060

6161
this.hapiClientVerbose = hapiClientVerbose;
6262

@@ -67,19 +67,19 @@ public GeccoClientImpl(KeyStore trustStore, KeyStore keyStore, char[] keyStorePa
6767
this.useChainedParameterNotLogicalReference = useChainedParameterNotLogicalReference;
6868
}
6969

70-
private void configureProxy(IRestfulClientFactory clientFactory, String proxySchemeHostPort, String proxyUsername,
70+
private void configureProxy(IRestfulClientFactory clientFactory, String proxyUrl, String proxyUsername,
7171
String proxyPassword)
7272
{
73-
if (proxySchemeHostPort != null && !proxySchemeHostPort.isBlank())
73+
if (proxyUrl != null && !proxyUrl.isBlank())
7474
{
7575
try
7676
{
77-
URL url = new URL(proxySchemeHostPort);
77+
URL url = new URL(proxyUrl);
7878
clientFactory.setProxy(url.getHost(), url.getPort());
7979
clientFactory.setProxyCredentials(proxyUsername, proxyPassword);
8080

81-
logger.info("Using proxy for GECCO connection with {host: {}, port: {}, username: {}}", url.getHost(),
82-
url.getPort(), proxyUsername);
81+
logger.info("Using proxy for GECCO FHIR server connection with {host: {}, port: {}, username: {}}",
82+
url.getHost(), url.getPort(), proxyUsername);
8383
}
8484
catch (MalformedURLException e)
8585
{

0 commit comments

Comments
 (0)