aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java73
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java4
2 files changed, 14 insertions, 63 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java
index ad465e0d8..ec261335d 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java
@@ -237,20 +237,8 @@ public class EditGeneralConfigAction extends BasicAction {
} catch (Exception ex) {
ex.printStackTrace();
}
-
- MOAIDConfiguration oldconfig = ConfigurationDBRead.getMOAIDConfiguration();
- AuthComponentGeneral oldauth = null;
- if (oldconfig != null) {
- oldauth = oldconfig.getAuthComponentGeneral();
- }
-
-// MOAIDConfiguration dbconfig = ConfigurationDBRead.getMOAIDConfiguration();
-// if (dbconfig == null) {
-// dbconfig = new MOAIDConfiguration();
-// isnewconfig = true;
-// }
- MOAIDConfiguration dbconfig = new MOAIDConfiguration();
+ MOAIDConfiguration dbconfig = ConfigurationDBRead.getMOAIDConfiguration();
AuthComponentGeneral dbauth = dbconfig.getAuthComponentGeneral();
if (dbauth == null) {
@@ -486,23 +474,6 @@ public class EditGeneralConfigAction extends BasicAction {
dbchainingmodes.setSystemDefaultMode(
ChainingModeType.fromValue(moaconfig.getDefaultchainigmode()));
- if (oldconfig != null) {
- ChainingModes oldchainigmodes = oldconfig.getChainingModes();
- if (oldchainigmodes != null) {
- List<TrustAnchor> oldtrustanchor = oldchainigmodes.getTrustAnchor();
- if (oldtrustanchor != null) {
- List<TrustAnchor> trustanchor = new ArrayList<TrustAnchor>();
- for (TrustAnchor oldel : oldtrustanchor) {
- TrustAnchor TAel = new TrustAnchor();
- TAel.setX509IssuerName(oldel.getX509IssuerName());
- TAel.setX509SerialNumber(oldel.getX509SerialNumber());
- TAel.setMode(oldel.getMode());
- trustanchor.add(TAel);
- }
- dbchainingmodes.setTrustAnchor(trustanchor);
- }
- }
- }
IdentityLinkSigners idlsigners = dbauth.getIdentityLinkSigners();
if (idlsigners == null) {
@@ -525,31 +496,28 @@ public class EditGeneralConfigAction extends BasicAction {
forcon.setURL(moaconfig.getSzrgwURL());
}
- //TODO: Set STORK Config!!!
- if (oldauth != null) {
- ForeignIdentities oldforeign = oldauth.getForeignIdentities();
- if (oldforeign != null) {
- STORK oldstork = oldforeign.getSTORK();
- if (oldstork == null)
- oldstork = new STORK();
+ ForeignIdentities foreign = dbauth.getForeignIdentities();
+ if (foreign != null) {
+ STORK stork = foreign.getSTORK();
+ if (stork == null)
+ stork = new STORK();
try {
log.error("QAAAA " + storkconfig.getDefaultQaa());
- oldstork.setQualityAuthenticationAssuranceLevel(storkconfig.getDefaultQaa());
+ stork.setQualityAuthenticationAssuranceLevel(storkconfig.getDefaultQaa());
if (storkconfig.getAttributes() != null)
- oldstork.setAttributes(storkconfig.getAttributes());
+ stork.setAttributes(storkconfig.getAttributes());
else
- oldstork.setAttributes((List<StorkAttribute>) (new ArrayList<StorkAttribute>()));
+ stork.setAttributes((List<StorkAttribute>) (new ArrayList<StorkAttribute>()));
if (storkconfig.getCpepslist() != null)
- oldstork.setCPEPS(storkconfig.getCpepslist());
+ stork.setCPEPS(storkconfig.getCpepslist());
else
- oldstork.setCPEPS((List<CPEPS>) (new ArrayList<CPEPS>()));
+ stork.setCPEPS((List<CPEPS>) (new ArrayList<CPEPS>()));
- dbforeign.setSTORK(oldstork);
} catch (Exception e) {
e.printStackTrace();
}
@@ -561,7 +529,6 @@ public class EditGeneralConfigAction extends BasicAction {
log.info("CPEPS LIST is null");
}
}
- }
if (MiscUtil.isNotEmpty(moaconfig.getMandateURL())) {
OnlineMandates dbmandate = dbauth.getOnlineMandates();
@@ -604,7 +571,7 @@ public class EditGeneralConfigAction extends BasicAction {
}
moaauth.setTrustProfileID(moaconfig.getMoaspssAuthTrustProfile());
- moaauth.setVerifyTransformsInfoProfileID(moaconfig.getAuthTransformList());
+ moaauth.getVerifyTransformsInfoProfileID().set(0, moaconfig.getAuthTransformList().get(0));
SecurityLayer seclayertrans = dbauth.getSecurityLayer();
if (seclayertrans == null) {
@@ -621,19 +588,6 @@ public class EditGeneralConfigAction extends BasicAction {
elem.setTransformation(moatrans.get(key));
trans.add(elem);
}
- } else {
- if (oldauth != null) {
- SecurityLayer oldsectrans = oldauth.getSecurityLayer();
- if (oldsectrans != null) {
- List<TransformsInfoType> oldtranslist = oldsectrans.getTransformsInfo();
- for (TransformsInfoType oldel : oldtranslist) {
- TransformsInfoType elem = new TransformsInfoType();
- elem.setFilename(oldel.getFilename());
- elem.setTransformation(oldel.getTransformation());
- trans.add(elem);
- }
- }
- }
}
if (trans.size() > 0)
seclayertrans.setTransformsInfo(trans);
@@ -660,9 +614,6 @@ public class EditGeneralConfigAction extends BasicAction {
ConfigurationDBUtils.save(dbconfig);
- if (oldconfig != null)
- ConfigurationDBUtils.delete(oldconfig);
-
} catch (MOADatabaseException e) {
log.warn("MOAID Configuration can not be stored in Database", e);
return LanguageHelper.getErrorString("error.db.oa.store", request);
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java
index 88220cded..e890e2145 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java
@@ -147,8 +147,8 @@ public class ConfigurationDBRead {
Logger.trace("Found entries: " + result.size());
if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
+ Logger.trace("No entries found. Create fresh instance.");
+ return new MOAIDConfiguration();
}
return (MOAIDConfiguration) result.get(0);