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