summaryrefslogtreecommitdiff
path: root/src/main/java/DNPM/services/consent/ConsentManagerServiceFactory.java
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2023-04-03 17:44:38 +0200
committerGitHub2023-04-03 17:44:38 +0200
commit4193ad9672c6f3a26e765d2fc987d7da94108fb1 (patch)
treec9df0d013bd8bddf1ac5976cf0dba8ca89f609d1 /src/main/java/DNPM/services/consent/ConsentManagerServiceFactory.java
parent6d401353026d9dc042e8300d871d43589b74f153 (diff)
parent0914dd21d26eaa83bb057d0bc0af74f9cd3df20c (diff)
Merge pull request #21 from CCC-MF/issue_20
Anpassung des ConsentManagements an verschiedene Standorte
Diffstat (limited to 'src/main/java/DNPM/services/consent/ConsentManagerServiceFactory.java')
-rw-r--r--src/main/java/DNPM/services/consent/ConsentManagerServiceFactory.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/java/DNPM/services/consent/ConsentManagerServiceFactory.java b/src/main/java/DNPM/services/consent/ConsentManagerServiceFactory.java
new file mode 100644
index 0000000..4e08f8a
--- /dev/null
+++ b/src/main/java/DNPM/services/consent/ConsentManagerServiceFactory.java
@@ -0,0 +1,27 @@
+package DNPM.services.consent;
+
+import de.itc.onkostar.api.IOnkostarApi;
+
+public class ConsentManagerServiceFactory {
+
+ private final IOnkostarApi onkostarApi;
+
+ public ConsentManagerServiceFactory(
+ final IOnkostarApi onkostarApi
+ ) {
+ this.onkostarApi = onkostarApi;
+ }
+
+ public ConsentManagerService currentUsableInstance() {
+ var consentFormName = onkostarApi.getGlobalSetting("consentform");
+
+ switch (consentFormName) {
+ case "Excel-Formular":
+ return new UkwConsentManagerService(this.onkostarApi);
+ case "MR.Consent":
+ default:
+ return new MrConsentManagerService(this.onkostarApi);
+ }
+ }
+
+}