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 java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.List;
24
25 import org.opensaml.saml2.core.impl.RequestAbstractTypeImpl;
26 import org.opensaml.xacml.ctx.RequestType;
27 import org.opensaml.xacml.policy.PolicySetType;
28 import org.opensaml.xacml.policy.PolicyType;
29 import org.opensaml.xacml.profile.saml.ReferencedPoliciesType;
30 import org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType;
31 import org.opensaml.xml.XMLObject;
32 import org.opensaml.xml.schema.XSBooleanValue;
33 import org.opensaml.xml.util.XMLObjectChildrenList;
34
35
36 public class XACMLAuthzDecisionQueryTypeImpl extends RequestAbstractTypeImpl implements XACMLAuthzDecisionQueryType {
37
38
39 private List<PolicyType> policies;
40
41
42 private List<PolicySetType> policySets;
43
44
45 private ReferencedPoliciesType referencedPolicies;
46
47
48 private RequestType request;
49
50
51 private XSBooleanValue inputContextOnly;
52
53
54 private XSBooleanValue returnContext;
55
56
57 private XSBooleanValue combinePolicies;
58
59
60
61
62
63
64
65
66 protected XACMLAuthzDecisionQueryTypeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
67 super(namespaceURI, elementLocalName, namespacePrefix);
68 setElementNamespacePrefix(namespacePrefix);
69 policies = new XMLObjectChildrenList<PolicyType>(this);
70 policySets = new XMLObjectChildrenList<PolicySetType>(this);
71 }
72
73
74 public XSBooleanValue getCombinePoliciesXSBooleanValue() {
75 return combinePolicies;
76 }
77
78
79 public XSBooleanValue getInputContextOnlyXSBooleanValue() {
80 return inputContextOnly;
81 }
82
83
84 public List<XMLObject> getOrderedChildren() {
85 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
86
87 if (super.getOrderedChildren() != null) {
88 children.addAll(super.getOrderedChildren());
89 }
90 if (request != null) {
91 children.add(request);
92 }
93
94 if (!policies.isEmpty()) {
95 children.addAll(policies);
96 }
97
98 if (!policySets.isEmpty()) {
99 children.addAll(policySets);
100 }
101
102 if (referencedPolicies != null) {
103 children.add(referencedPolicies);
104 }
105
106 return Collections.unmodifiableList(children);
107 }
108
109
110 public RequestType getRequest() {
111 return request;
112 }
113
114
115 public XSBooleanValue getReturnContextXSBooleanValue() {
116 return returnContext;
117 }
118
119
120 public Boolean isCombinePolicies() {
121 if (combinePolicies != null) {
122 return combinePolicies.getValue();
123 }
124
125 return Boolean.TRUE;
126 }
127
128
129 public Boolean isInputContextOnly() {
130 if (inputContextOnly != null) {
131 return inputContextOnly.getValue();
132 }
133
134 return Boolean.FALSE;
135 }
136
137
138 public Boolean isReturnContext() {
139 if (returnContext != null) {
140 return returnContext.getValue();
141 }
142
143 return Boolean.FALSE;
144 }
145
146
147 public void setCombinePolicies(XSBooleanValue combinePolicies) {
148 this.combinePolicies = prepareForAssignment(this.combinePolicies, combinePolicies);
149 }
150
151
152 public void setCombinePolicies(Boolean combinePolicies) {
153 if (combinePolicies != null) {
154 this.combinePolicies = prepareForAssignment(this.combinePolicies,
155 new XSBooleanValue(combinePolicies, false));
156 } else {
157 this.combinePolicies = prepareForAssignment(this.combinePolicies, null);
158 }
159
160 }
161
162
163 public void setInputContextOnly(XSBooleanValue inputContextOnly) {
164 this.inputContextOnly = prepareForAssignment(this.inputContextOnly, inputContextOnly);
165 }
166
167
168 public void setInputContextOnly(Boolean inputContextOnly) {
169 if (inputContextOnly != null) {
170 this.inputContextOnly = prepareForAssignment(this.inputContextOnly, new XSBooleanValue(inputContextOnly,
171 false));
172 } else {
173 this.inputContextOnly = prepareForAssignment(this.inputContextOnly, null);
174 }
175 }
176
177
178 public void setRequest(RequestType request) {
179 this.request = prepareForAssignment(this.request, request);
180 }
181
182
183 public void setReturnContext(XSBooleanValue returnContext) {
184 this.returnContext = prepareForAssignment(this.returnContext, returnContext);
185 }
186
187
188 public void setReturnContext(Boolean returnContext) {
189 if (returnContext != null) {
190 this.returnContext = prepareForAssignment(this.returnContext, new XSBooleanValue(returnContext, false));
191 } else {
192 this.returnContext = prepareForAssignment(this.returnContext, null);
193 }
194 }
195
196
197 public List<PolicyType> getPolicies() {
198 return policies;
199 }
200
201
202 public List<PolicySetType> getPolicySets() {
203 return policySets;
204 }
205
206
207 public ReferencedPoliciesType getReferencedPolicies() {
208 return referencedPolicies;
209 }
210
211
212 public void setReferencedPolicies(ReferencedPoliciesType policies) {
213 referencedPolicies = prepareForAssignment(referencedPolicies, policies);
214 }
215 }