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.saml1.core.Assertion;
24 import org.opensaml.saml1.core.Response;
25 import org.opensaml.saml1.core.Status;
26 import org.opensaml.xml.XMLObject;
27 import org.opensaml.xml.util.XMLObjectChildrenList;
28
29
30
31
32 public class ResponseImpl extends ResponseAbstractTypeImpl implements Response {
33
34
35 private Status status = null;
36
37
38 private final XMLObjectChildrenList<Assertion> assertions;
39
40
41
42
43
44
45
46
47 protected ResponseImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
48 super(namespaceURI, elementLocalName, namespacePrefix);
49 assertions = new XMLObjectChildrenList<Assertion>(this);
50 }
51
52
53 public List<Assertion> getAssertions() {
54 return assertions;
55 }
56
57
58 public Status getStatus() {
59 return status;
60 }
61
62
63 public void setStatus(Status status) throws IllegalArgumentException {
64 this.status = prepareForAssignment(this.status, status);
65 }
66
67
68 public List<XMLObject> getOrderedChildren() {
69 ArrayList<XMLObject> children = new ArrayList<XMLObject>(1 + assertions.size());
70
71 if (super.getOrderedChildren() != null) {
72 children.addAll(super.getOrderedChildren());
73 }
74
75 if (status != null) {
76 children.add(status);
77 }
78
79 children.addAll(assertions);
80
81 if (children.size() == 0) {
82 return null;
83 }
84
85 return Collections.unmodifiableList(children);
86 }
87 }