From bf385e99c9cf81d3958756e2c12f1c13ce46671b Mon Sep 17 00:00:00 2001 From: "GRUPOGMV\\ssis" Date: Thu, 18 Jul 2024 10:43:49 +0200 Subject: [PATCH] Comentario --- .../FromRegistrationServiceParticipantsExtension.java | 10 +++++----- ...ration.java => ParticipantRegistrationService.java} | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) rename extensions/participants-from-registration-service/src/main/java/org/upm/inesdata/catalog/{ParticipantConfiguration.java => ParticipantRegistrationService.java} (96%) diff --git a/extensions/participants-from-registration-service/src/main/java/org/upm/inesdata/catalog/FromRegistrationServiceParticipantsExtension.java b/extensions/participants-from-registration-service/src/main/java/org/upm/inesdata/catalog/FromRegistrationServiceParticipantsExtension.java index ef00192..e66d7dc 100644 --- a/extensions/participants-from-registration-service/src/main/java/org/upm/inesdata/catalog/FromRegistrationServiceParticipantsExtension.java +++ b/extensions/participants-from-registration-service/src/main/java/org/upm/inesdata/catalog/FromRegistrationServiceParticipantsExtension.java @@ -35,28 +35,28 @@ public class FromRegistrationServiceParticipantsExtension implements ServiceExte public void initialize(ServiceExtensionContext context) { var periodSeconds = context.getSetting(EXECUTION_PLAN_PERIOD_SECONDS, DEFAULT_EXECUTION_PERIOD_SECONDS); var monitor = context.getMonitor(); - var participantConfig = new ParticipantConfiguration(monitor, new ObjectMapper()); + var participantRegistrationService = new ParticipantRegistrationService(monitor, new ObjectMapper()); // Initial update - updateTargetNodeDirectory(context, participantConfig); + updateTargetNodeDirectory(context, participantRegistrationService); // Schedule periodic updates scheduler.scheduleAtFixedRate(() -> { try { - updateTargetNodeDirectory(context, participantConfig); + updateTargetNodeDirectory(context, participantRegistrationService); } catch (Exception e) { monitor.severe("Error updating TargetNodeDirectory", e); } }, periodSeconds, periodSeconds, TimeUnit.SECONDS); } - private void updateTargetNodeDirectory(ServiceExtensionContext context, ParticipantConfiguration participantConfig) { + private void updateTargetNodeDirectory(ServiceExtensionContext context, ParticipantRegistrationService participantRegistrationService) { var newDir = new InMemoryNodeDirectory(); Result tokenRepresentationResult = identityService.obtainClientCredentials( TokenParameters.Builder.newInstance().build()); - for (var target : participantConfig.getTargetNodes(context.getConfig(), tokenRepresentationResult)) { + for (var target : participantRegistrationService.getTargetNodes(context.getConfig(), tokenRepresentationResult)) { // skipping null target nodes if (target != null){ newDir.insert(target); diff --git a/extensions/participants-from-registration-service/src/main/java/org/upm/inesdata/catalog/ParticipantConfiguration.java b/extensions/participants-from-registration-service/src/main/java/org/upm/inesdata/catalog/ParticipantRegistrationService.java similarity index 96% rename from extensions/participants-from-registration-service/src/main/java/org/upm/inesdata/catalog/ParticipantConfiguration.java rename to extensions/participants-from-registration-service/src/main/java/org/upm/inesdata/catalog/ParticipantRegistrationService.java index 2975ed7..cb9e026 100644 --- a/extensions/participants-from-registration-service/src/main/java/org/upm/inesdata/catalog/ParticipantConfiguration.java +++ b/extensions/participants-from-registration-service/src/main/java/org/upm/inesdata/catalog/ParticipantRegistrationService.java @@ -23,7 +23,7 @@ /** * Handles participants in configuration and transforms them into TargetNodes */ -public class ParticipantConfiguration { +public class ParticipantRegistrationService { public static final List SUPPORTED_PROTOCOLS = List.of("dataspace-protocol-http"); @@ -42,7 +42,7 @@ public class ParticipantConfiguration { * @param monitor monitor * @param objectMapper mapper */ - public ParticipantConfiguration(Monitor monitor, ObjectMapper objectMapper) { + public ParticipantRegistrationService(Monitor monitor, ObjectMapper objectMapper) { this.monitor = monitor; this.objectMapper = objectMapper; }