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.core.impl;
22
23 import java.util.ArrayList;
24 import java.util.Collections;
25 import java.util.List;
26
27 import org.opensaml.common.impl.AbstractSAMLObject;
28 import org.opensaml.saml2.core.Audience;
29 import org.opensaml.saml2.core.ProxyRestriction;
30 import org.opensaml.xml.XMLObject;
31 import org.opensaml.xml.util.XMLObjectChildrenList;
32
33
34
35
36 public class ProxyRestrictionImpl extends AbstractSAMLObject implements ProxyRestriction {
37
38
39 private final XMLObjectChildrenList<Audience> audiences;
40
41
42 private Integer proxyCount;
43
44
45
46
47
48
49
50
51 protected ProxyRestrictionImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
52 super(namespaceURI, elementLocalName, namespacePrefix);
53 audiences = new XMLObjectChildrenList<Audience>(this);
54 }
55
56
57 public List<Audience> getAudiences() {
58 return audiences;
59 }
60
61
62 public Integer getProxyCount() {
63 return proxyCount;
64 }
65
66
67 public void setProxyCount(Integer newProxyCount) {
68 if (newProxyCount >= 0) {
69 this.proxyCount = prepareForAssignment(this.proxyCount, newProxyCount);
70 } else {
71 throw new IllegalArgumentException("Count must be a non-negative integer.");
72 }
73 }
74
75
76 public List<XMLObject> getOrderedChildren() {
77 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
78
79 children.addAll(audiences);
80 return Collections.unmodifiableList(children);
81 }
82 }