1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.ws.wssecurity.impl;
18
19 import java.util.Collections;
20 import java.util.List;
21
22 import org.opensaml.ws.wssecurity.EncryptedHeader;
23 import org.opensaml.xml.XMLObject;
24 import org.opensaml.xml.encryption.EncryptedData;
25 import org.opensaml.xml.schema.XSBooleanValue;
26 import org.opensaml.xml.util.LazyList;
27
28
29
30
31 public class EncryptedHeaderImpl extends AbstractWSSecurityObject implements EncryptedHeader {
32
33
34 private EncryptedData encryptedData;
35
36
37 private String wsuId;
38
39
40 private XSBooleanValue soap11MustUnderstand;
41
42
43 private String soap11Actor;
44
45
46 private XSBooleanValue soap12MustUnderstand;
47
48
49 private String soap12Role;
50
51
52 private XSBooleanValue soap12Relay;
53
54
55
56
57
58
59
60
61 public EncryptedHeaderImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
62 super(namespaceURI, elementLocalName, namespacePrefix);
63 }
64
65
66 public EncryptedData getEncryptedData() {
67 return encryptedData;
68 }
69
70
71 public void setEncryptedData(EncryptedData newEncryptedData) {
72 encryptedData = prepareForAssignment(encryptedData, newEncryptedData);
73 }
74
75
76 public String getWSUId() {
77 return wsuId;
78 }
79
80
81 public void setWSUId(String newId) {
82 String oldId = wsuId;
83 wsuId = prepareForAssignment(wsuId, newId);
84 registerOwnID(oldId, wsuId);
85 }
86
87
88 public Boolean isSOAP11MustUnderstand() {
89 if (soap11MustUnderstand != null) {
90 return soap11MustUnderstand.getValue();
91 }
92 return Boolean.FALSE;
93 }
94
95
96 public XSBooleanValue isSOAP11MustUnderstandXSBoolean() {
97 return soap11MustUnderstand;
98 }
99
100
101 public void setSOAP11MustUnderstand(Boolean newMustUnderstand) {
102 if (newMustUnderstand != null) {
103 soap11MustUnderstand = prepareForAssignment(soap11MustUnderstand,
104 new XSBooleanValue(newMustUnderstand, true));
105 } else {
106 soap11MustUnderstand = prepareForAssignment(soap11MustUnderstand, null);
107 }
108 }
109
110
111 public void setSOAP11MustUnderstand(XSBooleanValue newMustUnderstand) {
112 soap11MustUnderstand = prepareForAssignment(soap11MustUnderstand, newMustUnderstand);
113 }
114
115
116 public String getSOAP11Actor() {
117 return soap11Actor;
118 }
119
120
121 public void setSOAP11Actor(String newActor) {
122 soap11Actor = prepareForAssignment(soap11Actor, newActor);
123 }
124
125
126 public Boolean isSOAP12MustUnderstand() {
127 if (soap12MustUnderstand != null) {
128 return soap12MustUnderstand.getValue();
129 }
130 return Boolean.FALSE;
131 }
132
133
134 public XSBooleanValue isSOAP12MustUnderstandXSBoolean() {
135 return soap12MustUnderstand;
136 }
137
138
139 public void setSOAP12MustUnderstand(Boolean newMustUnderstand) {
140 if (newMustUnderstand != null) {
141 soap12MustUnderstand = prepareForAssignment(soap12MustUnderstand,
142 new XSBooleanValue(newMustUnderstand, false));
143 } else {
144 soap12MustUnderstand = prepareForAssignment(soap12MustUnderstand, null);
145 }
146 }
147
148
149 public void setSOAP12MustUnderstand(XSBooleanValue newMustUnderstand) {
150 soap12MustUnderstand = prepareForAssignment(soap12MustUnderstand, newMustUnderstand);
151 }
152
153
154 public String getSOAP12Role() {
155 return soap12Role;
156 }
157
158
159 public void setSOAP12Role(String newRole) {
160 soap12Role = prepareForAssignment(soap12Role, newRole);
161 }
162
163
164 public Boolean isSOAP12Relay() {
165 if (soap12Relay != null) {
166 return soap12Relay.getValue();
167 }
168 return Boolean.FALSE;
169 }
170
171
172 public XSBooleanValue isSOAP12RelayXSBoolean() {
173 return soap12Relay;
174 }
175
176
177 public void setSOAP12Relay(Boolean newRelay) {
178 if (newRelay != null) {
179 soap12Relay = prepareForAssignment(soap12Relay,
180 new XSBooleanValue(newRelay, false));
181 } else {
182 soap12Relay = prepareForAssignment(soap12Relay, null);
183 }
184 }
185
186
187 public void setSOAP12Relay(XSBooleanValue newRelay) {
188 soap12Relay = prepareForAssignment(soap12Relay, newRelay);
189 }
190
191
192 public List<XMLObject> getOrderedChildren() {
193 LazyList<XMLObject> children = new LazyList<XMLObject>();
194 if (encryptedData != null) {
195 children.add(encryptedData);
196 }
197 return Collections.unmodifiableList(children);
198 }
199
200 }