diff options
author | Gerwin Gsenger <g.gsenger@datentechnik-innovation.at> | 2015-01-27 16:18:00 +0100 |
---|---|---|
committer | Gerwin Gsenger <g.gsenger@datentechnik-innovation.at> | 2015-01-27 16:18:00 +0100 |
commit | 92a879913faceb6f8392048768953846cf7a4e86 (patch) | |
tree | 14e6a67a72769d40936b056bd9823681c18d0f16 /id/server/idserverlib/src/main | |
parent | e32765da563770ca209943fe14b84cc71c2d2aac (diff) | |
download | moa-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/server/idserverlib/src/main')
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; + } + +} |