aboutsummaryrefslogtreecommitdiff
path: root/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration
diff options
context:
space:
mode:
authorFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-01-16 08:55:06 +0100
committerFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-01-27 16:37:40 +0100
commit6c7a6f8e222e4fb39a11c220b63e785f2037d428 (patch)
tree2628e16ffc7296a2d6a8a3e9c2200dbc9f1536bd /id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration
parent8276884b9c45315df5fa951ce53b3d35f4983b22 (diff)
downloadmoa-id-spss-6c7a6f8e222e4fb39a11c220b63e785f2037d428.tar.gz
moa-id-spss-6c7a6f8e222e4fb39a11c220b63e785f2037d428.tar.bz2
moa-id-spss-6c7a6f8e222e4fb39a11c220b63e785f2037d428.zip
fix added real source of stork modules
Diffstat (limited to 'id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration')
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/all-wcprops41
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/entries232
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationCreator.java.svn-base127
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationEngine.java.svn-base69
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationReader.java.svn-base224
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationSingleton.java.svn-base74
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/InstanceEngine.java.svn-base70
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/package-info.java.svn-base19
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java127
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationEngine.java69
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java225
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationSingleton.java74
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/InstanceEngine.java70
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/package-info.java19
14 files changed, 1440 insertions, 0 deletions
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/all-wcprops b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/all-wcprops
new file mode 100644
index 000000000..96b3f2328
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/all-wcprops
@@ -0,0 +1,41 @@
+K 25
+svn:wc:ra_dav:version-url
+V 89
+/CITnet/svn/STORK2/!svn/ver/22/trunk/SamlEngine/src/main/java/eu/stork/peps/configuration
+END
+package-info.java
+K 25
+svn:wc:ra_dav:version-url
+V 107
+/CITnet/svn/STORK2/!svn/ver/22/trunk/SamlEngine/src/main/java/eu/stork/peps/configuration/package-info.java
+END
+ConfigurationCreator.java
+K 25
+svn:wc:ra_dav:version-url
+V 115
+/CITnet/svn/STORK2/!svn/ver/22/trunk/SamlEngine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java
+END
+ConfigurationReader.java
+K 25
+svn:wc:ra_dav:version-url
+V 114
+/CITnet/svn/STORK2/!svn/ver/22/trunk/SamlEngine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java
+END
+ConfigurationSingleton.java
+K 25
+svn:wc:ra_dav:version-url
+V 117
+/CITnet/svn/STORK2/!svn/ver/22/trunk/SamlEngine/src/main/java/eu/stork/peps/configuration/ConfigurationSingleton.java
+END
+InstanceEngine.java
+K 25
+svn:wc:ra_dav:version-url
+V 109
+/CITnet/svn/STORK2/!svn/ver/22/trunk/SamlEngine/src/main/java/eu/stork/peps/configuration/InstanceEngine.java
+END
+ConfigurationEngine.java
+K 25
+svn:wc:ra_dav:version-url
+V 114
+/CITnet/svn/STORK2/!svn/ver/22/trunk/SamlEngine/src/main/java/eu/stork/peps/configuration/ConfigurationEngine.java
+END
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/entries b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/entries
new file mode 100644
index 000000000..b811dc64b
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/entries
@@ -0,0 +1,232 @@
+10
+
+dir
+357
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/SamlEngine/src/main/java/eu/stork/peps/configuration
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2013-07-25T08:47:40.940990Z
+6
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+ConfigurationReader.java
+file
+
+
+
+
+2013-12-20T12:27:57.462475Z
+31bb8b4c7e74e039c561bf974dea7c33
+2013-07-25T08:47:40.940990Z
+6
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6979
+
+ConfigurationSingleton.java
+file
+
+
+
+
+2013-12-20T12:27:57.466475Z
+4350e34e9ec48ce7ad03db6a130559f2
+2013-07-25T08:47:40.940990Z
+6
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2367
+
+InstanceEngine.java
+file
+
+
+
+
+2013-12-20T12:27:57.466475Z
+36fb20db43ded05922bf0bbf785e5d48
+2013-07-25T08:47:40.940990Z
+6
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1820
+
+ConfigurationEngine.java
+file
+
+
+
+
+2013-12-20T12:27:57.466475Z
+99eae7ae70fa5bf4667edfb7912696c2
+2013-07-25T08:47:40.940990Z
+6
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1726
+
+package-info.java
+file
+
+
+
+
+2013-12-20T12:27:57.462475Z
+36f3c0e11d20c8f980d3115b21a23df0
+2013-07-25T08:47:40.940990Z
+6
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+806
+
+ConfigurationCreator.java
+file
+
+
+
+
+2013-12-20T12:27:57.462475Z
+4c130e8c9749dd63e58d57d4d699b7ee
+2013-07-25T08:47:40.940990Z
+6
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4114
+
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationCreator.java.svn-base b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationCreator.java.svn-base
new file mode 100644
index 000000000..2fabff7d6
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationCreator.java.svn-base
@@ -0,0 +1,127 @@
+/*
+ * Licensed under the EUPL, Version 1.1 or – as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence. You may
+ * obtain a copy of the Licence at:
+ *
+ * http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * Licence for the specific language governing permissions and limitations under
+ * the Licence.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.InvalidPropertiesFormatException;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+
+/**
+ * The Class InstanceCreator.
+ *
+ * @author fjquevedo
+ */
+public final class ConfigurationCreator {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ConfigurationCreator.class.getName());
+
+ /**
+ * Creates the configuration.
+ *
+ * @param instanceConfs the instance configuration
+ *
+ * @return the map< string, map< string, object>>
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static Map<String, Map<String, Object>> createConfiguration(
+ final Map<String, InstanceEngine> instanceConfs) throws STORKSAMLEngineException {
+
+ final HashMap<String, Map<String, Object>> instances =
+ new HashMap<String, Map<String, Object>>();
+
+ LOGGER.info("Create configuration.");
+ try {
+ // Only create instances for SAMLEngine configuration.
+ // INSTANCE
+ for (Map.Entry<String, InstanceEngine> entry : instanceConfs
+ .entrySet()) {
+ final InstanceEngine iEngine = entry.getValue();
+
+ final Map<String, Object> intance = new HashMap<String, Object>();
+
+ // CONFIGURATION
+ for (ConfigurationEngine configuration : iEngine
+ .getConfiguration()) {
+ // Properties only for configuration SamlEngine.
+ if (configuration.getName().equalsIgnoreCase(
+ "SamlEngineConf")) {
+ intance.put(configuration.getName(),
+ getNewInstance(configuration.getParameters()
+ .get("fileConfiguration")));
+ } else {
+ intance.put(configuration.getName(), configuration
+ .getParameters());
+ }
+ }
+ instances.put(entry.getKey(), intance);
+ }
+ } catch (STORKSAMLEngineException ex) {
+ LOGGER.error("Can not create instance from file configuration.");
+ throw new STORKSAMLEngineException(ex);
+ }
+ return instances;
+ }
+
+
+ /**
+ * Gets the new instance.
+ *
+ * @param fileName the file name
+ *
+ * @return the properties from the new instance
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine
+ * runtime exception
+ */
+ private static Properties getNewInstance(final String fileName)
+ throws STORKSAMLEngineException {
+ LOGGER.info("Create file configuration properties to Stork Saml Engine.");
+ InputStream fileEngineProp = null;
+ try {
+ fileEngineProp = ConfigurationCreator.class
+ .getResourceAsStream("/" + fileName);
+ final Properties configuration = new Properties();
+ configuration.loadFromXML(fileEngineProp);
+ return configuration;
+ } catch (InvalidPropertiesFormatException e) {
+ LOGGER.error("Invalid properties format.");
+ throw new STORKSAMLEngineException(e);
+ } catch (IOException e) {
+ LOGGER.error("Error read file: " + fileName);
+ throw new STORKSAMLEngineException(e);
+ } finally {
+ IOUtils.closeQuietly(fileEngineProp);
+ }
+ }
+
+ /**
+ * Instantiates a new instance creator.
+ */
+ private ConfigurationCreator() {
+ }
+} \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationEngine.java.svn-base b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationEngine.java.svn-base
new file mode 100644
index 000000000..910f4398e
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationEngine.java.svn-base
@@ -0,0 +1,69 @@
+/*
+ * Licensed under the EUPL, Version 1.1 or – as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence. You may
+ * obtain a copy of the Licence at:
+ *
+ * http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * Licence for the specific language governing permissions and limitations under
+ * the Licence.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.util.Map;
+
+/**
+ * The Class ConfigurationEngine.
+ *
+ * @author fjquevedo
+ */
+public class ConfigurationEngine {
+
+ /** The name of the configuration file. */
+ private String name;
+
+ /** The parameters. */
+ private Map<String, String> parameters;
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public final String getName() {
+ return name;
+ }
+
+ /**
+ * Gets the parameters.
+ *
+ * @return the parameters
+ */
+ public final Map<String, String> getParameters() {
+ return parameters;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param newName the new name
+ */
+ public final void setName(final String newName) {
+ this.name = newName;
+ }
+
+ /**
+ * Sets the parameters.
+ *
+ * @param newParameters the parameters
+ */
+ public final void setParameters(final Map<String, String> newParameters) {
+ this.parameters = newParameters;
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationReader.java.svn-base b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationReader.java.svn-base
new file mode 100644
index 000000000..374cf3fc3
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationReader.java.svn-base
@@ -0,0 +1,224 @@
+/*
+ * Licensed under the EUPL, Version 1.1 or – as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence. You may
+ * obtain a copy of the Licence at:
+ *
+ * http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * Licence for the specific language governing permissions and limitations under
+ * the Licence.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import eu.stork.peps.exceptions.SAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * The Class ConfigurationReader.
+ *
+ * @author fjquevedo
+ */
+public final class ConfigurationReader {
+
+ /** The Constant SAML_ENGINE_CONFIGURATION_FILE. */
+ private static final String ENGINE_CONF_FILE = "SamlEngine.xml";
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ConfigurationReader.class.getName());
+
+ /** The Constant NODE_CONFIGURATION. */
+ private static final String NODE_CONF = "configuration";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_CONF_NAME = "name";
+
+ /** The Constant NODE_INSTANCE_NAME. */
+ private static final String NODE_INST_NAME = "name";
+
+ /** The Constant NODE_INSTANCE. */
+ private static final String NODE_INSTANCE = "instance";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_PARAM_NAME = "name";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_PARAM_VALUE = "value";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_PARAMETER = "parameter";
+
+ /**
+ * Generate parameters.
+ *
+ * @param configurationNode the configuration node
+ *
+ * @return the map< string, string>
+ */
+ private static Map<String, String> generateParam(
+ final Element configurationNode) {
+
+ final HashMap<String, String> parameters = new HashMap<String, String>();
+
+ final NodeList parameterNodes = configurationNode
+ .getElementsByTagName(NODE_PARAMETER);
+
+ String parameterName;
+ String parameterValue;
+
+ for (int k = 0; k < parameterNodes.getLength(); ++k) {
+ // for every parameter find, process.
+ final Element parameterNode = (Element) parameterNodes.item(k);
+ parameterName = parameterNode.getAttribute(NODE_PARAM_NAME);
+ parameterValue = parameterNode.getAttribute(NODE_PARAM_VALUE);
+
+ // verified the content.
+ if (StringUtils.isBlank(parameterName)
+ || StringUtils.isBlank(parameterValue)) {
+ throw new STORKSAMLEngineRuntimeException(
+ "Error reader parameters (name - value).");
+ } else {
+ parameters.put(parameterName.trim(), parameterValue.trim());
+ }
+ }
+ return parameters;
+ }
+
+ /**
+ * Read configuration.
+ *
+ * @return the map< string, instance engine>
+ *
+ * @throws SAMLEngineException the STORKSAML engine runtime
+ * exception
+ */
+ public static Map<String, InstanceEngine> readConfiguration()
+ throws SAMLEngineException {
+
+ LOGGER.info("Init reader: " + ENGINE_CONF_FILE);
+ final Map<String, InstanceEngine> instanceConfs =
+ new HashMap<String, InstanceEngine>();
+
+ Document document = null;
+ // Load configuration file
+ final DocumentBuilderFactory factory = DocumentBuilderFactory
+ .newInstance();
+ DocumentBuilder builder;
+
+ InputStream engineConf = null;
+ try {
+
+ factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+
+ builder = factory.newDocumentBuilder();
+
+ engineConf = ConfigurationReader.class
+ .getResourceAsStream("/" + ENGINE_CONF_FILE);
+
+ document = builder.parse(engineConf);
+
+ // Read instance
+ final NodeList list = document.getElementsByTagName(NODE_INSTANCE);
+
+ for (int indexElem = 0; indexElem < list.getLength(); ++indexElem) {
+ final Element element = (Element) list.item(indexElem);
+
+ final InstanceEngine instanceConf = new InstanceEngine();
+
+ // read every configuration.
+ final String instanceName = element
+ .getAttribute(NODE_INST_NAME);
+
+ if (StringUtils.isBlank(instanceName)) {
+ throw new STORKSAMLEngineRuntimeException(
+ "Error reader instance name.");
+ }
+ instanceConf.setName(instanceName.trim());
+
+ final NodeList confNodes = element
+ .getElementsByTagName(NODE_CONF);
+
+ for (int indexNode = 0; indexNode < confNodes.getLength(); ++indexNode) {
+
+ final Element configurationNode = (Element) confNodes
+ .item(indexNode);
+
+ final String configurationName = configurationNode
+ .getAttribute(NODE_CONF_NAME);
+
+ if (StringUtils.isBlank(configurationName)) {
+ throw new STORKSAMLEngineRuntimeException(
+ "Error reader configuration name.");
+ }
+
+ final ConfigurationEngine confSamlEngine =
+ new ConfigurationEngine();
+
+ // Set configuration name.
+ confSamlEngine.setName(configurationName.trim());
+
+ // Read every parameter for this configuration.
+ final Map<String, String> parameters =
+ generateParam(configurationNode);
+
+ // Set parameters
+ confSamlEngine.setParameters(parameters);
+
+ // Add parameters to the configuration.
+ instanceConf.getConfiguration().add(confSamlEngine);
+ }
+
+ // Add to the list of configurations.
+ instanceConfs.put(element.getAttribute(NODE_INST_NAME),
+ instanceConf);
+ }
+
+ } catch (SAXException e) {
+ LOGGER.error("Error: init library parser.");
+ throw new SAMLEngineException(e);
+ } catch (ParserConfigurationException e) {
+ LOGGER.error("Error: parser configuration file xml.");
+ throw new SAMLEngineException(e);
+ } catch (IOException e) {
+ LOGGER.error("Error: read configuration file.");
+ throw new SAMLEngineException(e);
+ } finally {
+ IOUtils.closeQuietly(engineConf);
+ }
+
+ return instanceConfs;
+ }
+
+ /**
+ * Instantiates a new configuration reader.
+ */
+ private ConfigurationReader() {
+
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationSingleton.java.svn-base b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationSingleton.java.svn-base
new file mode 100644
index 000000000..53cea621d
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/ConfigurationSingleton.java.svn-base
@@ -0,0 +1,74 @@
+/*
+ * Licensed under the EUPL, Version 1.1 or – as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence. You may
+ * obtain a copy of the Licence at:
+ *
+ * http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * Licence for the specific language governing permissions and limitations under
+ * the Licence.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.exceptions.SAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * The Class InstanceCreator.
+ *
+ * @author fjquevedo
+ */
+public final class ConfigurationSingleton {
+
+ /** The instance of every engine SAML. */
+ private static Map<String, InstanceEngine> instanceConfigs;
+
+ /** The instances of SAML engine. */
+ private static Map<String, Map<String, Object>> instances;
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ConfigurationSingleton.class.getName());
+
+ static {
+ LOGGER.debug("Read all file configurations. (instances of SAMLEngine)");
+ try {
+ instanceConfigs = ConfigurationReader.readConfiguration();
+ } catch (SAMLEngineException e) {
+ LOGGER.error("Error read configuration file.");
+ throw new STORKSAMLEngineRuntimeException(e);
+ }
+ }
+
+ /**
+ * Gets the new instance.
+ *
+ * @param fileName the file name
+ *
+ * @return the properties from the new instance
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine runtime exception
+ */
+ private static Map<String, Map<String, Object>> getInstance(
+ final String fileName) throws STORKSAMLEngineException {
+ return ConfigurationCreator.createConfiguration(instanceConfigs);
+ }
+
+ /**
+ * Instantiates a new instance creator.
+ */
+ private ConfigurationSingleton() {
+ }
+
+} \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/InstanceEngine.java.svn-base b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/InstanceEngine.java.svn-base
new file mode 100644
index 000000000..e0e2d1965
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/InstanceEngine.java.svn-base
@@ -0,0 +1,70 @@
+/*
+ * Licensed under the EUPL, Version 1.1 or – as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence. You may
+ * obtain a copy of the Licence at:
+ *
+ * http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * Licence for the specific language governing permissions and limitations under
+ * the Licence.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * The Class InstanceConfiguration.
+ *
+ * @author fjquevedo
+ */
+public class InstanceEngine {
+
+ /** The configuration. */
+ private List<ConfigurationEngine> configuration = new ArrayList<ConfigurationEngine>();
+
+ /** The name. */
+ private String name;
+
+ /**
+ * Gets the parameters.
+ *
+ * @return the parameters
+ */
+ public final List<ConfigurationEngine> getConfiguration() {
+ return this.configuration;
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public final String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the parameters.
+ *
+ * @param newConfiguration the new parameters
+ */
+ public final void setConfiguration(final List<ConfigurationEngine> newConfiguration) {
+ this.configuration = newConfiguration;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param newName the new name
+ */
+ public final void setName(final String newName) {
+ this.name = newName;
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/package-info.java.svn-base b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/package-info.java.svn-base
new file mode 100644
index 000000000..6d0b54297
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/.svn/text-base/package-info.java.svn-base
@@ -0,0 +1,19 @@
+/*
+ * Licensed under the EUPL, Version 1.1 or – as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence. You may
+ * obtain a copy of the Licence at:
+ *
+ * http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * Licence for the specific language governing permissions and limitations under
+ * the Licence.
+ */
+
+/**
+ * Provides the classes necessary to create a SAML message instance.
+ */
+package eu.stork.peps.configuration;
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java
new file mode 100644
index 000000000..2fabff7d6
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java
@@ -0,0 +1,127 @@
+/*
+ * Licensed under the EUPL, Version 1.1 or – as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence. You may
+ * obtain a copy of the Licence at:
+ *
+ * http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * Licence for the specific language governing permissions and limitations under
+ * the Licence.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.InvalidPropertiesFormatException;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+
+/**
+ * The Class InstanceCreator.
+ *
+ * @author fjquevedo
+ */
+public final class ConfigurationCreator {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ConfigurationCreator.class.getName());
+
+ /**
+ * Creates the configuration.
+ *
+ * @param instanceConfs the instance configuration
+ *
+ * @return the map< string, map< string, object>>
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static Map<String, Map<String, Object>> createConfiguration(
+ final Map<String, InstanceEngine> instanceConfs) throws STORKSAMLEngineException {
+
+ final HashMap<String, Map<String, Object>> instances =
+ new HashMap<String, Map<String, Object>>();
+
+ LOGGER.info("Create configuration.");
+ try {
+ // Only create instances for SAMLEngine configuration.
+ // INSTANCE
+ for (Map.Entry<String, InstanceEngine> entry : instanceConfs
+ .entrySet()) {
+ final InstanceEngine iEngine = entry.getValue();
+
+ final Map<String, Object> intance = new HashMap<String, Object>();
+
+ // CONFIGURATION
+ for (ConfigurationEngine configuration : iEngine
+ .getConfiguration()) {
+ // Properties only for configuration SamlEngine.
+ if (configuration.getName().equalsIgnoreCase(
+ "SamlEngineConf")) {
+ intance.put(configuration.getName(),
+ getNewInstance(configuration.getParameters()
+ .get("fileConfiguration")));
+ } else {
+ intance.put(configuration.getName(), configuration
+ .getParameters());
+ }
+ }
+ instances.put(entry.getKey(), intance);
+ }
+ } catch (STORKSAMLEngineException ex) {
+ LOGGER.error("Can not create instance from file configuration.");
+ throw new STORKSAMLEngineException(ex);
+ }
+ return instances;
+ }
+
+
+ /**
+ * Gets the new instance.
+ *
+ * @param fileName the file name
+ *
+ * @return the properties from the new instance
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine
+ * runtime exception
+ */
+ private static Properties getNewInstance(final String fileName)
+ throws STORKSAMLEngineException {
+ LOGGER.info("Create file configuration properties to Stork Saml Engine.");
+ InputStream fileEngineProp = null;
+ try {
+ fileEngineProp = ConfigurationCreator.class
+ .getResourceAsStream("/" + fileName);
+ final Properties configuration = new Properties();
+ configuration.loadFromXML(fileEngineProp);
+ return configuration;
+ } catch (InvalidPropertiesFormatException e) {
+ LOGGER.error("Invalid properties format.");
+ throw new STORKSAMLEngineException(e);
+ } catch (IOException e) {
+ LOGGER.error("Error read file: " + fileName);
+ throw new STORKSAMLEngineException(e);
+ } finally {
+ IOUtils.closeQuietly(fileEngineProp);
+ }
+ }
+
+ /**
+ * Instantiates a new instance creator.
+ */
+ private ConfigurationCreator() {
+ }
+} \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationEngine.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationEngine.java
new file mode 100644
index 000000000..910f4398e
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationEngine.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed under the EUPL, Version 1.1 or – as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence. You may
+ * obtain a copy of the Licence at:
+ *
+ * http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * Licence for the specific language governing permissions and limitations under
+ * the Licence.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.util.Map;
+
+/**
+ * The Class ConfigurationEngine.
+ *
+ * @author fjquevedo
+ */
+public class ConfigurationEngine {
+
+ /** The name of the configuration file. */
+ private String name;
+
+ /** The parameters. */
+ private Map<String, String> parameters;
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public final String getName() {
+ return name;
+ }
+
+ /**
+ * Gets the parameters.
+ *
+ * @return the parameters
+ */
+ public final Map<String, String> getParameters() {
+ return parameters;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param newName the new name
+ */
+ public final void setName(final String newName) {
+ this.name = newName;
+ }
+
+ /**
+ * Sets the parameters.
+ *
+ * @param newParameters the parameters
+ */
+ public final void setParameters(final Map<String, String> newParameters) {
+ this.parameters = newParameters;
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java
new file mode 100644
index 000000000..9ae8bb669
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java
@@ -0,0 +1,225 @@
+/*
+ * Licensed under the EUPL, Version 1.1 or – as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence. You may
+ * obtain a copy of the Licence at:
+ *
+ * http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * Licence for the specific language governing permissions and limitations under
+ * the Licence.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import eu.stork.peps.exceptions.SAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * The Class ConfigurationReader.
+ *
+ * @author fjquevedo
+ */
+public final class ConfigurationReader {
+
+ /** The Constant SAML_ENGINE_CONFIGURATION_FILE. */
+ private static final String ENGINE_CONF_FILE = "SamlEngine.xml";
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ConfigurationReader.class.getName());
+
+ /** The Constant NODE_CONFIGURATION. */
+ private static final String NODE_CONF = "configuration";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_CONF_NAME = "name";
+
+ /** The Constant NODE_INSTANCE_NAME. */
+ private static final String NODE_INST_NAME = "name";
+
+ /** The Constant NODE_INSTANCE. */
+ private static final String NODE_INSTANCE = "instance";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_PARAM_NAME = "name";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_PARAM_VALUE = "value";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_PARAMETER = "parameter";
+
+ /**
+ * Generate parameters.
+ *
+ * @param configurationNode the configuration node
+ *
+ * @return the map< string, string>
+ */
+ private static Map<String, String> generateParam(
+ final Element configurationNode) {
+
+ final HashMap<String, String> parameters = new HashMap<String, String>();
+
+ final NodeList parameterNodes = configurationNode
+ .getElementsByTagName(NODE_PARAMETER);
+
+ String parameterName;
+ String parameterValue;
+
+ for (int k = 0; k < parameterNodes.getLength(); ++k) {
+ // for every parameter find, process.
+ final Element parameterNode = (Element) parameterNodes.item(k);
+ parameterName = parameterNode.getAttribute(NODE_PARAM_NAME);
+ parameterValue = parameterNode.getAttribute(NODE_PARAM_VALUE);
+
+ // verified the content.
+ if (StringUtils.isBlank(parameterName)
+ || StringUtils.isBlank(parameterValue)) {
+ throw new STORKSAMLEngineRuntimeException(
+ "Error reader parameters (name - value).");
+ } else {
+ parameters.put(parameterName.trim(), parameterValue.trim());
+ }
+ }
+ return parameters;
+ }
+
+ /**
+ * Read configuration.
+ *
+ * @return the map< string, instance engine>
+ *
+ * @throws SAMLEngineException the STORKSAML engine runtime
+ * exception
+ */
+ public static Map<String, InstanceEngine> readConfiguration()
+ throws SAMLEngineException {
+
+ LOGGER.info("Init reader: " + ENGINE_CONF_FILE);
+ final Map<String, InstanceEngine> instanceConfs =
+ new HashMap<String, InstanceEngine>();
+
+ Document document = null;
+ // Load configuration file
+ final DocumentBuilderFactory factory = DocumentBuilderFactory
+ .newInstance();
+ DocumentBuilder builder;
+
+ InputStream engineConf = null;
+ try {
+
+ factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+
+ builder = factory.newDocumentBuilder();
+
+ engineConf = ConfigurationReader.class
+ .getResourceAsStream("/" + ENGINE_CONF_FILE);
+
+
+ document = builder.parse(engineConf);
+
+ // Read instance
+ final NodeList list = document.getElementsByTagName(NODE_INSTANCE);
+
+ for (int indexElem = 0; indexElem < list.getLength(); ++indexElem) {
+ final Element element = (Element) list.item(indexElem);
+
+ final InstanceEngine instanceConf = new InstanceEngine();
+
+ // read every configuration.
+ final String instanceName = element
+ .getAttribute(NODE_INST_NAME);
+
+ if (StringUtils.isBlank(instanceName)) {
+ throw new STORKSAMLEngineRuntimeException(
+ "Error reader instance name.");
+ }
+ instanceConf.setName(instanceName.trim());
+
+ final NodeList confNodes = element
+ .getElementsByTagName(NODE_CONF);
+
+ for (int indexNode = 0; indexNode < confNodes.getLength(); ++indexNode) {
+
+ final Element configurationNode = (Element) confNodes
+ .item(indexNode);
+
+ final String configurationName = configurationNode
+ .getAttribute(NODE_CONF_NAME);
+
+ if (StringUtils.isBlank(configurationName)) {
+ throw new STORKSAMLEngineRuntimeException(
+ "Error reader configuration name.");
+ }
+
+ final ConfigurationEngine confSamlEngine =
+ new ConfigurationEngine();
+
+ // Set configuration name.
+ confSamlEngine.setName(configurationName.trim());
+
+ // Read every parameter for this configuration.
+ final Map<String, String> parameters =
+ generateParam(configurationNode);
+
+ // Set parameters
+ confSamlEngine.setParameters(parameters);
+
+ // Add parameters to the configuration.
+ instanceConf.getConfiguration().add(confSamlEngine);
+ }
+
+ // Add to the list of configurations.
+ instanceConfs.put(element.getAttribute(NODE_INST_NAME),
+ instanceConf);
+ }
+
+ } catch (SAXException e) {
+ LOGGER.error("Error: init library parser.");
+ throw new SAMLEngineException(e);
+ } catch (ParserConfigurationException e) {
+ LOGGER.error("Error: parser configuration file xml.");
+ throw new SAMLEngineException(e);
+ } catch (IOException e) {
+ LOGGER.error("Error: read configuration file.");
+ throw new SAMLEngineException(e);
+ } finally {
+ IOUtils.closeQuietly(engineConf);
+ }
+
+ return instanceConfs;
+ }
+
+ /**
+ * Instantiates a new configuration reader.
+ */
+ private ConfigurationReader() {
+
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationSingleton.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationSingleton.java
new file mode 100644
index 000000000..53cea621d
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationSingleton.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed under the EUPL, Version 1.1 or – as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence. You may
+ * obtain a copy of the Licence at:
+ *
+ * http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * Licence for the specific language governing permissions and limitations under
+ * the Licence.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.exceptions.SAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * The Class InstanceCreator.
+ *
+ * @author fjquevedo
+ */
+public final class ConfigurationSingleton {
+
+ /** The instance of every engine SAML. */
+ private static Map<String, InstanceEngine> instanceConfigs;
+
+ /** The instances of SAML engine. */
+ private static Map<String, Map<String, Object>> instances;
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ConfigurationSingleton.class.getName());
+
+ static {
+ LOGGER.debug("Read all file configurations. (instances of SAMLEngine)");
+ try {
+ instanceConfigs = ConfigurationReader.readConfiguration();
+ } catch (SAMLEngineException e) {
+ LOGGER.error("Error read configuration file.");
+ throw new STORKSAMLEngineRuntimeException(e);
+ }
+ }
+
+ /**
+ * Gets the new instance.
+ *
+ * @param fileName the file name
+ *
+ * @return the properties from the new instance
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine runtime exception
+ */
+ private static Map<String, Map<String, Object>> getInstance(
+ final String fileName) throws STORKSAMLEngineException {
+ return ConfigurationCreator.createConfiguration(instanceConfigs);
+ }
+
+ /**
+ * Instantiates a new instance creator.
+ */
+ private ConfigurationSingleton() {
+ }
+
+} \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/InstanceEngine.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/InstanceEngine.java
new file mode 100644
index 000000000..e0e2d1965
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/InstanceEngine.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed under the EUPL, Version 1.1 or – as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence. You may
+ * obtain a copy of the Licence at:
+ *
+ * http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * Licence for the specific language governing permissions and limitations under
+ * the Licence.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * The Class InstanceConfiguration.
+ *
+ * @author fjquevedo
+ */
+public class InstanceEngine {
+
+ /** The configuration. */
+ private List<ConfigurationEngine> configuration = new ArrayList<ConfigurationEngine>();
+
+ /** The name. */
+ private String name;
+
+ /**
+ * Gets the parameters.
+ *
+ * @return the parameters
+ */
+ public final List<ConfigurationEngine> getConfiguration() {
+ return this.configuration;
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public final String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the parameters.
+ *
+ * @param newConfiguration the new parameters
+ */
+ public final void setConfiguration(final List<ConfigurationEngine> newConfiguration) {
+ this.configuration = newConfiguration;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param newName the new name
+ */
+ public final void setName(final String newName) {
+ this.name = newName;
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/package-info.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/package-info.java
new file mode 100644
index 000000000..6d0b54297
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Licensed under the EUPL, Version 1.1 or – as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence. You may
+ * obtain a copy of the Licence at:
+ *
+ * http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * Licence for the specific language governing permissions and limitations under
+ * the Licence.
+ */
+
+/**
+ * Provides the classes necessary to create a SAML message instance.
+ */
+package eu.stork.peps.configuration;