aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java/at
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/idserverlib/src/main/java/at')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/modulregistration/AuthModule.java40
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/modulregistration/ModuleRegistration.java29
2 files changed, 69 insertions, 0 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/modulregistration/AuthModule.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/modulregistration/AuthModule.java
new file mode 100644
index 000000000..6ee18c0ab
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/modulregistration/AuthModule.java
@@ -0,0 +1,40 @@
+package at.gv.egovernment.moa.id.moduls.modulregistration;
+
+import com.datentechnik.process_engine.api.ExecutionContext;
+import com.datentechnik.process_engine.model.ProcessDefinition;
+
+/**
+ * Defines the module capabilities.
+ */
+public interface AuthModule {
+
+ /**
+ * Returns the priority of the module. The priority defines the place in the
+ * order of modules. The module with a highest priority is asked first, if
+ * it has a process which can do an authentication.
+ *
+ * @return the priority of the module.
+ */
+ int getPriority();
+
+ /**
+ * Checks if the module has a process, which is able to do an authentication
+ * with the given {@link ExecutionContext}.
+ *
+ * @param context
+ * an ExecutionContext for a process.
+ * @return the process-ID of a process which is able to work with the given
+ * ExecutionContext, or {@code null}.
+ */
+ String selectProcess(ExecutionContext context);
+
+ /**
+ * Returns the an Array of {@link ProcessDefinition}s of the processes
+ * included in this module.
+ *
+ * @return an array of resource uris of the processes included in this
+ * module.
+ */
+ String[] getProcessDefinitions();
+
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/modulregistration/ModuleRegistration.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/modulregistration/ModuleRegistration.java
new file mode 100644
index 000000000..fc352742d
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/modulregistration/ModuleRegistration.java
@@ -0,0 +1,29 @@
+package at.gv.egovernment.moa.id.moduls.modulregistration;
+
+import com.datentechnik.process_engine.api.ExecutionContext;
+
+public class ModuleRegistration {
+
+ private static ModuleRegistration instance;
+
+ public static ModuleRegistration getInstance() {
+ if (instance == null) {
+ instance = new ModuleRegistration();
+ }
+ return instance;
+ }
+
+ private ModuleRegistration() {
+ initRegistry();
+ }
+
+ private void initRegistry() {
+ // TODO: use ServiceLoader and Spring to find all modules
+ }
+
+ public String selectProcess(ExecutionContext context) {
+ // TODO: implement
+ return null;
+ }
+
+}