1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.saml1.core.impl;
18
19 import org.opensaml.saml1.core.Action;
20 import org.opensaml.saml1.core.AuthorizationDecisionQuery;
21 import org.opensaml.saml1.core.Evidence;
22 import org.opensaml.xml.XMLObject;
23 import org.opensaml.xml.io.UnmarshallingException;
24 import org.w3c.dom.Attr;
25
26
27
28
29 public class AuthorizationDecisionQueryUnmarshaller extends SubjectQueryUnmarshaller {
30
31
32 protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
33 throws UnmarshallingException {
34
35 AuthorizationDecisionQuery authorizationDecisionQuery;
36 authorizationDecisionQuery = (AuthorizationDecisionQuery) parentSAMLObject;
37
38 if (childSAMLObject instanceof Action) {
39 authorizationDecisionQuery.getActions().add((Action) childSAMLObject);
40 } else if (childSAMLObject instanceof Evidence) {
41 authorizationDecisionQuery.setEvidence((Evidence) childSAMLObject);
42 } else {
43 super.processChildElement(parentSAMLObject, childSAMLObject);
44 }
45 }
46
47
48 protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
49
50 AuthorizationDecisionQuery authorizationDecisionQuery;
51 authorizationDecisionQuery = (AuthorizationDecisionQuery) samlObject;
52
53 if (attribute.getLocalName().equals(AuthorizationDecisionQuery.RESOURCE_ATTRIB_NAME)) {
54 authorizationDecisionQuery.setResource(attribute.getValue());
55 } else {
56 super.processAttribute(samlObject, attribute);
57 }
58 }
59 }