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.metadata.impl;
22
23 import java.util.ArrayList;
24 import java.util.Collections;
25 import java.util.List;
26
27 import javax.xml.namespace.QName;
28
29 import org.opensaml.saml2.core.Attribute;
30 import org.opensaml.saml2.metadata.AssertionIDRequestService;
31 import org.opensaml.saml2.metadata.AttributeProfile;
32 import org.opensaml.saml2.metadata.Endpoint;
33 import org.opensaml.saml2.metadata.IDPSSODescriptor;
34 import org.opensaml.saml2.metadata.NameIDMappingService;
35 import org.opensaml.saml2.metadata.SingleSignOnService;
36 import org.opensaml.xml.XMLObject;
37 import org.opensaml.xml.schema.XSBooleanValue;
38 import org.opensaml.xml.util.XMLObjectChildrenList;
39
40
41
42
43 public class IDPSSODescriptorImpl extends SSODescriptorImpl implements IDPSSODescriptor {
44
45
46 private XSBooleanValue wantAuthnRequestsSigned;
47
48
49 private final XMLObjectChildrenList<SingleSignOnService> singleSignOnServices;
50
51
52 private final XMLObjectChildrenList<NameIDMappingService> nameIDMappingServices;
53
54
55 private final XMLObjectChildrenList<AssertionIDRequestService> assertionIDRequestServices;
56
57
58 private final XMLObjectChildrenList<AttributeProfile> attributeProfiles;
59
60
61 private final XMLObjectChildrenList<Attribute> attributes;
62
63
64
65
66
67
68
69
70 protected IDPSSODescriptorImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
71 super(namespaceURI, elementLocalName, namespacePrefix);
72 singleSignOnServices = new XMLObjectChildrenList<SingleSignOnService>(this);
73 nameIDMappingServices = new XMLObjectChildrenList<NameIDMappingService>(this);
74 assertionIDRequestServices = new XMLObjectChildrenList<AssertionIDRequestService>(this);
75 attributeProfiles = new XMLObjectChildrenList<AttributeProfile>(this);
76 attributes = new XMLObjectChildrenList<Attribute>(this);
77 }
78
79
80 public Boolean getWantAuthnRequestsSigned(){
81 if(wantAuthnRequestsSigned != null){
82 return wantAuthnRequestsSigned.getValue();
83 }
84
85 return Boolean.FALSE;
86 }
87
88
89 public XSBooleanValue getWantAuthnRequestsSignedXSBoolean() {
90 return wantAuthnRequestsSigned;
91 }
92
93
94 public void setWantAuthnRequestsSigned(Boolean newWantSigned){
95 if(newWantSigned != null){
96 wantAuthnRequestsSigned = prepareForAssignment(wantAuthnRequestsSigned, new XSBooleanValue(newWantSigned, false));
97 }else{
98 wantAuthnRequestsSigned = prepareForAssignment(wantAuthnRequestsSigned, null);
99 }
100 }
101
102
103 public void setWantAuthnRequestsSigned(XSBooleanValue wantSigned) {
104 wantAuthnRequestsSigned = prepareForAssignment(wantAuthnRequestsSigned, wantSigned);
105 }
106
107
108 public List<SingleSignOnService> getSingleSignOnServices() {
109 return singleSignOnServices;
110 }
111
112
113 public List<NameIDMappingService> getNameIDMappingServices() {
114 return nameIDMappingServices;
115 }
116
117
118 public List<AssertionIDRequestService> getAssertionIDRequestServices() {
119 return assertionIDRequestServices;
120 }
121
122
123 public List<AttributeProfile> getAttributeProfiles() {
124 return attributeProfiles;
125 }
126
127
128 public List<Attribute> getAttributes() {
129 return attributes;
130 }
131
132
133 public List<Endpoint> getEndpoints() {
134 List<Endpoint> endpoints = new ArrayList<Endpoint>();
135 endpoints.addAll(super.getEndpoints());
136 endpoints.addAll(singleSignOnServices);
137 endpoints.addAll(nameIDMappingServices);
138 endpoints.addAll(assertionIDRequestServices);
139 return Collections.unmodifiableList(endpoints);
140 }
141
142
143 public List<Endpoint> getEndpoints(QName type) {
144 if(type.equals(SingleSignOnService.DEFAULT_ELEMENT_NAME)){
145 return Collections.unmodifiableList(new ArrayList<Endpoint>(singleSignOnServices));
146 }else if(type.equals(NameIDMappingService.DEFAULT_ELEMENT_NAME)){
147 return Collections.unmodifiableList(new ArrayList<Endpoint>(nameIDMappingServices));
148 }else if(type.equals(AssertionIDRequestService.DEFAULT_ELEMENT_NAME)){
149 return Collections.unmodifiableList(new ArrayList<Endpoint>(assertionIDRequestServices));
150 }else{
151 return super.getEndpoints(type);
152 }
153 }
154
155
156 public List<XMLObject> getOrderedChildren() {
157 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
158
159 children.addAll(super.getOrderedChildren());
160 children.addAll(singleSignOnServices);
161 children.addAll(nameIDMappingServices);
162 children.addAll(assertionIDRequestServices);
163 children.addAll(attributeProfiles);
164 children.addAll(attributes);
165
166 return Collections.unmodifiableList(children);
167 }
168 }