aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2014-04-09 11:05:01 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2014-04-09 11:05:01 +0200
commit47615b97181da1c25881bdd4e9b61256476ce5b4 (patch)
tree4897eff7d30dbefdf93bb7eb0530e7cce553b718
parentad657b9d6cba12f9651d6c34b863acb1c3b05137 (diff)
downloadmoa-id-spss-47615b97181da1c25881bdd4e9b61256476ce5b4.tar.gz
moa-id-spss-47615b97181da1c25881bdd4e9b61256476ce5b4.tar.bz2
moa-id-spss-47615b97181da1c25881bdd4e9b61256476ce5b4.zip
update user initialized PVP2 metadata reload process
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java14
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/metadata/MOAMetadataProvider.java12
-rw-r--r--id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd18
3 files changed, 30 insertions, 14 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java
index cc2cf3bf0..452c5580d 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java
@@ -943,10 +943,12 @@ public class EditOAAction extends BasicAction {
authoa.setOAPVP2(pvp2);
}
- pvp2.setMetadataURL(pvp2OA.getMetaDataURL());
try {
- if (pvp2OA.getFileUpload() != null) pvp2.setCertificate(pvp2OA.getCertificate());
+ if (pvp2OA.getFileUpload() != null) {
+ pvp2.setCertificate(pvp2OA.getCertificate());
+ pvp2OA.setReLoad(true);
+ }
} catch (CertificateException e) {
log.info("Uploaded Certificate can not be found", e);
@@ -956,6 +958,14 @@ public class EditOAAction extends BasicAction {
return LanguageHelper.getErrorString("validation.pvp2.certificate.format", request);
}
+ if (pvp2OA.getMetaDataURL() != null &&
+ !pvp2OA.getMetaDataURL().equals(pvp2.getMetadataURL()))
+ pvp2OA.setReLoad(true);
+ pvp2.setMetadataURL(pvp2OA.getMetaDataURL());
+
+ if (pvp2OA.isReLoad())
+ pvp2.setUpdateRequiredItem(new Date());
+
OASAML1 saml1 = authoa.getOASAML1();
if (saml1 == null) {
saml1 = new OASAML1();
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/metadata/MOAMetadataProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/metadata/MOAMetadataProvider.java
index 6d9022bd9..f2e3e7cb1 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/metadata/MOAMetadataProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/metadata/MOAMetadataProvider.java
@@ -124,6 +124,7 @@ public class MOAMetadataProvider implements MetadataProvider {
.getAllActiveOnlineApplications();
//set Timestamp
+ Date oldTimeStamp = timestamp;
timestamp = new Date();
Iterator<OnlineApplication> oaIt = oaList.iterator();
@@ -138,7 +139,16 @@ public class MOAMetadataProvider implements MetadataProvider {
String metadataurl = pvp2Config.getMetadataURL();
if (loadedproviders.containsKey(metadataurl)) {
- //PVP2 OA is actually loaded, to nothing
+
+ if (pvp2Config.getUpdateRequiredItem() != null &&
+ pvp2Config.getUpdateRequiredItem().after(oldTimeStamp)) {
+ //PVP2 OA is actually loaded, but update is requested
+ Logger.info("Reload metadata for: " + oa.getFriendlyName());
+ loadedproviders.get(metadataurl).refresh();
+
+ }
+
+ // PVP2 OA is actually loaded, to nothing
providersinuse.put(metadataurl, loadedproviders.get(metadataurl));
loadedproviders.remove(metadataurl);
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 d7f48e51a..e8562a57b 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
@@ -842,6 +842,7 @@
<xsd:sequence>
<xsd:element name="metadataURL" type="xsd:anyURI" minOccurs="1" maxOccurs="1"/>
<xsd:element name="certificate" type="xsd:base64Binary" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="updateRequired" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
@@ -884,17 +885,12 @@
<xsd:element name="OA_STORK">
<xsd:complexType>
<xsd:sequence>
- <xsd:element name="StorkLogonEnabled" type="xsd:boolean"
- default="true" />
- <xsd:element ref="Qaa" minOccurs="0" maxOccurs="1" />
- <xsd:element ref="OAAttributes" minOccurs="0"
- maxOccurs="unbounded" />
- <xsd:element name="VidpEnabled" type="xsd:boolean"
- default="false" />
- <xsd:element ref="AttributeProviders" minOccurs="0"
- maxOccurs="unbounded" />
- <xsd:element name="requireConsent" type="xsd:boolean"
- default="true" />
+ <xsd:element name="StorkLogonEnabled" type="xsd:boolean" default="true"/>
+ <xsd:element ref="Qaa" minOccurs="0" maxOccurs="1"/>
+ <xsd:element ref="OAAttributes" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="VidpEnabled" type="xsd:boolean" default="false"/>
+ <xsd:element ref="AttributeProviders" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="requireConsent" type="xsd:boolean" default="true"/>
<xsd:element ref="C-PEPS" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>