diff options
author | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2017-01-02 16:35:43 +0100 |
---|---|---|
committer | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2017-01-02 16:35:43 +0100 |
commit | 8574f931c169248c67c3a5946351f9072628af46 (patch) | |
tree | 56ac39e631af4cd11058c4ba1193180af9d2e1fe /moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/tsl/TSLServiceFactory.java | |
parent | aabb36836ebfca9fe8cdc70dff13c0be7e5e761c (diff) | |
download | moa-sig-8574f931c169248c67c3a5946351f9072628af46.tar.gz moa-sig-8574f931c169248c67c3a5946351f9072628af46.tar.bz2 moa-sig-8574f931c169248c67c3a5946351f9072628af46.zip |
first untested beta version with new TSL lib
Diffstat (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/tsl/TSLServiceFactory.java')
-rw-r--r-- | moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/tsl/TSLServiceFactory.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/tsl/TSLServiceFactory.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/tsl/TSLServiceFactory.java new file mode 100644 index 0000000..83bcf3a --- /dev/null +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/tsl/TSLServiceFactory.java @@ -0,0 +1,47 @@ +package at.gv.egovernment.moa.spss.tsl; + +import at.gv.egovernment.moa.sig.tsl.TslClientFactory; +import at.gv.egovernment.moa.sig.tsl.api.ITslService; +import at.gv.egovernment.moa.sig.tsl.config.TslConfigurationImpl; +import at.gv.egovernment.moa.sig.tsl.exception.TslException; +import at.gv.egovernment.moa.spss.util.MessageProvider; +import at.gv.egovernment.moaspss.logging.LogMsg; +import at.gv.egovernment.moaspss.logging.Logger; + +public class TSLServiceFactory { + + private static ITslService tslClient = null; + + + public static void initialize(TslConfigurationImpl config) { + if (tslClient == null) { + try { + tslClient = TslClientFactory.buildTslService(config ); + + } catch (TslException e) { + Logger.fatal(new LogMsg(MessageProvider.getInstance().getMessage("init.05", new Object[]{e.getMessage()})), e); + + } + + } else { + Logger.error("TSL-Service client can only be initialized once."); + throw new IllegalStateException("TSL-Service client can only be initialized once."); + + } + + } + + public static boolean isInitialized() { + if (tslClient == null) + return false; + else + return true; + + } + + public static ITslService getTSLServiceClient() { + return tslClient; + + } + +} |