1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.samlext.saml2delrestrict.impl;
18
19 import java.util.ArrayList;
20 import java.util.Collections;
21 import java.util.List;
22
23 import org.joda.time.DateTime;
24 import org.opensaml.common.impl.AbstractSAMLObject;
25 import org.opensaml.saml2.core.BaseID;
26 import org.opensaml.saml2.core.EncryptedID;
27 import org.opensaml.saml2.core.NameID;
28 import org.opensaml.samlext.saml2delrestrict.Delegate;
29 import org.opensaml.xml.XMLObject;
30
31
32
33
34 public class DelegateImpl extends AbstractSAMLObject implements Delegate {
35
36
37 private BaseID baseID;
38
39
40 private NameID nameID;
41
42
43 private EncryptedID encryptedID;
44
45
46 private DateTime delegationInstant;
47
48
49 private String confirmationMethod;
50
51
52
53
54
55
56
57
58 protected DelegateImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
59 super(namespaceURI, elementLocalName, namespacePrefix);
60 }
61
62
63 public BaseID getBaseID() {
64 return baseID;
65 }
66
67
68 public String getConfirmationMethod() {
69 return confirmationMethod;
70 }
71
72
73 public DateTime getDelegationInstant() {
74 return delegationInstant;
75 }
76
77
78 public EncryptedID getEncryptedID() {
79 return encryptedID;
80 }
81
82
83 public NameID getNameID() {
84 return nameID;
85 }
86
87
88 public void setBaseID(BaseID newBaseID) {
89 baseID = prepareForAssignment(baseID, newBaseID);
90 }
91
92
93 public void setConfirmationMethod(String newMethod) {
94 confirmationMethod = prepareForAssignment(confirmationMethod, newMethod);
95 }
96
97
98 public void setDelegationInstant(DateTime newInstant) {
99 delegationInstant = prepareForAssignment(delegationInstant, newInstant);
100 }
101
102
103 public void setEncryptedID(EncryptedID newEncryptedID) {
104 encryptedID = prepareForAssignment(encryptedID, newEncryptedID);
105 }
106
107
108 public void setNameID(NameID newNameID) {
109 nameID = prepareForAssignment(nameID, newNameID);
110 }
111
112
113 public List<XMLObject> getOrderedChildren() {
114 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
115
116 if (baseID != null) {
117 children.add(baseID);
118 }
119 if (nameID != null) {
120 children.add(nameID);
121 }
122 if (encryptedID != null) {
123 children.add(encryptedID);
124 }
125 return Collections.unmodifiableList(children);
126 }
127
128 }