summaryrefslogtreecommitdiff
path: root/src/main/java/DNPM/services/consent/ConsentManagerServiceFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/DNPM/services/consent/ConsentManagerServiceFactory.java')
-rw-r--r--src/main/java/DNPM/services/consent/ConsentManagerServiceFactory.java25
1 files changed, 25 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..eb6c8ce
--- /dev/null
+++ b/src/main/java/DNPM/services/consent/ConsentManagerServiceFactory.java
@@ -0,0 +1,25 @@
+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 "MR.Consent":
+ default:
+ return new MrConsentManagerService(this.onkostarApi);
+ }
+ }
+
+}