Skip to content

Commit b85417e

Browse files
Mikk BachmannMikk Bachmann
authored andcommitted
feat: As a Security Server Administrator I want the diagnostics information available for global configuration and TSA to be improved so that I can more easily figure out issues with it
CR changes refs: XRDDEV-2921
1 parent 6a5aafc commit b85417e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/service/configuration-client/configuration-client-core/src/main/java/org/niis/xroad/confclient/core/ConfigurationDownloader.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -275,22 +275,22 @@ protected static class DownloadedContent {
275275
}
276276

277277
/**
278-
* Checks if the configuration oldConfigurationFile should be downloaded. The rules to download:
279-
* i) Configuration oldConfigurationFile does not exist in the system
280-
* ii) Configuration oldConfigurationFile hash is different from the one that system has
278+
* Checks if the configuration currentConfigurationFile should be downloaded. The rules to download:
279+
* i) Configuration currentConfigurationFile does not exist in the system
280+
* ii) Configuration currentConfigurationFile hash is different from the one that system has
281281
*
282282
* @param newConfigurationFile new configuration file
283-
* @param oldConfigurationFile current configuration file
283+
* @param currentConfigurationFile current configuration file
284284
* @return boolean value of whether the files should be downloaded or not
285285
*/
286-
boolean shouldDownload(ConfigurationFile newConfigurationFile, Path oldConfigurationFile) {
286+
boolean shouldDownload(ConfigurationFile newConfigurationFile, Path currentConfigurationFile) {
287287
log.trace("shouldDownload({}, {})", newConfigurationFile.getContentLocation(), newConfigurationFile.getHash());
288288

289-
if (Files.exists(oldConfigurationFile)) {
289+
if (Files.exists(currentConfigurationFile)) {
290290
String contentHash = newConfigurationFile.getHash();
291291
byte[] fileHash;
292292
try {
293-
fileHash = getFileHash(oldConfigurationFile, newConfigurationFile.getHashAlgorithmId());
293+
fileHash = getFileHash(currentConfigurationFile, newConfigurationFile.getHashAlgorithmId());
294294
} catch (IOException e) {
295295
throw XrdRuntimeException.systemException(ErrorCode.GLOBAL_CONF_PART_FILE_HASH_FAILURE)
296296
.details("Failed to get hash for existing global configuration file")
@@ -301,14 +301,14 @@ boolean shouldDownload(ConfigurationFile newConfigurationFile, Path oldConfigura
301301
if (StringUtils.equals(existingHash, contentHash)) {
302302
return false;
303303
} else {
304-
log.trace("Downloading {} because oldConfigurationFile has changed ({} != {})",
304+
log.trace("Downloading {} because currentConfigurationFile has changed ({} != {})",
305305
newConfigurationFile.getContentLocation(), existingHash, contentHash);
306306
return true;
307307
}
308308
}
309309

310-
log.trace("Downloading {} because oldConfigurationFile {} does not exist locally",
311-
newConfigurationFile.getContentLocation(), oldConfigurationFile);
310+
log.trace("Downloading {} because currentConfigurationFile {} does not exist locally",
311+
newConfigurationFile.getContentLocation(), currentConfigurationFile);
312312
return true;
313313
}
314314

0 commit comments

Comments
 (0)