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 java.util.ArrayList;
20 import java.util.Collections;
21 import java.util.List;
22
23 import org.opensaml.common.xml.SAMLConstants;
24 import org.opensaml.saml1.core.Action;
25 import org.opensaml.saml1.core.AuthorizationDecisionQuery;
26 import org.opensaml.saml1.core.Evidence;
27 import org.opensaml.xml.XMLObject;
28 import org.opensaml.xml.util.XMLObjectChildrenList;
29
30
31
32
33 public class AuthorizationDecisionQueryImpl extends SubjectQueryImpl implements AuthorizationDecisionQuery {
34
35
36 private String resource;
37
38
39 private final XMLObjectChildrenList<Action> actions;
40
41
42 private Evidence evidence;
43
44
45
46
47
48
49
50
51 protected AuthorizationDecisionQueryImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
52 super(namespaceURI, elementLocalName, namespacePrefix);
53 setElementNamespacePrefix(SAMLConstants.SAML1P_PREFIX);
54 actions = new XMLObjectChildrenList<Action>(this);
55 }
56
57
58 public String getResource() {
59 return resource;
60 }
61
62
63 public void setResource(String resource) {
64 this.resource = prepareForAssignment(this.resource, resource);
65 }
66
67
68 public List<Action> getActions() {
69 return actions;
70 }
71
72
73 public Evidence getEvidence() {
74 return evidence;
75 }
76
77
78 public void setEvidence(Evidence evidence) {
79 this.evidence = prepareForAssignment(this.evidence, evidence);
80 }
81
82
83 public List<XMLObject> getOrderedChildren() {
84 List<XMLObject> list = new ArrayList<XMLObject>(actions.size() + 2);
85
86 if (super.getOrderedChildren() != null) {
87 list.addAll(super.getOrderedChildren());
88 }
89
90 list.addAll(actions);
91 if (evidence != null) {
92 list.add(evidence);
93 }
94
95 if (list.size() == 0) {
96 return null;
97 }
98
99 return Collections.unmodifiableList(list);
100 }
101 }