1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.opensaml.ws.wstrust.impl;
19
20 import java.util.ArrayList;
21 import java.util.Collections;
22 import java.util.List;
23
24 import org.opensaml.ws.wssecurity.Created;
25 import org.opensaml.ws.wssecurity.Expires;
26 import org.opensaml.ws.wstrust.Lifetime;
27 import org.opensaml.xml.XMLObject;
28
29
30
31
32
33 public class LifetimeImpl extends AbstractWSTrustObject implements Lifetime {
34
35
36 private Created created;
37
38
39 private Expires expires;
40
41
42
43
44
45
46
47
48 public LifetimeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
49 super(namespaceURI, elementLocalName, namespacePrefix);
50 }
51
52
53 public Created getCreated() {
54 return created;
55 }
56
57
58 public Expires getExpires() {
59 return expires;
60 }
61
62
63 public void setCreated(Created newCreated) {
64 created = prepareForAssignment(created, newCreated);
65 }
66
67
68 public void setExpires(Expires newExpires) {
69 expires = prepareForAssignment(expires, newExpires);
70 }
71
72
73 public List<XMLObject> getOrderedChildren() {
74 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
75 if (created != null) {
76 children.add(created);
77 }
78 if (expires != null) {
79 children.add(expires);
80 }
81 return Collections.unmodifiableList(children);
82 }
83
84 }