aboutsummaryrefslogtreecommitdiff
path: root/moaSig/moa-sig-lib/src/main/java
diff options
context:
space:
mode:
authorThomas <>2022-09-15 09:16:49 +0200
committerThomas <>2022-09-15 09:21:31 +0200
commit33e99dc7b05e3d3ac38e2331b60395cfdc1b7e7e (patch)
treed3325ced30d31457ed23063c3febd47f36290def /moaSig/moa-sig-lib/src/main/java
parentc8ae5bfc35556ba7f12e44881792017a69568b28 (diff)
downloadmoa-sig-33e99dc7b05e3d3ac38e2331b60395cfdc1b7e7e.tar.gz
moa-sig-33e99dc7b05e3d3ac38e2331b60395cfdc1b7e7e.tar.bz2
moa-sig-33e99dc7b05e3d3ac38e2331b60395cfdc1b7e7e.zip
refact(iaik-moa): switch to static IAIK-MOA initializer implementation
Diffstat (limited to 'moaSig/moa-sig-lib/src/main/java')
-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);