1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.saml2.core.impl;
18
19 import java.util.ArrayList;
20 import java.util.Collections;
21 import java.util.List;
22
23 import org.opensaml.common.impl.AbstractSAMLObject;
24 import org.opensaml.saml2.core.BaseID;
25 import org.opensaml.saml2.core.EncryptedID;
26 import org.opensaml.saml2.core.NameID;
27 import org.opensaml.saml2.core.Subject;
28 import org.opensaml.saml2.core.SubjectConfirmation;
29 import org.opensaml.xml.XMLObject;
30 import org.opensaml.xml.util.XMLObjectChildrenList;
31
32
33
34
35 public class SubjectImpl extends AbstractSAMLObject implements Subject {
36
37
38 private BaseID baseID;
39
40
41 private NameID nameID;
42
43
44 private EncryptedID encryptedID;
45
46
47 private final XMLObjectChildrenList<SubjectConfirmation> subjectConfirmations;
48
49
50
51
52
53
54
55
56 protected SubjectImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
57 super(namespaceURI, elementLocalName, namespacePrefix);
58 subjectConfirmations = new XMLObjectChildrenList<SubjectConfirmation>(this);
59 }
60
61
62 public BaseID getBaseID() {
63 return baseID;
64 }
65
66
67 public void setBaseID(BaseID newBaseID) {
68 baseID = prepareForAssignment(baseID, newBaseID);
69 }
70
71
72 public NameID getNameID() {
73 return nameID;
74 }
75
76
77 public void setNameID(NameID newNameID) {
78 nameID = prepareForAssignment(nameID, newNameID);
79 }
80
81
82 public EncryptedID getEncryptedID() {
83 return this.encryptedID;
84 }
85
86
87 public void setEncryptedID(EncryptedID newEncryptedID) {
88 this.encryptedID = prepareForAssignment(this.encryptedID, newEncryptedID);
89 }
90
91
92 public List<SubjectConfirmation> getSubjectConfirmations() {
93 return subjectConfirmations;
94 }
95
96
97 public List<XMLObject> getOrderedChildren() {
98 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
99
100 if (baseID != null) {
101 children.add(baseID);
102 }
103
104 if (nameID != null) {
105 children.add(nameID);
106 }
107
108 if (encryptedID != null) {
109 children.add(encryptedID);
110 }
111
112 children.addAll(subjectConfirmations);
113
114 return Collections.unmodifiableList(children);
115 }
116 }