1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.opensaml.xacml.profile.saml.impl;
20
21 import org.opensaml.saml2.core.impl.RequestAbstractTypeUnmarshaller;
22 import org.opensaml.xacml.ctx.RequestType;
23 import org.opensaml.xacml.policy.PolicySetType;
24 import org.opensaml.xacml.policy.PolicyType;
25 import org.opensaml.xacml.profile.saml.ReferencedPoliciesType;
26 import org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType;
27 import org.opensaml.xml.XMLObject;
28 import org.opensaml.xml.io.UnmarshallingException;
29 import org.opensaml.xml.schema.XSBooleanValue;
30 import org.w3c.dom.Attr;
31
32
33
34
35 public class XACMLAuthzDecisionQueryTypeUnmarshaller extends RequestAbstractTypeUnmarshaller {
36
37
38 protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
39 XACMLAuthzDecisionQueryType xacmlauthzdecisionquery = (XACMLAuthzDecisionQueryType) parentObject;
40
41 if (childObject instanceof RequestType) {
42 xacmlauthzdecisionquery.setRequest((RequestType) childObject);
43 } else if (childObject instanceof PolicyType) {
44 xacmlauthzdecisionquery.getPolicies().add((PolicyType) childObject);
45 } else if (childObject instanceof PolicySetType) {
46 xacmlauthzdecisionquery.getPolicySets().add((PolicySetType) childObject);
47 } else if (childObject instanceof ReferencedPoliciesType) {
48 xacmlauthzdecisionquery.setReferencedPolicies((ReferencedPoliciesType) childObject);
49 } else {
50 super.processChildElement(parentObject, childObject);
51 }
52 }
53
54
55 protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
56 XACMLAuthzDecisionQueryType authzDS = (XACMLAuthzDecisionQueryType) samlObject;
57
58 if (attribute.getLocalName().equals(XACMLAuthzDecisionQueryType.INPUTCONTEXTONLY_ATTRIB_NAME)) {
59 authzDS.setInputContextOnly(XSBooleanValue.valueOf(attribute.getValue()));
60 }
61
62 if (attribute.getLocalName().equals(XACMLAuthzDecisionQueryType.RETURNCONTEXT_ATTRIB_NAME)) {
63 authzDS.setReturnContext(XSBooleanValue.valueOf(attribute.getValue()));
64 }
65
66 if (attribute.getLocalName().equals(XACMLAuthzDecisionQueryType.COMBINEPOLICIES_ATTRIB_NAME)) {
67 authzDS.setCombinePolicies(XSBooleanValue.valueOf(attribute.getValue()));
68 }
69
70 super.processAttribute(samlObject, attribute);
71 }
72
73 }