aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons/src
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2014-09-15 13:42:36 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2014-09-15 13:42:36 +0200
commit8074865580b5fa28817b37c9ad2e8c992ebef977 (patch)
tree475cd1ed9bc517dffbf023e7d9c7d16ce2bde8c5 /id/server/moa-id-commons/src
parent234f17d14f9f48655c27d54114df0aa2593cf6d8 (diff)
parent714a8cb32dd5585829dfc1926e56971425a2a692 (diff)
downloadmoa-id-spss-8074865580b5fa28817b37c9ad2e8c992ebef977.tar.gz
moa-id-spss-8074865580b5fa28817b37c9ad2e8c992ebef977.tar.bz2
moa-id-spss-8074865580b5fa28817b37c9ad2e8c992ebef977.zip
Merge branch 'moa-2.1-Snapshot'
Conflicts: id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OATargetConfiguration.java pom.xml
Diffstat (limited to 'id/server/moa-id-commons/src')
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java11
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java2
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/statistic/StatisticLog.java2
-rw-r--r--id/server/moa-id-commons/src/main/resources/config/bindings.xjb20
-rw-r--r--id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd29
5 files changed, 58 insertions, 6 deletions
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..46d3ca558 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
@@ -31,6 +31,8 @@ import org.apache.commons.lang.StringEscapeUtils;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceException;
+
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -65,7 +67,7 @@ public class ConfigurationDBRead {
List result;
EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
+
javax.persistence.Query query = session.createQuery(QUERIES.get("getActiveOnlineApplicationWithID"));
//query.setParameter("id", id+"%");
query.setParameter("id", StringEscapeUtils.escapeHtml(id));
@@ -147,8 +149,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);
@@ -221,7 +223,8 @@ public class ConfigurationDBRead {
if (result.size() == 0) {
Logger.trace("No entries found.");
- return null;
+ result = new ArrayList<OnlineApplication>();
+
}
return result;
}
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java
index 6bd987f96..cdb19340d 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java
@@ -154,7 +154,7 @@ public final class ConfigurationDBUtils {
synchronized (session) {
tx.begin();
- session.persist(dbo);
+ session.merge(dbo);
tx.commit();
//session.clear();
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/statistic/StatisticLog.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/statistic/StatisticLog.java
index c83bb20ca..97f26812f 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/statistic/StatisticLog.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/statistic/StatisticLog.java
@@ -40,7 +40,7 @@ import org.hibernate.annotations.DynamicUpdate;
@Entity
@DynamicUpdate(value=true)
-@Table(name = "statisiclog")
+@Table(name = "statisticlog")
@NamedQueries({
@NamedQuery(name="getAllEntriesNotBeforeTimeStamp", query = "select statisiclog from StatisticLog statisiclog where statisiclog.timestamp > :timeout")
})
diff --git a/id/server/moa-id-commons/src/main/resources/config/bindings.xjb b/id/server/moa-id-commons/src/main/resources/config/bindings.xjb
index cf04319c8..21714849b 100644
--- a/id/server/moa-id-commons/src/main/resources/config/bindings.xjb
+++ b/id/server/moa-id-commons/src/main/resources/config/bindings.xjb
@@ -2,6 +2,8 @@
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
+ xmlns:hj="http://hyperjaxb3.jvnet.org/ejb/schemas/customizations"
+ xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
jaxb:extensionBindingPrefixes="hj">
<jaxb:bindings schemaLocation="moaid_config_2.0.xsd" node="/xsd:schema">
@@ -12,4 +14,22 @@
adapter="com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter"/>
</jaxb:globalBindings>
</jaxb:bindings>
+
+ <jaxb:bindings schemaLocation="moaid_config_2.0.xsd" node="/xsd:schema/xsd:element[@name='C-PEPS']//xsd:element[@ref='OA_STORK']">
+ <hj:many-to-many name="OA_STORK">
+ <orm:join-table name="OA_CPEPS">
+ <orm:join-column name="aid" referenced-column-name="hjid" />
+ <orm:inverse-join-column name="bid" referenced-column-name="hjid" />
+ </orm:join-table>
+ </hj:many-to-many>
+ </jaxb:bindings>
+
+ <jaxb:bindings schemaLocation="moaid_config_2.0.xsd" node="/xsd:schema/xsd:element[@name='OA_STORK']//xsd:element[@ref='C-PEPS']">
+ <hj:many-to-many name="CPEPS" mappedBy="OA_STORK">
+ <hj:cascade>
+ <hj:cascade-persist/>
+ </hj:cascade>
+ </hj:many-to-many>
+ </jaxb:bindings>
+
</jaxb:bindings> \ No newline at end of file
diff --git a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd
index 8bc532236..f2f1949cc 100644
--- a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd
+++ b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd
@@ -551,6 +551,7 @@
<xsd:element ref="OA_SAML1" minOccurs="0"/>
<xsd:element ref="OA_PVP2" minOccurs="0"/>
<xsd:element ref="OA_OAUTH20" minOccurs="0"/>
+ <xsd:element ref="EncBPKInformation" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<!--xsd:element ref="pr:AbstractSimpleIdentification" minOccurs="0"
maxOccurs="1"/ -->
@@ -558,6 +559,31 @@
</xsd:element>
</xsd:sequence>
</xsd:complexType>
+ <xsd:element name="EncBPKInformation">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="bPKDecryption" minOccurs="0" maxOccurs="1">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="keyInformation" type="xsd:base64Binary" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="iv" type="xsd:base64Binary" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="keyStoreFileName" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="keyAlias" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="bPKEncryption" minOccurs="0" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="publicKey" type="xsd:base64Binary" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="target" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="vkz" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
<xsd:complexType name="ConnectionParameterServerAuthType">
<xsd:sequence>
<xsd:element name="AcceptedServerCertificates" type="xsd:anyURI" minOccurs="0">
@@ -803,6 +829,7 @@
<xsd:annotation>
<xsd:documentation>Name zum Key eines KeyStores, der den privaten
Schlüssel zum Erstellen einer Signatur darstellt
+
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
@@ -822,9 +849,11 @@
<xsd:complexType>
<xsd:sequence>
<xsd:element name="AttributeValue" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element ref="OA_STORK" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="countryCode" type="CountryCodeType" use="required"/>
<xsd:attribute name="URL" type="xsd:anyURI" use="required"/>
+ <xsd:attribute name="supportsXMLSignature" type="xsd:boolean" default="true"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="STORK">