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 org.opensaml.common.impl.AbstractSAMLObject;
28 import org.opensaml.saml2.metadata.AttributeConsumingService;
29 import org.opensaml.saml2.metadata.RequestedAttribute;
30 import org.opensaml.saml2.metadata.ServiceDescription;
31 import org.opensaml.saml2.metadata.ServiceName;
32 import org.opensaml.xml.XMLObject;
33 import org.opensaml.xml.schema.XSBooleanValue;
34 import org.opensaml.xml.util.XMLObjectChildrenList;
35
36
37
38
39 public class AttributeConsumingServiceImpl extends AbstractSAMLObject implements AttributeConsumingService {
40
41
42 private int index;
43
44
45 private XSBooleanValue isDefault;
46
47
48 private final XMLObjectChildrenList<ServiceName> serviceNames;
49
50
51 private final XMLObjectChildrenList<ServiceDescription> serviceDescriptions;
52
53
54 private final XMLObjectChildrenList<RequestedAttribute> requestAttributes;
55
56
57
58
59
60
61
62
63 protected AttributeConsumingServiceImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
64 super(namespaceURI, elementLocalName, namespacePrefix);
65 serviceNames = new XMLObjectChildrenList<ServiceName>(this);
66 serviceDescriptions = new XMLObjectChildrenList<ServiceDescription>(this);
67 requestAttributes = new XMLObjectChildrenList<RequestedAttribute>(this);
68 }
69
70
71 public int getIndex() {
72 return index;
73 }
74
75
76 public void setIndex(int index) {
77 if (this.index != index) {
78 releaseThisandParentDOM();
79 this.index = index;
80 }
81 }
82
83
84 public Boolean isDefault(){
85 if(isDefault != null){
86 return isDefault.getValue();
87 }
88
89 return Boolean.FALSE;
90 }
91
92
93 public XSBooleanValue isDefaultXSBoolean() {
94 return isDefault;
95 }
96
97
98 public void setIsDefault(Boolean newIsDefault){
99 if(newIsDefault != null){
100 isDefault = prepareForAssignment(isDefault, new XSBooleanValue(newIsDefault, false));
101 }else{
102 isDefault = prepareForAssignment(isDefault, null);
103 }
104 }
105
106
107 public void setIsDefault(XSBooleanValue newIsDefault) {
108 isDefault = prepareForAssignment(isDefault, newIsDefault);
109 }
110
111
112 public List<ServiceName> getNames() {
113 return serviceNames;
114 }
115
116
117 public List<ServiceDescription> getDescriptions() {
118 return serviceDescriptions;
119 }
120
121
122 public List<RequestedAttribute> getRequestAttributes() {
123 return requestAttributes;
124 }
125
126
127 public List<XMLObject> getOrderedChildren() {
128 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
129
130 children.addAll(serviceNames);
131 children.addAll(serviceDescriptions);
132 children.addAll(requestAttributes);
133
134 return Collections.unmodifiableList(children);
135 }
136 }