aboutsummaryrefslogtreecommitdiff
path: root/id
diff options
context:
space:
mode:
authorGerwin Gsenger <g.gsenger@datentechnik-innovation.at>2015-01-27 16:18:00 +0100
committerGerwin Gsenger <g.gsenger@datentechnik-innovation.at>2015-01-27 16:18:00 +0100
commit92a879913faceb6f8392048768953846cf7a4e86 (patch)
tree14e6a67a72769d40936b056bd9823681c18d0f16 /id
parente32765da563770ca209943fe14b84cc71c2d2aac (diff)
downloadmoa-id-spss-92a879913faceb6f8392048768953846cf7a4e86.tar.gz
moa-id-spss-92a879913faceb6f8392048768953846cf7a4e86.tar.bz2
moa-id-spss-92a879913faceb6f8392048768953846cf7a4e86.zip
initial version of ModuleRegistry and ModuleAuth
Diffstat (limited to 'id')
-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;
+ }
+
+}