1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.opensaml.xacml.ctx.impl;
20
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.List;
24
25 import org.opensaml.xacml.ctx.ActionType;
26 import org.opensaml.xacml.ctx.EnvironmentType;
27 import org.opensaml.xacml.ctx.RequestType;
28 import org.opensaml.xacml.ctx.ResourceType;
29 import org.opensaml.xacml.ctx.SubjectType;
30 import org.opensaml.xml.XMLObject;
31 import org.opensaml.xml.util.XMLObjectChildrenList;
32 import org.opensaml.xml.validation.AbstractValidatingXMLObject;
33
34
35 public class RequestTypeImpl extends AbstractValidatingXMLObject implements RequestType {
36
37
38 private XMLObjectChildrenList<SubjectType> subjects;
39
40
41 private XMLObjectChildrenList<ResourceType> resources;
42
43
44 private EnvironmentType environment;
45
46
47 private ActionType action;
48
49
50
51
52
53
54
55
56 protected RequestTypeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
57 super(namespaceURI, elementLocalName, namespacePrefix);
58 subjects = new XMLObjectChildrenList<SubjectType>(this);
59 resources = new XMLObjectChildrenList<ResourceType>(this);
60 }
61
62
63 public List<SubjectType> getSubjects() {
64 return subjects;
65 }
66
67
68 public List<ResourceType> getResources() {
69 return resources;
70 }
71
72
73 public EnvironmentType getEnvironment() {
74 return environment;
75 }
76
77
78 public void setEnvironment(EnvironmentType environment) {
79 this.environment = prepareForAssignment(this.environment, environment);
80 }
81
82
83 public ActionType getAction() {
84 return action;
85 }
86
87
88 public void setAction(ActionType action) {
89 this.action = prepareForAssignment(this.action, action);
90 }
91
92
93 public List<XMLObject> getOrderedChildren() {
94 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
95
96 children.addAll(subjects);
97 children.addAll(resources);
98
99 if (action != null) {
100 children.add(action);
101 }
102
103 if (environment != null) {
104 children.add(environment);
105 }
106
107 return Collections.unmodifiableList(children);
108 }
109 }