From 23a46b4be35277e06ec89f48730eeb694e686be8 Mon Sep 17 00:00:00 2001
From: Kenmegne <stephanie.kenmegne@gmail.com>
Date: Thu, 18 Jun 2026 15:40:06 +0000
Subject: [PATCH] add fdx-commons and fdx-consultation
---
fdx-consultation/fdxconsultation-core-impl/src/main/java/com/megatim/fdxconsultation/core/impl/helper/RoutingCheckerImpl.java | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/fdx-consultation/fdxconsultation-core-impl/src/main/java/com/megatim/fdxconsultation/core/impl/helper/RoutingCheckerImpl.java b/fdx-consultation/fdxconsultation-core-impl/src/main/java/com/megatim/fdxconsultation/core/impl/helper/RoutingCheckerImpl.java
new file mode 100644
index 0000000..208d3d1
--- /dev/null
+++ b/fdx-consultation/fdxconsultation-core-impl/src/main/java/com/megatim/fdxconsultation/core/impl/helper/RoutingCheckerImpl.java
@@ -0,0 +1,29 @@
+package com.megatim.fdxconsultation.core.impl.helper;
+
+import com.megatim.fdxcommons.model.pojo.DataInMemory;
+import com.megatim.fdxcommons.tools.exceptions.ApplicationForbidenException;
+import com.megatim.fdxconsultation.core.ifaces.helper.RoutingChecker;
+import javax.enterprise.context.Dependent;
+
+/**
+ *
+ * @author lenovo
+ */
+@Dependent
+public class RoutingCheckerImpl implements RoutingChecker {
+
+ @Override
+ public void stopIfNotProducer(String codeTypeFichier, DataInMemory dataInMemory, String codeParticipant) {
+ if (!dataInMemory.getTypeFichierToParticipantsEnvoi().get(codeTypeFichier).contains(codeParticipant)) {
+ throw new ApplicationForbidenException("Impossible de continuer la requête car le participant " + codeParticipant + " n'est pas producteur du type de fichier " + codeTypeFichier);
+ }
+ }
+
+ @Override
+ public void stopIfNotConsumer(String codeTypeFichier, DataInMemory dataInMemory, String codeParticipant) {
+ if (!dataInMemory.getTypeFichierToParticipantsReception().get(codeTypeFichier).contains(codeParticipant)) {
+ throw new ApplicationForbidenException("Impossible de continuer la requête car le participant " + codeParticipant + " n'est pas consommateur du type de fichier " + codeTypeFichier);
+ }
+ }
+
+}
--
Gitblit v1.10.0