1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.opensaml.ws.wssecurity.impl;
19
20 import java.util.ArrayList;
21 import java.util.Collections;
22 import java.util.List;
23
24 import javax.xml.namespace.QName;
25
26 import org.opensaml.ws.wssecurity.SecurityTokenReference;
27 import org.opensaml.xml.XMLObject;
28 import org.opensaml.xml.util.AttributeMap;
29 import org.opensaml.xml.util.IndexedXMLObjectChildrenList;
30
31
32
33
34
35 public class SecurityTokenReferenceImpl extends AbstractWSSecurityObject implements SecurityTokenReference {
36
37
38 private String id;
39
40
41 private List<String> usages;
42
43
44 private AttributeMap unknownAttributes;
45
46
47 private IndexedXMLObjectChildrenList<XMLObject> unknownChildren;
48
49
50
51
52
53
54
55
56 public SecurityTokenReferenceImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
57 super(namespaceURI, elementLocalName, namespacePrefix);
58 usages = new ArrayList<String>();
59 unknownAttributes = new AttributeMap(this);
60 unknownChildren = new IndexedXMLObjectChildrenList<XMLObject>(this);
61 }
62
63
64
65 public List<String> getWSSEUsages() {
66 return usages;
67 }
68
69
70 public void setWSSEUsages(List<String> newUsages) {
71 usages = prepareForAssignment(usages, newUsages);
72 }
73
74
75 public String getWSUId() {
76 return id;
77 }
78
79
80 public void setWSUId(String newId) {
81 String oldId = id;
82 id = prepareForAssignment(id, newId);
83 registerOwnID(oldId, id);
84 }
85
86
87
88 public AttributeMap getUnknownAttributes() {
89 return unknownAttributes;
90 }
91
92
93 public List<XMLObject> getUnknownXMLObjects() {
94 return unknownChildren;
95 }
96
97
98 public List<XMLObject> getUnknownXMLObjects(QName typeOrName) {
99 return (List<XMLObject>) unknownChildren.subList(typeOrName);
100 }
101
102
103 public List<XMLObject> getOrderedChildren() {
104 List<XMLObject> children = new ArrayList<XMLObject>();
105
106 if (!getUnknownXMLObjects().isEmpty()) {
107 children.addAll(getUnknownXMLObjects());
108 }
109 return Collections.unmodifiableList(children);
110 }
111
112 }