1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.xml.encryption.impl;
18
19 import java.util.ArrayList;
20 import java.util.Collections;
21 import java.util.List;
22
23 import org.opensaml.xml.XMLObject;
24 import org.opensaml.xml.encryption.DHKeyValue;
25 import org.opensaml.xml.encryption.Generator;
26 import org.opensaml.xml.encryption.P;
27 import org.opensaml.xml.encryption.PgenCounter;
28 import org.opensaml.xml.encryption.Public;
29 import org.opensaml.xml.encryption.Q;
30 import org.opensaml.xml.encryption.Seed;
31 import org.opensaml.xml.validation.AbstractValidatingXMLObject;
32
33
34
35
36 public class DHKeyValueImpl extends AbstractValidatingXMLObject implements DHKeyValue {
37
38
39 private P p;
40
41
42 private Q q;
43
44
45 private Generator generator;
46
47
48 private Public publicChild;
49
50
51 private Seed seed;
52
53
54 private PgenCounter pgenCounter;
55
56
57
58
59
60
61
62
63 protected DHKeyValueImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
64 super(namespaceURI, elementLocalName, namespacePrefix);
65 }
66
67
68 public P getP() {
69 return this.p;
70 }
71
72
73 public void setP(P newP) {
74 this.p = prepareForAssignment(this.p, newP);
75 }
76
77
78 public Q getQ() {
79 return this.q;
80 }
81
82
83 public void setQ(Q newQ) {
84 this.q = prepareForAssignment(this.q, newQ);
85 }
86
87
88 public Generator getGenerator() {
89 return this.generator;
90 }
91
92
93 public void setGenerator(Generator newGenerator) {
94 this.generator = prepareForAssignment(this.generator, newGenerator);
95 }
96
97
98 public Public getPublic() {
99 return this.publicChild;
100 }
101
102
103 public void setPublic(Public newPublic) {
104 this.publicChild = prepareForAssignment(this.publicChild, newPublic);
105 }
106
107
108 public Seed getSeed() {
109 return this.seed;
110 }
111
112
113 public void setSeed(Seed newSeed) {
114 this.seed = prepareForAssignment(this.seed, newSeed);
115 }
116
117
118 public PgenCounter getPgenCounter() {
119 return this.pgenCounter;
120 }
121
122
123 public void setPgenCounter(PgenCounter newPgenCounter) {
124 this.pgenCounter = prepareForAssignment(this.pgenCounter, newPgenCounter);
125 }
126
127
128 public List<XMLObject> getOrderedChildren() {
129 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
130
131 if (p != null) {
132 children.add(p);
133 }
134 if (q!= null) {
135 children.add(q);
136 }
137 if (generator != null) {
138 children.add(generator);
139 }
140 if (publicChild != null) {
141 children.add(publicChild);
142 }
143 if (seed != null) {
144 children.add(seed);
145 }
146 if (pgenCounter != null) {
147 children.add(pgenCounter);
148 }
149
150 if (children.size() == 0) {
151 return null;
152 }
153
154 return Collections.unmodifiableList(children);
155 }
156
157 }