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 javax.xml.namespace.QName;
24
25 import org.opensaml.common.impl.AbstractSAMLObject;
26 import org.opensaml.common.xml.SAMLConstants;
27 import org.opensaml.saml1.core.Advice;
28 import org.opensaml.saml1.core.Assertion;
29 import org.opensaml.saml1.core.AssertionIDReference;
30 import org.opensaml.xml.XMLObject;
31 import org.opensaml.xml.util.IndexedXMLObjectChildrenList;
32
33
34
35
36 public class AdviceImpl extends AbstractSAMLObject implements Advice {
37
38
39 private final IndexedXMLObjectChildrenList<XMLObject> assertionChildren;
40
41
42 private final IndexedXMLObjectChildrenList<XMLObject> unknownChildren;
43
44
45
46
47
48
49
50
51 protected AdviceImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
52 super(namespaceURI, elementLocalName, namespacePrefix);
53 assertionChildren = new IndexedXMLObjectChildrenList<XMLObject>(this);
54 unknownChildren = new IndexedXMLObjectChildrenList<XMLObject>(this);
55 }
56
57
58 public List<AssertionIDReference> getAssertionIDReferences() {
59
60
61
62
63
64
65 QName assertionIDRefQName = new QName(SAMLConstants.SAML1_NS, AssertionIDReference.DEFAULT_ELEMENT_LOCAL_NAME);
66 return (List<AssertionIDReference>) assertionChildren.subList(assertionIDRefQName);
67 }
68
69
70 public List<Assertion> getAssertions() {
71
72 QName assertionQname = new QName(SAMLConstants.SAML1_NS, Assertion.DEFAULT_ELEMENT_LOCAL_NAME);
73 return (List<Assertion>) assertionChildren.subList(assertionQname);
74 }
75
76
77
78
79 public List<XMLObject> getUnknownXMLObjects() {
80 return unknownChildren;
81 }
82
83
84 public List<XMLObject> getUnknownXMLObjects(QName typeOrName) {
85 return (List<XMLObject>) unknownChildren.subList(typeOrName);
86 }
87
88
89 public List<XMLObject> getOrderedChildren() {
90 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
91
92 children.addAll(assertionChildren);
93 children.addAll(unknownChildren);
94
95 return Collections.unmodifiableList(children);
96 }
97 }