aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java
diff options
context:
space:
mode:
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java274
1 files changed, 139 insertions, 135 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java
index b5c996c72..c833372c9 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java
@@ -25,8 +25,6 @@ package at.gv.egovernment.moa.id.configuration.data;
import java.util.ArrayList;
import java.util.List;
-import org.apache.log4j.Logger;
-
import at.gv.egovernment.moa.id.commons.MOAIDConstants;
import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.AuthComponentGeneral;
import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.CPEPS;
@@ -36,141 +34,147 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.STORK;
import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.StorkAttribute;
import at.gv.egovernment.moa.id.config.webgui.exception.ConfigurationException;
import at.gv.egovernment.moa.id.configuration.config.ConfigurationProvider;
+import lombok.extern.slf4j.Slf4j;
+@Slf4j
public class GeneralStorkConfig {
- private List<CPEPS> cpepslist;
- private List<StorkAttribute> attributes;
- private String qaa;
- private static final Logger log = Logger.getLogger(GeneralStorkConfig.class);
-
- private MOAIDConfiguration dbconfig = null;
-
- /**
- *
- */
- public GeneralStorkConfig() {
- try {
- dbconfig = ConfigurationProvider.getInstance().getDbRead().getMOAIDConfiguration();
-
- } catch (ConfigurationException e) {
- log.error("MOA-ID-Configuration initialization FAILED.", e);
-
- }
-
- }
-
- public void parse(MOAIDConfiguration config) {
- log.info("Initializing general Stork config");
-
- cpepslist = new ArrayList<CPEPS>();
- attributes = new ArrayList<StorkAttribute>();
-
- if (config != null) {
- AuthComponentGeneral auth = config.getAuthComponentGeneral();
-
- if (auth != null) {
- ForeignIdentities foreign = auth.getForeignIdentities();
-
- if (foreign != null) {
- STORK stork = foreign.getSTORK();
-
- if (stork != null) {
- // deep clone all the things
- // to foreclose lazyloading session timeouts
- if (stork.getCPEPS() != null) {
- for(CPEPS current : stork.getCPEPS()) {
- cpepslist.add(current);
- }
- }
-
- List<StorkAttribute> tmp = stork.getAttributes();
- if(null != tmp) {
-
- for(StorkAttribute current : tmp)
- attributes.add(current);
- }
-
- try {
- qaa = stork.getGeneral_eIDAS_LOA();
-
- } catch(NullPointerException e) {
- qaa = MOAIDConstants.eIDAS_LOA_HIGH;
- }
- }
-
- }
- }
- }
-
- if (cpepslist.isEmpty()) {
- CPEPS defaultCPEPS = new CPEPS();
- defaultCPEPS.setCountryCode("CC");
- defaultCPEPS.setURL("http://");
- defaultCPEPS.setSupportsXMLSignature(true);
- cpepslist.add(defaultCPEPS );
-
- }
- if(attributes.isEmpty())
- attributes.add(new StorkAttribute());
- }
-
- public List<String> getAllowedLoALevels() {
- return MOAIDConstants.ALLOWED_eIDAS_LOA;
- }
-
- public List<CPEPS> getRawCPEPSList() {
- return cpepslist;
+ private List<CPEPS> cpepslist;
+ private List<StorkAttribute> attributes;
+ private String qaa;
+
+ private MOAIDConfiguration dbconfig = null;
+
+ /**
+ *
+ */
+ public GeneralStorkConfig() {
+ try {
+ dbconfig = ConfigurationProvider.getInstance().getDbRead().getMOAIDConfiguration();
+
+ } catch (final ConfigurationException e) {
+ log.error("MOA-ID-Configuration initialization FAILED.", e);
+
+ }
+
+ }
+
+ public void parse(MOAIDConfiguration config) {
+ log.info("Initializing general Stork config");
+
+ cpepslist = new ArrayList<>();
+ attributes = new ArrayList<>();
+
+ if (config != null) {
+ final AuthComponentGeneral auth = config.getAuthComponentGeneral();
+
+ if (auth != null) {
+ final ForeignIdentities foreign = auth.getForeignIdentities();
+
+ if (foreign != null) {
+ final STORK stork = foreign.getSTORK();
+
+ if (stork != null) {
+ // deep clone all the things
+ // to foreclose lazyloading session timeouts
+ if (stork.getCPEPS() != null) {
+ for (final CPEPS current : stork.getCPEPS()) {
+ cpepslist.add(current);
+ }
+ }
+
+ final List<StorkAttribute> tmp = stork.getAttributes();
+ if (null != tmp) {
+
+ for (final StorkAttribute current : tmp) {
+ attributes.add(current);
+ }
+ }
+
+ try {
+ qaa = stork.getGeneral_eIDAS_LOA();
+
+ } catch (final NullPointerException e) {
+ qaa = MOAIDConstants.eIDAS_LOA_HIGH;
+ }
+ }
+
+ }
+ }
}
-
- public List<CPEPS> getCpepslist() {
- if (null == cpepslist)
- return null;
-
- //MOAIDConfiguration dbconfig = ConfigurationDBRead.getMOAIDConfiguration();
-
- try {
- List<CPEPS> cpepss = dbconfig.getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS();
-
- if (cpepss != null) {
- // make CountryCode "readonly"
- for (CPEPS newone : cpepslist) {
- for (CPEPS current : cpepss) {
- if (null != newone)
- if (current.getHjid().equals(newone.getHjid())) {
- newone.setCountryCode(current.getCountryCode());
- break;
- }
- }
- }
- }
-
- return cpepslist;
-
- } catch (NullPointerException e) {
- return null;
-
- }
-
- }
-
- public void setCpepslist(List<CPEPS> list) {
- cpepslist = list;
- }
-
- public List<StorkAttribute> getAttributes() {
- return attributes;
- }
-
- public void setAttributes(List<StorkAttribute> attributes) {
- this.attributes = attributes;
- }
-
- public String getDefaultQaa() {
- return qaa;
- }
-
- public void setDefaultQaa(String qaa) {
- this.qaa = qaa;
- }
+
+ if (cpepslist.isEmpty()) {
+ final CPEPS defaultCPEPS = new CPEPS();
+ defaultCPEPS.setCountryCode("CC");
+ defaultCPEPS.setURL("http://");
+ defaultCPEPS.setSupportsXMLSignature(true);
+ cpepslist.add(defaultCPEPS);
+
+ }
+ if (attributes.isEmpty()) {
+ attributes.add(new StorkAttribute());
+ }
+ }
+
+ public List<String> getAllowedLoALevels() {
+ return MOAIDConstants.ALLOWED_eIDAS_LOA;
+ }
+
+ public List<CPEPS> getRawCPEPSList() {
+ return cpepslist;
+ }
+
+ public List<CPEPS> getCpepslist() {
+ if (null == cpepslist) {
+ return null;
+ }
+
+ // MOAIDConfiguration dbconfig = ConfigurationDBRead.getMOAIDConfiguration();
+
+ try {
+ final List<CPEPS> cpepss = dbconfig.getAuthComponentGeneral().getForeignIdentities().getSTORK()
+ .getCPEPS();
+
+ if (cpepss != null) {
+ // make CountryCode "readonly"
+ for (final CPEPS newone : cpepslist) {
+ for (final CPEPS current : cpepss) {
+ if (null != newone) {
+ if (current.getHjid().equals(newone.getHjid())) {
+ newone.setCountryCode(current.getCountryCode());
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return cpepslist;
+
+ } catch (final NullPointerException e) {
+ return null;
+
+ }
+
+ }
+
+ public void setCpepslist(List<CPEPS> list) {
+ cpepslist = list;
+ }
+
+ public List<StorkAttribute> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(List<StorkAttribute> attributes) {
+ this.attributes = attributes;
+ }
+
+ public String getDefaultQaa() {
+ return qaa;
+ }
+
+ public void setDefaultQaa(String qaa) {
+ this.qaa = qaa;
+ }
}