aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2015-02-19 15:25:48 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2015-02-19 15:25:48 +0100
commit45c5e41898ea4660154d730cf863ee2886f71a03 (patch)
treef29377f6677196ae830e08330e70be219fb68782
parent1679466b77e29ff8181b1b01a320c3548e28a349 (diff)
downloadmoa-id-spss-45c5e41898ea4660154d730cf863ee2886f71a03.tar.gz
moa-id-spss-45c5e41898ea4660154d730cf863ee2886f71a03.tar.bz2
moa-id-spss-45c5e41898ea4660154d730cf863ee2886f71a03.zip
modify PVP attribute builder for MANDATE_PROF_REP_DESC
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/attributes/MandateProfRepDescAttributeBuilder.java45
1 files changed, 22 insertions, 23 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/attributes/MandateProfRepDescAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/attributes/MandateProfRepDescAttributeBuilder.java
index 1059e324e..e7ba26158 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/attributes/MandateProfRepDescAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/attributes/MandateProfRepDescAttributeBuilder.java
@@ -41,37 +41,36 @@ public class MandateProfRepDescAttributeBuilder implements IPVPAttributeBuilder
public <ATT> ATT build(OAAuthParameter oaParam, IAuthData authData,
IAttributeGenerator<ATT> g) throws AttributeException {
- if(authData.isUseMandate()) {
- Element mandate = authData.getMandate();
- if (mandate == null) {
- throw new NoMandateDataAttributeException();
- }
+ if(authData.isUseMandate()) {
+ String text = null;
+
+ MISMandate misMandate = authData.getMISMandate();
- Mandate mandateObject = MandateBuilder.buildMandate(authData.getMandate());
- if (mandateObject == null) {
+ if(misMandate == null) {
throw new NoMandateDataAttributeException();
}
-
- String text = null;
- if (MiscUtil.isNotEmpty(mandateObject.getAnnotation())) {
- text = mandateObject.getAnnotation();
-
- } else {
- MISMandate misMandate = authData.getMISMandate();
+
+ text = misMandate.getTextualDescriptionOfOID();
- if(misMandate == null) {
+ if (MiscUtil.isEmpty(text)) {
+ Element mandate = authData.getMandate();
+ if (mandate == null) {
throw new NoMandateDataAttributeException();
}
- text = misMandate.getTextualDescriptionOfOID();
-
- if(MiscUtil.isEmpty(text)) {
- return null;
+ Mandate mandateObject = MandateBuilder.buildMandate(authData.getMandate());
+ if (mandateObject == null) {
+ throw new NoMandateDataAttributeException();
+ }
+
+ text = mandateObject.getAnnotation();
- } else
- return g.buildStringAttribute(MANDATE_PROF_REP_DESC_FRIENDLY_NAME,
- MANDATE_PROF_REP_DESC_NAME, text);
- }
+ }
+
+ if(MiscUtil.isNotEmpty(text))
+ return g.buildStringAttribute(MANDATE_PROF_REP_DESC_FRIENDLY_NAME,
+ MANDATE_PROF_REP_DESC_NAME, text);
+
}
return null;