1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.opensaml.saml2.core.impl;
22
23 import java.util.ArrayList;
24 import java.util.Collections;
25 import java.util.List;
26
27 import org.opensaml.saml2.core.AuthnRequest;
28 import org.opensaml.saml2.core.Conditions;
29 import org.opensaml.saml2.core.NameIDPolicy;
30 import org.opensaml.saml2.core.RequestedAuthnContext;
31 import org.opensaml.saml2.core.Scoping;
32 import org.opensaml.saml2.core.Subject;
33 import org.opensaml.xml.XMLObject;
34 import org.opensaml.xml.schema.XSBooleanValue;
35
36
37
38
39 public class AuthnRequestImpl extends RequestAbstractTypeImpl implements AuthnRequest {
40
41
42 private Subject subject;
43
44
45 private NameIDPolicy nameIDPolicy;
46
47
48 private Conditions conditions;
49
50
51 private RequestedAuthnContext requestedAuthnContext;
52
53
54 private Scoping scoping;
55
56
57 private XSBooleanValue forceAuthn;
58
59
60 private XSBooleanValue isPassive;
61
62
63 private String protocolBinding;
64
65
66 private Integer assertionConsumerServiceIndex;
67
68
69 private String assertionConsumerServiceURL;
70
71
72 private Integer attributeConsumingServiceIndex;
73
74
75 private String providerName;
76
77
78
79
80
81
82
83
84 protected AuthnRequestImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
85 super(namespaceURI, elementLocalName, namespacePrefix);
86 }
87
88
89 public Boolean isForceAuthn() {
90 if (forceAuthn != null) {
91 return forceAuthn.getValue();
92 }
93
94 return Boolean.FALSE;
95 }
96
97
98 public XSBooleanValue isForceAuthnXSBoolean() {
99 return forceAuthn;
100 }
101
102
103 public void setForceAuthn(Boolean newForceAuth) {
104 if (newForceAuth != null) {
105 forceAuthn = prepareForAssignment(forceAuthn, new XSBooleanValue(newForceAuth, false));
106 } else {
107 forceAuthn = prepareForAssignment(forceAuthn, null);
108 }
109 }
110
111
112 public void setForceAuthn(XSBooleanValue newForceAuthn) {
113 forceAuthn = prepareForAssignment(this.forceAuthn, newForceAuthn);
114 }
115
116
117 public Boolean isPassive() {
118 if (isPassive != null) {
119 return isPassive.getValue();
120 }
121
122 return Boolean.FALSE;
123 }
124
125
126 public XSBooleanValue isPassiveXSBoolean() {
127 return isPassive;
128 }
129
130
131 public void setIsPassive(Boolean newIsPassive) {
132 if (newIsPassive != null) {
133 isPassive = prepareForAssignment(isPassive, new XSBooleanValue(newIsPassive, false));
134 } else {
135 isPassive = prepareForAssignment(isPassive, null);
136 }
137 }
138
139
140 public void setIsPassive(XSBooleanValue newIsPassive) {
141 this.isPassive = prepareForAssignment(this.isPassive, newIsPassive);
142 }
143
144
145 public String getProtocolBinding() {
146 return this.protocolBinding;
147 }
148
149
150 public void setProtocolBinding(String newProtocolBinding) {
151 this.protocolBinding = prepareForAssignment(this.protocolBinding, newProtocolBinding);
152 }
153
154
155 public Integer getAssertionConsumerServiceIndex() {
156 return assertionConsumerServiceIndex;
157 }
158
159
160 public void setAssertionConsumerServiceIndex(Integer newAssertionConsumerServiceIndex) {
161 this.assertionConsumerServiceIndex = prepareForAssignment(this.assertionConsumerServiceIndex,
162 newAssertionConsumerServiceIndex);
163 }
164
165
166 public String getAssertionConsumerServiceURL() {
167 return this.assertionConsumerServiceURL;
168 }
169
170
171 public void setAssertionConsumerServiceURL(String newAssertionConsumerServiceURL) {
172 this.assertionConsumerServiceURL = prepareForAssignment(this.assertionConsumerServiceURL,
173 newAssertionConsumerServiceURL);
174 }
175
176
177 public Integer getAttributeConsumingServiceIndex() {
178 return this.attributeConsumingServiceIndex;
179 }
180
181
182 public void setAttributeConsumingServiceIndex(Integer newAttributeConsumingServiceIndex) {
183 this.attributeConsumingServiceIndex = prepareForAssignment(this.attributeConsumingServiceIndex,
184 newAttributeConsumingServiceIndex);
185 }
186
187
188 public String getProviderName() {
189 return this.providerName;
190 }
191
192
193 public void setProviderName(String newProviderName) {
194 this.providerName = prepareForAssignment(this.providerName, newProviderName);
195 }
196
197
198 public Subject getSubject() {
199 return this.subject;
200 }
201
202
203 public void setSubject(Subject newSubject) {
204 this.subject = prepareForAssignment(this.subject, newSubject);
205 }
206
207
208 public NameIDPolicy getNameIDPolicy() {
209 return this.nameIDPolicy;
210 }
211
212
213 public void setNameIDPolicy(NameIDPolicy newNameIDPolicy) {
214 this.nameIDPolicy = prepareForAssignment(this.nameIDPolicy, newNameIDPolicy);
215 }
216
217
218 public Conditions getConditions() {
219 return this.conditions;
220 }
221
222
223 public void setConditions(Conditions newConditions) {
224 this.conditions = prepareForAssignment(this.conditions, newConditions);
225 }
226
227
228 public RequestedAuthnContext getRequestedAuthnContext() {
229 return this.requestedAuthnContext;
230 }
231
232
233 public void setRequestedAuthnContext(RequestedAuthnContext newRequestedAuthnContext) {
234 this.requestedAuthnContext = prepareForAssignment(this.requestedAuthnContext, newRequestedAuthnContext);
235 }
236
237
238 public Scoping getScoping() {
239 return this.scoping;
240 }
241
242
243 public void setScoping(Scoping newScoping) {
244 this.scoping = prepareForAssignment(this.scoping, newScoping);
245 }
246
247
248 public List<XMLObject> getOrderedChildren() {
249 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
250
251 if (super.getOrderedChildren() != null) {
252 children.addAll(super.getOrderedChildren());
253 }
254
255 if (subject != null) {
256 children.add(subject);
257 }
258
259 if (nameIDPolicy != null) {
260 children.add(nameIDPolicy);
261 }
262
263 if (conditions != null) {
264 children.add(conditions);
265 }
266
267 if (requestedAuthnContext != null) {
268 children.add(requestedAuthnContext);
269 }
270
271 if (scoping != null) {
272 children.add(scoping);
273 }
274
275 if (children.size() == 0) {
276 return null;
277 }
278
279 return Collections.unmodifiableList(children);
280 }
281 }