aboutsummaryrefslogtreecommitdiff
path: root/moaSig
diff options
context:
space:
mode:
authorThomas <>2022-09-15 09:16:49 +0200
committerThomas <>2022-09-15 09:16:49 +0200
commitafca5b6f8947c972c5d6cc4c8ae906fa1b7b123f (patch)
tree5fac544f5c8abc7351d87d516a86aac3beb8e613 /moaSig
parentb329b436b99d78dde21ab7a338331faaa2da6f6e (diff)
downloadmoa-sig-afca5b6f8947c972c5d6cc4c8ae906fa1b7b123f.tar.gz
moa-sig-afca5b6f8947c972c5d6cc4c8ae906fa1b7b123f.tar.bz2
moa-sig-afca5b6f8947c972c5d6cc4c8ae906fa1b7b123f.zip
refact(iaik-moa): switch to static IAIK-MOA initializer implementation
Diffstat (limited to 'moaSig')
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java16
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java2
2 files changed, 8 insertions, 10 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java
index 8ca19e4..3472419 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java
@@ -64,7 +64,7 @@ public class IaikConfigurator {
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(IaikConfigurator.class);
/** The warnings encountered during configuration. */
- private List warnings = new ArrayList();
+ private static List<String> warnings = new ArrayList<>();
/**
* Configure the IAIK MOA subsystem.
@@ -75,12 +75,10 @@ public class IaikConfigurator {
* @throws ConfigurationException An error occurred configuring the IAIK MOA
* subsystem.
*/
- public ConfigurationData configure(ConfigurationProvider moaConfig)
+ public static ConfigurationData configure(ConfigurationProvider moaConfig)
throws ConfigurationException {
final ConfigurationData configData = new ConfigurationDataImpl(moaConfig);
- warnings = new ArrayList();
-
try {
final TransactionId transId = new TransactionId("IaikConfigurator");
@@ -127,7 +125,7 @@ public class IaikConfigurator {
}
}
- private void logException(Throwable e) {
+ private static void logException(Throwable e) {
final StringWriter out = new StringWriter();
final PrintWriter writer = new PrintWriter(out);
e.printStackTrace(writer);
@@ -148,7 +146,7 @@ public class IaikConfigurator {
* Dump all <code>KeyEntryID</code>s contained in the configured
* <code>KeyModule</code>s to the log file.
*/
- private void dumpKeyEntryIDs() {
+ private static void dumpKeyEntryIDs() {
final MessageProvider msg = MessageProvider.getInstance();
final KeyModule module = KeyModuleFactory.getInstance(new TransactionId("dump"));
final Set keyEntryIds = module.getPrivateKeyEntryIDs();
@@ -169,7 +167,7 @@ public class IaikConfigurator {
*
* @param moaConfig The MOA configuration to check.
*/
- private void checkKeyGroupConfig(ConfigurationProvider moaConfig) {
+ private static void checkKeyGroupConfig(ConfigurationProvider moaConfig) {
final Map keyGroups = moaConfig.getKeyGroups();
Iterator iter;
@@ -202,7 +200,7 @@ public class IaikConfigurator {
* @return <code>true</code>, if the <code>keyGroupEntry</code> could be
* resolved to a <code>KeyEntryID</code>; otherwise <code>false</code>.
*/
- private boolean findKeyEntryID(KeyGroupEntry keyGroupEntry) {
+ private static boolean findKeyEntryID(KeyGroupEntry keyGroupEntry) {
final KeyModule module = KeyModuleFactory.getInstance(new TransactionId("check"));
final Set keyEntryIDs = module.getPrivateKeyEntryIDs();
Iterator iter;
@@ -228,7 +226,7 @@ public class IaikConfigurator {
* @param args Additional parameters for the message.
* @see at.gv.egovernment.moa.spss.server.util.MessageProvider
*/
- private void warn(String messageId, Object[] args) {
+ private static void warn(String messageId, Object[] args) {
final MessageProvider msg = MessageProvider.getInstance();
final String txt = msg.getMessage(messageId, args);
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java
index 7cb23df..3d935df 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java
@@ -177,7 +177,7 @@ public class SystemInitializer {
new ObjectID("2.5.4.97", "organizationIdentifier", (String) null, false));
Logger.info("Building IAIK-MOA configuration ... ");
- iaikConfiguration = new IaikConfigurator().configure(config);
+ iaikConfiguration = IaikConfigurator.configure(config);
runInitializer(config);