1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.saml2.metadata.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.saml2.metadata.AssertionIDRequestService;
26 import org.opensaml.saml2.metadata.AuthnAuthorityDescriptor;
27 import org.opensaml.saml2.metadata.AuthnQueryService;
28 import org.opensaml.saml2.metadata.Endpoint;
29 import org.opensaml.saml2.metadata.NameIDFormat;
30 import org.opensaml.xml.XMLObject;
31 import org.opensaml.xml.util.XMLObjectChildrenList;
32
33
34
35
36 public class AuthnAuthorityDescriptorImpl extends RoleDescriptorImpl implements AuthnAuthorityDescriptor {
37
38
39 private final XMLObjectChildrenList<AuthnQueryService> authnQueryServices;
40
41
42 private final XMLObjectChildrenList<AssertionIDRequestService> assertionIDRequestServices;
43
44
45 private final XMLObjectChildrenList<NameIDFormat> nameIDFormats;
46
47
48
49
50
51
52
53
54 protected AuthnAuthorityDescriptorImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
55 super(namespaceURI, elementLocalName, namespacePrefix);
56 authnQueryServices = new XMLObjectChildrenList<AuthnQueryService>(this);
57 assertionIDRequestServices = new XMLObjectChildrenList<AssertionIDRequestService>(this);
58 nameIDFormats = new XMLObjectChildrenList<NameIDFormat>(this);
59 }
60
61
62 public List<AuthnQueryService> getAuthnQueryServices() {
63 return authnQueryServices;
64 }
65
66
67 public List<AssertionIDRequestService> getAssertionIDRequestServices() {
68 return assertionIDRequestServices;
69 }
70
71
72 public List<NameIDFormat> getNameIDFormats() {
73 return nameIDFormats;
74 }
75
76
77 public List<Endpoint> getEndpoints() {
78 List<Endpoint> endpoints = new ArrayList<Endpoint>();
79 endpoints.addAll(authnQueryServices);
80 endpoints.addAll(assertionIDRequestServices);
81 return Collections.unmodifiableList(endpoints);
82 }
83
84
85 public List<Endpoint> getEndpoints(QName type) {
86 if(type.equals(AuthnQueryService.DEFAULT_ELEMENT_NAME)){
87 return Collections.unmodifiableList(new ArrayList<Endpoint>(authnQueryServices));
88 }else if(type.equals(AssertionIDRequestService.DEFAULT_ELEMENT_NAME)){
89 return Collections.unmodifiableList(new ArrayList<Endpoint>(assertionIDRequestServices));
90 }
91
92 return null;
93 }
94
95
96 public List<XMLObject> getOrderedChildren() {
97 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
98
99 children.addAll(super.getOrderedChildren());
100 children.addAll(authnQueryServices);
101 children.addAll(assertionIDRequestServices);
102 children.addAll(nameIDFormats);
103
104 return Collections.unmodifiableList(children);
105 }
106 }