1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package edu.internet2.middleware.shibboleth.common.profile.provider;
18
19 import org.opensaml.Configuration;
20 import org.opensaml.util.storage.StorageService;
21 import org.opensaml.ws.transport.http.HTTPInTransport;
22 import org.opensaml.ws.transport.http.HTTPOutTransport;
23 import org.opensaml.xml.XMLObjectBuilderFactory;
24 import org.opensaml.xml.parse.ParserPool;
25
26 import edu.internet2.middleware.shibboleth.common.relyingparty.ProfileConfiguration;
27 import edu.internet2.middleware.shibboleth.common.relyingparty.RelyingPartyConfiguration;
28 import edu.internet2.middleware.shibboleth.common.relyingparty.RelyingPartyConfigurationManager;
29 import edu.internet2.middleware.shibboleth.common.relyingparty.provider.SAMLMDRelyingPartyConfigurationManager;
30 import edu.internet2.middleware.shibboleth.common.session.Session;
31 import edu.internet2.middleware.shibboleth.common.session.SessionManager;
32
33
34
35
36
37
38
39
40
41
42 public abstract class AbstractShibbolethProfileHandler<RPManagerType extends SAMLMDRelyingPartyConfigurationManager, SessionType extends Session>
43 extends AbstractRequestURIMappedProfileHandler<HTTPInTransport, HTTPOutTransport> {
44
45
46 private ParserPool parserPool;
47
48
49 private StorageService<?, ?> storageService;
50
51
52 private RPManagerType rpManager;
53
54
55 private SessionManager<SessionType> sessionManager;
56
57
58 private XMLObjectBuilderFactory builderFactory;
59
60
61 protected AbstractShibbolethProfileHandler() {
62 super();
63 builderFactory = Configuration.getBuilderFactory();
64 }
65
66
67
68
69
70
71 public abstract String getProfileId();
72
73
74
75
76
77
78 public ParserPool getParserPool() {
79 return parserPool;
80 }
81
82
83
84
85
86
87 public void setParserPool(ParserPool pool) {
88 parserPool = pool;
89 }
90
91
92
93
94
95
96 public StorageService<?, ?> getStorageService() {
97 return storageService;
98 }
99
100
101
102
103
104
105 public void setStorageService(StorageService<?, ?> service) {
106 storageService = service;
107 }
108
109
110
111
112
113
114 public RPManagerType getRelyingPartyConfigurationManager() {
115 return rpManager;
116 }
117
118
119
120
121
122
123 public void setRelyingPartyConfigurationManager(RPManagerType manager) {
124 rpManager = manager;
125 }
126
127
128
129
130
131
132
133
134
135
136 public RelyingPartyConfiguration getRelyingPartyConfiguration(String relyingPartyId) {
137 RelyingPartyConfigurationManager rpcManager = getRelyingPartyConfigurationManager();
138 if (rpcManager != null) {
139 return rpcManager.getRelyingPartyConfiguration(relyingPartyId);
140 }
141
142 return null;
143 }
144
145
146
147
148
149
150
151
152
153
154
155
156 public ProfileConfiguration getProfileConfiguration(String relyingPartyId, String profileId) {
157 RelyingPartyConfiguration rpConfig = getRelyingPartyConfiguration(relyingPartyId);
158 if (rpConfig != null) {
159 return rpConfig.getProfileConfigurations().get(profileId);
160 }
161
162 return null;
163 }
164
165
166
167
168
169
170 public SessionManager<SessionType> getSessionManager() {
171 return sessionManager;
172 }
173
174
175
176
177
178
179 public void setSessionManager(SessionManager<SessionType> manager) {
180 sessionManager = manager;
181 }
182
183
184
185
186
187
188 public XMLObjectBuilderFactory getBuilderFactory() {
189 return builderFactory;
190 }
191 }