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